Repository navigation
snapshots: node --survey-snapshots and the weekly snapshots.md / snapshot_sources.txt (P8) - #116
Merged
Merged
Conversation
…and snapshot_sources.txt The node asks its neighbours for snapshot manifests for N seconds without opening its chain, prints the snapshots they declared (one line per group with its sources) and the serving peers that gave no manifest, and exits 0. The weekly known-hosts job runs it after the collection and ci/known-hosts/snapshot_sources.py (strict parsing: the output comes from a node that talked to untrusted peers) writes snapshots.md and snapshot_sources.txt, published in the known-hosts release and proposed with the known hosts; the packages ship snapshot_sources.txt when the repository has it. - SnapshotFetcher::surveyText, Node::startSurvey/finishSurvey (the bootstrap's discovery and manifest phases with the fetcher in dry-run), the --survey-snapshots option - robustness row snapshot-p2p-survey (JOIN_SURVEY=1): at the end of a p2p join the joiner is stopped and surveyed; the three serving nodes must be in one group and in the sources file Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan step P8 of the p2p snapshots: a way to see who serves which snapshot, and the weekly job that publishes it.
node --survey-snapshots [seconds](default 600, 10 to 86400): the node starts without opening its chain (whatever its folder holds), asks the neighbours that announce snapshots for their manifests for that long, prints what they declared and exits 0. It is the bootstrap's discovery and manifest phases with the fetcher in dry-run; nothing is fetched or imported. Output, one line per snapshot (strongest first), then the serving peers that gave no manifest:SURVEY group seq=… head=… state=… settings=… sources=<key>@<address>@<created>,…,SURVEY silent <key>@<address>,SURVEY end groups=… serving=… silent=….ci/known-hosts/snapshot_sources.pyturns that output andknown_peers.jsonintosnapshots.md(the snapshots seen, their sources, how many independent networks serve: what themin_sourcesdecision depends on) andsnapshot_sources.txt(the serving peers that answered a verified manifest, at most 3 per /24 or /48). The output comes from a node that talked to untrusted peers, so every field is checked against its exact shape (keys, IP addresses, 64-hex hashes, ISO dates) before it reaches a file or a pull request;--self-testcovers hostile input.known-hosts.yml,run-weekly.sh) runs the survey after its collection, publishes both files in theknown-hostsrelease and addssnapshot_sources.txtto the known-hosts pull request only when it found serving nodes.make-package.shand the Docker entrypoint ship the file when the repository has it.startBootstraponly moves its hook set into a sharedmakeFetcher.Test plan
SnapshotFetcher.SurveyTextListsTheGroupsAndTheSilentSources),snapshot_sources.py --self-testsnapshot-p2p-survey(at the end of a p2p join the joiner is stopped and surveyed):SURVEY end groups=1 serving=3 silent=0, the three serving nodes in one group and in the generated sources file🤖 Generated with Claude Code