Skip to content

solver: stage-3 diagnostics show the timestamp choice and the block the network stored - #176

Merged
EnzinoBB merged 2 commits into
masterfrom
diag/stage1-timestamps
Nov 9, 2026
Merged

EnzinoBB merged 2 commits into
masterfrom
diag/stage1-timestamps

Conversation

@EnzinoBB

@EnzinoBB EnzinoBB commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Logging only, on the failure path (info level only when a peer's stage 3 fails the final check, debug level otherwise). Nothing signed, sent or stored changes; chooseTimeStamp() keeps its arithmetic and order, the diagnostics read the same values alongside it. Follows #167/#168.

Motivation: a community.17 node on mainnet (key 6ZW39KmR) is the minority in stage 3 in about half of the rounds it is trusted (failed=block+round, key ok, trusted hash agreed), then gray-listed. Its stage3 inputs line differs from the written block only in ts (2–5 ms lower), but the written block is the writer's second stage-3 iteration with a 6-member mask, so ts and reward differ for that reason alone and the first-iteration cause is still unknown. These lines make a failing node's own log sufficient for the mask-independent inputs, and comparable with a peer's for the timestamp.

What is logged:

  • stage3 timestamp (new, right after stage3 inputs): the last block timestamp used, every stage-1 timestamp held for the round with its fate (in, outlier, masked, not-after-last, empty, invalid, sender-out-of-range), N, mean, disp, the chosen timestamp and any fallback. Bounded by the confidant count.
  • stage3 inputs gains the hashed fields it did not show: confMask (confirmation mask bits), confSigs (hash of the round-confirmation signatures, with the number of zero slots), realTrusted, version, roundCost, bootstrap.
  • stage3 network block (new): when this node's stage 3 failed, the block the network stores for that sequence is logged once with the same fields and differs= naming the fields that differ (armed by the first failure, read and cleared by storeBlockEvent/lastBlockReplacedEvent; at most one line per diagnosed round).
  • docs/consensus-diagnostics.md: how to read and compare the lines (sections 1a and 1b).

Tests: Linux build; testnet.yml runs on this branch (official peers + contracts, and a timestamp-skew run from the test/stage3-skew hook) listed in the comments below.

🤖 Generated with Claude Code

EnzinoBB and others added 2 commits November 9, 2026 08:09
… block the network stored

Logging only, on the failure path (info level only when a peer's stage 3 fails the final
check, debug level otherwise); nothing signed, sent or stored changes.

- "stage3 timestamp": alongside SolverCore::chooseTimeStamp(), without touching its arithmetic
  or order, the last block timestamp used, every stage-1 timestamp held for the round with its
  fate (in, outlier, masked, not-after-last, empty, invalid), N, mean, dispersion, the chosen
  timestamp and the fallback taken, so two nodes can compare the set of stamps they averaged.
- "stage3 inputs" gains the hashed fields the line did not show: the confirmation mask bits, a
  hash of the round-confirmation signatures (with the number of zero slots), the real-trusted
  mask written, the block version, the round cost and the bootstrap flag.
- "stage3 network block": when the stage 3 of this node failed, the block the network stores for
  that sequence is logged once with the same fields and the names of the fields that differ,
  so a failing node's log alone shows which mask-independent input differed.
- docs/consensus-diagnostics.md: how to read and compare the new lines, and why ts and reward
  of the stored block differ anyway when the writer retried stage 3 with a smaller mask.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@EnzinoBB
EnzinoBB merged commit c8050fb into master Nov 9, 2026
5 checks passed
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