Skip to content

perf(get-block): 14.5 MiB full-chain resolver catalog, Ed25519 short-circuit, and 720 MiB/s JSON streaming - #107

Merged
augustin-cheron merged 1 commit into
mainfrom
perf/get-block-round3-fast-resolver-and-render
Nov 30, 2026
Merged

augustin-cheron merged 1 commit into
mainfrom
perf/get-block-round3-fast-resolver-and-render

Conversation

@augustin-cheron

Copy link
Copy Markdown
Collaborator

Summary

  • Foundation Native Resolver Full-Chain Catalog (blockzilla/get-block/resolver):
    • Replaces full in-RAM Vec<ArchiveV2HotBlockIndexRow> (22.5 MiB/epoch -> 24.5 GiB across 1,100 epochs, exceeding MemoryMax=2G) with a 256-row sparse-stride HotIndex (13.5 KiB/epoch -> 14.5 MiB total RAM for 1,100 epochs, 1,700x smaller) backed by a single <= 13.3 KiB pread on the pinned open archive-v2-blocks.index FD.
    • Adds --startup-verify sha256|metadata (sha256 default preserved; metadata admits 1,100+ pre-verified epochs in < 200 ms without reading 450 GB into cgroup page cache) and reuses a thread_local! 64 KiB scratch buffer in Catalog::resolve.
  • VoteTowerSync Ed25519 verify_strict Short-Circuit & Wire Reuse:
    • select_signed_message_candidate_ed25519 stops at the first verified candidate when each instruction's candidates have pairwise-distinct byte slices (guaranteed unique under ed25519_dalek::VerifyingKey::verify_strict), skipping Candidate 1 message serialization and Ed25519 scalar multiplication on modern vote transactions.
    • vote_proof::resolve_message_wire returns the already-serialized & verified wire_message directly into scratch.wire_message, skipping a second key-resolution and message-serialization pass in block_base64.
  • 719.8 MiB/s Worker JSON & Base64 Streaming (+64.5% Faster):
    • $O(1)$ open-addressed pubkey hash table + collision-free per-pubkey Base58 memoization on Resolver (five8::encode_32 runs at most once per unique pubkey across transaction keys, token balances, rewards, and logs).
    • Zero-Vec<String> log streaming (fill_logs_scratch_with_resolver + fast_json_str), vectorized BASE64.encode_slice (base64_bytes), stack [u8; 9] ComputeBudget serialization, and single-pass predecoded (message, metadata) reuse across HotBlockData::collect_references -> stream_full_value_into (6.66 ms -> 4.08 ms, 719.8 MiB/s, SHA-256 verified identical).

@augustin-cheron
augustin-cheron merged commit 4669e5f into main Nov 30, 2026
6 checks passed
@augustin-cheron
augustin-cheron deleted the perf/get-block-round3-fast-resolver-and-render branch November 30, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant