Skip to content

csnode: check bootstrap round tables against the node's round and stall state - #71

Merged
EnzinoBB merged 4 commits into
masterfrom
fix/bootstrap-gate
Oct 22, 2026
Merged

EnzinoBB merged 4 commits into
masterfrom
fix/bootstrap-gate

Conversation

@EnzinoBB

Copy link
Copy Markdown
Collaborator

Hardening of Node::getBootstrapTable. It is stacked on #70; the base will become master once #70 is merged.

Changes

  • Round window. A table is taken only for a round next to the node's own: from its last block up to its round + 2. These are exactly the rounds an honest starter (sending its last block + 1) can send to a node that is at most one block away or that has learned the network round. The check is cs::isBootstrapRoundInWindow in csnode/include/csnode/bootstrapgate.hpp.
  • Stall check. An unsigned table is taken only once the node's own round has lasted half of round_elapse_time, which is the condition under which an honest node starts a bootstrap. A node younger than round_elapse_time, or already in a bootstrap round, takes the table as before. RoundStat now keeps the time of the last round change separately from the elapse tick.
  • Signed tables. A table of initial confidants signed through the diag API is recognised by its signature and skips the stall check.
  • No block-removal request. The 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.
  • robustness.yml: new node_alt_ref input, for mixed binaries as in testnet.yml.

Sending is unchanged, and honest tables always pass both checks, so a mixed network makes the same choices as before.

Validation

  • Unit tests for the window and the stall check.
  • Testnet at 7 nodes, and with node_alt_ref=master (official receiver behaviour on the even nodes).
  • Robustness: mixed-power-cut, rocksdb-power-cut, net-partition and chaos-mixed, plus mixed-power-cut with node_alt_ref=master.
  • 9 nodes on a branch combined with ci(testnet): resource sampling and a nodes input for testnet and robustness #68.
  • Expected in the logs: no does not fit this node or ms old ... drop lines on honest traffic.

🤖 Generated with Claude Code

EnzinoBB and others added 4 commits October 22, 2026 15:16
…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
- 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
- robustness.yml: node_alt_ref input, mixed binaries as in testnet.yml

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le, docs precision, tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant