!5308pub/churn-in-tenure → develop2b59529faf

Operational minimum node age for churn-in

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.

9commits
216files
8.3klines changed
484lines to read
0migrations
1new mimir

Where the diff is

Who may churn in

An age-start height per node gates Ready nodes; low bond and age marks wait for room.

newchanged

3-minute explainer

What changed

Capped operational mimir

3 votes set it; counts for at most 3 churn intervals.

3 votesmin(value, 3 × ChurnInterval)age ≥ min

Age start

Age counts from when the bond last reached MinimumBondInRune.

  • bond < min: −1, no age
  • reaches min: starts now
  • synced on every write and churn
  • old nodes: StatusSince floor

Churn-in filter

Only old-enough Ready nodes fill slots; young ones only top up to BFT.

Readyold enough ✓too young · held

Removals within room

Low bond and age marks go last, only while old-enough nodes remain.

other marksroom = old-enough − markedlow bond · age

Caveats

Writes on every node account and churn; no migration.

State + upgrade

Mimirs

  • newChurnInMinNodeAgeBlocks0 (off), ≤ 3 × ChurnInterval

Store keys + proto fields added

node_age_start/<node address>
+ int64 height, −1 below MinimumBondInRune
GenesisState
+ node_age_starts = 53 (NodeAgeStart: node_address, height)

Line by line · every changed logic line, narrated

10:14runtime
20code chapters
100%logic lines narrated (375/375)
14flagged 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

ActiveBlockHeight
Height a node last became Active; zeroed when it churns out.
Age start
New per-node height under node_age_start/: when the bond last reached MinimumBondInRune, or −1 below it. Age is height minus it. keeper_node_account.go ↗
Churn
Periodic rotation of the active validator set: some nodes leave, Ready nodes join, and new vaults are keygen'd. manager_validator_current.go ↗
LeaveScore
Set on an Active node marked to churn out; nonzero means it is a removal candidate this churn.
Mimir
On-chain key-value overrides set by node votes or admin; operational mimirs need only a few node votes. docs/mimir.md ↗
MinimumBondInRune
Smallest bond a node needs to be churned in; reaching it starts the node's age. docs/mimir.md ↗
MinimumNodesForBFT
Smallest active set THORChain tolerates; a next set below it starts a ragnarok. constants ↗
Operational mimir
A mimir listed in IsOperationalMimir: OperationalVotesMin (3) active nodes set it, most-voted value wins, a tie sets nothing. mimir_strings.go ↗
Ragnarok
Network shutdown that returns all funds to users.
Ready / Standby
Node statuses: Standby nodes that pass checks become Ready at churn and may be picked to become Active.
StatusSince
Height of a node account's last status change; reset at every churn for nodes that move status.