Skip to content

feat(vara.eth): add --batch-commitment-period node knob#5606

Open
grishasobol wants to merge 4 commits into
masterfrom
gsobol/ethexe/batch-commit-period
Open

feat(vara.eth): add --batch-commitment-period node knob#5606
grishasobol wants to merge 4 commits into
masterfrom
gsobol/ethexe/batch-commit-period

Conversation

@grishasobol

@grishasobol grishasobol commented Jun 26, 2026

Copy link
Copy Markdown
Member

What

Adds a coordinator-local knob batch_commitment_period: NonZeroU32 (CLI flag
--batch-commitment-period, default 1). When a node is the elected
coordinator it only builds a BatchCommitment on Ethereum blocks whose
height % batch_commitment_period == 0. With the default 1 the behavior is
unchanged (commit every block); larger values commit every Nth block (every
2nd, 5th, 10th, 100th, ...).

How

  • DEFAULT_BATCH_COMMITMENT_PERIOD (= 1) in ethexe-common.
  • Threaded CLI NodeParamsservice::config::NodeConfig
    ethexe_consensus::ValidatorConfigValidatorCore.
  • Gate added in Idle::maybe_advance_to_role (ethexe/consensus/.../idle.rs),
    inside the coordinator branch only: the elected coordinator drops back to
    Idle on a non-multiple height. Participants are unaffected — they always
    enter the role and validate whatever the coordinator commits. This keeps the
    knob purely coordinator-local (like commitment_delay_limit): different nodes
    may run different values without losing quorum.

Tests

  • Defaults to period = 1 everywhere (no behavior change in existing tests).
  • ethexe-consensus:
    • batch_commitment_period_gates_coordinator_by_block_height (period 2 — as
      coordinator: odd height stays Idle, even height → CoordinatorBoot).
    • participant_enters_regardless_of_batch_commitment_period (huge period —
      a non-coordinator still enters Participant on a non-multiple height).
  • ethexe-service: batch_commitment_period_commits_only_on_multiples
    (period 2, single validator/coordinator — a ping still round-trips and every
    committed batch lands on a multiple-of-period height).

Local: cargo fmt --all, cargo clippy --all-targets (clean), new tests +
ethexe-consensus/ethexe-common/ethexe-cli suites pass; full
cargo nextest run -p "ethexe-*" passed on the prior revision.

Operational note

The period is coordinator-local, so divergent values across nodes are safe.
Keep it small enough that every era's election window still contains several
multiple-of-period blocks (validator-set rotation has an election-window
deadline), and prefer period <= uncommitted-chain-len-threshold so the
idle-chain checkpoint still fires close to its threshold. Default 1 avoids
all of this.

🤖 Generated with Claude Code

grishasobol and others added 2 commits June 26, 2026 14:55
Add a node-local `batch_commitment_period: NonZeroU32` (CLI
`--batch-commitment-period`, default 1). A validator only builds/validates a
batch commitment on blocks whose `height % period == 0`, so commitments can be
produced every Nth block instead of every block. Default 1 reproduces the
previous every-block behavior.

Threaded CLI -> NodeConfig -> ethexe-consensus ValidatorConfig/ValidatorCore;
gate added in `Idle::maybe_advance_to_role` (height-based, applies to both
coordinator and participant). Tests default to period 1; adds one consensus
unit test (idle gate, period 2) and one service integration test (ping
round-trips and every committed batch lands on a multiple-of-period height).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147tTHt6e7mhirSAPwNxRc3
Move the height gate out of the shared role-dispatch path and into the
coordinator branch only. Participants now always enter the Participant role and
validate whatever the coordinator chooses to commit, regardless of their own
period; only the elected coordinator consults its local batch_commitment_period
to decide whether a block is a commitment block. This makes the knob purely
coordinator-local (like commitment_delay_limit) — nodes may run different values
without losing quorum.

Tests: rename the coordinator-gating test; add a participant test asserting it
enters the role even on a non-multiple height with a huge local period.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147tTHt6e7mhirSAPwNxRc3
@grishasobol grishasobol added type: feat New functionality or user-visible improvement scope: vara.eth Vara Ethereum application layer (L2) labels Jun 26, 2026
Comment thread ethexe/cli/src/params/node.rs
@grishasobol grishasobol self-assigned this Jun 26, 2026
@grishasobol grishasobol added the ai-generated Created entirely by an AI agent without direct human authorship label Jun 26, 2026
Address review: add the `batch-commitment-period` knob to
`.ethexe.example.toml` and `.ethexe.example.local.toml`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147tTHt6e7mhirSAPwNxRc3
@grishasobol grishasobol marked this pull request as ready for review June 26, 2026 13:15
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 adds a new node-local configuration knob that allows the elected coordinator to throttle batch commitments to every Nth block. This change is designed to be purely local to the coordinator, ensuring that different nodes can operate with different commitment cadences without impacting consensus or requiring cross-node agreement. The implementation updates the configuration propagation path and adds logic in the consensus layer to conditionally skip the coordinator boot process based on block height.

Highlights

  • New CLI Knob: Introduced a coordinator-local configuration flag --batch-commitment-period (default 1) to control the cadence of batch commitments based on Ethereum block height.
  • Coordinator Logic: Updated the consensus coordinator role to skip block commitment if the current block height is not a multiple of the configured period, while maintaining standard participant behavior.
  • Testing: Added comprehensive unit and integration tests to verify that the coordinator correctly gates commitments while participants remain unaffected.
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 the 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 counterproductive. 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.

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.

@grishasobol grishasobol enabled auto-merge June 26, 2026 13:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 coordinator-local configuration parameter, batch_commitment_period, allowing coordinators to build batch commitments only on blocks whose height is a multiple of the configured period. Feedback on the changes suggests explicitly casting the period to u64 when calling is_multiple_of to ensure type correctness and compilation, and dynamically finding even and odd blocks in the unit tests to avoid relying on brittle hardcoded indices.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread ethexe/consensus/src/validator/idle.rs
Comment thread ethexe/consensus/src/validator/idle.rs Outdated
Address review: select the even/odd-height blocks for the coordinator gate
test dynamically instead of by fixed index, so it doesn't depend on the mock
chain's genesis-height parity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0147tTHt6e7mhirSAPwNxRc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Created entirely by an AI agent without direct human authorship scope: vara.eth Vara Ethereum application layer (L2) type: feat New functionality or user-visible improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants