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

synchronizer: double-check old L1 block to detect reorgs #3540

Closed
joanestebanr opened this issue Apr 8, 2024 · 0 comments · Fixed by #3546
Closed

synchronizer: double-check old L1 block to detect reorgs #3540

joanestebanr opened this issue Apr 8, 2024 · 0 comments · Fixed by #3546

Comments

@joanestebanr
Copy link
Contributor

joanestebanr commented Apr 8, 2024

Rationale

Synchronizer is going to check in background the L1block after the block has been consolidated by ethereum.

You can choose what do you consider 'consolidated' (the safety level):

  • type of block: finalized, safe or latest
  • add or substract a offset

Implementation

There are 2 goruintes that are checking in background blocks:

  • One check from 'consolidated' point and if it's ok it mark as checked the block and is no longer verified
  • The other check from 'consolidated' point to newest blocks, it just verify without marking and do it continously until the block is marked as checked.

So you can configure next scenario:

  • From 0 to safe: validate and mark as checked if match L1 RPC
  • From safe to latest -5 : check in memory

Configuration

	[Synchronizer.L1BlockCheck]
		Enable = true
		L1SafeBlockPoint = "finalized"
		L1SafeBlockOffset = 0
		ForceCheckBeforeStart = true
		PreCheckEnable = true
		L1PreSafeBlockPoint = "latest"
		L1PreSafeBlockOffset = -32
  • Enable : it enable of disable full feature
  • ForceCheckBeforeStart: Before start anything it check the pending block up to 'consolidated' point
  • L1SafeBlockPoint + L1SafeBlockOffset : define what we consider as 'consolidated' point
  • PreCheckEnable: enables second gorutine that check newest blocks continuously
  • L1PreSafeBlockPoint + L1PreSafeBlockOffset : define the maximum block to check for the second gorutine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant