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

Tests v7 beta1 and updates Istanbul numbers #1871

Merged
merged 19 commits into from
Nov 5, 2019

Conversation

carver
Copy link
Contributor

@carver carver commented Nov 5, 2019

What was wrong?

Rebased version of #1858 with a few updates, merged in from #1870

How was it fixed?

Essentially all of this PR is courtesy of @voith and @veox -- I only moved it because I didn't want to rebase their branches without a conversation, and I really want to get a release out today.

I added a couple minor pieces from #1870:

  • new internal type of news fragment
  • prefer computation.raise_if_error() over assert computation.is_success
  • moved news fragment to feature since Istanbul support belongs there

So I'm going to be a touch aggressive and approve/merge "myself" in the PR, which is really 97% contributed by others.

To-Do

  • Clean up commit history

Cute Animal Picture

put a cute animal picture link inside the parentheses

voith and others added 19 commits November 5, 2019 12:37
Added a normalizer `normalize_post_state` to handle this
case. Renamed existing method `normalize_post_state` to `normalize_post_state_hash`
Plus a bonus fix:

tests: fix import when DEBUG2 logging.

Logging utilities have moved to separate package, eth_utils.

===

The EIP-161 implementation evolved over a few commits originally,
here is the history:

Geth is now filling (some) tests in upstream/tests, so for edge-cases
that are impossible on mainnet, prefer geth's approach.

Walk the entire computation tree, including branches that errored
out (got REVERTed, OOGed, etc.), looking for wabbit RIPEMD160,
_always_ collecting it. Skip everything else on errored branches.

---

Don't collect if nested computation errored.

In the general non-RIPEMD160 case, if the computation errored, it
would still be collected, because of the computation.is_origin_computation
condition.

---

collect_touched_accounts(): clean up.

Now that `computation.is_origin_computation` no longer needs to
be considered, it's fine to move the RIPEMD160 special-casing
back into the `if` clause, because the condition is the same.

---

collect_touched_accounts():
remove computation.is_origin_computation when considering SELFDESTRUCT beneficiaries + refactor.

`computation.is_origin_computation` has been present since the file was first introduced by @pipermerriam:

ethereum@69a8385#diff-28f7a9ef4182d19a95f4cccb1c073ef3

However, whether it's present or not has no effect on the tests passing.

(Possibly, this is due to the case not being covered in the tests...)

I can't find a place which explicitly states that beneficiary collection
should only be skipped if the error happened in the origin computation.

From the fact that having a `computation.is_origin_computation` in the
next if-clause (`if computation.msg.to != constants.CREATE_CONTRACT_ADDRESS`)
caused an error in a RevertPrecompiledTouchExactOOG test, it would seem
that upstream (geth v1.9.6) does not consider this a necessary condition.

Therefore, removing the condition here, too; and re-working the if-else
clauses to look like they did previously (moving the RIPEMD160 special-casing
as a sub-clause of the main clause).
Used these napkin-quality scripts:

https://gist.github.com/veox/02336c518f049cb749608657622d127f

SQUASHED:

tests: add Istanbul variants to existing SLOWEST_TESTS + CALLBlake2f_MaxRounds.

GeneralStateTests/stTimeConsuming/CALLBlake2f_MaxRounds.json takes an awful long
time - I was never able to run it fully.

Beyond that, file names for some previous slow tests have changed, losing a
`_dXgYvZ` qualifier.

Not all have been reviewed! Just enough for the BlockchainTests to run Istanbul
within half an hour on my workstation.

tests: mark `randomStatetest94` as slow for Istanbul, too.

Test passes, takes 22 seconds to run in py-evm (checked for Istanbul only),
and indeed causes a +3 GiB memory use peak on my workstation - similar to
`geth`, as reported here:

https://gitter.im/ethereum/tests?at=5d8c6d25b38cc849bf1402fe

(Not as time-consuming as some other tests, though.)
Moved "newsfragment" to `internal` section + update it, because:

`towncrier --draft` shows that newsfragments in the `misc` category
don't get their contents displayed, they just get listed with a link in
the "Miscellaneous internal" section.

This is unacceptable! Move to `internal` section instead.
Raising the exception immediately tells you what's wrong if a test
fails, rather than giving you a no-context assertion failure.
@carver carver force-pushed the tests-v7-beta1-and-istanbul-numbers branch from 998806a to 812cc56 Compare November 5, 2019 20:45
@carver carver merged commit 608708f into ethereum:master Nov 5, 2019
@carver carver deleted the tests-v7-beta1-and-istanbul-numbers branch November 5, 2019 20:50
@carver
Copy link
Contributor Author

carver commented Nov 6, 2019

Looks like this closes #1837 too.

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.

4 participants