Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update state tests #1396

Merged
merged 4 commits into from
Oct 17, 2018
Merged

Conversation

cburgdorf
Copy link
Contributor

@cburgdorf cburgdorf commented Oct 15, 2018

What was wrong?

State tests are out of date and there seem to be some structural changes to fix before we can move #1181 forward

How was it fixed?

  • update to latest ethereum/tests submodule
  • handle new sealEngine property
  • workaround issue with the way these tests are generated and the side effects that causes in respect to state clearing (shout out to @pipermerriam for the awesome debugging session helping with that 🙏)

Cute Animal Picture

put a cute animal picture link inside the parentheses

@cburgdorf
Copy link
Contributor Author

Failing tests may be related to ethereum/go-ethereum#16470

@cburgdorf
Copy link
Contributor Author

@carver @pipermerriam I've been trying to track this down for hours. From what I see, it seems that the expectations about how the state should be has changed for the scenario where all transactions failed.

It seems geth also made changes related to that after updating their ethereum/tests submodule.

ethereum/go-ethereum@32f28a9#diff-f53696be8527ac422b8d4de7c8e945c1R149

@cburgdorf
Copy link
Contributor Author

Just throwing out some findings to memorize for myself and share with anyone interested:

Applying f80381f makes some tests go green that otherwise would fail e.g.:

pytest -s tests/json-fixtures/test_state.py -k 'stTransactionTest/TransactionNonceCheck.json:TransactionNonceCheck:Frontier:0'

But at the same time, that patch makes other tests go red that succeed without that patch, e.g.:

pytest -s tests/json-fixtures/test_state.py -k 'TransactionFromCoinbaseNotEnoughFounds.json:TransactionFromCoinbaseNotEnoughFounds:Frontier:0'

# block and thus, the mechanisms which would touch/create/clear the
# coinbase account based on the mining reward are present during test
# generation, but not part of the execution, thus we must artificially
# touch the coinbase account to satisfy the state root that the tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last sentence should be updated:

thus we must artificially create the account in VMs prior to the state clearing rules, as well as conditionally cleaning up the coinbase account when left empty in VMs after the state clearing rules came into effect.

@cburgdorf
Copy link
Contributor Author

@pipermerriam CI is green, even though we don't see it due to that rate limiting issue.

@pipermerriam
Copy link
Member

kicked the tests (and working on escalating the broader issue so this stops happening)

Copy link
Member

@pipermerriam pipermerriam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still quite grumbly at the nonsense we have to jump through due to how these tests were generated.

@cburgdorf cburgdorf merged commit e68e7c3 into ethereum:master Oct 17, 2018
# Primitives
#
@functools.lru_cache(maxsize=1024)
def normalize_int(value):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we now have two copies of every method in this module:

  • one in eth/tools/_utils/normalization.py
  • one in eth/tools/fixtures/normalization.py

Can't these be deleted out of the fixtures/normalization module? Otherwise I'm worried the files are going to diverge, and maintenance will be a nightmare.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that wasn't intentional, probably just an accidental leftover from when I shuffled that stuff around a while back. Removing the ones from fixtures/normalization seems correct.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writing up an issue.

# generation, but not part of the execution, thus we must artificially
# create the account in VMs prior to the state clearing rules,
# as well as conditionally cleaning up the coinbase account when left
# empty in VMs after the state clearing rules came into effect.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, bummer. Thanks for the writeup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants