Skip to content

Add receipt / log reads to cryptosim#3081

Open
jewei1997 wants to merge 45 commits intomainfrom
cryptosim-receipt-gen-reads
Open

Add receipt / log reads to cryptosim#3081
jewei1997 wants to merge 45 commits intomainfrom
cryptosim-receipt-gen-reads

Conversation

@jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Mar 17, 2026

Describe your changes and provide context

This PR extends the cryptosim receipt benchmark from a write-only workload into a mixed read/write workload that exercises the production receipt store path more realistically. It adds concurrent receipt readers to RecieptStoreSimulator, uses deterministic synthetic tx hashes so readers can reconstruct lookup targets without storing per-tx state, and simulates both receipt-by-hash queries and eth_getLogs-style log filter reads with a configurable recency bias toward newer blocks.

To make that workload measurable, the PR adds receipt read metrics and dashboard panels for read latency, reads/sec, cache hit vs miss rate, found vs not found results, and log filter latency. It also adds an optional receipt read observer so cache hits/misses are recorded at the ledger-cache layer, updates the parquet receipt store to return ErrNotFound cleanly when there is no legacy KV fallback, and refreshes the sample receipt-store config to enable the new benchmark mode. Overall, this gives us a better way to evaluate receipt-store behavior under concurrent reads, writes, cache pressure, and pruning.

Testing performed to validate your change

Ran go test ./sei-db/ledger_db/receipt/...
Ran go test ./sei-db/state_db/bench/cryptosim/...
Added unit coverage for deterministic SyntheticTxHash generation
Added unit coverage for receipt cache hit/miss observer reporting

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 23, 2026, 9:39 PM

@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 54.28571% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.56%. Comparing base (491d2c6) to head (7b8ccba).

Files with missing lines Patch % Lines
sei-db/ledger_db/receipt/cached_receipt_store.go 53.33% 12 Missing and 2 partials ⚠️
sei-db/ledger_db/receipt/parquet_store.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3081      +/-   ##
==========================================
+ Coverage   58.33%   58.56%   +0.22%     
==========================================
  Files        2096     2096              
  Lines      173400   173402       +2     
==========================================
+ Hits       101149   101548     +399     
+ Misses      63194    62800     -394     
+ Partials     9057     9054       -3     
Flag Coverage Δ
sei-chain-pr 74.23% <54.28%> (?)
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/ledger_db/receipt/receipt_store.go 74.74% <100.00%> (+0.25%) ⬆️
sei-db/ledger_db/receipt/parquet_store.go 66.91% <0.00%> (-0.51%) ⬇️
sei-db/ledger_db/receipt/cached_receipt_store.go 85.61% <53.33%> (-8.41%) ⬇️

... and 39 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 changed the title cryptosim reads Add receipt / log reads to cryptosim Mar 18, 2026
# Conflicts:
#	sei-db/state_db/bench/cryptosim/cryptosim_config.go
#	sei-db/state_db/bench/cryptosim/receipt_test.go
Base automatically changed from cryptosim-receipt-gen to main March 18, 2026 20:28
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