Skip to content

test(flatkv): increase docker ci coverage#3417

Open
blindchaser wants to merge 2 commits into
mainfrom
yiren/docker-coverage
Open

test(flatkv): increase docker ci coverage#3417
blindchaser wants to merge 2 commits into
mainfrom
yiren/docker-coverage

Conversation

@blindchaser
Copy link
Copy Markdown
Contributor

@blindchaser blindchaser commented May 11, 2026

Describe your changes and provide context

Testing performed to validate your change


Note

Medium Risk
Adds a new seidb import-flatkv-from-memiavl path and changes flatkv.KVImporter close/abort semantics, which directly affects data import finalization and on-disk state integrity. Also expands CI with disruptive crash/state-sync/digest checks that may introduce flakiness if readiness/height gating is off.

Overview
Strengthens Docker integration coverage for FlatKV by adding state-sync and cross-validator digest comparisons plus a SIGKILL crash-recovery smoke test, and wiring these into the GitHub Actions integration matrix.

Introduces an EVM FlatKV import test workflow: generates deterministic EVM fixtures, runs historical RPC assertions (flatkv_evm_test.yaml), performs a cluster-wide memiavl -> FlatKV import and restart, then re-runs the assertions and verifies FlatKV contains expected EVM storage.

Adds a new seidb command import-flatkv-from-memiavl (currently evm-only) backed by a new flatkv.ImportTranslator, and updates flatkv.KVImporter to support Err(), Abort(), and idempotent Close() so partial/failed imports do not finalize snapshots. Extensive new unit tests cover translator encoding/merging and importer lifecycle/backpressure behavior.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 11, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 11, 2026, 3:47 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 59.01639% with 125 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.25%. Comparing base (654d40b) to head (f46dc25).

Files with missing lines Patch % Lines
...cmd/seidb/operations/import_flatkv_from_memiavl.go 45.74% 84 Missing and 18 partials ⚠️
sei-db/state_db/sc/flatkv/import_translator.go 77.14% 8 Missing and 8 partials ⚠️
sei-db/state_db/sc/flatkv/importer.go 86.95% 4 Missing and 2 partials ⚠️
sei-db/tools/cmd/seidb/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3417      +/-   ##
==========================================
- Coverage   59.25%   59.25%   -0.01%     
==========================================
  Files        2110     2112       +2     
  Lines      174181   174454     +273     
==========================================
+ Hits       103210   103368     +158     
- Misses      62044    62133      +89     
- Partials     8927     8953      +26     
Flag Coverage Δ
sei-chain-pr 56.21% <59.01%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-db/tools/cmd/seidb/main.go 0.00% <0.00%> (ø)
sei-db/state_db/sc/flatkv/importer.go 91.35% <86.95%> (+3.52%) ⬆️
sei-db/state_db/sc/flatkv/import_translator.go 77.14% <77.14%> (ø)
...cmd/seidb/operations/import_flatkv_from_memiavl.go 45.74% <45.74%> (ø)
🚀 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.

Copy link
Copy Markdown

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

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: 00487eff98

ℹ️ 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".

cmd.Flags().String("home", "", "Sei home directory. Defaults to $HOME/.sei")
cmd.Flags().String("data-dir", "", "Sei data directory or home directory. If the basename is data, its parent is used as home")
cmd.Flags().StringSlice("modules", []string{keys.EVMStoreKey}, "Comma-separated module names to import. Initial production scope supports only evm")
cmd.Flags().Int64("height", 0, "memiavl version to import. 0 means latest")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Refuse stale --height imports

When an operator uses the advertised --height with a value below the current memiavl latest, the command imports FlatKV at that older version while leaving the Cosmos/memiavl store at its later latest. On the next GIGA_STORAGE startup, CompositeCommitStore.LoadVersion(0) opens both backends and reconcileVersions rolls the ahead backend back to the minimum version, so all Cosmos blocks above --height can be truncated. Please either reject non-latest heights unless memiavl has already been rolled back, or make the command roll both stores to the same version.

Useful? React with 👍 / 👎.

…verage

`seidb import-flatkv-from-memiavl` copies a memiavl module (evm only) into
FlatKV at a given height. Adds the CLI + translator, KVImporter
Abort/Close-idempotent for partial-commit safety, unit tests for the
concurrency pipeline + a 50K-pair E2E, and a docker CI job asserting
post-import RPC reads match pre-import values.

Offline DR / test-seeding tool only; does NOT exercise the MigrationManager
(V0 -> V1) production path, and the post-import smoke is RPC-sample-level
not a full set comparison.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 10c93b3. Configure here.

Comment thread integration_test/contracts/verify_statesync_flatkv_digest.sh Outdated
@blindchaser blindchaser force-pushed the yiren/docker-coverage branch from 10c93b3 to 0414b90 Compare May 11, 2026 15:15
…ash recovery

- verify_statesync_flatkv_digest.sh: donor↔rpc-node dump-flatkv sha256 match
  at a chain height both nodes have committed, replacing the existing
  height-only state-sync probe.
- verify_cross_validator_flatkv_digest.sh: all 4 validators must agree on
  flatkv physical content at a common committed chain height, catching
  silent drift the AppHash path cannot.
- verify_flatkv_crash_recovery.sh: SIGKILL a validator mid block production,
  restart it, wait for catch-up, then 4-way digest match at a common
  committed chain height.
- Wire the first two into the GIGA "Chain Operation Test" job; add a new
  GIGA "FlatKV Crash Recovery" job for the SIGKILL test.

Compares via chain height + dump-flatkv WAL-replay (which works regardless
of flatkv SnapshotInterval) rather than intersecting flatkv snapshot dirs,
so the checks remain meaningful on CI devnets that never reach the default
SnapshotInterval=10000 block boundary.
@blindchaser blindchaser force-pushed the yiren/docker-coverage branch from 0414b90 to f46dc25 Compare May 11, 2026 15:46
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.

1 participant