Skip to content

feat(flatkv): include legacyDB in ApplyChangeSets, LtHash, and read path#2978

Merged
blindchaser merged 3 commits intomainfrom
yiren/flatkv-legacydb
Feb 27, 2026
Merged

feat(flatkv): include legacyDB in ApplyChangeSets, LtHash, and read path#2978
blindchaser merged 3 commits intomainfrom
yiren/flatkv-legacydb

Conversation

@blindchaser
Copy link
Copy Markdown
Contributor

Describe your changes and provide context

  • legacy keys (codesize, address mappings, etc.) were silently ignored in FlatKV — not written to legacyDB, not included in LtHash integrity hash, and not readable via Get(). This adds full legacyDB support across the write path, commit batches, LtHash computation, and read path.

Testing performed to validate your change

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 25, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 27, 2026, 12:12 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2026

Codecov Report

❌ Patch coverage is 75.40984% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.02%. Comparing base (49ed980) to head (184c413).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/state_db/sc/flatkv/store_write.go 74.35% 5 Missing and 5 partials ⚠️
sei-db/state_db/sc/flatkv/store_read.go 75.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2978       +/-   ##
===========================================
+ Coverage   58.13%   64.02%    +5.89%     
===========================================
  Files        2111       14     -2097     
  Lines      173464     1276   -172188     
===========================================
- Hits       100847      817   -100030     
+ Misses      63666      344    -63322     
+ Partials     8951      115     -8836     
Flag Coverage Δ
sei-chain 60.84% <75.40%> (+2.73%) ⬆️
sei-db 69.50% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-db/state_db/sc/flatkv/store.go 64.65% <100.00%> (+0.62%) ⬆️
sei-db/state_db/sc/flatkv/store_read.go 56.75% <75.00%> (+2.85%) ⬆️
sei-db/state_db/sc/flatkv/store_write.go 71.87% <74.35%> (+0.90%) ⬆️

... and 2097 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.

Comment on lines +387 to +397
for _, pw := range s.legacyWrites {
if pw.isDelete {
if err := batch.Delete(pw.key); err != nil {
return fmt.Errorf("legacyDB delete: %w", err)
}
} else {
if err := batch.Set(pw.key, pw.value); err != nil {
return fmt.Errorf("legacyDB set: %w", err)
}
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
@blindchaser blindchaser merged commit f748419 into main Feb 27, 2026
38 checks passed
@blindchaser blindchaser deleted the yiren/flatkv-legacydb branch February 27, 2026 02:27
yzang2019 added a commit that referenced this pull request Feb 27, 2026
* main: (66 commits)
  feat(flatkv): include legacyDB in ApplyChangeSets, LtHash, and read path (#2978)
  Deflake mempool tests with Eventually-based block waits (#2983)
  Demote noisy gasless classification log to debug level (#2982)
  Harden `TestStateLock_NoPOL` against proposal/timeout race (#2980)
  added a config parameter to limit outbound p2p connections. (#2974)
  merged unconditional and persistent peers status (#2977)
  Fix race between file pruning and in-flight parquet queries (#2975)
  fix(giga): don't migrate balance on failed txs (#2961)
  Fix hanging upgrade tests by adding timeouts to wait_for_height (#2976)
  Add snapshot import for Giga Live State (#2970)
  Fix Rocksdb MVCC read timestamp lifetime for iterators (#2971)
  Reduce exposed tendermint RPC endpoint (#2968)
  Deflake `TestStateLock_NoPOL` by widening propose timeout in test (#2969)
  go bench read + write receipts/logs for parquet vs pebble (#2794)
  [giga] clear up cache after Write (#2827)
  fix: use correct EVM storage key prefix in benchmark key generation (#2966)
  Harden staking precompile test against CI flakiness (#2967)
  Don't sync flatKV DBs when committing  (#2964)
  Fix flaky `TestStateLock_POLSafety1` (#2962)
  Add metrics for historical proof success/failure rate (#2958)
  ...
yzang2019 pushed a commit that referenced this pull request Feb 27, 2026
…ath (#2978)

## Describe your changes and provide context

- legacy keys (codesize, address mappings, etc.) were silently ignored
in FlatKV — not written to legacyDB, not included in LtHash integrity
hash, and not readable via Get(). This adds full legacyDB support across
the write path, commit batches, LtHash computation, and read path.

## Testing performed to validate your change
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.

4 participants