-
-
Notifications
You must be signed in to change notification settings - Fork 434
feat: add spec references, a mapping of spec to implementation #8778
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
base: unstable
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @jtraglia, 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 introduces a robust system for tracking and verifying the client's adherence to Ethereum specifications. By creating a dedicated 'specrefs' directory and leveraging the 'ethspecify' tool, the project aims to improve development efficiency in managing specification changes and enhance the auditability of client implementations against the official Ethereum protocols. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
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
|
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.
Code Review
This pull request introduces a new specrefs directory to map specification items to their implementations in the codebase, using the ethspecify tool. This is a great initiative for improving spec compliance and maintainability. The new configuration files are well-structured, and the process is documented in a new README. I've found a small typo in the README and suggested an improvement to make the search patterns in the configuration more robust. Overall, this is a valuable addition to the repository.
| - name: AGGREGATE_DUE_BPS | ||
| sources: | ||
| - file: packages/config/src/chainConfig/configs/mainnet.ts | ||
| search: "AGGREGATE_DUE_BPS:" |
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.
The search pattern "AGGREGATE_DUE_BPS:" is a bit weak and could potentially match unintended lines, such as in comments. For better robustness, I suggest using a more specific regex that anchors the search to the start of the line and accounts for leading whitespace. This improvement should be applied to other similar simple string searches in this file for consistency and maintainability.
search: '^\s+AGGREGATE_DUE_BPS:'
regex: trueThere 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.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
nflaig
left a comment
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.
generally looks good to me, thanks @jtraglia
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
nflaig
left a comment
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.
LGTM - waiting for @ensi321 to give this a final pass
|
this should be closing #7477 once merged |
ensi321
left a comment
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.
I think this is great. Minor maintenance effort from our side. And we can be monitor the exception list to see if Lodestar is missing something from the spec.
| sources: [] | ||
| spec: | | ||
| <spec fn="_fft_field" fork="fulu" hash="d9de8aaf"> | ||
| def _fft_field( |
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.
Hmmm, I don't see the point of having content of each function here. It could be a good reference but generally something like link should be enough? Same with containers and data classes.
| @@ -0,0 +1,11986 @@ | |||
| - name: _fft_field | |||
| sources: [] | |||
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.
For those that are under exceptions, is it possible to not generate them here?

Motivation
This PR adds a directory with specification references. These are used to map specification items (configs, presets, functions, etc) to client implementations (code in Lodestar). These specification references are meant to (1) help developers keep track of specification changes and (2) make it easier for third-parties (eg EF Protocol Security) to verify clients adhere to the specifications.
Our team is working to do this for all clients.
Note: The function mappings are the only weak-spot. It's quite difficult to map some of these because of implementation differences & the fact that not everything is implemented (eg Gloas functions). The specref functions will most likely require some additional work, but this PR does identify most functions.
AI Assistance Disclosure
Yes, I used Claude Code to identify/map most of these.
Fixes: #7477