Skip to content

Deep Fuzz: Masternode List Deterministic Diffs #335

@thepastaclaw

Description

@thepastaclaw

Deep Fuzz: Masternode List Deterministic Diffs

Parent: Fuzzing initiative (mega PR on ci/fuzz-regression)

Goal

Fuzz the deterministic masternode list diff computation — the mechanism SPV/light clients use to sync the MN list. An error here means light clients see a different MN list than full nodes, which is a consensus split for LLMQ-based features (ChainLocks, InstantSend).

Attack Surface

  • CDeterministicMNManager::GetListDiffForBlock() — computes diffs between MN list states
  • CDeterministicMNList::ApplyDiff() — applies diffs to reconstruct lists
  • CSimplifiedMNListDiff serialization/deserialization — what goes over the wire
  • ProRegTx/ProUpServTx/ProUpRegTx/ProUpRevTx application to the MN list

Harness Design

  1. Initialize TestingSetup with a small deterministic MN list (10-20 masternodes)
  2. Use FuzzedDataProvider to generate sequences of ProReg/ProUpServ/ProUpReg/ProUpRev transactions
  3. Apply each transaction to the MN list, compute diff, apply diff to a second list
  4. Assert both lists match (roundtrip consistency)
  5. Also fuzz CSimplifiedMNListDiff deserialization with structured inputs

Corpus Strategy

  • Chain data: Extract ProRegTx, ProUpServTx, ProUpRegTx, ProUpRevTx from mainnet (thousands available)
  • Simulated: Construct valid MN registration sequences with known keys, then apply update/revoke sequences. Vary: operator key rotations, service address changes, payout address changes, revocation reasons
  • Diff roundtrip: Serialize a known MN list state, compute diff, serialize diff, deserialize, apply — verify consistency

Checklist

  • Study MN list management in src/evo/deterministicmns.cpp
  • Study simplified MN list diff in src/evo/simplifiedmns.cpp
  • Design harness with initial MN list population
  • Extract ProReg/ProUp* TXs from mainnet for corpus
  • Build structured MN operation sequence generator
  • Write harness with diff roundtrip assertion
  • Add to ci/fuzz-regression branch
  • Push corpus to thepastaclaw/qa-assets

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-reviewSub-agent completed work, awaiting main session review/PRp2-normalRegular queue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions