Skip to content

Backport release/v6.7: Apply compiled KV repair files at a fixed height and generate them from digest inspect lists - #4410

Merged
blindchaser merged 5 commits into
release/v6.7from
backport-4400-to-release/v6.7
Oct 1, 2026
Merged

blindchaser merged 5 commits into
release/v6.7from
backport-4400-to-release/v6.7

Conversation

@seidroid

@seidroid seidroid Bot commented Oct 1, 2026

Copy link
Copy Markdown

Backport of #4400 to release/v6.7.

@seidroid

seidroid Bot commented Oct 1, 2026

Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-4400-to-release/v6.7
git worktree add --checkout .worktree/backport-4400-to-release/v6.7 backport-4400-to-release/v6.7
cd .worktree/backport-4400-to-release/v6.7
git reset --hard HEAD^
git cherry-pick -x 792ff53715ca75e7ffb48b6400c53c4f3b964bd2
git push --force-with-lease

@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedOct 1, 2026, 4:32 PM

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.43816% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.51%. Comparing base (8e7ba86) to head (a4ad665).

Files with missing lines Patch % Lines
...i-db/tools/cmd/seidb/operations/kvrepair_export.go 81.01% 22 Missing and 19 partials ⚠️
sei-db/common/kvrepair/repair.go 84.00% 14 Missing and 10 partials ⚠️
app/upgrades/kvrepair/kvrepair.go 86.74% 6 Missing and 5 partials ⚠️
...b/tools/cmd/seidb/operations/evm_logical_digest.go 33.33% 2 Missing ⚠️
sei-db/tools/cmd/seidb/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff                @@
##           release/v6.7    #4410      +/-   ##
================================================
- Coverage         61.40%   60.51%   -0.89%     
================================================
  Files              2163     2072      -91     
  Lines            189115   178582   -10533     
================================================
- Hits             116121   108067    -8054     
+ Misses            62261    60611    -1650     
+ Partials          10733     9904     -829     
Flag Coverage Δ
sei-chain-pr 47.53% <83.43%> (?)
sei-db 70.02% <ø> (+0.21%) ⬆️
sei-db-state-db ?
sei-db-state-db-pr 69.87% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/app.go 71.73% <100.00%> (+0.01%) ⬆️
sei-db/common/kvrepair/values.go 100.00% <100.00%> (ø)
sei-db/tools/cmd/seidb/main.go 0.00% <0.00%> (ø)
...b/tools/cmd/seidb/operations/evm_logical_digest.go 41.40% <33.33%> (+7.04%) ⬆️
app/upgrades/kvrepair/kvrepair.go 86.74% <86.74%> (ø)
sei-db/common/kvrepair/repair.go 84.00% <84.00%> (ø)
...i-db/tools/cmd/seidb/operations/kvrepair_export.go 81.01% <81.01%> (ø)

... and 96 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

blindchaser and others added 2 commits October 1, 2026 11:30
…on v6.7

release/v6.7 has no EVM balance key: a 0x21 key parses as a misc key, and
FlatKV receives no balance changes. ReadsAsAbsent no longer names a balance
kind, and kvrepair-export writes only the nonce and code hash keys of an
account and refuses an account whose balance differs.

The conflict in digestMemIAVLReplaySemantic keeps backendMemIAVL and the new
semantic-replay mode constant. The tests use the v6.7 Commit and snapshot
signatures.

Co-authored-by: Cursor <cursoragent@cursor.com>
golangci-lint v2.8.0 on release/v6.7 does not see the Listed < 0 guard in the
same condition.

Co-authored-by: Cursor <cursoragent@cursor.com>
@blindchaser
blindchaser marked this pull request as ready for review October 1, 2026 15:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T15:57:33.434726Z 73914e8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cursor

cursor Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Direct module-store mutations at consensus-defined heights can halt the chain on unexpected pre-state or cause consensus failure if repair data is wrong; operational risk is high though gated by old-value checks and review workflow.

Overview
Adds a kvrepair hard-fork path so reviewed EVM (and other module) store fixes ship as embedded JSON and run at a fixed chain ID + block height via HardForkManager.

The app wires kvrepair.Register at startup: it loads every repairs/*.json file, validates stores and duplicate keys, and registers one handler per repair. At target_repair_height, each handler sets or deletes listed keys, optionally checks the pre-repair old value (or old_absent), and always re-writes entries so correct and repaired nodes commit the same changeset. EVM comparisons treat all-zero slots/nonces/code hashes and empty code as absent where FlatKV and memiavl disagree.

Tooling: seidb kvrepair-export builds repair files from paired evm-logical-digest inspect lists (memiavl reserve vs composite/flatkv prod). Shared types and strict JSON parsing live in sei-db/common/kvrepair. Docs note --key-offset 4 for digest prefix filtering; a composite migration test checks repair-shaped writes survive EVM migration.

Reviewed by Cursor Bugbot for commit a4ad665. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is a clean backport of #4400. It adds the kvrepair file format with strict parsing and validation, a hard-fork handler that applies embedded repair files at a fixed height, and a seidb kvrepair-export tool that builds repair files from digest inspect lists. With no .json repair files embedded, no handlers are registered, which matches the non-app-hash-breaking label; the referenced helpers exist on the base, and tests cover the parser, validator, handler and exporter, including an end-to-end export-and-apply run.

Findings: 0 blocking | 0 non-blocking | 0 posted inline

Blockers

  • None at the file/PR level.

Non-blocking

  • None at the file/PR level.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73914e853c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +32 to +36
// Usage:
//
// seidb evm-logical-digest --backend memiavl -d <reserve memiavl dir> \
// --memiavl-open-mode replay --height H --inspect-bucket storage \
// --key-offset 4 --key-prefix 03AB --list --list-limit 0 --json > reserve.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Move the CLI walkthrough out of the GoDoc

KVRepairExportCmd has a multi-paragraph GoDoc containing an invocation workflow and command examples rather than a concise description of what the function returns. Move this material to the Cobra command's Long/Example text or package documentation and keep the function GoDoc to one or two descriptive sentences.

AGENTS.md reference: AGENTS.md:L61-L72

Useful? React with 👍 / 👎.

@alexander-sei
alexander-sei self-requested a review October 1, 2026 15:57
@alexander-sei
alexander-sei enabled auto-merge (squash) October 1, 2026 16:17
@blindchaser
blindchaser disabled auto-merge October 1, 2026 16:26
@blindchaser
blindchaser merged commit f30175a into release/v6.7 Oct 1, 2026
72 checks passed
@blindchaser
blindchaser deleted the backport-4400-to-release/v6.7 branch October 1, 2026 17:22
alexander-sei added a commit that referenced this pull request Oct 1, 2026
Regenerated with ./scripts/generate-changelog.sh release/v6.6 release/v6.7.

Co-authored-by: Cursor <cursoragent@cursor.com>
masih pushed a commit that referenced this pull request Oct 1, 2026
Adds the `release/v6.7` entries merged since the rc2 changelog (#4293),
in prep to cut **v6.7.0-rc4**. The rc3 update (#4335) was closed without
merging, so its entries are included here:

- [#4411](#4411) — Log a
pinned node's skipped migration kick-off once per batch size
- [#4410](#4410) — Apply
compiled KV repair files at a fixed height and generate them from digest
inspect lists
- [#4409](#4409) — feat:
add migration pause handler
- [#4397](#4397) —
fix(evmrpc): release eth_getLogs DB-read slots when a block read panics
- [#4378](#4378) — Raise
goreleaser timeout to 2h
- [#4377](#4377) — Fix
FlatKV state sync bad-hash scenario
- [#4371](#4371) —
fix(seidb): keep writes in the old DB until the migration boundary first
moves
- [#4348](#4348) —
fix(seidb): report only the current migration boundary on the snapshot
gauge
- [#4347](#4347) —
fix(flatkv): keep 10 old checkpoints instead of mirroring memIAVL's
count
- [#4339](#4339) — rc3
version bump
- [#4334](#4334) — Fail
dynamic-gas precompile out-of-gas as an EVM out-of-gas call
- [#4315](#4315) — Pin the
Go builder image per architecture in build-static.sh
- [#4313](#4313) —
fix(memiavl): hold a snapshot reference for an iterator's lifetime
- [#4295](#4295) — rc2
version bump
- [#4294](#4294) — rc2
changelog backport

Also returns `## v6.7` to the format used through v6.6: the version
heading, `sei-chain`, and the generated PR list. The hand-written `###
Improvements` and `### Upgrade guide` sections are removed; every PR
they described is already a line in the generated list.

Regenerated with `./scripts/generate-changelog.sh release/v6.6
release/v6.7`; only the `## v6.7` section changes. Docs-only; no code
change.

**Backport note:** the #4347 backport added its own line to the top of
the `## v6.7` list on `release/v6.7`, and `main` doesn't have it, so the
`backport release/v6.7` cherry-pick of this PR conflicts at that one
spot (simulated with `git merge-tree`). Resolve it by taking this PR's
side: its fifteen lines already include #4347.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
masih pushed a commit that referenced this pull request Oct 1, 2026
## Summary
- Bump `version.json` from `v6.7.0-rc3` to `v6.7.0-rc4` to cut the
fourth `v6.7` release candidate.

Contents since rc3: #4411, #4410, #4409, #4397, #4378, #4377, #4371,
plus the rc4 changelog update (#4415, with the conflict-marker fix
#4416). The changelog has already landed, so the `v6.7.0-rc4` tag will
include it.

- All seven are labeled `non-app-hash-breaking`. #4371 changes the
AppHash only for nodes pinned to a `migrate_*` write mode while the
migration hasn't started (see #4369), and the hard-fork handlers added
by #4409 and #4410 are not registered for any chain in this release.
Unlike rc3, moving from rc3 to rc4 should not need a coordinated
validator switch.
- Push `v6.7.0-rc4` by hand on this PR's merge commit once it has
merged; the tagging ruleset stops `uci-release-publish` from creating
it. The rc3 tag was pushed before #4339 merged and sits on `0d56aaeef`,
where `version.json` still reads `v6.7.0-rc2`.
- #4378 raises GoReleaser's timeout to 2h. The rc3 tag push hit the 1h
limit during the emulated arm64 build and attached nothing, so rc4 is
the first `v6.7` release candidate that should get binaries.

## Test plan
- [x] `git diff --check`

Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants