Skip to content

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Mar 17, 2025

No description provided.

Darioush Jalali and others added 5 commits December 12, 2024 10:04
* 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 and others added 24 commits March 21, 2025 10:27
- 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]>
- 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
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
qdm12 and others added 3 commits April 1, 2025 10:15
@qdm12 qdm12 changed the title Libevm phase 2.5 libevm phase 2.5 Apr 2, 2025
@qdm12 qdm12 marked this pull request as ready for review April 2, 2025 13:36
@qdm12 qdm12 requested review from a team, ceyonur and darioush as code owners April 2, 2025 13:36
- 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
Copy link
Contributor

@alarso16 alarso16 left a comment

Choose a reason for hiding this comment

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

Relatively nit comments

@qdm12 qdm12 merged commit 220454e into master Apr 16, 2025
13 checks passed
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.

4 participants