Skip to content

[Flow EVM] Upgrade to Ethereum Glamsterdam hard-fork #8553

@m-Peter

Description

@m-Peter

Upgrade Flow EVM with the upcoming changes included in the Ethereum Glamsterdam hard-fork.

High-level Tasks:

  • 1. Update ethereum/go-ethereum dependency in flow-go to its latest version
  • 2. Fix breaking changes on types & interfaces from ethereum/go-ethereum version updates
  • 3. Implement new interfaces/methods added from ethereum/go-ethereum updates
  • 4. Implement & verify correctness of all EIPs included in Glamsterdam hard-fork (https://eips.ethereum.org/EIPS/eip-7773)
  • 5. Update existing timestamp activation mechanism for hard-forks (Flow EVM testnet & mainnet)

1. Update ethereum/go-ethereum dependency in flow-go to its latest version

Current version in master branch is github.com/ethereum/go-ethereum v1.16.8.
The latest version is github.com/ethereum/go-ethereum v1.17.2, at the time of writing.

2. Fix breaking changes on types & interfaces from ethereum/go-ethereum version updates

Breakdown of breaking changes per version:

v1.16.9

No breaking changes

v1.17.0

v1.17.1

No breaking changes

v1.17.2

  • EmitLogsForBurnAccounts() was added in StateDB interface
    • Make sure this is now called from Geth (it is called indeed)
    • Add a test-case, utilizing SelfDestruct() to assert the burn log is emitted
  • GasPool type change from uint64 to GasPool struct
    • Double check proper initialization for this (NewGasPool is the proper constructor)
  • TransferFunc now expects the ChainRules as an extra parameter
    • Check why the rules are needed (the rules are needed for checking if Amsterdam is enabled, to emit EthTransferLog)

1.17.3

  • Use uint256 in core Message for faster gas calculations (core: use uint256 in core.Message ethereum/go-ethereum#34934)
  • EmitLogsForBurnAccounts() was renamed to LogsForBurnAccounts() and it now returns all the Burn logs
  • Touch() was added in StateDB interface
  • VerkleTime was renamed to UBTTime in ChainConfig
  • NewContract() expects a GasBudget struct type, instead of a plain uint64 value
  • TransactionToMessage() no longer works for DryRunTransaction, since we provide no V,R,S signature values
  • Calldata floor gas cost has increased, the gas limit for certain test transactions was updated to match this

3. Implement new interfaces/methods added from ethereum/go-ethereum updates

  • EmitLogsForBurnAccounts() has been implemented and tested
  • IsNewContract() was already implemented in our custom StateDB interface implementation
  • SelfDestruct() has been updated, to handle EIP-6780. Flow EVM genesis block was already on Dencun, so we only support SelfDestruct() with EIP-6780, not the legacy behavior prior to Dencun.
  • SLOTNUM information is being injected in the EVM.BlockContext, to provide the value for the newly-added SLOTNUM opcode.

4. Implement & verify correctness of all EIPs included in Glamsterdam hard-fork

The following list contains the EIP-s which are non-applicable on Flow EVM, given that we do not use Ethereum's PoS mechanism/consensus layer:

  • EIP-8045: Exclude slashed validators from proposing
  • EIP-8061: Increase exit and consolidation churn
  • EIP-8080: Let exits use the consolidation queue
  • EIP-7688: Forward compatible consensus data structures
  • EIP-7732: Enshrined Proposer-Builder Separation

The following list contains the EIP-s which are applicable for Flow EVM, but they are still in draft status, hence they are not yet implemented in Geth, and their inclusion on Glamsterdam hard-fork is not yet decided:

  • [DRAFT] EIP-2780: Reduce intrinsic transaction gas
  • [DRAFT] EIP-7904: General Repricing
  • [DRAFT] EIP-8038: State-access gas cost increase
  • [DRAFT] EIP-7997: Deterministic Factory Predeploy

The following list contains the EIPs which are applicable for Flow EVM, they are scheduled for inclusion on Glamsterdam hard-fork, and therefore should be implemented:

  • EIP-7708: ETH transfers emit a log
    • EVMAddress.deposit
    • COA.deposit
    • COA.withdraw
    • COA.call
    • COA.deploy
  • EIP-7954: Increase Maximum Contract Size
  • EIP-8024: Backward compatible SWAPN, DUPN, EXCHANGE
  • EIP-7778: Block Gas Accounting without Refunds
  • EIP-7843: SLOTNUM opcode
  • EIP-7976: Increase Calldata Floor Cost
  • EIP-7981: Increase Access List Cost
  • EIP-7928: Block-Level Access Lists
  • EIP-8037: State Creation Gas Cost Increase

5. Update existing timestamp activation mechanism for hard-forks (Flow EVM testnet & mainnet)

Activation mechanism for Glamsterdam hard-fork upgrade has been updated.

  • For Emulator / Previewnet networks Flow EVM already runs on Glamsterdam
  • For Testnet / Mainnet a future date has been set. Upon exact date finalization from the Ethereum team, these will be updated to reflect the actual dates.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions