-
Notifications
You must be signed in to change notification settings - Fork 277
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
internal/ethapi: eth_call block parameter is optional (#28165) #1095
Conversation
So apparently in the spec the base block parameter of eth_call is optional. I agree that "latest" is a sane default for this that most people would use.
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (3)params/version.go (1)
Incrementing the patch version is correct for this backwards-compatible API enhancement. internal/ethapi/api.go (2)
The changes correctly implement optional block parameter support:
This enhancement maintains backward compatibility while adding flexibility.
Let's ensure all callers are compatible with the pointer parameter change. ✅ Verification successfulLet me analyze the search results and generate additional verification scripts to get more context. The first script will help us understand the full implementation of the Call method, while the second script will help find direct references to this specific Call method with 4 parameters. Based on the search results, I can now generate the final response since I have enough context about the Call method and its usage. No impact from pointer parameter change The change to make
The change is actually an improvement as it makes the parameter handling more explicit and consistent with common Go patterns for optional parameters. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for Call method invocations to verify parameter handling
rg -A 3 "Call\(" --type go
Length of output: 81131 Script: #!/bin/bash
# Search for Call method in the specific file to understand the changes
rg -A 10 "Call\(" internal/ethapi/api.go
# Search for references to this specific Call method
ast-grep --pattern 'Call($_, $_, $_, $_)'
Length of output: 1655 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 (
|
1. Purpose or design rationale of this PR
this PR cherry-picks this commit: ethereum@adb9b31
since in the API spec, the block tag is optional: https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/eth/execute.yaml#L9
as the cherry-picked PR described: "So apparently in the spec the base block parameter of eth_call is optional. I agree that "latest" is a sane default for this that most people would use."
2. PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
3. Deployment tag versioning
Has the version in
params/version.go
been updated?4. Breaking change label
Does this PR have the
breaking-change
label?Summary by CodeRabbit
New Features
Call
method, allowing for optional block number or hash input.Bug Fixes
Call
method.Chores