Skip to content

commitment rebuild: add --no-history flag - #20147

Merged
sudeepdino008 merged 3 commits into
mainfrom
dwightbot/commitment-rebuild-no-history-flag
Mar 25, 2026
Merged

sudeepdino008 merged 3 commits into
mainfrom
dwightbot/commitment-rebuild-no-history-flag

Conversation

@sudeepdino008

Copy link
Copy Markdown
Member

Adds a --no-history flag to commitment rebuild that skips history regeneration and only rebuilds commitment KV files using the faster shard-based path.

  • When set, history (.v) and index (.ef) files are left untouched
  • Mutually exclusive with --resume
  • Default behavior (without the flag) is unchanged

When --no-history is set, the commitment rebuild command uses the faster
shard-based rebuildCommitment path that only regenerates commitment KV
files without regenerating commitment history (.v) and index (.ef) files.

This is useful when you only need to rebuild the commitment state without
the overhead of full history regeneration.

The flag is mutually exclusive with --resume.
@sudeepdino008
sudeepdino008 marked this pull request as ready for review March 25, 2026 11:13
@sudeepdino008
sudeepdino008 enabled auto-merge March 25, 2026 11:13
@sudeepdino008
sudeepdino008 requested review from Copilot and removed request for AskAlexSharov and Giulio2002 March 25, 2026 11:14

Copilot AI 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.

Pull request overview

Adds a --no-history flag to the integration commitment rebuild command to force the rebuild to skip commitment history regeneration and use the non-history (file/shard-based) rebuild path, without changing default behavior when the flag is not provided.

Changes:

  • Introduces a new --no-history CLI flag for commitment rebuild.
  • Enforces mutual exclusivity between --no-history and --resume.
  • Forces the rebuild flow to avoid history regeneration when --no-history is set.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
cmd/integration/commands/flags.go Adds the noHistory flag storage and a helper to register --no-history on a command.
cmd/integration/commands/commitment.go Wires the new flag into commitment rebuild, adds mutual-exclusion validation, and adjusts rebuild-mode selection (withHistory).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/integration/commands/commitment.go
… exclusive

When --no-history is set, DeleteStateSnapshots runs with OnlyDomain=true,
which preserves history/index snapshot files. Combined with --clear-commitment,
this would leave stale .v/.ef artifacts after clearing DB tables.

Add a validation check to prevent this problematic combination, consistent
with the existing --clear-commitment/--resume and --no-history/--resume checks.
@sudeepdino008
sudeepdino008 added this pull request to the merge queue Mar 25, 2026
Merged via the queue into main with commit 6b74125 Mar 25, 2026
35 checks passed
@sudeepdino008
sudeepdino008 deleted the dwightbot/commitment-rebuild-no-history-flag branch March 25, 2026 21:30
sudeepdino008 added a commit that referenced this pull request Apr 1, 2026
Adds a `--no-history` flag to `commitment rebuild` that skips history
regeneration and only rebuilds commitment KV files using the faster
shard-based path.

- When set, history (`.v`) and index (`.ef`) files are left untouched
- Mutually exclusive with `--resume`
- Default behavior (without the flag) is unchanged

---------

Co-authored-by: awskii <awskii@users.noreply.github.com>
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.

3 participants