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

[HOLESKY PECTRA] Fork Pinning Sync #9180

Open
tbenr opened this issue Feb 26, 2025 · 0 comments
Open

[HOLESKY PECTRA] Fork Pinning Sync #9180

tbenr opened this issue Feb 26, 2025 · 0 comments

Comments

@tbenr
Copy link
Contributor

tbenr commented Feb 26, 2025

In case of network instability up to a level in which it becomes difficult to sync to an accepted canonical chain,
we could implement a syncing strategy that could work as follows:

--Xp2p-pinning-fork-sync-file=/opt/pinned-fork.json|https://raw.github..../pinned-fork.json

content will be [<slot,block_root>]:

{
    "3711036": "0x8ce1c41b23acbfa2748fac0725157785ae53c7200d959b22172ce8ae355a4540",
    "3711058": "0x2d58d27886354a292f7247215a84b1ed0a1a714465eca800df8dd2255275eb16",
    "3711098": "0xf1c7bba5b0507cf18dccfbc2d1f2c29e4c86798a95cffc190fb28968d8248eb8",
    "3711149": "0x5e0e1f3b65afc3dff55d5c59593519f2b900a5e84ed7294d96992168ecc3c0d7",
    "3711158": "0x9b332abea859ea938f6072ea36cd2e2bc14145cb91b43b90d75b2e8e65cc69b3",
    "3711171": "0xd1f31203e6a17ffcd914ff87e5c71edc74f8a9073c2457aed3c441e08b634129",
    "3711187": "0xa879c8eddbb705152c8b59a4635a193638d902aa6b5a5a5040eadf5552fd79ec",
    "3711211": "0x10609ba31c3a464d2d4ab19a771bb0fa338225d2ae525f6a1ef89a4c28921638"
}
  1. when the sync service starts, it will give precedence to that content, and, for each slot in sequence it will make sure that current node is on that fork.
  2. if a slot,block-root is not found in our recentChainData, then it will try to look up it with a BlockByRange\BlobsByRange with a count set to 1 (single slot lookup).
    1. on empty response or blockRoot not matching -> immediately disconnect from peer and retry with another one
  3. if found, import it and keep going with next slot,blockRoot
  4. when the end of the file is reached, we will be on that fork, and we can resume the normal syncing
  5. regularly (every a configurable amount of time, default 1min?), refresh the content and do the check again, just in case the content is updated with more recent slots. If refresh happens while still doing the pinning sync, i think we should stop what we are doing and rerun the process, just in case the file gets updated with a different fork (maybe we are struggling trying to find a peer to download a slot,blockRoot and the new file is not containing that anymore)

In this way we should:

  1. disconnect from peers that are not on the pinned canonical chain.
  2. sync the chain faster and not get fooled by dead-ended forks.
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

No branches or pull requests

1 participant