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

use libevm: params, core/vm, eth/tracers/* + some of core/types #662

Open
wants to merge 27 commits into
base: libevm
Choose a base branch
from

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Sep 26, 2024

Why this should be merged

Improved maintainability and reducing copies of upstream packages with modified code. This reduces our tech debt by entirely using the upstream vm module + jump tables.

As we have the libevm branch to test these changes, I would like to defer some of the following cleanups to future PRs:

  • using "core/vm" instead of "/vmerrs" where possible
  • removal of IsProhibited
  • renaming "ava-labs/go-ethereum" to "ava-labs/libevm"

How this works

Uses core/vm, and eth/tracer/* packages from https://github.com/ava-labs/libevm as a module that expands geth code without making destructive modifications instead of using code copied from upstream and modified in this repo.
Instead, the avalanche specific functionality such as precompiles are re-introduced through the hooks provided by libevm

How this was tested

CI, reprocessed historical blocks of fuji/mainnet (probably should run this again with additional switches using upstream fork names)

params/config.go Outdated
CortinaBlockTimestamp: utils.NewUint64(0),
DurangoBlockTimestamp: utils.NewUint64(0),
EtnaTimestamp: utils.NewUint64(0),
_ = do_init() // XXX: is (temporarily) here because type registeration must proceed the call to .Rules()
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting!

@darioush darioush force-pushed the use-libevm branch 2 times, most recently from f127a63 to 0976d50 Compare October 11, 2024 21:10
@darioush darioush changed the base branch from master to libevm October 14, 2024 22:44
@darioush darioush marked this pull request as ready for review October 14, 2024 23:05
@darioush darioush requested review from ceyonur and a team as code owners October 14, 2024 23:05
@darioush darioush changed the title wip: use libevm use libevm: params, core/vm, eth/tracers/* + some of core/types Oct 14, 2024
Comment on lines +74 to +75
// GetPredicateResults returns an byte array result of verifying the predicates
// of the given block.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
// GetPredicateResults returns an byte array result of verifying the predicates
// of the given block.
// GetPredicateResultsBytes returns an byte array result of verifying the predicates
// of the given block.

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

Successfully merging this pull request may close these issues.

2 participants