Skip to content

db/integrity: enable CommitmentRoot check on all .kv files#21029

Merged
AskAlexSharov merged 1 commit into
mainfrom
cm_root_kv_filter
May 8, 2026
Merged

db/integrity: enable CommitmentRoot check on all .kv files#21029
AskAlexSharov merged 1 commit into
mainfrom
cm_root_kv_filter

Conversation

@sudeepdino008

@sudeepdino008 sudeepdino008 commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Filter .kv files before slicing in CheckCommitmentRoot, so onlyCheckLastFile picks the latest .kv instead of whatever aggTx.Files returned last (which was often the .ef).
  • Default CHECK_COMMITMENT_ROOT_ONLY_LAST_FILE and CHECK_COMMITMENT_ROOT_ONLY_LAST_FILE_RECOMPUTE to false so the check now covers all .kv files by default.
  • Add a discovery log line and a clearer warning when no .kv files are present.
  • with db/state, db/integrity: FilesOnlyStateReader for commitment rebuild and CommitmentRoot #21026 -- recompute check works fine now; and it is fast enough to do for all kv files

Test plan

  • make lint
  • make erigon integration
  • Run erigon seg integrity --check=CommitmentRoot against a datadir and confirm all .kv files get checked.

Filter .kv files before slicing in CheckCommitmentRoot so onlyCheckLastFile
picks the latest .kv instead of whatever aggTx.Files returned last (often
the .ef). Also default onlyCheckLastFile and onlyRecomputeLastFile to false
so the check covers all .kv files by default.
@sudeepdino008 sudeepdino008 requested a review from awskii May 7, 2026 10:41
@AskAlexSharov AskAlexSharov added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit a98a674 May 8, 2026
38 checks passed
@AskAlexSharov AskAlexSharov deleted the cm_root_kv_filter branch May 8, 2026 04:42
sudeepdino008 added a commit that referenced this pull request May 12, 2026
…, kv integrity (#21135)

Cherry-picks to `release/3.4`:

- #20939 — cmd/integration: allow resume of commitment rebuild (no
history case)
- #21023 — cmd/utils/app: wait for background build/merge before
MergeLoop in seg retire
- #21029 — db/integrity: enable CommitmentRoot check on all .kv files

---------

Co-authored-by: moskud <sudeepdino008@gmail.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.

2 participants