Skip to content

feat(rpc): warn operators before their signing history gets them PoSe-voted bad - #8207

Draft
PastaPastaPasta wants to merge 4 commits into
dashpay:developfrom
PastaPastaPasta:pose-signing-history-warning
Draft

PastaPastaPasta wants to merge 4 commits into
dashpay:developfrom
PastaPastaPasta:pose-signing-history-warning

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Stacked on #8086; only the last three commits are new. Draft until #8086 merges.

Issue being fixed or feature implemented

With #8086, DKG members vote a member bad once it has signed at most a quarter of at least 6 recent commitments it was a valid member of. A masternode that stops signing carries no PoSe penalty until that first happens, and from then on fixing it doesn't help, because a member voted bad adds nothing to its history. A previously healthy masternode needs about 5 days of not signing to get there, and its operator sees nothing during those days.

This turns those days into a warning period. The feature commit is UdjinM6's, offered during review of #8086 and kept with his authorship.

What was done?

  • masternode status gets a signingHistory object (gatheringHeight, window, countedSince, validCommitments, signedCommitments, recentUnsigned, oneMissAway, expiringSoon, atRisk, votedBad), gathered at the block the hourly DKG sessions gather at so the cached result is shared with them.
  • quorum info members get signed, and quorum memberof entries get isSigner, so an operator can see which commitments were missed.
  • A DKG session the masternode is a member of logs a WARNING about its own history when it is at risk or already voted bad.
  • CountSignedCommitments and HasInsufficientSigningHistory return the same results as on feat: PoSe-vote members that persistently do not sign quorum commitments #8086; the summary shares the vote's cutoff filter. The vote itself does not change. votedBad reports the history alone: a session still drops its signing-history votes when they would leave fewer members than the quorum's minimum size, as on feat: PoSe-vote members that persistently do not sign quorum commitments #8086.
  • At risk means any of: 2 or more unsigned commitments of quorums based after the last signed one; fewer than half signed out of at least 6; one more unsigned commitment would get it voted bad; or the history leaving the window over the next day would get it voted bad. Several unsigned commitments mined between two hourly gatherings can still go from no warning to voted bad; that is documented in the code and RPC help.
  • Functional coverage in feature_llmq_simplepose_capabilities.py, inside the existing non-signer scenario.
  • Release notes, including the operator-key reset path (ProUpRegTx with a new operator key bans at once, a ProUpServTx with the new key revives and restarts the history).

How Has This Been Tested?

  • Unit: llmq_dkg_tests gets a table-driven case for the summary (same-height records in either order, streak resets, the at-risk thresholds, one miss away, expiry at the end of and partway through the lookahead) and checks that the summary counts the same records as the vote. llmq_dkg_tests, llmq_blockprocessor_tests and rpc_tests pass.
  • Functional: the non-signer scenario of feature_llmq_simplepose_capabilities.py now samples masternode status at the start of every DKG round while the masternode omits its commitments. It checks that the history starts empty after the earlier revival, that atRisk is reported before votedBad, and that votedBad (without atRisk) is reported in the round that gets it banned. It also checks gatheringHeight, window and countedSince, quorum info signed and quorum memberof isSigner for an omitted and for a signed commitment, both of the masternode's own WARNING lines, and that the history is no longer at risk once it signs again. The status is sampled at DKG start because a PoSe-banned masternode's masternode status no longer reports its proTxHash, so it has no signing history to show.
  • Before the rebase onto feat: PoSe-vote members that persistently do not sign quorum commitments #8086's current commit, each new functional check was confirmed to fail with a mutation: signed taken from validMembers, isSigner taken from validMembers, atRisk forced to false, votedBad forced to false, recentUnsigned forced to 0, countedSince ignoring revivals, the at-risk log line removed, and the voted-bad log line removed.
  • Passing locally on a debug build (with RPC result doc checks) at this head: feature_llmq_simplepose_capabilities.py, feature_llmq_simplepose_capabilities.py --disable-spork23, feature_llmq_dkgerrors.py and rpc_help.py, plus the three unit suites above.

Breaking Changes

None. New RPC fields only; consensus and the PoSe vote are unchanged.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (if you have permission to set one)

🤖 Generated with Claude Code

@PastaPastaPasta PastaPastaPasta added this to the 24.1 milestone Nov 19, 2026
@PastaPastaPasta PastaPastaPasta changed the title feat(llmq): warn operators before their signing history gets them PoSe-voted bad feat(rpc): warn operators before their signing history gets them PoSe-voted bad Nov 19, 2026
@thepastaclaw

thepastaclaw commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 1f88342. Normal review starts when eligible; priority review starts as soon as a slot is available.

@PastaPastaPasta
PastaPastaPasta force-pushed the pose-signing-history-warning branch 5 times, most recently from cf02567 to 3e95b65 Compare November 20, 2026 14:34
PastaPastaPasta and others added 4 commits November 24, 2026 11:03
…mmitments

