You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shekhirin opened this issue
Aug 27, 2024
· 0 comments
· Fixed by #10787
Assignees
Labels
A-exexExecution ExtensionsC-enhancementNew feature or requestS-needs-designThis issue requires design work to think about how it would best be accomplished
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.
The logic inside the subscribe_to_notifications should also handle the backfill of missing blocks, according to the provided head:
If the ExExHead is ahead of the node head, wait until notifications catch up with head.number, and then compare the hashes to determine if the ExEx is on the canonical chain:
If it's not, we need to revert (HOW — unclear) ExEx to the first canonical block and then send blocks up to the canonical chain tip.
If it is, then the ExEx is on the canonical chain and we can proceed as usual.
If the 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.
If the ExExHead is behind of the node head:
Check if the ExExHead is canonical. If needed, revert to the first canonical block with hashes matching between the ExEx and the node
Send notifications for blocks from head.number + 1 to the node head
Proceed as usual.
It's not clear how to do reverts properly, because the node may not have the data for the provided ExExHead to construct a ChainReverted 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:
A-exexExecution ExtensionsC-enhancementNew feature or requestS-needs-designThis 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: