reth
reth copied to clipboard
Save Merkle stage checkpoint into the same database table as other stages
Describe the feature
Merkle stage still uses the SyncStageProgress table to save its checkpoint: https://github.com/paradigmxyz/reth/blob/b90d0b41069015d5746b08b3e408e738bc65a6a7/crates/primitives/src/stage/checkpoints.rs#L15-L26
Instead, we should use the SyncStage table along with the StageCheckpointUnit as hashing stages do: https://github.com/paradigmxyz/reth/blob/b90d0b41069015d5746b08b3e408e738bc65a6a7/crates/primitives/src/stage/checkpoints.rs#L273-L276
We didn't do it initially because Merkle checkpoint is pretty heavy (it contains some unbounded trie-related fields) compared to hashing stages', so it can't be Copy. It's a problem because Exec|Unwind)(Input|Output) are Copy.
After moving the Merkle stage checkpoint into one unified table, we can safely delete the SyncStageProgress table and everything related to it, simplifying the stage checkpointing logic.
Additional context
No response