paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.99k stars 1.22k forks source link

Emit a WARN log if the ExEx WAL grows beyond a certain number of blocks #12626

Closed shekhirin closed 2 days ago

shekhirin commented 4 days ago

Describe the feature

If an ExEx doesn't emit FinishedHeight events, the WAL will never be cleared and will grow indefinitely https://github.com/paradigmxyz/reth/blob/4b4f9cf40626c8714f0a0caa152a970fa6e5dfa0/crates/exex/exex/src/manager.rs#L348-L367

To help prevent this user error, we can emit a WARN log in ExExManager::finalize_wal if the WAL contains more than 128 blocks after a call to self.wal.finalize().

To do that, we need to add a method to Wal that will return the number of blocks in the WAL.

Additional context

No response

htiennv commented 4 days ago

could i take this @shekhirin, thank you!