Skip to content

Revert "feat(sei-db): add flatkv store implementation (#2793)"#2918

Merged
blindchaser merged 1 commit intomainfrom
yiren/revert-flatkv
Feb 18, 2026
Merged

Revert "feat(sei-db): add flatkv store implementation (#2793)"#2918
blindchaser merged 1 commit intomainfrom
yiren/revert-flatkv

Conversation

@blindchaser
Copy link
Contributor

This reverts commit 07025b9.

  • 07025b9 contains wrongly rebased code, will revert and re-commit.

Describe your changes and provide context

Testing performed to validate your change

@github-actions
Copy link

github-actions bot commented Feb 18, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedFeb 18, 2026, 2:44 PM

Copy link
Contributor

@mojtaba-esk mojtaba-esk left a comment

Choose a reason for hiding this comment

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

Thanks man!

Copy link

@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: a75cda5e34

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

if cfg.WriteMode == config.DualWrite || cfg.WriteMode == config.SplitWrite {
store.evmCommitter = flatkv.NewCommitStore(homeDir, logger, cfg.FlatKVConfig)
}
// TODO: initialize FlatKV store for evmSC when cfg.WriteMode != config.CosmosOnlyWrite

Choose a reason for hiding this comment

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

P1 Badge Initialize FlatKV for non-cosmos write modes

NewCompositeCommitStore no longer creates an evmCommitter when write_mode is dual_write or split_write, so cs.evmCommitter stays nil for all runtime instances; in split_write, ApplyChangeSets routes EVM changes only to this backend, which means EVM state updates are silently dropped instead of being committed. This causes data loss for any node running migration modes, so startup should either initialize flatkv.NewCommitStore(...) for non-cosmos_only modes or fail fast when those modes are configured.

Useful? React with 👍 / 👎.

@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 69.60874% with 334 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.32%. Comparing base (07025b9) to head (a75cda5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-db/ledger_db/parquet/store.go 66.44% 56 Missing and 43 partials ⚠️
sei-db/ledger_db/receipt/parquet_store.go 65.53% 62 Missing and 29 partials ⚠️
sei-db/ledger_db/parquet/reader.go 73.26% 48 Missing and 25 partials ⚠️
sei-db/state_db/sc/flatkv/keys.go 0.00% 23 Missing ⚠️
sei-db/ledger_db/receipt/receipt_cache.go 79.54% 10 Missing and 8 partials ⚠️
sei-db/ledger_db/parquet/wal.go 75.38% 8 Missing and 8 partials ⚠️
sei-db/state_db/sc/composite/store.go 60.00% 3 Missing and 3 partials ⚠️
cmd/seid/cmd/root.go 0.00% 2 Missing ⚠️
sei-db/common/evm/keys.go 83.33% 0 Missing and 2 partials ⚠️
sei-db/ledger_db/receipt/cached_receipt_store.go 95.91% 1 Missing and 1 partial ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2918      +/-   ##
==========================================
+ Coverage   57.22%   57.32%   +0.10%     
==========================================
  Files        2094     2097       +3     
  Lines      171956   172767     +811     
==========================================
+ Hits        98400    99041     +641     
- Misses      64739    64848     +109     
- Partials     8817     8878      +61     
Flag Coverage Δ
sei-chain 52.82% <69.60%> (+0.08%) ⬆️
sei-cosmos 48.19% <ø> (ø)
sei-db 68.72% <ø> (?)

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

Files with missing lines Coverage Δ
app/params/config.go 86.66% <100.00%> (+0.36%) ⬆️
evmrpc/filter.go 69.07% <ø> (+0.43%) ⬆️
sei-db/state_db/sc/flatkv/config.go 100.00% <100.00%> (ø)
cmd/seid/cmd/root.go 0.00% <0.00%> (ø)
sei-db/common/evm/keys.go 80.95% <83.33%> (-10.54%) ⬇️
sei-db/ledger_db/receipt/cached_receipt_store.go 92.30% <95.91%> (+3.26%) ⬆️
sei-db/ledger_db/receipt/receipt_store.go 76.96% <80.00%> (+7.37%) ⬆️
sei-db/state_db/sc/composite/store.go 56.84% <60.00%> (+8.19%) ⬆️
sei-db/ledger_db/parquet/wal.go 75.38% <75.38%> (ø)
sei-db/ledger_db/receipt/receipt_cache.go 81.11% <79.54%> (-2.81%) ⬇️
... and 4 more

... and 31 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 blindchaser merged commit 7f6c8c4 into main Feb 18, 2026
41 of 44 checks passed
@blindchaser blindchaser deleted the yiren/revert-flatkv branch February 18, 2026 14:55
Comment on lines +214 to +224
for blockNum, logs := range chunk.logs {
if blockNum < fromBlock || blockNum > toBlock {
continue
}
for _, lg := range logs {
if matchLog(lg, crit) {
logCopy := *lg
result = append(result, &logCopy)
}
}
}

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
"fmt"
"log"
"path/filepath"
"runtime"

Check notice

Code scanning / CodeQL

Sensitive package import Note

Certain system packages contain functions which may be a possible source of non-determinism
Comment on lines +317 to +339
go func() {
for {
latestVersion := s.latestVersion.Load()
pruneBeforeBlock := latestVersion - s.config.KeepRecent
if pruneBeforeBlock > 0 {
pruned := s.pruneOldFiles(uint64(pruneBeforeBlock))
if pruned > 0 && s.log != nil {
s.log.Info(fmt.Sprintf("Pruned %d parquet file pairs older than block %d", pruned, pruneBeforeBlock))
}
}

// Add random jitter (up to 50% of base interval) to avoid thundering herd
jitter := time.Duration(rand.Float64()*float64(pruneIntervalSeconds)*0.5) * time.Second
sleepDuration := time.Duration(pruneIntervalSeconds)*time.Second + jitter

select {
case <-s.pruneStop:
return
case <-time.After(sleepDuration):
// Continue to next iteration
}
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
}

// Add random jitter (up to 50% of base interval) to avoid thundering herd
jitter := time.Duration(rand.Float64()*float64(pruneIntervalSeconds)*0.5) * time.Second

Check notice

Code scanning / CodeQL

Floating point arithmetic Note

Floating point arithmetic operations are not associative and a possible source of non-determinism
}

// Add random jitter (up to 50% of base interval) to avoid thundering herd
jitter := time.Duration(rand.Float64()*float64(pruneIntervalSeconds)*0.5) * time.Second

Check notice

Code scanning / CodeQL

Floating point arithmetic Note

Floating point arithmetic operations are not associative and a possible source of non-determinism
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

Comments