fix: node_info label for erigon_get_header_by_number (#12346)#221
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideFix the node_info macro invocation by updating its label to the correct erigon_getHeaderByNumber RPC method name. Class diagram for EthApi method updateclassDiagram
class EthApi {
+block_by_number(number: BlockNumber): Result<Option<AnyRpcBlock>>
+"get_header_by_number(number: BlockNumber): Result<Option<AnyRpcBlock>>"
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
@phrwlk is attempting to deploy a commit to the Foundry development Team on Vercel. A member of the Team first needs to authorize it. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Summary of ChangesHello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a minor but important fix by correcting an internal logging label. The change ensures that the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a copy-paste error in a logging macro within the erigon_get_header_by_number function. The change is accurate and improves the correctness of log outputs. I've added one comment with a suggestion to improve the clarity and correctness of the function where the change was made.
| number: BlockNumber, | ||
| ) -> Result<Option<AnyRpcBlock>> { | ||
| node_info!("ots_getApiLevel"); | ||
| node_info!("erigon_getHeaderByNumber"); |
There was a problem hiding this comment.
While this change correctly fixes the logging output for this function, the function's implementation seems to have a discrepancy with its name and the Erigon RPC specification.
The function erigon_get_header_by_number is expected to return only a block header, but its return type is Result<Option<AnyRpcBlock>> and it returns a full block object (with transaction hashes).
Other functions in this file, like ots_get_block_details, have comments explaining why they deviate from the spec for simplicity. If returning a full block here is intentional, it would be beneficial to add a similar comment to this function to clarify the behavior and avoid confusion.
For example:
/// For simplicity purposes, we return the entire block instead of only the header.
/// This is the original purpose of the endpoint (to save bandwidth), but it doesn't seem
/// necessary in the context of an anvil node.
Alternatively, if the intention is to adhere to the spec, the function could be updated to return only the header (AnyRpcHeader).
Motivation
Solution
PR Checklist
Summary by Sourcery
Bug Fixes: