Skip to content

Parquet disable full range scan#3294

Open
jewei1997 wants to merge 3 commits intomainfrom
parquet-disable-full-range-scan
Open

Parquet disable full range scan#3294
jewei1997 wants to merge 3 commits intomainfrom
parquet-disable-full-range-scan

Conversation

@jewei1997
Copy link
Copy Markdown
Contributor

@jewei1997 jewei1997 commented Apr 21, 2026

Describe your changes and provide context

If the pebbledb tx index for the new parquet-based receiptdb is disabled, we will currently fallback to range scans over all the parquet files. This is a problem because it is a very expensive operation. This PR disallows the full range scan if the tx index is disabled.

Testing performed to validate your change

unit tests.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 21, 2026, 8:21 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.51%. Comparing base (0ad5733) to head (2d008bd).

Files with missing lines Patch % Lines
sei-db/ledger_db/receipt/parquet_store.go 63.63% 3 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3294   +/-   ##
=======================================
  Coverage   58.51%   58.51%           
=======================================
  Files        2072     2072           
  Lines      207938   207942    +4     
=======================================
+ Hits       121676   121687   +11     
+ Misses      77477    77472    -5     
+ Partials     8785     8783    -2     
Flag Coverage Δ
sei-chain-pr 71.50% <63.63%> (?)
sei-db 69.36% <ø> (ø)

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 64.89% <ø> (ø)
sei-db/ledger_db/receipt/parquet_store.go 67.89% <63.63%> (+1.93%) ⬆️
🚀 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.

Comment on lines +33 to +37
// ErrTxIndexDisabled indicates that a receipt-by-tx-hash lookup missed the
// in-memory cache and cannot be served because the parquet backend's pebble
// tx hash index is disabled. A full parquet scan would require reading every
// file on disk and is intentionally not attempted.
ErrTxIndexDisabled = errors.New("receipt tx hash index is disabled; parquet fallback scan is not allowed")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the end user get a "not found" error, or will they get this message? We should just be telling the user the data is not found, the fact that we aren't doing a scan is probably not helpful to them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

What the user saw before the UX fix (parquet backend + tx-index-backend = "", query for unknown hash):

  {"jsonrpc":"2.0","id":1,"error":{"code":-32000,
   "message":"receipt tx hash index is disabled; parquet fallback scan is not allowed"}}

Non-standard, leaks internal details, and breaks clients that expect the Ethereum null convention.

What the user sees after the fix:

  {"jsonrpc":"2.0","id":1,"result":null}

Standard Ethereum "unknown tx" behavior.

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