Skip to content

add receipt generation to cryptosim#3047

Open
jewei1997 wants to merge 22 commits intomainfrom
cryptosim-receipt-gen
Open

add receipt generation to cryptosim#3047
jewei1997 wants to merge 22 commits intomainfrom
cryptosim-receipt-gen

Conversation

@jewei1997
Copy link
Contributor

@jewei1997 jewei1997 commented Mar 10, 2026

Describe your changes and provide context

  • Add receipt generation to cryptosim: each simulated ERC20 transfer transaction now produces a realistic receipt with logs, bloom filter, gas fields, and tx type distribution
  • Add a RecieptStoreSimulator that consumes generated receipts and writes them to a parquet store with WAL, flush, rotation, and pruning — matching the real node's write path
  • Add configurable parquet store settings: ReceiptKeepRecent, ReceiptPruneIntervalSeconds, ReceiptMaxBlocksPerFile, ReceiptBlockFlushInterval
  • Add receipt write metrics: receipt_block_write_duration_seconds (histogram), receipt_channel_depth (gauge), receipts_written_total (counter), receipt_errors_total (counter)
  • Move block building to a background goroutine (blockBuilder) so transaction generation doesn't block the main execution loop

Set "GenerateReceipts": true to enable. See config/reciept-store.json for an example config. All receipt store tuning parameters have production-matching defaults and can be left unset.

Testing performed to validate your change

unit tests + running cryptosim simulation

@github-actions
Copy link

github-actions bot commented Mar 10, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMar 17, 2026, 7:19 PM

@codecov
Copy link

codecov bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.42%. Comparing base (1d93a1a) to head (d329019).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3047   +/-   ##
=======================================
  Coverage   58.42%   58.42%           
=======================================
  Files        2088     2088           
  Lines      172102   172102           
=======================================
  Hits       100547   100547           
  Misses      62618    62618           
  Partials     8937     8937           
Flag Coverage Δ
sei-chain-pr 75.27% <100.00%> (?)
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/parquet_store.go 67.42% <100.00%> (ø)
🚀 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.

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.

1 participant