!4241odin/mimir-refactor-constants → developf090ce591d

IsOperationalMimir moves from the keeper to constants

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.

5commits
9files
583lines changed
190lines to read
identicalmoved rule body
0state / consensus changes

Where the diff is

3-minute explainer

What changed

The move

Keeper method becomes constants.IsOperationalMimir; both keeper copies deleted.

KeeperMimirKVStoreKVStoreDummy→ constants

+ strings import, nothing else

Same rule

Six-step cascade, first hit wins, byte-identical to the old body.

exact 18 except 2 prefix 3 has 11 prefix 2 suffix operational economic except 2 and no match → economic

Callers

Vote tally and churn purge call constants directly; same answers.

  • handler_mimir.go:167: plurality vs 2/3
  • keeper_mimir.go:76: purge votes at churn
  • 3 test files

Dummy keeper

Test doubles lose the 3-word shortcut and use the real rule.

MintSynths: economic → operationalNodePauseChainBlocks: operational → economic

Tests

85-case table plus loops; runs through the mocknet TestPackage hook.

  • 18 exact + 2 exceptions × 3 casings
  • 11 contains words × 5 placements
  • mocknet only: TestPackage is the one hook

Line by line · every changed logic line, narrated

3:59runtime
7code chapters
100%logic lines narrated (147/147)
2flagged 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

Churn
The periodic rotation of the active validator set. At each churn, PurgeOperationalNodeMimirs deletes node votes on operational keys but keeps their set values. manager_validator_current.go ↗
Economic mimir
Any mimir that is not operational. It changes only when two-thirds of active validators vote for the same value. HasSuperMajority ↗
gocheck hook
A plain Go test that calls TestingT(t) and runs every gocheck suite registered in the package. Constants has one, TestPackage, built only under mocknet. gopkg.in/check.v1 ↗
Keeper
THORNode's store-access layer. KeeperMimir is the interface for mimir reads and writes; this MR removes IsOperationalMimir from it. keeper.go ↗
KVStoreDummy
A no-op keeper that test doubles embed. It used to carry a simplified, three-word IsOperationalMimir. keeper_dummy.go ↗
Mimir
On-chain key/value overrides that node operators vote on to tune or halt THORChain behaviour without a software upgrade. docs/mimir.md ↗
mocknet
The build tag CI unit tests run under. The constants package's existing TestPackage hook is in a mocknet-only file. Makefile ↗ constants_mocknet_test.go ↗
Operational mimir
A mimir key that IsOperationalMimir returns true for. It is set by the most-voted value once it reaches OperationalVotesMin, and its node votes are purged every churn. constants/mimir_strings.go ↗ ValueOfOperational ↗
OperationalVotesMin
Minimum number of node votes an operational mimir value needs before it takes effect; default 3. constants_v1.go ↗