PoSe only punishes members that are not valid in a mined commitment. A
member that sends its contributions but never signs the commitment stays
valid and is never punished.

During the complaint phase, count from mined commitments of the last
4032 blocks how many each member was valid in and how many it signed,
ignoring those before its registration or last revival. A member that
signed at most a quarter of at least six of them gets a bad vote, so with
enough votes the existing PoSe penalty applies. The counts are derived
from chain data up to the start of the DKG cycle only, so all members
agree on them. The check is gated by SPORK_23 like the other bad votes.

These votes are dropped in a round where they would leave fewer than
minSize of the members this node has not already voted bad, after the
contribution phase and its other bad-connection votes. This is the
node's own estimate, not a prediction of the round: a round that ends
below minSize neither penalizes the member nor lets it add a signed
record, so the node does not cast votes that would cause that by its
own count. The counts are the same for every member; only the set of
remaining members depends on the node's view, and a node that drops the
votes only lowers their count.

GetSigningRecords() gathers the records against the active chain and the
active-chain check runs on a cache hit too, so a result cached while the
gathering block was on the active chain is not reused once a reorg has
disconnected it.

A member voted down for too little signing history is flagged
badConnection, the flag a bad peer connection already sets.
SendComplaint() no longer lets that flag hide a complaint about an
invalid share from the same member: when the bad votes stay below
dkgBadVotesThreshold the member remains valid, and only a complaint
makes it justify its share, which is what lets the complaining member
build its key and sign the commitment. Receivers count the bad-vote and
complaint bitsets independently, so a member may appear in both.

A dedicated simulated DKG error, commit-omit-all-types, omits premature
commitments in the DKGs of every LLMQ type, so a test can produce a
member that signs no commitment in any type. Only this error is allowed
outside LLMQ_TEST, and only on a mockable chain; the gate of every other
simulated error is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…em voted bad

A masternode that stops signing final commitments carries no PoSe penalty
until other members first vote it bad for its signing history, and from
then on the ban is effectively certain. Give operators the days in between
as a warning period:

- `masternode status` reports `signingHistory`: the gathering height, the
  height the history is counted since (registration or last revival), the
  valid and signed commitments, `recentUnsigned`, `oneMissAway`,
  `expiringSoon`, `atRisk` and `votedBad`. It is gathered at the block the hourly DKG sessions gather
  at, so the result is shared with them, and it is an estimate: each
  session gathers at its own block and counts since the registration or
  revival known at its quorum base block;
- `quorum info` members report `signed`, and `quorum memberof` reports
  `isSigner`, so an operator can see which commitments it missed;
- a DKG session the masternode is a member of logs a warning when its own
  history is at risk or already gets it voted bad.

`recentUnsigned` counts the unsigned commitments of quorums based strictly
after the most recent signed one: quorums of different types share base
heights, so records of the same height have no order. At risk means any
of:
- at least 2 such commitments;
- fewer than half signed out of at least 6;
- `expiringSoon`: the window slides, so signed records leaving it can push
  a history to being voted bad without another unsigned commitment. The
  check looks a day ahead, and evaluates the threshold after each quorum
  height leaves, since old signed records may leave before old unsigned
  ones and the history only crosses the threshold on the way;
- `oneMissAway`: one more unsigned commitment would get it voted bad, now
  or at any of those points as records leave.

Several new unsigned commitments mined between two hourly gatherings can
still take a history from no warning to being voted bad; warning for
that would need a far more conservative rule.

Unit tests cover the summary against the vote's counts and cutoffs,
same-height records in either order, streak resets, the at-risk
thresholds, one miss from being voted bad, the expiry transitions at the
end of and partway through the lookahead, and expiry together with one
more miss. Making the height comparison inclusive, dropping the
lookahead, checking expiry only at its end, disabling the one-miss check,
or checking one more miss only against the current totals makes them
fail.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Extend the existing non-signer scenario of
feature_llmq_simplepose_capabilities.py:

- sample `masternode status` `signingHistory` at the start of every DKG
  round while the masternode omits its commitments, and check that it
  starts empty after the earlier revival, never counts a signed
  commitment, counts every unsigned one as recent, reports `atRisk`
  before it is voted bad and `votedBad` (without `atRisk`) in the round
  that gets it banned;
- check `gatheringHeight`, `window` and `countedSince` against the tip
  and `protx info`;
- check `quorum info` member `signed` and `quorum memberof` `isSigner`
  for a commitment it omitted and, after the revival, one it signed;
- check the masternode logs both its own at-risk and voted-bad
  warnings, and that once it signs again the history is no longer at
  risk.

The status is sampled at DKG start because a PoSe-banned masternode's
`masternode status` no longer reports its proTxHash, and so neither its
signing history.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

This pull request has conflicts, please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants