Skip to content

Commit 0903ce8

Browse files
committed
Merge bitcoin/bitcoin#30592: Remove mempoolfullrbf
c189eec doc: release note for mempoolrullrbf removal (Greg Sanders) d47297c rpc: Mark fullrbf and bip125-replaceable as deprecated (Greg Sanders) 04a5dce docs: remove requirement to signal bip125 (Greg Sanders) 111a23d Remove -mempoolfullrbf option (Greg Sanders) Pull request description: Given bitcoin/bitcoin#30493 and the related discussion on network uptake it's probably not helpful to have an option for a feature that will not be respected by the network in any meaningful way. Wallet changes can be done in another PR on its own cadence to account for possible fingerprinting, waiting for fullrbf logic to permeate the network, etc. ACKs for top commit: stickies-v: re-ACK c189eec achow101: ACK c189eec murchandamus: ACK c189eec rkrux: reACK c189eec Tree-SHA512: 9447f88f8f291c56c5bde70af0a91b0a4f5163aaaf173370fbfdaa3c3fd0b44120b14d3a1977f7ee10e27ffe9453f8a70dd38aad0ffb8c39cf145049d2550730
2 parents f842d08 + c189eec commit 0903ce8

12 files changed

+20
-241
lines changed

doc/bips.md

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ BIPs that are implemented by Bitcoin Core:
3434
* [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)).
3535
* [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
3636
* [`BIP 113`](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/bitcoin/bitcoin/pull/6566)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).
37-
* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee partially implemented: signaling is enforced if configured. For other replacement rules, see doc/policy/mempool-replacements.md.
3837
* [`BIP 130`](https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/bitcoin/bitcoin/pull/6494)).
3938
* [`BIP 133`](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/bitcoin/bitcoin/pull/7542)).
4039
* [`BIP 141`](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)), defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), and *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)).

doc/policy/mempool-replacements.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@ A transaction ("replacement transaction") may replace its directly conflicting t
1010
their in-mempool descendants (together, "original transactions") if, in addition to passing all
1111
other consensus and policy rules, each of the following conditions are met:
1212

13-
1. If `-mempoolfullrbf=0` (the value is 1 by default), the directly conflicting transactions all signal replaceability explicitly. A transaction is
14-
signaling BIP125 replaceability if any of its inputs have an nSequence number less than (0xffffffff - 1).
15-
A transaction also signals replaceability if its version field is set to 3.
16-
17-
*Rationale*: See [BIP125
18-
explanation](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki#motivation).
13+
1. (Removed)
1914

2015
2. The replacement transaction only include an unconfirmed input if that input was included in
2116
one of the directly conflicting transactions. An unconfirmed input spends an output from a
@@ -80,3 +75,5 @@ This set of rules is similar but distinct from BIP125.
8075
#25353](https://github.com/bitcoin/bitcoin/pull/25353)).
8176

8277
* Full replace-by-fee is the default policy as of **v28.0** ([PR #30493](https://github.com/bitcoin/bitcoin/pull/30493)).
78+
79+
* Signaling for replace-by-fee is no longer required as of [PR 30592](https://github.com/bitcoin/bitcoin/pull/30592).

doc/policy/packages.md

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ The following rules are enforced for all packages:
3838

3939
* Only limited package replacements are currently considered. (#28984)
4040

41-
- If `-mempoolfullrbf=0` (the value is 1 by default), all direct conflicts must signal replacement.
42-
4341
- Packages are 1-parent-1-child, with no in-mempool ancestors of the package.
4442

4543
- All conflicting clusters (connected components of mempool transactions) must be clusters of up to size 2.

doc/release-notes-30592.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Full Replace-By-Fee
2+
===================
3+
4+
Starting with v28.0, the `mempoolfullrbf` startup option was set to
5+
default to `1`. With widespread adoption of this policy, users no longer
6+
benefit from disabling it, so the option has been removed, making full
7+
replace-by-fee the standard behavior. (#30592)

src/init.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,6 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
637637
"is of this size or less (default: %u)",
638638
MAX_OP_RETURN_RELAY),
639639
ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
640-
argsman.AddArg("-mempoolfullrbf", strprintf("(DEPRECATED) Accept transaction replace-by-fee without requiring replaceability signaling (default: %u)", DEFAULT_MEMPOOL_FULL_RBF), ArgsManager::ALLOW_ANY, OptionsCategory::NODE_RELAY);
641640
argsman.AddArg("-permitbaremultisig", strprintf("Relay transactions creating non-P2SH multisig outputs (default: %u)", DEFAULT_PERMIT_BAREMULTISIG), ArgsManager::ALLOW_ANY,
642641
OptionsCategory::NODE_RELAY);
643642
argsman.AddArg("-minrelaytxfee=<amt>", strprintf("Fees (in %s/kvB) smaller than this are considered zero fee for relaying, mining and transaction creation (default: %s)",

src/kernel/mempool_options.h

-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ static constexpr unsigned int DEFAULT_MAX_MEMPOOL_SIZE_MB{300};
2121
static constexpr unsigned int DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB{5};
2222
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
2323
static constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY_HOURS{336};
24-
/** Default for -mempoolfullrbf, if the transaction replaceability signaling is ignored */
25-
static constexpr bool DEFAULT_MEMPOOL_FULL_RBF{true};
2624
/** Whether to fall back to legacy V1 serialization when writing mempool.dat */
2725
static constexpr bool DEFAULT_PERSIST_V1_DAT{false};
2826
/** Default for -acceptnonstdtxn */
@@ -55,7 +53,6 @@ struct MemPoolOptions {
5553
std::optional<unsigned> max_datacarrier_bytes{DEFAULT_ACCEPT_DATACARRIER ? std::optional{MAX_OP_RETURN_RELAY} : std::nullopt};
5654
bool permit_bare_multisig{DEFAULT_PERMIT_BAREMULTISIG};
5755
bool require_standard{true};
58-
bool full_rbf{DEFAULT_MEMPOOL_FULL_RBF};
5956
bool persist_v1_dat{DEFAULT_PERSIST_V1_DAT};
6057
MemPoolLimits limits{};
6158

src/node/mempool_args.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& argsman, const CChainP
9292
return util::Error{strprintf(Untranslated("acceptnonstdtxn is not currently supported for %s chain"), chainparams.GetChainTypeString())};
9393
}
9494

95-
mempool_opts.full_rbf = argsman.GetBoolArg("-mempoolfullrbf", mempool_opts.full_rbf);
96-
if (!mempool_opts.full_rbf) {
97-
LogInfo("Warning: mempoolfullrbf=0 set but deprecated and will be removed in a future release\n");
98-
}
99-
10095
mempool_opts.persist_v1_dat = argsman.GetBoolArg("-persistmempoolv1", mempool_opts.persist_v1_dat);
10196

10297
ApplyArgsManOptions(argsman, mempool_opts.limits);

src/rpc/mempool.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static std::vector<RPCResult> MempoolEntryDescription()
277277
{RPCResult{RPCResult::Type::STR_HEX, "transactionid", "parent transaction id"}}},
278278
RPCResult{RPCResult::Type::ARR, "spentby", "unconfirmed transactions spending outputs from this transaction",
279279
{RPCResult{RPCResult::Type::STR_HEX, "transactionid", "child transaction id"}}},
280-
RPCResult{RPCResult::Type::BOOL, "bip125-replaceable", "Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability.\n"},
280+
RPCResult{RPCResult::Type::BOOL, "bip125-replaceable", "Whether this transaction signals BIP125 replaceability or has an unconfirmed ancestor signaling BIP125 replaceability. (DEPRECATED)\n"},
281281
RPCResult{RPCResult::Type::BOOL, "unbroadcast", "Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)"},
282282
};
283283
}
@@ -682,7 +682,7 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool)
682682
ret.pushKV("minrelaytxfee", ValueFromAmount(pool.m_opts.min_relay_feerate.GetFeePerK()));
683683
ret.pushKV("incrementalrelayfee", ValueFromAmount(pool.m_opts.incremental_relay_feerate.GetFeePerK()));
684684
ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()});
685-
ret.pushKV("fullrbf", pool.m_opts.full_rbf);
685+
ret.pushKV("fullrbf", true);
686686
return ret;
687687
}
688688

