Skip to content

fast-sync C: native P2P messages via a vendored btcd wire (getanchors/anchors, getcas/cas) #122

Description

@LiranCohen

Part of the ION fast-sync overlay epic #111. Option C — the native-P2P transport, complementing the HTTP gateway (#115).

btcd's wire.makeEmptyMessage is a closed switch, so custom commands can't ride the existing Bitcoin connection (verified on #115). The chosen path: vendor a small btcd fork (13x-tech/btcd) adding ONLY the ION messages we need, via a go.mod replace (same pattern the repo already uses for go-jose). Upstream them later if demand warrants.

Messages (handshake-gated by ServiceION #114)

  • getanchors{fromHeight,toHeight}anchors{[]Bundle} — a bounded height range of verifiable bundles.
  • getcas{[]CID}cas{[]blob} — content-addressed blobs, self-verifying.

Each implements wire.Message (BtcEncode/BtcDecode/Command/MaxPayloadLength) with strict size bounds, and is registered in the forked makeEmptyMessage. The p2p client's listeners handle them, calling the SAME fastsync.Service as the HTTP gateway (#115) — only the transport differs; the trust model (verify against own PoW chain) is identical.

Notes

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