-
Notifications
You must be signed in to change notification settings - Fork 213
[Flow EVM] Upgrade to Ethereum Glamsterdam hard-fork #8554
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
Open
m-Peter
wants to merge
32
commits into
master
Choose a base branch
from
mpeter/flow-evm-glamsterdam-upgrade
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
ffb657b
Bump ethereum/go-ethereum dependency to v1.16.9
m-Peter 2211adf
Bump ethereum/go-ethereum dependency to v1.17.0
m-Peter e632f26
Bump ethereum/go-ethereum dependency to v1.17.1
m-Peter 922adff
Bump ethereum/go-ethereum dependency to v1.17.2
m-Peter 9abd95a
Add activation timestamps for Glamsterdam hard-fork
m-Peter d8c57ba
Add E2E tests to verify correctness of EIP-7708 (log emission for ETH…
m-Peter b45e523
Populate EVM BlockContext with information regarding SLOTNUM opcode
m-Peter 2b94740
Update COA deployment logic to match EVM internals
m-Peter c308dec
Add more descriptive comments
m-Peter 336a258
Set the Amsterdam hard-fork activation date to end of 2026
m-Peter e7423fc
Update calculation of SlotNumber in EVM BlockProposal
m-Peter 368fe19
Update ethereum/go-ethereum dependency to v1.17.3 and fix breaking AP…
m-Peter 68af970
Remove MaxTxGas limit cap under the Amsterdam hard-fork
m-Peter d4ae578
Record state access read in StateDB's public API
m-Peter 52a7ae6
Bump OpenTelemetry packages to latest patched version
m-Peter f6eeb74
Test improvements and code simplifications
m-Peter 805f19a
Address review comments
m-Peter 8b481e5
Remove redundant sortedAddresses array allocation in LogsForBurnAccou…
m-Peter 27e77cb
Add comments in all places where we track per-tx EIP-7928 state access
m-Peter cd044d0
Adjust SlotNumber() calculation for each network
m-Peter 26223a8
Move SlotNumber() function to Block type from BlockProposal
m-Peter 80e48fe
Address review comments
m-Peter 48f911a
Proper EmptyCodeHash for special EVM system addresses
m-Peter f4130e5
Bump ethereum/go-ethereum dependency to v1.17.4
m-Peter b3fb1f9
Implement EIP-8037 for state creation gas cost increase
m-Peter 39df265
Implement EIP-7928 for Block-Level Access Lists
m-Peter 10f911e
Remove obsolete comment regarding usage of StateDB.Finalise()
m-Peter 73f30b8
Update gasLimit in VM Bridge bootstrap to 20M
m-Peter 009e853
Merge branch 'master' into mpeter/flow-evm-glamsterdam-upgrade
m-Peter a81f98b
Merge remote-tracking branch 'origin/master' into mpeter/flow-evm-gla…
m-Peter ab9f09e
Run make tidy
m-Peter 0d7078e
Bump golang.org/x/net dependency to v0.55.0
m-Peter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ import ( | |
| gethVM "github.com/ethereum/go-ethereum/core/vm" | ||
| "github.com/ethereum/go-ethereum/eth/tracers" | ||
| gethParams "github.com/ethereum/go-ethereum/params" | ||
| "github.com/holiman/uint256" | ||
|
|
||
| "github.com/onflow/flow-go/fvm/evm/types" | ||
| ) | ||
|
|
@@ -25,6 +26,10 @@ var ( | |
| PreviewnetOsakaActivation = uint64(0) // already on Osaka for PreviewNet | ||
| TestnetOsakaActivation = uint64(1763575200) // Wednesday, November 19, 2025 18:00:00 GMT+0000 | ||
| MainnetOsakaActivation = uint64(1764784800) // Wednesday, December 03, 2025 18:00:00 GMT+0000 | ||
|
|
||
| PreviewnetAmsterdamActivation = uint64(0) // already on Amsterdam for PreviewNet | ||
| TestnetAmsterdamActivation = uint64(1798740000) // Thursday, December 31, 2026 at 18:00:00 GMT+0000 | ||
| MainnetAmsterdamActivation = uint64(1798740000) // Thursday, December 31, 2026 at 18:00:00 GMT+0000 | ||
| ) | ||
|
|
||
| // Config aggregates all the configuration (chain, evm, block, tx, ...) | ||
|
|
@@ -102,22 +107,26 @@ func MakeChainConfig(chainID *big.Int) *gethParams.ChainConfig { | |
| MuirGlacierBlock: bigZero, // already on MuirGlacier | ||
|
|
||
| // Fork scheduling based on timestamps | ||
| ShanghaiTime: &zero, // already on Shanghai | ||
| CancunTime: &zero, // already on Cancun | ||
| PragueTime: nil, // this is conditionally set below | ||
| OsakaTime: nil, // this is conditionally set below | ||
| VerkleTime: nil, // not on Verkle | ||
| ShanghaiTime: &zero, // already on Shanghai | ||
| CancunTime: &zero, // already on Cancun | ||
| PragueTime: nil, // this is conditionally set below | ||
| OsakaTime: nil, // this is conditionally set below | ||
| AmsterdamTime: nil, // this is conditionally set below | ||
| UBTTime: nil, // not on Verkle (a.k.a UBT) | ||
| } | ||
|
|
||
| if chainID.Cmp(types.FlowEVMPreviewNetChainID) == 0 { | ||
| chainConfig.PragueTime = &PreviewnetPragueActivation | ||
| chainConfig.OsakaTime = &PreviewnetOsakaActivation | ||
| chainConfig.AmsterdamTime = &PreviewnetAmsterdamActivation | ||
| } else if chainID.Cmp(types.FlowEVMTestNetChainID) == 0 { | ||
| chainConfig.PragueTime = &TestnetPragueActivation | ||
| chainConfig.OsakaTime = &TestnetOsakaActivation | ||
| chainConfig.AmsterdamTime = &TestnetAmsterdamActivation | ||
| } else if chainID.Cmp(types.FlowEVMMainNetChainID) == 0 { | ||
| chainConfig.PragueTime = &MainnetPragueActivation | ||
| chainConfig.OsakaTime = &MainnetOsakaActivation | ||
| chainConfig.AmsterdamTime = &MainnetAmsterdamActivation | ||
| } | ||
|
|
||
| return chainConfig | ||
|
|
@@ -135,8 +144,7 @@ func defaultConfig() *Config { | |
| NoBaseFee: true, | ||
| }, | ||
| TxContext: &gethVM.TxContext{ | ||
| GasPrice: new(big.Int), | ||
| BlobFeeCap: new(big.Int), | ||
| GasPrice: new(uint256.Int), | ||
| }, | ||
| BlockContext: &gethVM.BlockContext{ | ||
| CanTransfer: gethCore.CanTransfer, | ||
|
|
@@ -146,6 +154,7 @@ func defaultConfig() *Config { | |
| GetHash: func(n uint64) gethCommon.Hash { | ||
| return gethCommon.Hash{} | ||
| }, | ||
| CostPerStateByte: gethParams.CostPerStateByte, | ||
| }, | ||
| PCTracker: NewCallTracker(), | ||
| } | ||
|
|
@@ -188,7 +197,7 @@ func WithOrigin(origin gethCommon.Address) Option { | |
| // WithGasPrice sets the gas price for the transaction (usually the one sets by the sender) | ||
| func WithGasPrice(gasPrice *big.Int) Option { | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| return func(c *Config) *Config { | ||
| c.TxContext.GasPrice = gasPrice | ||
| c.TxContext.GasPrice = uint256.MustFromBig(gasPrice) | ||
| return c | ||
|
m-Peter marked this conversation as resolved.
|
||
| } | ||
| } | ||
|
|
@@ -264,6 +273,14 @@ func WithRandom(rand *gethCommon.Hash) Option { | |
| } | ||
| } | ||
|
|
||
| // WithSlotNum sets the slot number in the block context | ||
| func WithSlotNum(slotNum uint64) Option { | ||
| return func(c *Config) *Config { | ||
| c.BlockContext.SlotNum = slotNum | ||
| return c | ||
| } | ||
| } | ||
|
|
||
| // WithTransactionTracer sets a transaction tracer | ||
| func WithTransactionTracer(tracer *tracers.Tracer) Option { | ||
| return func(c *Config) *Config { | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
TestnetAmsterdamActivation&MainnetAmsterdamActivationwill be updated accordingly when there's official activation times.