Found using differential fuzzing (bitcoinfuzz) that rust-bitcoin rejects 46-byte version messages that Bitcoin Core and btcd would accept it.
rust-bitcoin requires all 9 fields, while Bitcoin Core treats fields after receiver as optional (for pre-protocol-106 compatibility).
Bitcoin Core behavior (net_processing.cpp:3559-3621 https://github.com/bitcoin/bitcoin/blob/1f8f7d477ae0d33bd96f7936889c17bd40805fb9/src/net_processing.cpp#L3604)
// Mandatory: version, services, timestamp, addr_recv (46 bytes)
vRecv >> nVersion >> nServices >> nTime;
vRecv >> addrMe;
// Optional: each checked with !vRecv.empty()
if (!vRecv.empty()) { vRecv.ignore(26); vRecv >> nNonce; }
if (!vRecv.empty()) { vRecv >> strSubVer; }
if (!vRecv.empty()) { vRecv >> starting_height; }
if (!vRecv.empty()) { vRecv >> fRelay; }
Defaults: nonce=1, user_agent="", start_height=-1, relay=true
Should rust-bitcoin match Bitcoin Core's optional field handling, or is the current strictness intentional?
Found using differential fuzzing (bitcoinfuzz) that rust-bitcoin rejects 46-byte version messages that Bitcoin Core and btcd would accept it.
rust-bitcoin requires all 9 fields, while Bitcoin Core treats fields after
receiveras optional (for pre-protocol-106 compatibility).Bitcoin Core behavior (
net_processing.cpp:3559-3621https://github.com/bitcoin/bitcoin/blob/1f8f7d477ae0d33bd96f7936889c17bd40805fb9/src/net_processing.cpp#L3604)Defaults:
nonce=1,user_agent="",start_height=-1,relay=trueShould rust-bitcoin match Bitcoin Core's optional field handling, or is the current strictness intentional?