-
Notifications
You must be signed in to change notification settings - Fork 159
move block extender to vm #984
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
Conversation
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
Co-authored-by: Michael Kaplan <55204436+michaelkaplan13@users.noreply.github.com> Signed-off-by: Ceyhun Onur <ceyhunonur54@gmail.com>
2ddb618 to
d477ea2
Compare
|
Please resolve the merge conflicts so we're not reviewing out-of-date code. This PR is also unfocussed, hence being a 3500-line delta. Why does file restructuring need to be done at the same time as dependency updates, creating a new VM wrapper, etc.? It makes it extremely difficult to review as we have to understand so many interlocking parts at the same time. |
This is because the previous PR was squashed, doing a rebase now |
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.
fwict looks good, but the recursive initialization doesn't seem super great
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.
I spoke with @StephenButtolph about wrapper VMs and all of the problems arise when there's a non 1:1 mapping between wrapping and inner blocks (e.g. multiple proposervm outer blocks could reference the same inner block). I don't see this arising in this refactor, but noting so we all keep it in mind.
Why this should be merged
This PR moves atomic block extension and relevant code to atomic pkg
Note: some "extra" changes are introduced with TODOs. These are to prevent UTs being failed an will be cleaned up with upcoming PRs.
How this works
This pull request introduces significant refactoring and feature updates to the EVM plugin, primarily focusing on modularizing the atomic VM functionality, improving error handling, and enhancing code organization. The changes include renaming and restructuring files, updating error handling, and introducing a new
VMwrapper for atomic extensions.Refactoring and Modularization:
File restructuring: Renamed several files under
plugin/evm/atomictoplugin/evm/atomic/vmfor better modularity and organization. For example,atomic_block_extension.gowas renamed toblock_extension.goandtx_semantic_verifier.gowas moved to thevmsubdirectory. [1] [2] [3]New
VMwrapper: Introduced a newVMstruct inplugin/evm/atomic/vm/vm.goto encapsulate the atomic extension logic, providing a cleaner and more extensible interface. This includes theWrapVMfunction and theInitializemethod for setting up the VM and its extensions.Code Enhancements:
Error handling improvements: Updated error variables to be exported (
ErrMissingUTXOs,ErrEmptyBlock) for better consistency and usage across the codebase. [1] [2] [3]Refactored method calls: Replaced direct calls to
atomicBackendandmempoolwith corresponding methods (AtomicBackend(),AtomicMempool()) for improved encapsulation and abstraction. [1] [2] [3] [4]Dependency Updates:
Atomic package usage: Updated references in
tx_semantic_verifier.goand related files to use theatomicpackage explicitly, improving clarity and dependency management. For example,atomic.CalculateDynamicFeeandatomic.Codec.Unmarshalare now used. [1] [2]Test updates: Adjusted test files (
export_tx_test.go,import_tx_test.go) to reflect the newatomicvmpackage structure and updated imports accordingly. [1] [2]Additional Changes:
Configstruct inplugin/evm/extension/config.goand introduced a newSetExtensionConfigmethod in theExtensibleVMinterface for better configuration management. [1] [2]These changes collectively enhance the maintainability, readability, and modularity of the EVM plugin codebase.
How this was tested
Existing tests
Note:
Need to be documented?
No
Need to update RELEASES.md?
No