-
Notifications
You must be signed in to change notification settings - Fork 10
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
Set a non-zero BaseFeePerGas
on block responses
#648
Conversation
Also update the eth_maxPriorityFeePerGas to return the configured gas price.
WalkthroughThe changes in this pull request introduce a new variable Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Outside diff range and nitpick comments (2)
api/api.go (2)
35-35
: Consider declaring as a constant.While the implementation is correct, consider declaring this as a constant since it represents a fixed value that shouldn't change during runtime.
-var baseFeesPerGas = big.NewInt(1) +const baseFeesPerGasValue = 1 +var baseFeesPerGas = big.NewInt(baseFeesPerGasValue)
1235-1235
: Add documentation explaining the gas price usage.While the implementation is correct, please add a comment explaining why we're using the configured gas price as the priority fee. This helps clarify the relationship between these two concepts for future maintainers.
// MaxPriorityFeePerGas returns a suggestion for a gas tip cap for dynamic fee transactions. +// We use the configured gas price as the priority fee to ensure consistency +// across the API and to maintain compatibility with EIP-1559 transactions. func (b *BlockChainAPI) MaxPriorityFeePerGas(ctx context.Context) (*hexutil.Big, error) { return (*hexutil.Big)(b.config.GasPrice), nil }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
api/api.go
(4 hunks)tests/web3js/eth_non_interactive_test.js
(1 hunks)
🔇 Additional comments (4)
tests/web3js/eth_non_interactive_test.js (2)
382-382
: LGTM! The updated test aligns with the non-zero BaseFeePerGas
requirement.
The change from zero to non-zero (1n) values for baseFeePerGas
correctly reflects the implementation of non-zero base fees in block responses, which addresses the Hardhat ignition deployment issues mentioned in #647.
379-384
: Verify test coverage for gas fee calculations.
The test validates the basic fee history structure, but consider adding additional test cases to verify:
- The consistency of
baseFeePerGas
across different block ranges - The interaction between
baseFeePerGas
andmaxPriorityFeePerGas
- Edge cases with varying block numbers and percentiles
This would ensure robust validation of the gas fee calculation changes.
api/api.go (2)
942-942
: LGTM!
The change correctly uses the non-zero baseFeesPerGas
in fee history responses, ensuring consistency with block responses.
1058-1058
: LGTM!
The change correctly sets a non-zero base fee in block responses, which directly addresses the issue with Hardhat ignition deployments.
Closes: #647
Description
Also update the
eth_maxPriorityFeePerGas
to return the configured gas price.Example usage of hardhat ignition deployment:
Example usage of
forge create
:Example usage of
cast send
:For contributor use:
master
branchFiles changed
in the Github PR explorerSummary by CodeRabbit