Skip to content

Instantly share code, notes, and snippets.

@svanstaa
svanstaa / p2p_utxo_set_share_dos.py
Last active April 20, 2026 17:45
DoS resistance tests for bitcoin/bitcoin#35054 (P2P UTXO set sharing)
#!/usr/bin/env python3
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test P2P UTXO set sharing DoS resistance.
Demonstrates that the serving node handles abusive request patterns
from peers on a local regtest network: repeated getutxosetinfo spam,
rapid duplicate chunk requests, concurrent serving to many peers,
slow-reading peers filling send buffers, and lack of banning on