!5304odin/solvency-gated-inbounds → develope74360cc81

Hold inbounds on solvency-gated chains until a solvent report covers them

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.

12commits
49files
7.1klines changed
1.2klines to read
default offSolvencyGateInbound
100 / 200releases · vaults per pass

Where the diff is

Where an inbound waits

Gated inbounds park after crediting; a later solvent consensus releases them in EndBlock.

Observequorum, finalisedCredit vaultbalance += coinsParkby external heightEndBlock releaselater block, height okExecuteswap / handler / refundBifrost+ solvent reportsSolvency checkhalt if insolventconfirm
newchanged

3-minute explainer

What changed

Why gate

Spoofed inbounds halt the chain before paying out.

observecreditparkinsolvent → halt

Park at finalisation

Gated inbound stored per vault by height; handler returns.

no swap queuedno handlerno refund

Solvent reports confirm

Consensus confirms only when wallet covers the full ledger.

full ledgerext heightnever backwards

Release in EndBlock

Covered height plus later-block consensus; failures refund.

confirmed ≥ heightconfirmedAt > ParkedAt→ cache context, before swap queue

Bounds and ops

100 per block, 200 vaults per pass; gate off releases all.

100 / block200 vaultsfails closed0 → release all

State + upgrade

Mimirs

  • newSolvencyGateInbound-<CHAIN>0 (off)

Store and proto added

SolvencyGatedInbound (solvency_gated_inbound/)
+ chain+ pub_key+ height+ tx_id+ parked_at+ memo
solvency confirmation (solvency_confirmation/, raw 16 B)
+ external height+ THORChain height
GenesisState
+ solvency_gated_inbounds = 51

Line by line · every changed logic line, narrated

16:40runtime
24code chapters
100%logic lines narrated (937/937)
28flagged 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

Asgard index
The list GetAsgardVaults reads. cleanupAsgardIndex drops inactive vaults from it, so it can miss vaults Bifrost still reports. helpers.go ↗
Bifrost
The node's chain-observer process; it watches external chains and signs observations and solvency reports.
CacheContext
A branched store view whose writes commit only if the release succeeds.
EndBlock
Cosmos SDK hook run at the end of each block; releases now run here before the swap queue. module.go ↗
Mimir
On-chain parameter overrides voted by nodes or admin; SolvencyGateInbound-<CHAIN> is a new one. docs/mimir.md ↗
Parked inbound
A finalised, vault-credited inbound stored instead of executed until a solvent confirmation covers it. solvency_gate.go ↗
PermittedSolvencyGapUSD
Shortfall below which a vault still counts solvent, so smaller spoofs still pass the gate. docs/mimir.md ↗
Solvency checker
Bifrost reports vault wallet balances; THORChain compares them to its books and halts a chain whose vault is short. handler_solvency_helpers.go ↗
Solvency confirmation
Per vault and chain: the highest external height attested solvent, and the THORChain block of that consensus. keeper_solvency_gate.go ↗
SolvencyHalt
Mimirs set by the checker: SolvencyHalt<Chain>Chain halts a chain; SolvencyHaltVault-<pubkey>-<chain> flags one vault as insolvent there. handler_solvency_helpers.go ↗