Skip to content

Conversation

@guha-rahul
Copy link
Contributor

This pr add Fulu fork and along with it , It also adds

  • proposer lookahead (EIP-7917) which is helpful for based preconfirmation protocols as it precalculates and store a deterministic proposer lookahead in the beacon state at the start of every epoch.

@gemini-code-assist
Copy link

Summary of Changes

Hello @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

  • Fulu Fork Implementation: This pull request introduces the 'Fulu' fork, adding it to the system's fork enumeration and configuration.
  • Proposer Lookahead (EIP-7917): A key feature of the Fulu fork is the implementation of EIP-7917's proposer lookahead. This mechanism precalculates and stores a deterministic list of future block proposers in the beacon state at the start of each epoch, which is crucial for preconfirmation protocols.
  • State Transition and Type Updates: The changes involve extensive updates to consensus types, beacon state, and block structures to accommodate the Fulu fork, including new data structures for Data Availability Sampling (DAS) and modifications to state transition logic for epoch processing and validator slashing.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

  1. The style guide mandates asserting all function arguments to ensure functions do not operate on unchecked data, which is crucial for safety and correctness.

Copy link
Contributor Author

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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

  1. The style guide mandates asserting all function arguments to ensure functions do not operate on unchecked data, which is crucial for safety and correctness.

Copy link
Contributor Author

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);

@twoeths
Copy link
Collaborator

twoeths commented Oct 20, 2025

this is part of #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants