!5290fix/observe-credit-across-finality → develop3549d2a9f9

Credit observations across finality tiers in slash accounting

AI-generatedEverything on this page was written by an AI agent from the diff: the summaries, the narration, the diagrams, the flags and the glossary. It can be wrong or incomplete, so check it against the code before you rely on it.

7commits
6files
1.2klines changed
241lines to read
+1voter proto field
noneversion gate

Where the diff is

Tests1 files · 729 lines

x/thorchain/handler_observed_tx_finality_credit_test.go+729 −0
1final first, non-final late2sub-quorum flush3instant-final member4variant spam capped5XMR skipped

3-minute explainer

What changed

The problem

Honest non-final observers kept +1 when their tier never formed consensus.

Refund unreached tier

Final consensus refunds non-final observers if non-final consensus never formed.

final non-final 000000+lack+lack0 ✓0 ✓0 ✓·····

Late non-final refund

First non-final obs within flex after final: observe point back, penalty kept.

final consensus @Fnon-final obs ≤ F+flex−observe point
first in tiernot XMRsame credit class

Excuse final observers

Non-final consensus skips lack penalty for nodes already seen as final.

final non-final ······+1+1000000excusedexcused

State + upgrade

Proto fields added

ObservedTxVoter
+ excused_observers (repeated string, = 16)

Line by line · every changed logic line, narrated

8:47runtime
13code chapters
100%logic lines narrated (200/200)
13flagged spots
speed

Chapters

What to check

Ask an AI about this change

Chat assistantClaude, ChatGPT, … (reads a link)

Coding agentClaude Code, Cursor, … (reads the repo)

The context file is context.md. Use Copy with context for an AI that can't open links; it pastes the whole file in.

Glossary

Excused observer
A node spared the lack penalty at non-final consensus because it already observed the tx as final; its late non-final gets only the observe point back. handler_observed_tx_helpers.go ↗
Finality tier
Observations of a tx are either final (enough confirmations) or non-final; each tier is voted and reaches consensus separately in one voter. type_observed_tx.go ↗
Instant observation
The signing committee's pre-broadcast observation of its own outbound, submitted with zero confirmations required, so it lands in the final tier. bifrost/signer/sign.go ↗
LackOfObservationPenalty
Extra slash points charged at consensus to active nodes that didn't observe the tx. constants ↗
ObservationDelayFlexibility
Blocks after consensus during which a late observer still gets its slash points back. constants ↗
ObservedTxVoter
Stored record collecting every node's observations of one tx, its consensus tx and heights. Gains excused_observers here. type_observed_tx.proto ↗
ObserveSlashPoints
Slash point charged on each observation up front and refunded when consensus credits the observer. constants ↗
Slash points
Per-node misbehaviour counter; it reduces rewards and feeds churn-out decisions.