Skip to content

[btc-hardening][kyoto] migrate to upstream bip157 v0.5.0#488

Open
0xsiddharthks wants to merge 3 commits intomainfrom
siddharth/kyoto-upgrade
Open

[btc-hardening][kyoto] migrate to upstream bip157 v0.5.0#488
0xsiddharthks wants to merge 3 commits intomainfrom
siddharth/kyoto-upgrade

Conversation

@0xsiddharthks
Copy link
Copy Markdown
Contributor

@0xsiddharthks 0xsiddharthks commented Apr 26, 2026

Replace our kyoto dependency from my fork of the 2140-dev/kyoto repo with the latest official release.

Replace the 0xsiddharthks/kyoto fork (siddharth/upgrades, rev f2ba601c)
with crates.io bip157 = "0.5.0". All four features the fork carried
landed upstream:

  - get_header(height)            -> PR #563
  - height_of_hash(hash)          -> PR #564 (canonical-only semantics)
  - whitelist_only()              -> PR #565 folded into #567
  - hostname trusted peers        -> PR #566 (redesigned in review)

Adapt to upstream's API changes:

  - DnsPeer removed. Use TrustedPeer::from_hostname(host, port) and the
    Builder::add_peer{,s} APIs over TrustedPeer instead of the old
    add_dns_peer{,s}.
  - Note v0.5.0 consumes hostname peers on use (popped from the
    whitelist when first tried, never reinstated). Re-resolution
    requires rebuilding the kyoto node, which our connectivity
    supervisor already does on consecutive failures.
  - broadcast_tx renamed to submit_package(impl Into<Package>). We
    pass a Transaction directly via the From<Transaction> for Package
    impl, so the call site is a one-line rename with the same return
    type (Wtxid).

Requester::height_of_hash now returns None for non-canonical hashes
(canonical-only via #564). The hashi call site already treats Ok(None)
as "block not on canonical chain" so this tightens correctness for
free with no behavior change. Soften the surrounding warn from
"possibly malicious" to acknowledge sync lag and recent reorgs as the
more common explanations.

We also inherit BIP-130 sendheaders, the new/tried peer fallback fix,
the late-CF-header ban fix, plus rescan_from(height), chain_tip(),
peer_info(), and Package::new_one_parent_one_child for future use.
- Promote kyoto/bip157 to [workspace.dependencies] for consistency
- Trim doc comments back toward pre-PR style
- Tighten the warn! when bitcoind reports a hash kyoto hasn't seen yet
@0xsiddharthks 0xsiddharthks marked this pull request as ready for review April 27, 2026 21:45
@0xsiddharthks 0xsiddharthks changed the title [kyoto] migrate to upstream bip157 v0.5.0 [1/n][btc-hardening][kyoto] migrate to upstream bip157 v0.5.0 Apr 27, 2026
* [kyoto] tighten supervisor restart threshold to 15 failures
@0xsiddharthks 0xsiddharthks changed the title [1/n][btc-hardening][kyoto] migrate to upstream bip157 v0.5.0 [btc-hardening][kyoto] migrate to upstream bip157 v0.5.0 Apr 27, 2026
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