mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-14 20:20:43 +02:00
Add -datacarrierfullcount option to control applying -datacarriersize to all datacarrying
This commit is contained in:
parent
6da90efc65
commit
7cbe5cde36
@ -644,6 +644,7 @@ void SetupServerArgs(ArgsManager& argsman)
|
|||||||
argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
argsman.AddArg("-bytespersigop", strprintf("Equivalent bytes per sigop in transactions for relay and mining (default: %u)", DEFAULT_BYTES_PER_SIGOP), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||||
argsman.AddArg("-bytespersigopstrict", strprintf("Minimum bytes per sigop in transactions we relay and mine (default: %u)", DEFAULT_BYTES_PER_SIGOP_STRICT), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
argsman.AddArg("-bytespersigopstrict", strprintf("Minimum bytes per sigop in transactions we relay and mine (default: %u)", DEFAULT_BYTES_PER_SIGOP_STRICT), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||||
argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
argsman.AddArg("-datacarrier", strprintf("Relay and mine data carrier transactions (default: %u)", DEFAULT_ACCEPT_DATACARRIER), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
|
||||||
|
argsman.AddArg("-datacarrierfullcount", strprintf("Apply datacarriersize limit to all known datacarrier methods (default: %u)", DEFAULT_DATACARRIER_FULLCOUNT), ArgsManager::ALLOW_ANY | (DEFAULT_DATACARRIER_FULLCOUNT ? uint32_t{ArgsManager::DEBUG_ONLY} : 0), OptionsCategory::NODE_RELAY);
|
||||||
argsman.AddArg("-datacarriersize",
|
argsman.AddArg("-datacarriersize",
|
||||||
strprintf("Relay and mine transactions whose data-carrying raw scriptPubKey "
|
strprintf("Relay and mine transactions whose data-carrying raw scriptPubKey "
|
||||||
"is of this size or less (default: %u)",
|
"is of this size or less (default: %u)",
|
||||||
|
@ -58,6 +58,7 @@ struct MemPoolOptions {
|
|||||||
* If nullopt, any size is nonstandard.
|
* If nullopt, any size is nonstandard.
|
||||||
*/
|
*/
|
||||||
std::optional<unsigned> max_datacarrier_bytes{DEFAULT_ACCEPT_DATACARRIER ? std::optional{MAX_OP_RETURN_RELAY} : std::nullopt};
|
std::optional<unsigned> max_datacarrier_bytes{DEFAULT_ACCEPT_DATACARRIER ? std::optional{MAX_OP_RETURN_RELAY} : std::nullopt};
|
||||||
|
bool datacarrier_fullcount{DEFAULT_DATACARRIER_FULLCOUNT};
|
||||||
bool permit_bare_pubkey{DEFAULT_PERMIT_BAREPUBKEY};
|
bool permit_bare_pubkey{DEFAULT_PERMIT_BAREPUBKEY};
|
||||||
bool permit_bare_multisig{DEFAULT_PERMIT_BAREMULTISIG};
|
bool permit_bare_multisig{DEFAULT_PERMIT_BAREMULTISIG};
|
||||||
bool require_standard{true};
|
bool require_standard{true};
|
||||||
|
@ -90,6 +90,7 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& argsman, const CChainP
|
|||||||
} else {
|
} else {
|
||||||
mempool_opts.max_datacarrier_bytes = std::nullopt;
|
mempool_opts.max_datacarrier_bytes = std::nullopt;
|
||||||
}
|
}
|
||||||
|
mempool_opts.datacarrier_fullcount = argsman.GetBoolArg("-datacarrierfullcount", DEFAULT_DATACARRIER_FULLCOUNT);
|
||||||
|
|
||||||
mempool_opts.require_standard = !argsman.GetBoolArg("-acceptnonstdtxn", DEFAULT_ACCEPT_NON_STD_TXN);
|
mempool_opts.require_standard = !argsman.GetBoolArg("-acceptnonstdtxn", DEFAULT_ACCEPT_NON_STD_TXN);
|
||||||
if (!chainparams.IsTestChain() && !mempool_opts.require_standard) {
|
if (!chainparams.IsTestChain() && !mempool_opts.require_standard) {
|
||||||
|
@ -79,6 +79,8 @@ static const bool DEFAULT_ACCEPT_DATACARRIER = true;
|
|||||||
* +2 for the pushdata opcodes.
|
* +2 for the pushdata opcodes.
|
||||||
*/
|
*/
|
||||||
static const unsigned int MAX_OP_RETURN_RELAY = 83;
|
static const unsigned int MAX_OP_RETURN_RELAY = 83;
|
||||||
|
/** Default for -datacarrierfullcount */
|
||||||
|
static constexpr bool DEFAULT_DATACARRIER_FULLCOUNT{false};
|
||||||
/**
|
/**
|
||||||
* An extra transaction can be added to a package, as long as it only has one
|
* An extra transaction can be added to a package, as long as it only has one
|
||||||
* ancestor and is no larger than this. Not really any reason to make this
|
* ancestor and is no larger than this. Not really any reason to make this
|
||||||
|
@ -967,7 +967,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
|
|||||||
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, reason);
|
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!ignore_rejects.count("txn-datacarrier-exceeded")) && DatacarrierBytes(tx, m_view) > m_pool.m_max_datacarrier_bytes.value_or(0)) {
|
if (m_pool.m_opts.datacarrier_fullcount && (!ignore_rejects.count("txn-datacarrier-exceeded")) && DatacarrierBytes(tx, m_view) > m_pool.m_opts.max_datacarrier_bytes.value_or(0)) {
|
||||||
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "txn-datacarrier-exceeded");
|
return state.Invalid(TxValidationResult::TX_INPUTS_NOT_STANDARD, "txn-datacarrier-exceeded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1285,7 +1285,7 @@ class TaprootTest(BitcoinTestFramework):
|
|||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.num_nodes = 1
|
self.num_nodes = 1
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.extra_args = [["-par=1"]]
|
self.extra_args = [["-par=1", "-datacarrierfullcount"]]
|
||||||
|
|
||||||
def block_submit(self, node, txs, msg, err_msg, cb_pubkey=None, fees=0, sigops_weight=0, witness=False, accept=False):
|
def block_submit(self, node, txs, msg, err_msg, cb_pubkey=None, fees=0, sigops_weight=0, witness=False, accept=False):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user