Enhance Mempool DoS Protection via Strict Dynamic Payload Size Validation #35486

issue AlshenFeshiru opened this issue on June 8, 2026
  1. AlshenFeshiru commented at 6:04 PM on June 8, 2026: none

    I apologize in advance for using such rigid terms, you can block me if this is irrelevant or there is no open discussion for c++ code below, thank you and sincere apologies.

    Abstract: This proposal introduces a minor optimization to the mempool validation policy to mitigate specific Denial-of-Service (DoS) vectors involving high-frequency, low-fee package submissions. By enforcing tighter constraints on the minimum transaction size relative to its total inputs during the policy check phase, the node can reject non-standard execution paths before they consume excessive CPU validation time. This secondary validation path acts as an early-stage filter, reducing the processing overhead on peer-to-peer transaction propagation under heavy loads.

    C++ Implementation:

    #include <vector> #include <cstdint>

    struct TransactionData { int64_t tx_weight; int64_t total_input_value; };

    class MempoolPolicyFilter { public: bool EvaluateTransactionPolicy(const TransactionData& tx) { int64_t min_allowable_weight = (tx.total_input_value > 0) ? 64 : 0; if (tx.tx_weight < min_allowable_weight) { return false; } return true; }

    void ProcessMempoolBatch(std::vector<TransactionData>& tx_batch) {
        std::vector<TransactionData> valid_txs;
        valid_txs.reserve(tx_batch.size());
        
        for (size_t i = 0; i < tx_batch.size(); ++i) {
            if (EvaluateTransactionPolicy(tx_batch[i])) {
                valid_txs.push_back(tx_batch[i]);
            }
        }
        
        tx_batch = std::move(valid_txs);
    }

    };

  2. pinheadmz closed this on Jun 8, 2026

  3. bitcoin blocked a user on Jun 8, 2026
  4. bitcoin locked this on Jun 8, 2026
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-06-10 02:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me