!5267odin/observe-quorum-perf → develop36c83eacd8

Halve quorum handler time: save the voter once, verify attestation signatures ahead of the block

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.

4commits
10files
678lines changed
258lines to read
−45–70%gas, batch quorum msgs (author)
−40–47%handler time, warmed (author)
2 × 32kmax cached signatures

Where the diff is

4-minute explainer

What changed

Where the time goes

Signature checks ~76% of CPU; voter rewritten once per signer.

bytes written per messageN²before

Save the voter once

Apply attestations in memory, one SetObservedTx*Voter at the end.

applyapplyapplyapplyapplySet voter × 1in memoryif any added

Same store, less gas

Store byte-identical; gas_used drops, so ship at an upgrade height.

gas_usedLastResultsHash→ upgrade height
  • whole KV store compared after every message
  • not version-gated in code

Signature cache

Only successes stored, keyed on exact pubkey, sig and bytes.

SHA-256(len|…)hit → truemiss → verifyok: store

Warm it in ebifrost

Bifrost submits; a bounded goroutine verifies before the block.

bifrost gRPCcopy + payloadslot free?verify → cache
txnetwork feesolvencyerrataprice feed

busy → skip, never queue

Results

Batch messages ~45% faster warmed, 6–9% cold (author's numbers).

ObservedTxQuorumIn/batch-quorumdevelop7.70cold7.15warmed4.23 ms

Line by line · every changed logic line, narrated

6:54runtime
7code chapters
100%logic lines narrated (201/201)
7flagged 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

ab.sh
The repo's interleaved base-vs-candidate benchmark script; its guard reports REVERT on any gas change by design. scripts/perf/ab.sh ↗
Attestation
One validator's secp256k1 signature over an observation's signable payload, with its pubkey. common.proto ↗
Enshrined bifrost (ebifrost)
The in-process gRPC service through which a node's bifrost submits attestations to THORNode, which caches them and injects them into blocks. ebifrost.go ↗ docs/bifrost/oracle.md ↗
gas_used / LastResultsHash
Each tx's gas used is part of its result; CometBFT hashes the results into the next block header, so a gas change is consensus-visible. CometBFT docs ↗
GOMAXPROCS
Go's limit on threads running Go code at once; the warm-up uses a quarter of it, at least one. runtime.GOMAXPROCS ↗
MsgObservedTxQuorum
A message carrying one observed transaction plus many validators' attestations, replacing one MsgObservedTxIn/Out per signer. msg_observed_tx_quorum.proto ↗ handler ↗
Observed-tx voter
The stored record of every signer's observation of one tx. It grows with each signer, which made per-signer saves quadratic. type_observed_tx.proto ↗
secp256k1
The elliptic curve signature scheme validators sign attestations with; verifying it dominates quorum handler CPU. Bitcoin wiki ↗
Upgrade height
The block height at which all nodes switch to a new binary, so consensus-visible changes take effect everywhere at once. docs/release.md ↗