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

Intermediate state trie root in pre-Byzantium blocks during transactions #824

Closed
jochem-brouwer opened this issue Jul 27, 2020 · 0 comments · Fixed by #815
Closed

Intermediate state trie root in pre-Byzantium blocks during transactions #824

jochem-brouwer opened this issue Jul 27, 2020 · 0 comments · Fixed by #815

Comments

@jochem-brouwer
Copy link
Member

jochem-brouwer commented Jul 27, 2020

EIP 658 which was introduced in Byzantium changes the transaction receipt. It swaps the intermediate transaction root (the state root after the transaction has executed) with the transaction execution status.

This poses problems for our current implementation of the VM, which is mentioned in the code.

The problem is that in runBlock we checkpoint the StateManager and then either commit or revert it, depending on if the VM had any internal errors (at least this seems to be the reason to me).

A naive fix (but also an ugly one) would do above only if we are at a fork >= Byzantium and thus checkpoint/commit every TX in order to get the state root. The problem with this is, that if the VM itself crashes, we are left with an unprocessed blocks and have no means to recover the previous state.

It seems to me that for < Byzantium VMs we need to add a similar checkpointing mechanism which is invoked every time we run a block. But I'm a bit in the dark here. Any ideas?

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

Successfully merging a pull request may close this issue.

1 participant