-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import EL deposits even when EL is stuck #3956
Conversation
The `eth1_monitor` only starts importing deposits once the EL reports a new head block. However, the EL may be stuck at a block, e.g., the TTD. By polling the latest EL block once after subscribing to new EL block events it is ensured that deposits are still imported in this situation.
let fullBlockId = FullBlockId.init(blk) | ||
|
||
if m.latestEth1Block.isSome and | ||
m.latestEth1Block.get == fullBlockId: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this condition must be preserved. The execution engine can pivot to another block at the same height or even to another block at a lower height. We we need to sleep and continue (which means retrying the request) only if we have obtained exactly the same block as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new logic simply replicates the existing logic in newBlockHeadersHandler
, having separate logic for events-based vs polling-based API does not seem right.
The eth1_monitor
subtracts 1024 blocks (follow distance) from this latest EL block to determine its syncing target, so smaller reorgs around the chain tip are not a problem.
The >
logic seems more correct, because we don't react to reorgs going backward and simply keep the blocks that we already have imported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if there's multiple ELs connected with different syncing progress, we should probably only follow the one with higher sync progress, which is guaranteed by the >
logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More accurate would probably be a check based on timestamp, but I'm not sure if there's a reason why block number is used instead of timestamp to determine newer block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are fair points. I guess we can name this operation to have it consistent in both places - e.g. m.isNewLatestBlock(blk)
The
eth1_monitor
only starts importing deposits once the EL reports anew head block. However, the EL may be stuck at a block, e.g., the TTD.
By polling the latest EL block once after subscribing to new EL block
events it is ensured that deposits are still imported in this situation.