Repository navigation
csnode: take a bootstrap round table only for a round next to the node's own, and only once its round has stalled - #79
Open
EnzinoBB wants to merge 1 commit into
Conversation
…d stall state - a table is taken only for a round next to the node's own: from its last block to its round + 2, the rounds an honest starter (last block + 1) sends to a node at most one block away or that learned the round (cs::isBootstrapRoundInWindow, csnode/bootstrapgate.hpp) - an unsigned table only once the node's own round has lasted half of round_elapse_time, the condition under which an honest node starts a bootstrap; a node younger than round_elapse_time or already in a bootstrap round takes it as before (cs::isBootstrapStallAccepted). RoundStat keeps the time of the last round change apart from the elapse tick - a table of initial confidants signed through the diag API is recognised by its signature and skips the stall check - a table whose signature cannot be read is dropped (it went on before) - the block-removal request derived from the table's round is gone: the permission flag it set is already set by every loaded or recorded block, so it never took effect Same change in the community fork: #71. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Why this PR
Node::getBootstrapTabletakes a bootstrap round table for any round number, at any time, as long as it weighs more than the last one taken. An unsigned table is not authenticated, so a node can be pushed into a bootstrap round while its own round is progressing normally, or for a round far from its own. The same function also requests the removal of blocks derived from the table's round; that request never takes effect (the permission flag it sets is already set by every loaded or recorded block). Reported privately to the Credits team (problem 2 of our report). This PR is a mitigation that every node can deploy on its own; the complete fix (every bootstrap table signed with the blockchain key) changes what nodes accept and needs a coordinated release.What changes
cs::isBootstrapRoundInWindow(newcsnode/include/csnode/bootstrapgate.hpp): a table is taken only for a round from the node's last block to max(last block, current round) + 2, the rounds an honest starter (its last block + 1) sends to a node at most one block away or still syncing.cs::isBootstrapStallAccepted: an unsigned table is taken only once the node's own round has lasted half ofround_elapse_time, the condition under which an honest node starts a bootstrap. A node younger thanround_elapse_time, or already in a bootstrap round, takes it as today.RoundStatkeeps the time of the last round change (msSinceRoundChange) apart from the elapse tick, and the node start time (msSinceStart).Effect on the network
Nothing changes on the wire. An honest bootstrap still works: the starter only sends a table after its own round stalled, and the receivers of an honest table are within the window. A node with this change ignores tables that a node without it would take outside that window or before its round stalls. Tested on private networks of mixed official and community binaries, including bootstrap restarts.
Tests
tests/csnode/bootstrapgate_tests.cpp(new): the window (honest rounds, other rounds, no overflow near the top) and the stall rule. Built and run on 4a95aaa (GCC 13).Same change in the community fork: CreditsCommunity#71, running on mainnet community nodes.