Skip to content

move atomic backend and consensus callbacks #1011

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ceyonur
Copy link
Collaborator

@ceyonur ceyonur commented Jun 7, 2025

Replaces: #986

Why this should be merged

Moves atomic backend, repository and fx interface to atomic vm

How this works

This pull request primarily focuses on refactoring and improving the extensibility of the EVM plugin by introducing new interfaces and simplifying existing code. Key changes include the removal of redundant methods, updates to references for atomic VM components, and enhancements to configuration and testing logic.

Refactoring and Code Simplification:

  • Removed the AtomicBackend() method from the VM implementation and replaced direct calls to it with references to atomicVM.AtomicBackend. This change simplifies the code and aligns it with the updated structure. (plugin/evm/atomic/vm/block_extension.go: [1] [2] [3] [4]
  • Removed redundant methods in plugin/evm/vm_extensible.go and added new methods to expose VersionDB and ChainConfig. (plugin/evm/vm_extensible.go: [1] [2]

Updates to Testing Logic:

  • Updated test cases to use atomicVM references instead of direct VM components, ensuring consistency with the refactored code. (plugin/evm/export_tx_test.go: [1] [2] [3]; plugin/evm/tx_test.go: [4]; plugin/evm/vm_test.go: [5] [6]

Enhancements to Configuration:

  • Added new methods to the ExtensibleVM interface, including ChainConfig, ReadLastAccepted, and VersionDB, to improve extensibility and provide better access to VM configurations. (plugin/evm/extension/config.go: [1] [2]

File Renaming:

  • Renamed plugin/evm/bonus_blocks.go to plugin/evm/atomic/vm/bonus_blocks.go to better reflect its purpose and location within the atomic VM structure. (plugin/evm/atomic/vm/bonus_blocks.go: plugin/evm/atomic/vm/bonus_blocks.goL3-R3)

How this was tested

Existing tests

Need to be documented?

No

Need to update RELEASES.md?

No

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of the removed lines moved to atomic/vm

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To what extent were they changed? Was it a copy/paste, or more complicated than that? Everything else LGTM and I'm just trying to gauge how thoroughly that part needs to be reviewed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of them stays pretty much same but it won't hurt to check diffs in function-by-function, or whatever method you prefer as a reviewer.

@ceyonur ceyonur marked this pull request as ready for review June 7, 2025 20:44
@ceyonur ceyonur requested a review from a team as a code owner June 7, 2025 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants