!5309itz/sol-anchor-prewarm-slotms → developeed67a09f3

SOL: prewarm the blockhash anchor, slot time becomes a mimir

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.

13commits
10files
551lines changed
291lines to read
300→214msSOL slot constant
20→28slots per THOR block

Where the diff is

3-minute explainer

What changed

The 32 second budget

150 blocks at 214ms leaves ~32s; nonce creates expired.

15s marginderive hashkeysign + send✗ -32002

Prewarm the anchor

Derive the blockhash during the vault reads, hit the cache at keysign.

pure function of heightsingleflight: one RPC fan-outfailures never cachedonly after signing gates

SOLSlotMilliseconds mimir

Read at keysign height, clamped 50-2000ms, sets keep-alive threshold.

mimir @ heightclamp 50…20006000 / ms28 slots

Constant 300 → 214ms

Fallback, scanner pacing, observer flex window and quote ETAs all shift.

mimir fallbackscanner pacingflex windowquote ETAs

State + upgrade

Mimirs and constants

  • newSOLSlotMillisecondsunset → 214
  • changedSOLChain.ApproximateBlockMilliseconds300 → 214

Line by line · every changed logic line, narrated

5:24runtime
9code chapters
100%logic lines narrated (261/261)
12flagged 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

Consensus blockhash
The blockhash every TSS member derives from the keysign height, so all sign identical bytes. sol_client.go ↗
Durable nonce
A Solana nonce account that replaces the recent blockhash so signed txs do not expire; creating one still needs a recent blockhash.
Keep-alive
Periodic vault self-sends so a vault's signature history stays fresh; due when the newest signature is older than the threshold. sol_keepalive.go ↗
MAX_PROCESSING_AGE
Solana rejects a transaction whose blockhash is more than 150 blocks old; about 32s at a 214ms slot.
Mimir
THORChain's on-chain key/value overrides, set by node votes or admin; bifrost reads them from the chain. constants/mimir_strings.go ↗
Observer flex window
How far back the block scanner rolls on restart, in chain blocks; computed from THOR blocks over the chain's block time. blockscanner.go ↗
singleflight
Go helper that merges concurrent calls for the same key into one execution, so the prewarm and keysign share one derivation. pkg.go.dev ↗
TSS keysign
Threshold signing by a vault's member nodes; every member must agree on the message to form a party.