state: Clean up state finalization#609
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #609 +/- ##
=======================================
Coverage 97.29% 97.29%
=======================================
Files 78 78
Lines 7640 7648 +8
=======================================
+ Hits 7433 7441 +8
Misses 207 207
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| } | ||
| } // namespace | ||
|
|
||
| void clear_empty_or_destructed_accounts(State& state, evmc_revision rev) |
There was a problem hiding this comment.
This YP part is actually wrong: ethereum/yellowpaper#885.
346d056 to
a0b39d8
Compare
a0b39d8 to
99695ed
Compare
79f997b to
60e30e5
Compare
- Separate selfdestruct handling from empty account clearing. - Apply block reward to coinbase consistently. Co-authored-by: Paweł Bylica <pawel@ethereum.org>
60e30e5 to
9f5c406
Compare
|
|
||
| const auto res = state::transition(state, test.block, tx, rev, vm); | ||
|
|
||
| // Finalize block with reward 0. |
There was a problem hiding this comment.
In state tests it's not 0 on pre-merge revisions.
There was a problem hiding this comment.
For state tests this is always 0. This effectively only touches/creates the coinbase account.
There was a problem hiding this comment.
True, apparently it's non-zero only in blockchain tests.
There was a problem hiding this comment.
FYI, this is configurable in t8n via --state.reward.
|
|
||
| if (holds_alternative<std::error_code>(validation_result)) | ||
| { | ||
| // Pre EIP-158 coinbase has to be touched also for invalid tx. |
There was a problem hiding this comment.
This emulates applying block reward of 0. Previously, I wasn't exactly sure why this is needed. Now the block reward is "properly" applied in the end.
- Separate selfdestruct handling from empty account clearing. - Apply block reward to coinbase consistently. Co-authored-by: Paweł Bylica <pawel@ethereum.org>

t8nandstate-test-runner.