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

Merged
merged 39 commits into from
Nov 6, 2024

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 Show resolved Hide resolved
@darioush darioush force-pushed the use-libevm branch 2 times, most recently from f127a63 to 0976d50 Compare October 11, 2024 21:10
@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
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

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

I'd like to see what @ceyonur thinks too, but generally this LGTM. Only a few nits and questions as I see you've already merged my recommendations PR.

core/blockchain_test.go Outdated Show resolved Hide resolved
core/evm.go Outdated Show resolved Hide resolved
core/evm.go Show resolved Hide resolved
core/state/statedb.go Show resolved Hide resolved
core/state_transition.go Show resolved Hide resolved
plugin/evm/export_tx.go Outdated Show resolved Hide resolved
plugin/evm/import_tx.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
predicate/predicate_bytes.go Outdated Show resolved Hide resolved
core/vm/runtime/runtime.go Show resolved Hide resolved
core/evm.go Outdated Show resolved Hide resolved
core/evm.go Show resolved Hide resolved
core/evm.go Show resolved Hide resolved
core/vm/opcodes.go Outdated Show resolved Hide resolved
params/hooks_libevm.go Outdated Show resolved Hide resolved
plugin/evm/import_tx.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
precompile/contracts/warp/contract_warp_handler.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
nativeasset/contract.go Show resolved Hide resolved
nativeasset/contract.go Show resolved Hide resolved
nativeasset/contract.go Outdated Show resolved Hide resolved
plugin/evm/vm.go Outdated Show resolved Hide resolved
params/hooks_libevm.go Outdated Show resolved Hide resolved
@darioush darioush enabled auto-merge (squash) November 6, 2024 16:30
@darioush darioush merged commit 4093a7d into libevm Nov 6, 2024
6 checks passed
@darioush darioush deleted the use-libevm branch November 6, 2024 16:39
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.

3 participants