Skip to content

Conversation

@jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Jan 14, 2026

Describe your changes and provide context

This PR converts the current ReceiptDB interface from StateStore interface to using a receipt-specific interface. In a future PR, we will add in the new Parquet implementation for receipts.

Testing performed to validate your change

unit tests.

@github-actions
Copy link

github-actions bot commented Jan 14, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJan 16, 2026, 10:04 PM

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.98%. Comparing base (91ef5cb) to head (aaea971).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2701      +/-   ##
==========================================
- Coverage   43.76%   41.98%   -1.78%     
==========================================
  Files        1914     1017     -897     
  Lines      159504    84779   -74725     
==========================================
- Hits        69801    35593   -34208     
+ Misses      83284    45839   -37445     
+ Partials     6419     3347    -3072     
Flag Coverage Δ
sei-chain ?
sei-cosmos 38.20% <ø> (-0.01%) ⬇️
sei-db 68.94% <ø> (+0.22%) ⬆️
sei-tendermint 47.27% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 909 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.

}
go func() {
for {
pruneStartTime := time.Now()

Check warning

Code scanning / CodeQL

Calling the system time Warning

Calling the system time may be a possible source of non-determinism
Comment on lines 321 to 339
go func() {
for {
pruneStartTime := time.Now()
latestVersion := db.GetLatestVersion()
pruneVersion := latestVersion - keepRecent
if pruneVersion > 0 {
// prune all versions up to and including the pruneVersion
if err := db.Prune(pruneVersion); err != nil {
log.Error("failed to prune receipt store till", "version", pruneVersion, "err", err)
}
log.Info(fmt.Sprintf("Pruned receipt store till version %d took %s\n", pruneVersion, time.Since(pruneStartTime)))
}

// Generate a random percentage (between 0% and 100%) of the fixed interval as a delay
randomPercentage := rand.Float64()
randomDelay := int64(float64(pruneInterval) * randomPercentage)
time.Sleep(time.Duration(pruneInterval+randomDelay) * time.Second)
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
jewei1997 and others added 7 commits January 15, 2026 13:59
- Add sentinel errors ErrNotFound and ErrNotConfigured for consistent error checking
- Add shutdown mechanism for pruning goroutine with stopPruning channel
- Update Close() to signal pruning goroutine to stop using sync.Once
- Update x/evm/keeper/receipt.go to use sentinel errors and errors.Is()
- Replace string-based error comparison with errors.Is() for better error handling

Co-authored-by: jeremy <[email protected]>

// Generate a random percentage (between 0% and 100%) of the fixed interval as a delay
randomPercentage := rand.Float64()
randomDelay := int64(float64(pruneInterval) * randomPercentage)

Check notice

Code scanning / CodeQL

Floating point arithmetic Note

Floating point arithmetic operations are not associative and a possible source of non-determinism
- Rename StoreReceipts to SetReceipts for consistency
- Rename LatestHeight to LatestVersion
- Rename SetLatestHeight to SetLatestVersion
- Rename SetEarliestHeight to SetEarliestVersion
- Update all usages in keeper, evmrpc, and tests

Co-authored-by: jeremy <[email protected]>
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