-
Notifications
You must be signed in to change notification settings - Fork 184
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
[Beyond EVM] - Implement an StateDB for Flow EVM #5129
Comments
I initially tried to follow the original design of Geth stateDB (what EVM expects), having a single hot state (with dirty flags) backed with a journal to handle reverts, Though I found this approach very fragile, the original implementation on Geth does these journal edits in a conditional fashion, and I'm worried their approach might result in a revert not reconstructing the original state. One concern I have is the parity of revert and apply. For example, if a sequence of these actions happens on the state, the original implementation would misbehave:
In another hypothetical example, when addBalance is called a subBalance is captured in the journal, but this assumes addBalance and subBalance always cancel each other. However, if there is an underflow or something similar, the This problem becomes more severe, considering append to the journal is conditional, for example for some operation calls we don't add anything to the journal. So that's why I started the other way of dealing with snapshots and reverts the same way we do it at FVM. This also makes the design very clean and simple. The only catch is the number of delta views grows, it has an impact on the performance, but that seems to be not a concern for us for two reasons:
|
Details of the architecture
How to review PRs:
|
Problem Definition
The current 3 layer structure of the databases on geth, has several performance issues:
Proposed Solution
Following benchmark results and previous conversation on the performance and safety.
It has been decided to implement a new database satisfying the Geth StateDB interface that doesn't have the issues mentioned above.
The text was updated successfully, but these errors were encountered: