-
Notifications
You must be signed in to change notification settings - Fork 12
Enable EVM Fusaka hard-fork #913
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
Conversation
WalkthroughUpdated module dependencies in Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Requester
participant FlowNode as Flow node / emulator
Note over Client,Requester: eth_estimateGas request
Client->>Requester: eth_estimateGas(tx, blockOverrides?)
Requester->>Requester: compute initial passingGasLimit
alt passingGasLimit > gethParams.MaxTxGas
Requester->>FlowNode: GetLatestEVMHeight()
FlowNode-->>Requester: height / error
Requester->>FlowNode: GetBlockByHeight(height)
FlowNode-->>Requester: block / error
Requester->>Requester: build emulator config (apply blockOverrides)
alt emulatorConfig indicates Osaka
Requester->>Requester: clamp passingGasLimit := gethParams.MaxTxGas
Note right of Requester `#DFF2E1`: Osaka cap applied (EIP‑7825)
else
Note right of Requester `#FFF4D1`: no clamp
end
end
Requester->>Requester: run simulation with passingGasLimit
Requester-->>Client: return estimate or error
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
d24234e to
d55cd8a
Compare
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
go.mod(5 hunks)models/transaction_test.go(1 hunks)services/requester/requester.go(1 hunks)tests/go.mod(5 hunks)tests/web3js/estimate_gas_overrides_test.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- models/transaction_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Test
- GitHub Check: Lint
🔇 Additional comments (3)
tests/web3js/estimate_gas_overrides_test.js (1)
104-122: LGTM! Good test coverage for Osaka gas cap handling.The test validates that
eth_estimateGascontinues to work correctly when provided with gas limits exceeding the EIP-7825 cap (16,777,216), ensuring the new capping logic in the gateway doesn't break estimation behavior.go.mod (1)
7-7: LGTM! Dependency updates align with Fusaka hard-fork enablement.The dependency bumps, particularly
ethereum/go-ethereumto v1.16.5 and the updatedonflow/flow-gocommit, provide the necessary Osaka/Fusaka hard-fork support for PreviewNet and Testnet.Also applies to: 13-15, 37-37, 43-43, 92-92, 149-150, 222-223
tests/go.mod (1)
6-6: LGTM! Test dependency updates maintain consistency with main module.The test module dependencies are properly synchronized with the main
go.mod, ensuring the test environment has the necessary Osaka/Fusaka support.Also applies to: 8-8, 10-10, 12-13, 25-25, 31-31, 91-91, 160-161, 248-250
01387cd to
fd7d892
Compare
| blockNumber = blockOverrides.Number.ToInt() | ||
| } | ||
| if blockOverrides.Time != nil { | ||
| blockTime = uint64(*blockOverrides.Time) |
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.
if blockNumber and blockTime are updated here, do we need to update the configs at Line 352 and 353?
emulator.WithBlockNumber(blockNumber),
emulator.WithBlockTime(blockTime),
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.
Nice catch @zhangchiqing 👏
This part was a bit confusing, so I simplified the creation of the ChainConfig in ee75cc9 .
For reference, the config for the activation of each hard-fork, is actually hard-coded here: https://github.com/onflow/flow-go/blob/master/fvm/evm/emulator/config.go#L86-L123 . And this isn't something that depends on the block overrides that a user supplies for gas estimation.
The configs at Line 352 and 353:
emulator.WithBlockNumber(blockNumber),
emulator.WithBlockTime(blockTime),only control the returned values of:
block.number;
block.timestamp;in a Solidity contract function execution. And this part is already handled else-where: https://github.com/onflow/flow-evm-gateway/blob/main/services/requester/overridable_blocks_provider.go#L49-L55 .
ee75cc9 to
f9e2865
Compare
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumtests/go.sumis excluded by!**/*.sum
📒 Files selected for processing (8)
go.mod(4 hunks)models/errors/errors.go(0 hunks)models/transaction_test.go(1 hunks)services/requester/requester.go(1 hunks)tests/go.mod(4 hunks)tests/tx_batching_test.go(6 hunks)tests/web3js/estimate_gas_overrides_test.js(1 hunks)tests/web3js/eth_failure_handling_test.js(1 hunks)
💤 Files with no reviewable changes (1)
- models/errors/errors.go
🚧 Files skipped from review as they are similar to previous changes (4)
- go.mod
- tests/go.mod
- services/requester/requester.go
- models/transaction_test.go
🧰 Additional context used
🧬 Code graph analysis (1)
tests/web3js/eth_failure_handling_test.js (1)
tests/e2e-network/e2e_test.js (1)
assert(3-3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test
🔇 Additional comments (3)
tests/web3js/estimate_gas_overrides_test.js (1)
104-122: LGTM! Well-structured test for gas estimation above the Fusaka cap.The test validates that
eth_estimateGascorrectly handles gas limits exceeding the EIP-7825 cap (16,777,216) and still returns accurate estimates. This aligns with the PR's objective of moving gas cap enforcement from transaction submission to the estimation layer.tests/web3js/eth_failure_handling_test.js (2)
15-15: LGTM! Comment accurately reflects the Fusaka gas cap.The updated comment correctly specifies the EIP-7825 gas limit of 16,777,216 and provides helpful context by mentioning the Fusaka hard-fork.
18-18: LGTM! Error message assertion updated for Fusaka cap.The updated error message assertion reflects the new gas cap (16,777,216) and provides more detailed information by showing both the cap and the transaction's gas limit. This improves the error message quality.
Closes: #912
Depends on: onflow/flow-go#8085
Description
Updates the flow-go version to onflow/flow-go#8085, which enables the Fusaka hard-fork for
PreviewNet(a.k.a Emulator) &Testnetnetworks.For contributor use:
masterbranchFiles changedin the Github PR explorerSummary by CodeRabbit