Skip to content

evmrpc: expose pruned receipt watermarks#3409

Open
jewei1997 wants to merge 8 commits intomainfrom
STO-504/investigate-error-vs-empty-response-need-to-comply-with-evmrpc
Open

evmrpc: expose pruned receipt watermarks#3409
jewei1997 wants to merge 8 commits intomainfrom
STO-504/investigate-error-vs-empty-response-need-to-comply-with-evmrpc

Conversation

@jewei1997
Copy link
Copy Markdown
Contributor

@jewei1997 jewei1997 commented May 8, 2026

Summary

This PR makes EVM RPC responses distinguish pruned historical receipt data from genuinely empty or nonexistent results when the node has enough height context.

Externally visible changes:

  • Block-level RPCs such as eth_getBlockByNumber, eth_getBlockByHash, and eth_getBlockReceipts now return a typed receipt-pruned error when the requested block is below the node’s receipt retention watermark.
  • Future numeric block requests continue to return null per Ethereum JSON-RPC behavior.
  • Transaction-hash-only receipt misses continue to return null, because a hash alone cannot prove whether the receipt never existed or was pruned.
  • Receipt stores now expose an earliest retained height so RPC can report when historical receipt data is unavailable on this node.

Testing

  • Added coverage for typed block height availability errors.
  • Added coverage for receipt earliest-version tracking across cached, Pebble, and parquet receipt stores.
  • Added coverage for block RPC receipt-pruned behavior.

Add typed pruned-height errors and expose receipt earliest-version watermarks so RPC callers can distinguish unavailable historical data from future heights.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 8, 2026, 4:17 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.11%. Comparing base (817ecf0) to head (44e4191).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
evmrpc/block.go 62.50% 5 Missing and 4 partials ⚠️
sei-db/ledger_db/parquet/store.go 70.58% 2 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3409   +/-   ##
=======================================
  Coverage   59.10%   59.11%           
=======================================
  Files        2108     2108           
  Lines      173535   173591   +56     
=======================================
+ Hits       102564   102611   +47     
- Misses      62094    62097    +3     
- Partials     8877     8883    +6     
Flag Coverage Δ
sei-chain-pr 68.29% <77.77%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
evmrpc/tx.go 85.75% <100.00%> (+0.27%) ⬆️
evmrpc/watermark_manager.go 75.88% <100.00%> (+1.41%) ⬆️
sei-db/ledger_db/parquet/reader.go 82.05% <100.00%> (+0.32%) ⬆️
sei-db/ledger_db/receipt/cached_receipt_store.go 88.42% <100.00%> (+0.12%) ⬆️
sei-db/ledger_db/receipt/parquet_store.go 71.42% <100.00%> (+0.16%) ⬆️
sei-db/ledger_db/receipt/receipt_store.go 67.00% <100.00%> (+0.33%) ⬆️
sei-db/ledger_db/parquet/store.go 70.22% <70.58%> (+0.54%) ⬆️
evmrpc/block.go 81.28% <62.50%> (-1.21%) ⬇️
🚀 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 and others added 3 commits May 7, 2026 23:46
Return a typed receipt-pruned error for block RPCs below the receipt retention watermark so callers can distinguish unavailable historical receipts from empty responses.

Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve null semantics for missing transaction receipts while avoiding fragile string matching on receipt-store errors.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add focused assertions for typed height availability errors and receipt earliest-version tracking across cached, pebble, and parquet stores.

Co-authored-by: Cursor <cursoragent@cursor.com>
jewei1997 and others added 4 commits May 7, 2026 23:58
Assert block RPCs return the receipt-pruned sentinel when requested block data is available but receipts are below the retention watermark.

Co-authored-by: Cursor <cursoragent@cursor.com>
Return the receipt-pruned error for block transaction count RPCs before receipt-dependent filtering can collapse pruned blocks to zero counts.

Co-authored-by: Cursor <cursoragent@cursor.com>
Return the receipt-pruned error for transaction-by-block-index RPCs before receipt-dependent filtering can collapse pruned blocks to null results.

Co-authored-by: Cursor <cursoragent@cursor.com>
Assert receipt-pruned errors for block transaction count and transaction-by-block-index RPCs below the receipt watermark.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jewei1997 jewei1997 requested review from Kbhat1 and codchen May 8, 2026 04:16
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