Skip to content

Corrupted DB after pectra upgrade and entered restart loop after #16149

Closed
@gamebak

Description

@gamebak

Describe the bug

My Reth db is in an infinite loop since pectra upgrade. This message with block invalid at 22431084

2025-05-10T13:38:46.314489Z  INFO Status connected_peers=0 latest_block=22431081
2025-05-10T13:38:54.323649Z  INFO Forkchoice updated head_block_hash=0x65e42a23f04f541542ac38eaf03487738d2b7b3f6dda0755f85975c0817ee9f4 safe_block_hash=0x65e42a23f04f541542ac38eaf03487738d2b7b3f6dda0755f85975c0817ee9f4 finalized_block_hash=0x65e42a23f04f541542ac38eaf03487738d2b7b3f6dda0755f85975c0817ee9f4
....
2025-05-10T13:04:56.204041Z  WARN Invalid block error on new payload invalid_hash=0x684c9cbfd176f5e9385b9260ef06385f58861ddd96ad14a551a63bc9b2f92025 invalid_number=22431084 validation_err=missing requests hash
2025-05-10T13:04:56.204285Z  WARN Encountered invalid block number=22431084 hash=0x684c9cbfd176f5e9385b9260ef06385f58861ddd96ad14a551a63bc9b2f92025
^C2025-05-10T13:04:56.732518Z  INFO Wrote network peers to file peers_file="/mnt/nvme/full/eth/reth/reth-data/known-peers.json"

What I did trying to solve this:

  1. I upgrade lighthouse updated && did a full re-sync
  2. Trying to unstage reth to an older block, I saw other saying this could work.

#No matter what older block I set in there, I'll get the same error , shutting down with that index

./target/release/reth stage unwind --datadir /mnt/nvme/full/eth/reth/reth-data to-block 22423984

./target/release/reth stage unwind --datadir /mnt/nvme/full/eth/reth/reth-data to-block 22423984
2025-05-10T13:36:55.244353Z  INFO Initialized tracing, debug log directory: /home/ubuntu/.cache/reth/logs/mainnet
2025-05-10T13:36:55.270092Z  INFO Opening storage db_path="/mnt/nvme/full/eth/reth/reth-data/db" sf_path="/mnt/nvme/full/eth/reth/reth-data/static_files"
2025-05-10T13:36:55.285667Z  INFO Verifying storage consistency.
2025-05-10T13:36:55.303169Z  INFO Executing a pipeline unwind. target=22423984 highest_static_file_block=22431081
2025-05-10T13:36:55.381384Z ERROR shutting down due to error
Error: trying to append row to Receipts at index #2765880181 but expected index #2762137434

Location:
    /mnt/nvme/full/eth/reth/crates/cli/commands/src/stage/unwind.rs:78:13

What am I doing wrong with reth that I'm unable to unwind to a previous block and correct the error?

Steps to reproduce

Well, try ro run reth + older lighthouse before pectra upgrade and it will probably corrupt your db as well.

Node logs


Platform(s)

Linux (x86)

Container Type

Not running in a container

What version/commit are you on?

1.3.8 (8e4c33e)

What database version are you on?

Current database version: 2
Local database version: 2

Which chain / network are you on?

mainnet

What type of node are you running?

Full via --full flag

What prune config do you use, if any?

[stages.headers]
downloader_max_concurrent_requests = 100
downloader_min_concurrent_requests = 5
downloader_max_buffered_responses = 100
downloader_request_limit = 1000
commit_threshold = 10000

[stages.bodies]
downloader_request_limit = 200
downloader_stream_batch_size = 1000
downloader_max_buffered_blocks_size_bytes = 2147483648
downloader_min_concurrent_requests = 5
downloader_max_concurrent_requests = 100

[stages.sender_recovery]
commit_threshold = 5000000

[stages.execution]
max_blocks = 500000
max_changes = 5000000
max_cumulative_gas = 1500000000000
max_duration = "10m"

[stages.prune]
commit_threshold = 1000000

[stages.account_hashing]
clean_threshold = 500000
commit_threshold = 100000

[stages.storage_hashing]
clean_threshold = 500000
commit_threshold = 100000

[stages.merkle]
clean_threshold = 5000

[stages.transaction_lookup]
chunk_size = 5000000

[stages.index_account_history]
commit_threshold = 100000

[stages.index_storage_history]
commit_threshold = 100000

[stages.etl]
file_size = 524288000

[prune]
block_interval = 5

[prune.segments.receipts_log_filter]

[peers]
refill_slots_interval = "5s"
trusted_nodes = []
trusted_nodes_only = false
max_backoff_count = 5
ban_duration = "12h"
incoming_ip_throttle_duration = "30s"

[peers.connection_info]
max_outbound = 100
max_inbound = 30
max_concurrent_outbound_dials = 15

[peers.reputation_weights]
bad_message = -16384
bad_block = -16384
bad_transactions = -16384
already_seen_transactions = 0
timeout = -4096
bad_protocol = -2147483648
failed_to_connect = -25600
dropped = -4096
bad_announcement = -1024

[peers.backoff_durations]
low = "30s"
medium = "3m"
high = "15m"
max = "1h"

[sessions]
session_command_buffer = 32
session_event_buffer = 260

[sessions.limits]

[sessions.initial_internal_request_timeout]
secs = 20
nanos = 0

[sessions.protocol_breach_request_timeout]
secs = 120
nanos = 0

[sessions.pending_session_timeout]
secs = 20
nanos = 0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugAn unexpected or incorrect behaviorS-needs-triageThis issue needs to be labelled

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions