Summary:
This proposal introduces a policy-level optimization to the Bitcoin Core mempool validation layer to mitigate potential Denial-of-Service (DoS) vectors stemming from high-frequency, low-weight transaction submissions. By imposing strict minimal transaction weight guidelines relative to enter buildings in the course of the preliminary coverage validation part, nodes can filter out non-standard, economically unviable transaction paths earlier than allocating crucial CPU validation time or propagating them additional throughout the peer-to-peer community.
Motivation:
The Bitcoin mempool framework depends on coverage checks to stop useful resource exhaustion assaults. Whereas minimal relay charges filter out customary spam, particular anomalies involving transactions with abnormally low weights relative to their execution overhead can introduce pointless validation pressure. Implementing an early-stage weight filter inside the usual transaction validation sequence offers an express, light-weight layer of protection in opposition to low-fee payload flooding.
Specification:
This optimization integrates instantly into Bitcoin Core’s native validation pipeline. As a substitute of working standalone mock buildings, the logic applies on to the usual transaction reference sorts (CTransactionRef) and populates the validation state machine (TxValidationState) in response to customary inside error codes.
C++ Implementation Draft:
#embrace <consensus/validation.h>
#embrace <primitives/transaction.h>
#embrace <coverage/coverage.h>
bool CheckTransactionWeightPolicy(const CTransactionRef& tx, TxValidationState& state) {
constexpr int64_t MIN_STANDARD_MEMP_WEIGHT = 64;
if (!tx->vin.empty()) {
int64_t current_tx_weight = GetTransactionWeight(*tx);
if (current_tx_weight < MIN_STANDARD_MEMP_WEIGHT) {
return state.Invalid(TxValidationResult::TX_NOT_STANDARD,
"tx-weight-below-mempool-policy",
"Transaction weight is beneath the minimal required coverage threshold.");
}
}
return true;
}
Backward Compatibility:
This proposal is strictly a node-level validation coverage configuration (mempool coverage rule). It doesn’t introduce adjustments to the consensus layer or alter core block verification mechanics. Transactions failing this particular rule are rejected from native mempool storage and peer relay, however stay utterly legitimate if mined into an precise block, sustaining full community compatibility and stopping any danger of consensus divergence.
