Skip to content
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

Merged
merged 7 commits into from
Aug 12, 2022
Merged

Conversation

etan-status
Copy link
Contributor

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.

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.
@github-actions
Copy link

Unit Test Results

       12 files  ±0       860 suites  ±0   1h 16m 21s ⏱️ + 5m 10s
  1 911 tests ±0    1 764 ✔️ ±0  147 💤 ±0  0 ±0 
10 341 runs  ±0  10 151 ✔️ ±0  190 💤 ±0  0 ±0 

Results for commit ee95496. ± Comparison against base commit d07d7b1.

let fullBlockId = FullBlockId.init(blk)

if m.latestEth1Block.isSome and
m.latestEth1Block.get == fullBlockId:
Copy link
Contributor

@zah zah Aug 12, 2022

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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)

@zah zah enabled auto-merge (squash) August 12, 2022 14:51
@zah zah merged commit 052f9ed into unstable Aug 12, 2022
@zah zah deleted the dev/etan/el-initevent branch August 12, 2022 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants