Skip to content

Update to EVM Pectra hard-fork #805

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
merged 10 commits into from
May 8, 2025
Merged

Update to EVM Pectra hard-fork #805

merged 10 commits into from
May 8, 2025

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Apr 8, 2025

Work towards: onflow/flow-go#7152

Description

Changes related to EVM Pectra hard-fork.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Summary by CodeRabbit

  • New Features

    • Added support for EIP-7702 transactions, including contract write and self-execution flows.
    • Expanded special block number handling to include earliest, safe, finalized, latest, and pending states.
    • Enhanced transaction argument structure to support new transaction types and fields.
    • Introduced chain configuration injection for improved tracing and debugging.
  • Bug Fixes

    • Standardized block number resolution and improved handling of special block tags.
    • Corrected bloom filter computation for blocks and receipts.
    • Fixed block override key naming for accurate debug trace calls.
  • Dependency Updates

    • Upgraded Go toolchain and multiple direct and indirect dependencies for improved stability and compatibility.
  • Tests

    • Introduced comprehensive tests for EIP-7702, Pectra upgrade, and contract interactions using Viem and Web3.js.
    • Updated test expectations and added new scenarios for advanced transaction and contract features.
  • Chores

    • Added new Solidity contract and configuration files for testing and client integration.

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from dfcb253 to 9cb1976 Compare April 15, 2025 13:14
@m-Peter m-Peter marked this pull request as ready for review April 15, 2025 13:25
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from 856798f to 05b1de0 Compare April 21, 2025 10:09
coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch 5 times, most recently from 8ba6066 to c0ac69a Compare April 23, 2025 10:35
coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch 2 times, most recently from 6714ec3 to 60ee47f Compare April 23, 2025 16:49
coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from 03c2691 to 8cd8f49 Compare April 24, 2025 13:19
coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch 2 times, most recently from a2054eb to b2d4345 Compare April 28, 2025 10:57
coderabbitai[bot]

This comment was marked as resolved.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from 000d894 to e6a368e Compare May 7, 2025 17:23
@m-Peter m-Peter changed the base branch from main to mpeter/poc-index-finalized-block-results May 7, 2025 17:34
@m-Peter m-Peter changed the base branch from mpeter/poc-index-finalized-block-results to main May 7, 2025 17:50
@m-Peter m-Peter changed the base branch from main to mpeter/poc-index-finalized-block-results May 7, 2025 18:04
@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from 5426373 to 237faaa Compare May 7, 2025 18:19
// if special values (latest) we return latest executed height
//
// all the special values are:
// EarliestBlockNumber = BlockNumber(-5)
Copy link
Member

Choose a reason for hiding this comment

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

Optional, I would suggest to use -10 instead of -5, in case we need to define other BlockNumber.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't define this special value, this is actually defined from Geth itself. See here: https://github.com/onflow/go-ethereum/blob/master/rpc/types.go#L66 . By using -10 we would deviate from Geth, and I want to avoid that.

api/utils.go Outdated
var err error
if blockNumber == rpc.EarliestBlockNumber {
height = 0
} else if blockNumber <= rpc.PendingBlockNumber {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
} else if blockNumber <= rpc.PendingBlockNumber {
} else if blockNumber < 0 {

Optional, but I think this would be slightly safer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have updated the implementation in this commit: c95ea08, to make it more explicit and readable. I want to avoid using magic values like 0, I would prefer making comparisons with the constants defined by Geth.

@m-Peter m-Peter force-pushed the feature/pectra-upgrade branch from e5992f3 to c95ea08 Compare May 8, 2025 07:52
@m-Peter m-Peter changed the base branch from mpeter/poc-index-finalized-block-results to main May 8, 2025 07:56
@j1010001 j1010001 merged commit c6ae29a into main May 8, 2025
2 checks passed
@j1010001 j1010001 deleted the feature/pectra-upgrade branch May 8, 2025 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants