Skip to content

Conversation

@jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Jan 22, 2026

Describe your changes and provide context

  • add new parquet receiptdb interface implementation alongside pebbledb
  • introduce ledger cache layer above both pebbledb and parquet
  • use duckdb to read from parquet files
  • included functionality for WAL (crash recovery) + pruning
  • does not have any functionality for fallback reading from pebbledb, we expect a clean switchover using state sync

Testing performed to validate your change

unit tests, state sync on loadtest cluster

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 30, 2026, 2:22 PM

@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

❌ Patch coverage is 30.43981% with 601 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.42%. Comparing base (16b48de) to head (ed38621).

Files with missing lines Patch % Lines
sei-db/ledger_db/receipt/parquet_store.go 0.00% 459 Missing ⚠️
sei-db/ledger_db/receipt/receipt_log_filters.go 0.00% 38 Missing ⚠️
evmrpc/filter.go 55.22% 23 Missing and 7 partials ⚠️
sei-db/ledger_db/receipt/receipt_cache.go 83.47% 12 Missing and 7 partials ⚠️
sei-db/ledger_db/receipt/parquet_reader_stub.go 36.36% 14 Missing ⚠️
sei-db/ledger_db/receipt/cached_receipt_store.go 85.22% 7 Missing and 6 partials ⚠️
sei-db/ledger_db/receipt/parquet_wal.go 0.00% 12 Missing ⚠️
sei-db/ledger_db/receipt/receipt_store.go 75.00% 9 Missing and 2 partials ⚠️
app/app.go 60.00% 3 Missing and 1 partial ⚠️
cmd/seid/cmd/root.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2740      +/-   ##
==========================================
+ Coverage   47.10%   56.42%   +9.31%     
==========================================
  Files        1939     2014      +75     
  Lines      159389   165834    +6445     
==========================================
+ Hits        75086    93565   +18479     
+ Misses      77799    64065   -13734     
- Partials     6504     8204    +1700     
Flag Coverage Δ
sei-chain 41.50% <30.43%> (-0.14%) ⬇️
sei-cosmos 48.12% <ø> (-0.01%) ⬇️
sei-db 68.72% <ø> (ø)
sei-tendermint 57.80% <ø> (?)

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

Files with missing lines Coverage Δ
app/seidb.go 81.03% <ø> (ø)
cmd/seid/cmd/app_config.go 100.00% <100.00%> (ø)
sei-db/config/config.go 100.00% <ø> (ø)
sei-db/db_engine/pebbledb/mvcc/db.go 64.14% <100.00%> (+0.06%) ⬆️
sei-db/ledger_db/receipt/parquet_support.go 100.00% <100.00%> (ø)
cmd/seid/cmd/root.go 0.00% <0.00%> (ø)
app/app.go 70.81% <60.00%> (-0.13%) ⬇️
sei-db/ledger_db/receipt/receipt_store.go 57.95% <75.00%> (-26.28%) ⬇️
sei-db/ledger_db/receipt/parquet_wal.go 0.00% <0.00%> (ø)
sei-db/ledger_db/receipt/cached_receipt_store.go 85.22% <85.22%> (ø)
... and 5 more

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

@jewei1997 jewei1997 force-pushed the parquet-receiptdb-option2 branch from 34a1f18 to d0eba45 Compare January 29, 2026 17:37
Comment on lines +385 to +407
go func() {
for {
latestVersion := s.latestVersion.Load()
pruneBeforeBlock := latestVersion - s.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 jitter to avoid thundering herd
jitter := time.Duration(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 jitter to avoid thundering herd
jitter := time.Duration(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
jewei1997 and others added 7 commits January 29, 2026 15:45
The conversions are safe because:
- begin/end are validated positive block heights
- toBlock is a block height fitting in int64
- blockHeight and txIdx are validated non-negative

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.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.

2 participants