-
Notifications
You must be signed in to change notification settings - Fork 361
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
Fix eip2929 implementation #280
Fix eip2929 implementation #280
Conversation
@RomarQ could you split this PR into three PRs?
|
This reverts commit 654fb20.
Could you add |
Done
|
This depends on #288. We can test it this way: cargo run --release --verbose -p jsontests -- jsontests/res/ethtests/GeneralStateTests/Cancun/stEIP1153-transientStorage --debug |
Once we enable tests for Line 106 in 8168ca1
if we run all the tests, some will fail, mainly because there are still a few incompatibilities after berlin (gas related). I only fixed a few, there are more. |
We could fix those incompatibilities in future PRs, let's merge this PR first |
|
||
// https://eips.ethereum.org/EIPS/eip-2929 | ||
let target_is_cold = handler.is_cold(target, None); | ||
handler.mark_hot(target, None); |
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.
I wonder is this move (from interpreter
to gasometer
), related to the fix?
The reason why it was put in interpreter
because the code is supposed to support custom gasometers. Otherwise with this change, any custom meters will not properly mark hot/cold.
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.
Yes, in some circumstances, the addresses were not being considered as warm
when they should. If the objective is to have the code as customisable as possible, probably having it in the gasometer is not that bad.
Includes a fix related to EIP-2929, where some addresses were incorrectly considered
cold
and consumed extra gas. I identified this issue when running the tests located atethtests/GeneralStateTests/Cancun/stEIP1153-transientStorage
, which were failing because the gas costs did not match.