!5300boonew/sol-fee-consensus → developda06024b94

Deterministic SOL network-fee buckets

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.4klines changed
503lines to read
50slots per boundary
≤ 2boundaries of catch-up
5boundaries per fee median
0protocol state changes
200lamport vote deadband

Where the diff is

4-minute explainer

What changed

Why votes diverged

Skipped boundaries, rolling cache, relabelled fees, truncated listings

skipped boundariesrolling cachestale fee relabelledtruncated getBlocks

One boundary per pass

In order, bounded to the last two crossed boundaries

5,050 ✓5,100…5,250 skipped5,3005,350

Fresh sample per boundary

10 slots, newest first, to 100 txs; pure function of finalized data

getBlocksmedian / blockmedian of mediansround 100

Median of five boundaries

One block's leader can no longer set the reported fee

−200−150−100−50boundarymedian

minContextSlot guard

A lagging backend rejects instead of truncating the listing

minContextSlot = boundary-32016 → retry

Publish or suppress

Vote only when ≥2 steps from agreed fee; late signers attest

<2 steps → skip≥2 steps / none → voteequal + just agreed → attestlookup fails → retry

Risk

Bifrost-only; stricter sampling retries whole buckets

Line by line · every changed logic line, narrated

9:33runtime
15code chapters
100%logic lines narrated (407/407)
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

Agave
The main Solana validator client, whose RPC clamps getBlocks ranges to its finalized root.
Agreed fee
The network fee THORChain currently holds for SOL; a local sample equal to it is not re-voted.
Fee boundary
A slot that is a multiple of fee_update_interval (50); each boundary gets one fee sample and at most one vote at that exact slot. config/default.yaml ↗
GasCacheBlocks
For SOL, the eligible-transaction target per sample (100), not a block-cache length. config.go ↗
History boundaries
solFeeHistoryBoundaries = 5: the report is the median of this boundary's sample and the four preceding ones. sol_scanner.go ↗
LackOfObservationPenalty
Slash points THORNode adds to validators that did not sign an observation; late signers within ObservationDelayFlexibility get them refunded. constants/constant_values.go ↗
Lamport
The smallest SOL unit, 10⁻⁹ SOL; fees round to 100 lamports.
minContextSlot
Solana RPC option: the serving node must have reached this slot, else it returns error -32016. Solana RPC docs ↗
Network fee vote
Bifrost's report of a chain's fee rate to THORChain, keyed by chain, height, size and rate; matching votes reach consensus.
Retention floor
getFirstAvailableBlock: the lowest slot the node still stores; proves whether a sparse window is complete. get_block.go ↗