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

Is state checkpointing in runBlock necessary? #622

Closed
s1na opened this issue Nov 25, 2019 · 2 comments
Closed

Is state checkpointing in runBlock necessary? #622

s1na opened this issue Nov 25, 2019 · 2 comments

Comments

@s1na
Copy link
Contributor

s1na commented Nov 25, 2019

runBlock checkpoints the state before processing the block and reverts on errors. I'm not sure if this is necessary. I think it should throw if there's any error.

The state transition unit in Eth1 is the transaction. There we should revert state on failure. But a block is only a collection of txes which themselves handle checkpointing. If something fails on the block level it's a bug in our code and it shouldn't revert the state.

Also had a quick look at geth and couldn't find this revert on block processing failure. Maybe I'm missing something, but if others agree we should remove this.

@ryanio
Copy link
Contributor

ryanio commented Nov 26, 2019

Lines for reference:

https://github.com/ethereumjs/ethereumjs-vm/blob/259e66b8fc65b46351b60541035b8d4e75e38746/lib/runBlock.ts#L99-L107

@holgerd77
Copy link
Member

On the block level uncle and miner rewards are attributed and the state updated accordingly. We experimented with removing checkpointing in #1017, but it turned out to be necessary. Will close.

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

No branches or pull requests

4 participants