mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
db9888feecnet: detect wrong-network V1 talking to V2Transport (Pieter Wuille)91e1ef8684test: add unit tests for V2Transport (Pieter Wuille)297c888997net: make V2Transport preallocate receive buffer space (Pieter Wuille)3ffa5fb49enet: make V2Transport send uniformly random number garbage bytes (Pieter Wuille)0be752d9f8net: add short message encoding/decoding support to V2Transport (Pieter Wuille)8da8642062net: make V2Transport auto-detect incoming V1 and fall back to it (Pieter Wuille)13a7f01557net: add V2Transport class with subset of BIP324 functionality (Pieter Wuille)dc2d7eb810crypto: Spanify EllSwiftPubKey constructor (Pieter Wuille)5f4b2c6d79net: remove unused Transport::SetReceiveVersion (Pieter Wuille)c3fad1f29dnet: add have_next_message argument to Transport::GetBytesToSend() (Pieter Wuille) Pull request description: This is part of #27634. This implements the BIP324 v2 transport (which implements all of what the BIP calls transport layer *and* application layer), though in a non-exposed way. It is tested through an extensive fuzz test, which verifies that v2 transports can talk to v2 transports, and v1 transports can talk to v2 transports, and a unit test that exercises a number of unusual scenarios. The transport is functionally complete, including: * Autodetection of incoming V1 connections. * Garbage, both sending and receiving. * Short message type IDs, both sending and receiving. * Ignore packets (receiving only, but tested in a unit test). * Session IDs are visible in `getpeerinfo` output (for manual comparison). Things that are not included, left for future PRs, are: * Actually using the v2 transport for connections. * Support for the `NODE_P2P_V2` service flag. * Retrying downgrade to V1 when attempted outbound V2 connections immediately fail. * P2P functional and unit tests ACKs for top commit: naumenkogs: ACKdb9888feectheStack: re-ACKdb9888feecmzumsande: Code Review ACKdb9888feecTree-SHA512: 8906ac1e733a99e1f31c9111055611f706d80bbfc2edf6a07fa6e47b21bb65baacd1ff17993cbbf588063b2f5ad30b3af674a50c7bc8e8ebf4671483a21bbfeb