Repository navigation
Conversation
…nly) Every 10 minutes and once at the start the node logs who keeps the network going: its neighbours by announced version (official 4.2.532 when the handshake's minor version is 0, community when higher, unknown when not yet announced), the share of official and community nodes among the trusted seats (confidants with their realTrusted bit) of the last 1000 stored blocks, and how often this node was trusted. OFFICIAL NODES GONE when no official neighbour for 10 minutes or no official confidant among the trusted of the last 200 rounds (with at least half of the seats classified); OFFICIAL NODES BACK when they return; TRUSTED SEATS COMMUNITY-ONLY when every seat of the last 1000 rounds was a community node. Each alert once on the change, then at most every 10 minutes. peer-status.json next to the db folder (atomic and fsynced, the writer of the fork guard files is now shared), printed by the Docker healthcheck, which stays healthy for it. The FORK HELD detail line says whether the refused peer is an official or a community node. Node::officialNodesGone() for later use. Consensus-neutral: nothing is sent, signed, hashed or validated differently; no new configuration. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The window holds blocks stored since the start (blocks read from the database at start-up are not counted), so the first line of a restarted node said "no stored blocks yet" next to a full database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Operators can now see in the log and in the status whether official nodes are still around or whether community nodes are carrying the network.
What it adds
PEERSline, once at the start and then every 10 minutes:PEERS: 16 neighbours (11 official, 5 community); last 1000 rounds: trusted seats 76% official, 24% community; this node trusted in 41%known_peers.json): minor 0 is official 4.2.532, minor > 0 is community, and nothing announced yet is unknown.OFFICIAL NODES GONE: no official neighbour for 10 minutes, or no official confidant among the trusted of the last 200 rounds. The second test needs at least half of the seats classified, so a window of unknown keys does not raise it.OFFICIAL NODES BACKwhen they return.TRUSTED SEATS COMMUNITY-ONLY(a warning) when every seat of the last 1000 rounds was a community node, andTRUSTED SEATS MIXED againwhen that ends.peer-status.jsonnext to the db folder, likefork-held.json: written atomically and fsynced, using the writer from csnode: bound automatic chain reorganisations #189, which is now shared (cs::forkguard::writeFileAtomic). It is rewritten with each PEERS line, each alert and each state change.test-entrypoint.shcovers this.; the other side is an official node (4.2.532)or... a community node.Node::officialNodesGone(), for the community bootstrap (csnode: community bootstrap fallback (opt-in) and official-stop CI scenarios #188) or other later users.Constraints
Tests
tests/csnode/peerstatus_tests.cppwith 17 tests covering:docs/quick-start.md(reading the PEERS line),docs/differences.md("Running"). Thedocs/CHANGES.mdrow follows once the PR number is known.🤖 Generated with Claude Code