-
Notifications
You must be signed in to change notification settings - Fork 291
Refactoring: statedb interface #405
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
base: develop
Are you sure you want to change the base?
Refactoring: statedb interface #405
Conversation
| evmDb := gdb.EvmStore().EvmDb | ||
| if evmDb == nil { | ||
| panic("unknown EvmDb format") | ||
| } |
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.
We might wrap these into a function in evmstore.Store to avoid duplicate code?
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.
Better I will add different error messages which explain each case.
| return nil, err | ||
| } | ||
|
|
||
| state, ok := evmcore.IsMptStateDB(statedb) |
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.
Sorry for asking, was just looking into the code and the consensus and found PRs.
How do you think, does it worth it to use generics+interfaces here to get rid of type assertion and have more strict type checks?
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.
It will be an over-engineering for now. All we need is check here does the proofs complies with the legacy format.
We should not return others kind of proofs because clients understand the legacy (MPT) only.
Replaces exact
state.StateDBstruct with more generalevmcore.StateDBinterface.This is necessary for easier maintain go-opera on different state db implementation (flat, erigon, etc.).