Skip to content

SwiftSync full-chain capstone test (testnet4) #12

@melvincarvalho

Description

@melvincarvalho

A capstone test proving the SwiftSync cancelling accumulator reproduces the real UTXO set across the entire testnet4 chain, validated against ground truth.

What it does

src/_sscapstone.mjs streams every block (genesis..tip, 1..140,503) once and maintains in parallel:

  • acc — the SwiftSync cancelling accumulator (add each created output, subtract each spent one). Its residual = the UTXO set at tip, with no set stored.
  • utxo — the real UTXO set, built the slow way (sharded Set, add/delete). The independent oracle.

It then feeds the survivor set into a fresh accumulator and asserts that digest equals the streaming accumulator's residual. Match ⇒ the stateless construction reproduces the real set. The survivor count is cross-checked against the fully-validated validate-sync run.

assumevalid shape (outpoint-only elements, OP_RETURN/coinbase handled like the UTXO set), salt=null (deterministic reference construction), matching validate.js.

Result — PASS

SwiftSync residual digest  85562fb9cee8b822f19c37473988fc23db71d5d84d503e4f9f15167c0a5a4716
oracle (real set) digest   85562fb9cee8b822f19c37473988fc23db71d5d84d503e4f9f15167c0a5a4716
  • blocks 1..140,503 · 45,882,953 outputs · 31,754,638 inputs (77.6M ops) · 9,582,654 OP_RETURN skipped
  • final UTXO count 14,128,315 vs validate-sync's 14,128,340 @h140,500 (Δ−25 = the 3-block height gap)
  • walk 54.0 min + oracle rebuild 2.1 min, single-threaded JS (does double work: accumulator + explicit oracle set)

This digest is the regression anchor for the SwiftSync package.

Note: a single V8 Set caps near 16.7M entries (incl. delete tombstones before rehash); testnet4's spam region churns past that, so the oracle set is sharded across 256 sub-sets by first txid byte.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions