Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| // 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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.