Subscribe to a channel with ExEx notifications manually #10571
Labels
A-exex
Execution Extensions
C-enhancement
New feature or request
S-needs-design
This issue requires design work to think about how it would best be accomplished
Describe the feature
Problem
Currently, we pass a channel with
ExExNotification
s right into theExExContext
reth/crates/node/builder/src/launch/exex.rs
Lines 51 to 62 in 7ea748e
This approach has a downside: #10489. We don't know from what block height to start sending notifications to the ExEx, or if the ExEx has an incorrect fork, that's no longer canonical.
Solution
Don't subscribe the ExEx to notifications by default, but instead provide a method for the ExEx to call and get a channel for new notifications.
pseudocode:
The logic inside the
subscribe_to_notifications
should also handle the backfill of missing blocks, according to the providedhead
:ExExHead
is ahead of the node head, wait until notifications catch up withhead.number
, and then compare the hashes to determine if the ExEx is on the canonical chain:ExExHead
is at the same block number as the node head, but the hash is mismatching, then do step 1.i. above with reverting up to the first canonical block with hashes matching between the ExEx and the node.ExExHead
is behind of the node head:ExExHead
is canonical. If needed, revert to the first canonical block with hashes matching between the ExEx and the nodehead.number + 1
to the node headIt's not clear how to do reverts properly, because the node may not have the data for the provided
ExExHead
to construct aChainReverted
variant.Actual Solution for Now
Same as described above, but only handling cases 1.2 and 3 and not checking if the chain is canonical.
Additional context
No response
The text was updated successfully, but these errors were encountered: