reth icon indicating copy to clipboard operation
reth copied to clipboard

Add helper stream type for finalized notifications

Open mattsse opened this issue 9 months ago • 4 comments

Describe the feature

it could be useful to have a new stream type that only returns notifications for finalized blocks.

this can be achieved by combining:

https://github.com/paradigmxyz/reth/blob/2652ec8af559401bf46cf0fb132bab313e82031e/crates/chain-state/src/notifications.rs#L56-L56

with:

https://github.com/paradigmxyz/reth/blob/2652ec8af559401bf46cf0fb132bab313e82031e/crates/chain-state/src/notifications.rs#L164-L164

this new stream type would then be a select over both streams, it would buffer the most recent canon notification, if the forkchoice stream yields a new finalized header it would then return that block

ref #8794

Additional context

No response

mattsse avatar Jan 29 '25 11:01 mattsse