@@ -704,7 +704,7 @@ static RPCHelpMan getmempoolinfo()
704704
{RPCResult::Type::STR_AMOUNT, "minrelaytxfee", "Current minimum relay fee for transactions"},
705705
{RPCResult::Type::NUM, "incrementalrelayfee", "minimum fee rate increment for mempool limiting or replacement in " + CURRENCY_UNIT + "/kvB"},
706706
{RPCResult::Type::NUM, "unbroadcastcount", "Current number of transactions that haven't passed initial broadcast yet"},
707-
{RPCResult::Type::BOOL, "fullrbf", "True if the mempool accepts RBF without replaceability signaling inspection"},
707+
{RPCResult::Type::BOOL, "fullrbf", "True if the mempool accepts RBF without replaceability signaling inspection (DEPRECATED)"},
708708
}},
709709
RPCExamples{
710710
HelpExampleCli("getmempoolinfo", "")

src/validation.cpp

+2-22
Original file line numberDiff line numberDiff line change
@@ -816,30 +816,10 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
816816
const CTransaction* ptxConflicting = m_pool.GetConflictTx(txin.prevout);
817817
if (ptxConflicting) {
818818
if (!args.m_allow_replacement) {
819-
// Transaction conflicts with a mempool tx, but we're not allowing replacements.
819+
// Transaction conflicts with a mempool tx, but we're not allowing replacements in this context.
820820
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "bip125-replacement-disallowed");
821821
}
822-
if (!ws.m_conflicts.count(ptxConflicting->GetHash()))
823-
{
824-
// Transactions that don't explicitly signal replaceability are
825-
// *not* replaceable with the current logic, even if one of their
826-
// unconfirmed ancestors signals replaceability. This diverges
827-
// from BIP125's inherited signaling description (see CVE-2021-31876).
828-
// Applications relying on first-seen mempool behavior should
829-
// check all unconfirmed ancestors; otherwise an opt-in ancestor
830-
// might be replaced, causing removal of this descendant.
831-
//
832-
// All TRUC transactions are considered replaceable.
833-
//
834-
// Replaceability signaling of the original transactions may be
835-
// ignored due to node setting.
836-
const bool allow_rbf{m_pool.m_opts.full_rbf || SignalsOptInRBF(*ptxConflicting) || ptxConflicting->version == TRUC_VERSION};
837-
if (!allow_rbf) {
838-
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY, "txn-mempool-conflict");
839-
}
840-
841-
ws.m_conflicts.insert(ptxConflicting->GetHash());
842-
}
822+
ws.m_conflicts.insert(ptxConflicting->GetHash());
843823
}
844824
}
845825

0 commit comments

Comments
 (0)