-
Notifications
You must be signed in to change notification settings - Fork 688
Run London fork tests #2021
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
Run London fork tests #2021
Conversation
Okay, I think it makes sense to wait until #2020 is merged before trying to debug more. |
6e23997
to
e18b170
Compare
e18b170
to
640dc6b
Compare
Just a few errors left. Some notes along the way:
|
27f7c3a
to
9ed3c84
Compare
Looks like you were right on the money with this one 👌... uncle gas limit wasn't being validated all the way (not London related though also required Berlin -> London transition validation) but also gas limit increase / decrease factor (1/1024) is an exclusive limit whereas it had been inclusive this whole time. The last few commits here should highlight these changes and all the current tests now pass. I did remove the silenced However...
@carver thoughts? Seems to me like we are good to go if we decide that the above assumptions are good: that synthetic state tests and vm performance timeout tests can be skipped for now. relevant links for "synthetic state" explanation (from comments within test_blockchain.py skipped tests): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks good to me! I can't approve "my own" PR X)
Agree that it's okay to leave those other tests as skipped or xfail
(as appropriate) for now.
I'll do a bit of tidying work and get it merged!
self.logger.debug2( | ||
"%s failure: %s", | ||
self.mnemonic, | ||
f"Insufficient Funds: {storage_address_balance} < {stack_data.endowment}" | ||
) | ||
elif stack_too_deep: | ||
err_msg = "Stack limit reached" | ||
self.logger.debug2("%s failure: %s", self.mnemonic, err_msg,) | ||
self.logger.debug2("%s failure: %s", self.mnemonic, "Stack limit reached") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was an implicit invariant check in the previous code that's not here anymore (because if neither of the if
checks were true, the logger would fail on a missing err_msg
. Maybe add an else: raise RuntimeError("unreachable")
?
@@ -369,6 +369,11 @@ def assert_imported_genesis_header_unchanged(genesis_fields, genesis_header): | |||
) | |||
|
|||
|
|||
EXPECTED_BAD_BLOCK_EXCEPTIONS = ( | |||
TypeError, rlp.DecodingError, rlp.DeserializationError, ValidationError, AssertionError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: trailing commas are nice
uncle_parent_gas_limit = uncle_parent.gas_limit | ||
if not hasattr(uncle_parent, 'base_fee_per_gas') and hasattr(uncle, 'base_fee_per_gas'): | ||
# if Berlin -> London transition, double the parent limit for validation | ||
uncle_parent_gas_limit *= 2 | ||
|
||
validate_gas_limit(uncle.gas_limit, uncle_parent_gas_limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, this is a bummer, but I don't have a better suggestion right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, yes, same... I think it can use a refactor at some point for sure.
@@ -380,4 +380,4 @@ zero value transfer transaction. | |||
... ) | |||
|
|||
>>> chain.mine_block(mix_hash=mix_hash, nonce=nonce) | |||
<ByzantiumBlock(#Block #1-0x41f6..2913)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this change? Something about the gas limit being off by one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carver yep
9ed3c84
to
d993114
Compare
Exploit tests seem to have moved in a way that caused our previous skipping to fail. We only skipped tests that started with bcExploitTest, now we skip them if that is the name of a folder anywhere in the test path.
For example: InitCollision_d0g0v0_London
- We have an 'expectException' flag we can reference for validating should_be_good_block for blockchain tests. These changes tweak blockchain test validation to use this flag since some block fixtures for tests have both good and bad blocks in them now. - If the gas limit is AT 1/1024th of the parent gas limit, this is also unacceptable. These changes add equal-to signs when comparing the gas limit to the parent. This passes currently-failing ethereum tests >= London.
The gas_limit was improperly allowed to be 1/1024th of the parent gas limit. However, this is an exclusive limit that the new gas limit must be inside of, therefore requiring +1 or -1 from the bound as the inclusive, allowable values.
d993114
to
92095eb
Compare
I snuck in a little renaming of the objects in the logs to help identify which block is built locally and which is proposed by the test. I also skipped a few more slow tests that were causing the London job to be significantly slower than the others. |
What was wrong?
Fix #2017
How was it fixed?
To-Do
Cute Animal Picture