-
Notifications
You must be signed in to change notification settings - Fork 275
libevm phase 2.5 #1501
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
Merged
libevm phase 2.5 #1501
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* format: as coreth * use libevm: params, core/vm, eth/tracers/* + some of core/types (#662) Co-authored-by: Arran Schlosberg <[email protected]> * format: as subnet-evm * fix coreth formatting * fix mocks * fix contract deployer allowlist * nits * nits * nit * fix test import loop * fix imports * nits * fix * add TODO --------- Co-authored-by: Arran Schlosberg <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]> Co-authored-by: Darioush Jalali <[email protected]> Co-authored-by: Michael Kaplan <[email protected]> Co-authored-by: Ceyhun Onur <[email protected]> Co-authored-by: Richard Pringle <[email protected]> Co-authored-by: Quentin McGaw <[email protected]> Co-authored-by: Meaghan FitzGerald <[email protected]> Co-authored-by: Quentin McGaw <[email protected]> Co-authored-by: mountcount <[email protected]> Co-authored-by: chuangjinglu <[email protected]> Co-authored-by: guqicun <[email protected]> Co-authored-by: Dmytrol <[email protected]> fix problematic const name and some typos in comment (#1400) fix some function names in interface comment (#1397) close database on shutdown (#1403) fix some function names in comment (#1405) Fix Typos in Documentation (#1404) fix test generator (#724)
…_test.go (#1442) - Move our code from state_processor.go to state_processor_ext.go - Move our code from state_processor_test.go to state_procesor_ext_test.go - Slight modifications to state_processor.go to make it more alike geth master
- Use `core.NewBlockContext` to convert `types.Block` and `types.Header` for calls to `core.ApplyUpgrades`
qdm12
commented
Mar 17, 2025
- use libevm/metrics instead of subnet-evm/metrics - file kept and refactored `metrics/prometheus/prometheus.go` with the `Gatherer` implementation we use - file kept and refactored `metrics/prometheus/prometheus_test.go` - new file `metrics/prometheus/interfaces.go` added for refactoring - geth global variable `metrics.Enabled` is set to true both in libevm and in `plugin/evm.VM.initializeMetrics` Signed-off-by: Quentin McGaw <[email protected]> Co-authored-by: Arran Schlosberg <[email protected]>
- Sort alphabetically libevm imports in `imports.go` - Move `state_account.go` libevm imports to `imports.go` See original PR ava-labs/coreth#819
- Import errors from libevm/vmerrs - Define subnet-evm specific errors in plugin/evm/vmerrors See original PR ava-labs/coreth#829
- Define `HeaderExtra` with `RLP` and `JSON` serialization methods - remove `BlockNonce` - remove `EncodeNonce` - new functions `GetHeaderExtra` and `SetHeaderExtra` - Migrate existing custom `Header` to `HeaderSerializable` in block_ext.go with only `Hash` method for RLP code generation - Rename files gen_header_json.go to gen_header_serializable_json.go - Rename files gen_header_rlp.go to gen_header_serializable_rlp.go - Update avalanchego to prevent double core/types extra registration conflict See original PR ava-labs/coreth#746 Signed-off-by: Quentin Mc Gaw <[email protected]> Co-authored-by: Quentin Mc Gaw <[email protected]> Co-authored-by: Arran Schlosberg <[email protected]> Co-authored-by: Ceyhun Onur <[email protected]> Co-authored-by: Darioush Jalili <[email protected]>
- Implement `PostCopy` header hook - Remove `CopyHeader` and use imported one from libevm See original PR ava-labs/coreth#759 Signed-off-by: Quentin McGaw <[email protected]> Co-authored-by: Arran Schlosberg <[email protected]>
… libevm - `BlockGasCost` getter pure function - New import from libevm's `core/types`: `Block`, `Blocks`, `Body`, `CalcUncleHash`, `NewBlock` and `NewBlockWithHeader` - remove now unneeded `core/types/block.go` See original PR ava-labs/coreth#760 Signed-off-by: Quentin McGaw <[email protected]> Co-authored-by: Arran Schlosberg <[email protected]>
- Part of the core/rawdb migration to use libevm - Using libevm `InspectDatabase` - Define options passed to libevm `InspectDatabase` See original PR ava-labs/coreth#791
- Move our own code to `_ext.go` files - Import symbols from libevm in imports.go See original PR ava-labs/coreth#772 Co-authored-by: Arran Schlosberg <[email protected]>
See original PR ava-labs/coreth#851
- fix generation of code using type aliases and Go 1.23 - reproducible generation locally (pin gencodec version) - CI keeps generated Go files up to date with other source code - Generate missing files See original PR ava-labs/coreth#856
See original PR ava-labs/coreth#850 Co-authored-by: Arran Schlosberg <[email protected]>
Reduces overlap between subnet-evm and upstream files: - Types and variables that are identical to `libevm` are moved to `imports.go`. - Files that include only `subnet-evm` have the `_ext.go` suffix added. See original PR ava-labs/coreth#872
These packages are unused and were just copies from the `ava-labs/libevm` repo. See original PR ava-labs/coreth#876
Until a complete transition to a `libevm` package, it shouldn't be allowed to be imported directly. Remove the package from the allowed list and move a `types` test into `package types_test` to avoid a circular dependency. See original PR ava-labs/coreth#874
Complete the transition of `core/types` to upstream code. Note that the previous commit results in _all_ upstream types / vars / consts being in the `imports.go` file. This results in a strict partition of upstream and local identifiers so it is safe to simply change import paths. 1. Globally change all imports from `subnet-evm/core/types` to `libevm/core/types`; 2. Rename all `subnet-evm/core/types` imports to `customtypes` for ease of review here; 3. Dot import `libevm/core/types` in tests only to avoid hundreds of noisy changes. See original PR ava-labs/coreth#875
The `types` package now only contains `coreth` logic an nothing from upstream so it shouldn't live in the same location in the repo. Automated: ```shell $ git mv core/types plugin/evm/types $ find -name '*.go' | xargs sed -i 's|"github.com/ava-labs/coreth/core/types"|"github.com/ava-labs/coreth/plugin/evm/types"|' $ golangci-lint run --fix ``` See original PR ava-labs/coreth#877
- import interfaces from github.com/ava-labs/libevm directly - import `NotFound` error from github.com/ava-labs/libevm directly - Keep our two subnet-evm-specific interfaces at interfaces/interfaces.go See original PR ava-labs/coreth#883
Changes applied from comments on the review of ava-labs/coreth#820 See original PR ava-labs/coreth#862 Signed-off-by: Quentin McGaw <[email protected]> Co-authored-by: Arran Schlosberg <[email protected]>
ceyonur
reviewed
Apr 2, 2025
This was referenced Apr 3, 2025
ceyonur
reviewed
Apr 4, 2025
- add missing fee config block for `params.ChainConfig` `Description` method and add test - add missing fee config block for `params.ChainConfig` `Verify` method and add test - add test for `params.SetEthUpgrades` - add comment on the usage of `params.SetEthUpgrades` in genesis
ceyonur
approved these changes
Apr 15, 2025
alarso16
approved these changes
Apr 15, 2025
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.
Relatively nit comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.