Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receipt Segments Not Properly Tracked Despite Data Existing in DB #13578

Open
1 task done
NimaMan opened this issue Dec 28, 2024 · 0 comments
Open
1 task done

Receipt Segments Not Properly Tracked Despite Data Existing in DB #13578

NimaMan opened this issue Dec 28, 2024 · 0 comments
Labels
C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled

Comments

@NimaMan
Copy link

NimaMan commented Dec 28, 2024

Describe the bug

Description

Receipt segments are not being properly tracked in the database, leading to inability to retrieve transaction receipts despite:

  1. Having proper pruning configuration (2.6M blocks retention)
  2. Receipts actually existing in the database
  3. Transactions being retrievable

Database Statistics

| Segment      | Block Range  | Transaction Range | Shape (columns x rows) | Size      |
|--------------|--------------|-------------------|------------------------|-----------|
| Headers      | 0..=21500570 | N/A               | 3 x 21500571          | 11 GiB    |
| Transactions | 0..=21500570 | 0..=2635271062    | 1 x 2635271063        | 656.2 GiB |
| Receipts     | 0..=0       | N/A               | 1 x 0                 | 80 B      |

However, the actual receipt table shows:

| Receipts     | 91516302    | 17703        | 3964402    | 168292      | 15.8 GiB  |

Configuration

[prune.segments]
receipts = { distance = 2628000 }  # ~1 year retention

Expected Behavior

  • Receipt should be available as:
    1. Transaction is from block 21127360 (20 days ago)
    2. Within configured retention window (2.6M blocks)
    3. Receipt data exists in DB (15.8 GiB of receipt data)

Actual Behavior

  • Receipt segment shows 0..=0 range
  • Cannot retrieve receipts despite having 15GB receipt data
  • Transaction data is retrievable but receipts are not

Environment

  • OS: Ubuntu

Possbile reason

The issue appears to be with segment tracking rather than actual data storage or pruning, as:

  1. Receipt table has significant data (15.8 GiB)
  2. But receipt segment shows empty range (0..=0)
  3. Pruning configuration is correctly set

Steps to reproduce

  1. Run Reth node with above pruning configuration
  2. Let it sync fully
  3. Try to retrieve receipt for transaction from ~20 days ago:
curl -X POST -H "Content-Type: application/json" \
  --data '{
    "jsonrpc":"2.0",
    "method":"eth_getTransactionReceipt",
    "params":["0x5b4865e4016f4e6f4c04d02b3a9a5450de28abbd3f301a0bb8ca6ada56c480cc"],
    "id":1
  }' \
  http://127.0.0.1:8545

Node logs


Platform(s)

No response

Container Type

Not running in a container

What version/commit are you on?

reth Version: 1.0.8
Commit SHA: 7c818c1
Build Timestamp: 2024-10-09T15:51:38.682845608Z
Build Features: jemalloc
Build Profile: release

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

main net

What type of node are you running?

Archive (default)

What prune config do you use, if any?

[prune]
block_interval = 5

[prune.segments]
sender_recovery = "full"

[prune.segments.receipts]
before = 11052984

[prune.segments.account_history]
distance = 10064

[prune.segments.storage_history]
distance = 10064

[prune.segments.receipts_log_filter.0x00000000219ab540356cbb839cbe05303d7705fa]
before = 11052984

If you've built Reth from source, provide the full command you used

No response

Code of Conduct

  • I agree to follow the Code of Conduct
@NimaMan NimaMan added C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled labels Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior S-needs-triage This issue needs to be labelled
Projects
Status: Todo
Development

No branches or pull requests

1 participant