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.21k forks source link

Emit a node event when we inserted an executed block #12719

Open mattsse opened 1 day ago

mattsse commented 1 day ago

Describe the feature

currently we silently add an executed block

https://github.com/paradigmxyz/reth/blob/8df9045fd8de4d7f9d71e4798dec2d302e964702/crates/engine/tree/src/tree/mod.rs#L1209-L1211

this happens in op-reth when we insert the derived block, we should also emit an event here if this block's parent extends the canonical chain (inserted.parent = canonical)

https://github.com/paradigmxyz/reth/blob/8df9045fd8de4d7f9d71e4798dec2d302e964702/crates/consensus/beacon/src/engine/event.rs#L19-L19

but we should introduce a new event variant for this case instead

Additional context

No response

stevencartavia commented 1 day ago

🙋🏽‍♂️

stevencartavia commented 1 day ago

@mattsse can the new variant be named CanonicalParentBlockAdded(Arc<SealedBlock>, Duration)?