-
Notifications
You must be signed in to change notification settings - Fork 3
Implement Fulu #71
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: main
Are you sure you want to change the base?
Implement Fulu #71
Conversation
Summary of ChangesHello @guha-rahul, 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 integrates the Fulu fork into the system, a significant upgrade that enhances the predictability of the blockchain by implementing EIP-7917's proposer lookahead. This feature allows for the deterministic identification of future block proposers, which is essential for advancing preconfirmation protocols and improving overall network efficiency and security. The integration required comprehensive updates across various core components, including consensus types, state management, and block processing logic. 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
|
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 the Fulu fork, which includes the proposer lookahead feature from EIP-7917. The changes are well-structured, adding new types for Fulu, updating configuration, and integrating the new logic into the state transition process. The implementation correctly reuses existing structures from the Electra fork where possible.
My review focuses on improving code safety and adherence to the project's style guide. I've identified an unused variable that causes unnecessary computation, which should be removed. I've also suggested adding assertions for pointer arguments in new helper functions to prevent potential null pointer dereferences, in line with the safety-critical coding rules. Additionally, I've pointed out several places where documentation comments can be improved to better align with the prescribed sentence structure and punctuation style.
| effective_balance_increments: *const EffectiveBalanceIncrements, | ||
| out: []ValidatorIndex, | ||
| ) !void { | ||
| const lookahead_epochs = preset.MIN_SEED_LOOKAHEAD + 1; |
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 effective_balance_increments parameter is a pointer and could be null. To improve safety and adhere to the style guide, you should assert that it's not null at the beginning of the function.1
std.debug.assert(effective_balance_increments != null);
const lookahead_epochs = preset.MIN_SEED_LOOKAHEAD + 1;
Style Guide References
Footnotes
-
The style guide mandates asserting all function arguments to ensure functions do not operate on unchecked data, which is crucial for safety and correctness. ↩
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.
const pointers cannot be null so instead added this check std.debug.assert(effective_balance_increments.items.len > 0);
| effective_balance_increments: *const EffectiveBalanceIncrements, | ||
| ) !void { | ||
| // Only process for Fulu fork | ||
| if (!state.isFulu()) return; |
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 effective_balance_increments parameter is a pointer and could be null. To improve safety and adhere to the style guide, you should assert that it's not null at the beginning of the function.1
std.debug.assert(effective_balance_increments != null);
// Only process for Fulu fork
if (!state.isFulu()) return;
Style Guide References
Footnotes
-
The style guide mandates asserting all function arguments to ensure functions do not operate on unchecked data, which is crucial for safety and correctness. ↩
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.
const pointers cannot be null so instead added this check std.debug.assert(effective_balance_increments.items.len > 0);
|
this is part of #19 |
This pr add Fulu fork and along with it , It also adds