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

fix: syncer spamming RPC and reaching tip of chain #289

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

joanestebanr
Copy link
Contributor

@joanestebanr joanestebanr commented Jan 29, 2025

When any synchronize exceeds the block finalized keep asking continously for same range without any sleep, and don't extend the range to reach the lastest block

expected

  • The idea is to extend the range to go to the lastest block seen on network,
    Here the explanation of how must work the range when we are > finalized:

Ask logs for current range [ n - m ]

  • Returns log block x -> next_range = [ x - ( x+ block_chunk) ]
  • Returns empty:
  • if ( fbn - n > block_chunck ) -> create empty block with getHeader(fbn+block_chunk)
  • we have enough blocks on finalized zone to create a empty block
  • next_range = [ (fbn + block_chunck) - m + block_chunck ]
  • else
  • We just increase the range:
  • next_range = [ n - m + block_chunck ]
2025-01-29T11:11:21.890+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.893+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.896+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.899+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.902+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.906+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.909+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.914+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.919+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}
2025-01-29T11:11:21.923+0100	INFO	sync/evmdownloader.go:138	getting events from blocks 665 to  681. lastFinalizedBlock: 670	{"pid": 156441, "version": "v0.1.0", "syncer": "l1infotreesync"}

@joanestebanr joanestebanr changed the base branch from develop to release/v0.5.1 January 29, 2025 10:23
@joanestebanr joanestebanr changed the title fix: hash meddler error (#285) (#288) fix: syncer spamming RPC and reaching head of chain Jan 29, 2025
@joanestebanr joanestebanr self-assigned this Jan 29, 2025
@joanestebanr joanestebanr marked this pull request as ready for review January 29, 2025 11:54
@joanestebanr joanestebanr changed the title fix: syncer spamming RPC and reaching head of chain fix: syncer spamming RPC and reaching tip of chain Jan 29, 2025
@joanestebanr joanestebanr merged commit 822782c into release/v0.5.1 Jan 30, 2025
14 checks passed
@joanestebanr joanestebanr deleted the fix/syncers_spamming_rpc branch January 30, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants