Skip to content

Conversation

@qdm12
Copy link
Contributor

@qdm12 qdm12 commented Feb 20, 2025

Why this should be merged

Libevm phase 2.5, see each commit for details

How this works

⚠️ this should only be ff-only merged in master:

git fetch origin
git checkout master
git merge --ff-only libevm
git push

Remaining items

How this was tested

CI passing, new tests added

Need to be documented?

Good question?

Need to update RELEASES.md?

  • Releases.md updated

Darioush Jalali and others added 8 commits November 6, 2024 16:39
* refactor: params.ChainConfigExtra -> params/extras

* remove type alias AvalancheConfig

* remove type alias for PrecompileConfig

* remove type alias UpgradeConfig

* remove type alias network upgrade

* seems ok to import ethparams.ChainConfig

* remove type aliases

* refactor: use `ChainConfig.Hooks().(*ChainConfigExtra)`

* move RulesExtra (only struct, keep behavior)

* refactor: return extras.RulesExtra from GetRulesExtra

* rename extras.RulesExtra -> extras.Rules

* rename file

* refactor: rename extras.ChainConfigExtra -> extras.ChainConfig

* return error if chain config type does not match

* nit

* comment and style improvements

* nit

* nit

---------

Co-authored-by: Arran Schlosberg <[email protected]>
Darioush Jalali and others added 18 commits March 10, 2025 09:57
…r_ext.go (#781)

- Move our code from state_processor.go to state_processor_ext.go
- Slight modifications to state_processor.go to make it more alike geth master
- Define `core.BlockContext` implementing `contract.ConfigurationBlockContext` (same as subnet-evm)
- Use `core.NewBlockContext` to convert `types.Block` and `types.Header` for calls to `core.ApplyUpgrades`
Co-authored-by: Quentin Mc Gaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
…es (#819)

- Sort alphabetically libevm imports in `imports.go`
- Move `state_account.go`'s libevm imports to `imports.go`
- Move extras registration from `state_account.go` to new file `libevm.go`
- Implement `HeaderExtra` 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

Signed-off-by: Quentin McGaw <[email protected]>
Co-authored-by: Quentin Mc Gaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
- Implement `PostCopy` header hook
- Remove `CopyHeader` and use imported one from libevm

Signed-off-by: Quentin McGaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
… libevm (#760)

- `BlockBodyExtra` extra payload defined for both `Block` and `Body`
  - hook `Copy` to be used in `Block` methods `Body`, `WithSeal`, `WithBody` and `WithWithdrawals`
  - hooks `BlockRLPFieldsForEncoding` and `BlockRLPFieldsForDecoding` for RLP codec of `Block`
  - hooks `BodyRLPFieldsForEncoding` and `BodyRLPFieldsForDecoding` for RLP codec of `Body`
- `SetBlockExtra` to set an extra payload `BlockBodyExtra` on a `Block`
- `SetBodyExtra` to set an extra payload `BlockBodyExtra` on a `Body`
- Block getter pure functions for extra fields: `BlockExtDataGasUsed`, `BlockGasCost`, `BlockExtData`, `BlockVersion`, `BlockExtDataGasUsed`, `BlockGasCost`
- New import from libevm's `core/types`: `Block`, `Blocks`, `Body`, `CalcUncleHash`, `NewBlock` and `NewBlockWithHeader`
- remove now unneeded `core/types/block.go`
- add test dependency github.com/google/go-cmp v0.7.0

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`
- Move our own code to `_ext.go` files
- Import symbols from libevm in imports.go
- Use Block and Body hooks previously implemented

Co-authored-by: Arran Schlosberg <[email protected]>
@qdm12 qdm12 closed this Mar 25, 2025
…887)

- Previous avalanchego was based on top of v1.12.3, although master branch is based off v1.12.3-name-fortuna
- Current avalanchego is now based on top of v1.12.3-name-fortuna.0
- Fix versions.sh to detect avalanchego commit hashes for names with more dashes
qdm12 and others added 5 commits March 26, 2025 14:08
- import interfaces from github.com/ava-labs/libevm directly
- import `NotFound` error from github.com/ava-labs/libevm directly
- Keep our two coreth-specific interfaces at interfaces/interfaces.go
- Metrics enabled corrrectly
- Remove config argument from BackendConstructor since it's no longer needed
- Export newTimestampCompatError with wrapping function NewTimestampCompatErr
- Export rlpHash with wrapping function RLPHash
- rlpgen supports type aliases
- Better logging
- changes applied from comments on the review of #820
- suggested changes from the review on #828 
- add test to check PredicateBytesFromExtra is the inverse of SetPredicateBytesInExtra

Signed-off-by: Quentin McGaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
@qdm12 qdm12 changed the title [WIP] chore(all): libevm phase 2.5 chore(all): libevm phase 2.5 Mar 28, 2025
@qdm12 qdm12 marked this pull request as ready for review March 28, 2025 07:55
@qdm12 qdm12 requested review from a team and ceyonur as code owners March 28, 2025 07:55
@qdm12
Copy link
Contributor Author

qdm12 commented Mar 28, 2025

Conflits will be resolved with #898

qdm12 added a commit to ava-labs/subnet-evm that referenced this pull request Mar 28, 2025
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]>
qdm12 added a commit to ava-labs/subnet-evm that referenced this pull request Apr 1, 2025
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]>
@darioush darioush added this pull request to the merge queue Apr 10, 2025
@qdm12 qdm12 removed this pull request from the merge queue due to a manual request Apr 10, 2025
@qdm12 qdm12 merged commit 7316fd8 into master Apr 10, 2025
8 checks passed
node-druidx56y added a commit to node-druidx56y/subnet-evm that referenced this pull request Sep 28, 2025
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]>
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.

6 participants