Repository navigation
solver: info-level stage-3 diagnostics (logging only) - #167
Merged
Merged
Conversation
- solvercore: one "stage3 inputs" line per stage 3 with the inputs of the signed hashes (seq, prev hash, timestamp, reward, tx/fee hashes, characteristic, new wallets, confirmations, writer, mask, our 3 hashes) - solverinterface: classify each stage-3 final-check failure (another block/round hash vs key or message mismatch) and log the agree/disagree split, grouped by failure pattern, bounded to 10 failures per iteration - node: performRoundPackage logs the keys a round package gray-lists, "OWN KEY" when ours is one of them - trustedstage3state: active/total/needed counts and mask on the "not enough active confidants" warning - blockchain: "signatures of the block are insufficient or incorrect" is a warning with the block's sequence, hash and previous hash - docs/consensus-diagnostics.md: how to read the lines Nothing that is signed, hashed, compared, sent or stored changes. 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Info-level diagnostics for stage-3 disagreements, following the operator report where a trusted node failed "Block/Round Signatures are not valid" for most peers (trusted signature and mask agreeing), waited for bootstrap, and saw its own key gray-listed for 1000 rounds.
Logging only. Nothing that is signed, hashed, compared, sent or stored changes; no new exceptions; no serialized structure changes.
What is logged
solvercore.cpp(after "StageThree prepared")stage3 inputs:round, iteration, seq, prev hash, timestamp, reward (hex), tx count, hash of the tx signatures in block order, hash of the counted fees, characteristic mask hash/size, newWallets, smart signatures, confirmations (mask size / signatures), writer, our block/round/trusted hashes (8 hex), realTrustedMask. One line per stage 3.solverinterface.cpp(final check)stage3 check failed T[i] <key8> ... failed=<checks> -> <verdict>: (a) signed another block/round hash (key ok, trusted hash agreed), (b) key or message mismatch (trusted signature fails too), plus already marked untrusted / mask or writer differsstage3 split: who agreed with our hashes (own marked) and the failing senders grouped by failure pattern; bounded to 10 failures per iterationnode.cppperformRoundPackageround package R-n from <sender8> gray-lists k of N confidants of R-(n-1) for 1000 rounds: [T<i>:<key8>...], with(OWN KEY)/- OWN KEY gray-listedtrustedstage3state.cppactive a of N, need m, mask ...blockchain.cpp#seq hash <hex> prev <hex>Keys are the first 8 base58 characters of public keys. Private keys are never logged.
About point (c) of the request (verify a failing signature against other peers' hashes): stage 3 carries no hashes on the wire, and every accepted stage 3 matched our hashes, so there is no other hash to verify against; re-deriving an alternative round hash (
RoundPackage::bytesToSign(!showVersion)) would rewrite the package's cached binary, so it is not done. Failing senders are grouped by pattern instead, which shows the majority/minority split.docs/consensus-diagnostics.mdexplains how an operator reads the lines to find the input that differed;docs/differences.mdlinks it;docs/CHANGES.mdrow added.Tests
ctest: 3/3 passed.node_alt_ref=official,contracts=1): success, all 7 nodes at 1101, equal STATE DIGESTs; 0 check failures, 0 gray-listings. Our nodes (odd) printstage3 inputs, and all of them print identical hashes per round, e.g. R-600 on three nodes:only=chaos-mixed,net-partition,slow-nodes(comma-separated, no spaces: the filter iscontains(',<only>,', ',<name>,')); only those three ran, all success. Gray-list lines appeared (no stage-3 signature failures in these scenarios: exclusions there come from missing stages):test/stage3-skew(NOT part of this PR, never to be merged): n3 and n5 build their block with the timestamp + 1 ms. The run reached 508 blocks and failed only on its own STATE DIGEST #1000 check (target was 500). It reproduces the operator's report and the new lines pinpoint the timestamp:Consensus-neutrality notes for review
solvercore.cpp: readsdeferredBlock_through a const reference (newWallets()const overload, so no copy-on-write detach), the round package'spoolMetaInfo(), and hashes copies of tx signatures/fees withcscrypto::calculateHash.deferredBlock_.hash()was already computed above. One allocation of n×64 bytes per stage 3.blockchain.cpp:pool.hash()lazily computes and caches a hash; it is only called whenpool.is_valid(), i.e. aftercompose()already set it, so nothing new is cached.solverinterface.cpp: adds a memberstage3Failures_(diagnostic state, cleared with the stage storages innextRound/adjustStageThreeStorage); never read by consensus code. No extra signature verifications.node.cpp: thesenderparameter ofperformRoundPackageis now named (was/*sender*/); the gray-list loop callsaddToGraylistexactly as before.🤖 Generated with Claude Code