Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jul 13, 2022

-mempoolfullrbf allows valid replacement transactions into the mempool, even if they do not signal for BIP125. If it is set, it would be confusing if the wallet and RPC didn't signal for BIP125 replacement:

  • The wallet will refuse to replace non-signalling transactions.
  • However, such transactions may be replaced over RPC or P2P.
  • Such replacements may not propagate well over the P2P network.

So to prevent those issues in the normal case, adjust the default for -walletrbf as well as the RPC raw transactions API.

It is still possible for users to set -mempoolfullrbf=1 -walletrbf=0, as well as passing in the replaceable=False option to each RPC, if they wish. Or to leave the -mempoolfullrbf default value: off.

Copy link
Member

@darosior darosior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@fanquake fanquake requested review from ariard, glozow and instagibbs July 13, 2022 09:27
@maflcko maflcko force-pushed the 2207-rpc-wallet-replace- branch from faffb06 to fac6ce4 Compare July 13, 2022 11:04
@glozow glozow requested a review from achow101 July 13, 2022 12:25
Copy link
Member

@glozow glozow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK based on the description, will review more closely soon

@achow101
Copy link
Member

Tend to NACK

I would expect that -walletrbf would default to 1 sooner than -mempoolfullrbf will default to 1, so having these tied just makes it more annoying to make that change. Otherwise, I agree that it would make sense to default -walletrbf=1 when -mempoolfullrbf=1.

Copy link

@ariard ariard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I think #25610 is a better approach rather than coupling wallet and mempool settings.

if (!request.params[3].isNull()) {
rbf = request.params[3].isTrue();
}
const bool rbf{request.params[3].isNull() ? args.GetBoolArg("-mempoolfullrbf", DEFAULT_MEMPOOL_FULL_RBF) : request.params[3].getBool()};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the following works, though I would rather do some wallet options encapsulations like done with MemPoolOptions. I believe the wallet could have its own default transaction-relay policy settings in case the mempool ones are bigger (e.g if local limitdescendantsize=100, still makes sense to propagate chain of transactions of max size=25)

diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 263baa3c9..dc9f02160 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -305,8 +305,9 @@ static RPCHelpMan createrawtransaction()
         }, true
     );
     const ArgsManager& args{EnsureAnyArgsman(request.context)};
+    const NodeContext& node = EnsureAnyNodeContext(request.context);
 
-    const bool rbf{request.params[3].isNull() ? args.GetBoolArg("-mempoolfullrbf", DEFAULT_MEMPOOL_FULL_RBF) : request.params[3].getBool()};
+    const bool rbf{request.params[3].isNull() ? node.mempool->m_full_rbf : request.params[3].getBool()};
     CMutableTransaction rawTx = ConstructTransaction(request.params[0], request.params[1], request.params[2], rbf);
 
     return EncodeHexTx(CTransaction(rawTx));

@DrahtBot
Copy link
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #25610 (wallet, rpc: Opt in to RBF by default by achow101)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko maflcko closed this Jul 14, 2022
@maflcko maflcko deleted the 2207-rpc-wallet-replace-🌡 branch July 14, 2022 06:25
@bitcoin bitcoin locked and limited conversation to collaborators Jul 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants