Useful for anyone using third-party scripts to make use of RBF functionality.
Defaults to sending txs with full-RBF off.
Useful for anyone using third-party scripts to make use of RBF functionality.
Defaults to sending txs with full-RBF off.
404 | @@ -405,6 +405,7 @@ std::string HelpMessage(HelpMessageMode mode) 405 | strUsage += HelpMessageOpt("-txconfirmtarget=<n>", strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"), DEFAULT_TX_CONFIRM_TARGET)); 406 | strUsage += HelpMessageOpt("-maxtxfee=<amt>", strprintf(_("Maximum total fees (in %s) to use in a single wallet transaction; setting this too low may abort large transactions (default: %s)"), 407 | CURRENCY_UNIT, FormatMoney(DEFAULT_TRANSACTION_MAXFEE))); 408 | + strUsage += HelpMessageOpt("-optintofullrbf", strprintf(_("Send transactions with full-RBF opt-in enabled (default: %u)"), DEFAULT_OPT_INTO_FULL_RBF));
Parameter names shouldn't imply a default value (as "opt-in" does).
Perhaps -walletusefullrbf
-walletrbf maybe?
Also, don't forget the #ifdef ENABLE_WALLET guard...
I think everything is under an ENABLE_WALLET guard; did I miss something?
Re: name, other names like -spendzeroconfchange and -sendfreetransactions have similar grammar as -optintofullrbf, so I'm inclined to continue that pattern.
No, I just failed to expand more of the code visible here.
Cool, thanks for reminding me though - that it was under ENABLE_WALLET was just luck.
This is confusing, is it full RBF or opt-in RBF ? We've been using fullRBF to refer to the relay policy that ignores the opt-in flag and always does RBF regardless of the sender's intentions. Can you just call it optinRBF instead of optinfullRBF ?
Agree with @luke-jr 's suggestion: -walletrbf.
utACK
utACK
utACK, but does the wallet actually support the re-creation of a transaction in any sane way? Or is this a political thing?
concept ACK only if the wallet actually allows you to re-broadcast a replacement.
@dcousens I suppose it's useful for testing software-- e.g. if you want something that identifies these transactions you need to generate some, if nothing else. Actual replacement will be a non-trivial amount of work. Concept ACK at least...
if you want something that identifies these transactions you need to generate some, if nothing else
Then use sendrawtransaction?
Actual replacement will be a non-trivial amount of work.
IMHO, then that is what should prefix this flag. Otherwise its just misleading.
Real world use case: Core's wallet is used in day-to-day operation, but occasionally stuck transactions need replacing to get confirmed, which the user then uses an external script for. It's not pretty, but it's a real use case.
If it was only needed for testing stuff, I'd say +1 to just telling people to use sendrawtransaction also - or modify the code.
@dcousens I have scripts that do the rebroadcast, and using those scripts is a pain if Bitcoin Core isn't already sending txs with opt-in enabled, allowing those scripts to be used with existing txs. I'm sure we'll have even better support in the future, but this is a trivial first-step.
Particularly with the opt-in defaulting to false, I can't see how this is political - we're just making it a little easier to use a feature that we've already merged.
Real world use case: Core's wallet is used in day-to-day operation, but occasionally stuck transactions need replacing to get confirmed, which the user then uses an external script for. It's not pretty, but it's a real use case.
Sure, concept ACK then.
I can't see how this is political - we're just making it a little easier to use a feature that we've already merged.
If you don't accept the above use case as a possibility, then, IMHO, it didn't really serve any other purpose.
I didn't personally think people would be mixing scripts and the UI.
Rebased
Just changed this to set nSequence to maxint-2 instead, so that more of the nSequence bits are identical to non-opt-in behavior.
This might come in handy if we, for instance, ever implement proof-of-stake blocksize voting and need a default option that matches what most wallets already do.
re-ACK , but, if the idea is future proofing it. Why not just allow say 64 nSequence bits?
What do you mean by "100 nSequence bits"?
On 2 December 2015 12:32:11 GMT+08:00, Daniel Cousens notifications@github.com wrote:
re-ACK, but, if the idea is future proofing it. Why not just allow say 100
nSequencebits?
Reply to this email directly or view it on GitHub: #7132 (comment)
maxint-64
Sorry, I don't see what's the advantage of that; maxint-2 seems simpler.
On 2 December 2015 12:38:06 GMT+08:00, Daniel Cousens notifications@github.com wrote:
maxint-64
Reply to this email directly or view it on GitHub: #7132 (comment)
@petertodd my understanding is you're expanding the non-opt-in space by 1 to allow for possible future usage. Why only increase that space by 1 bit, and not say 5 bits?
Oh! That's not at all what I'm doing! This is just the wallet code; I'm changing what txs the wallet produces, not changing the rules for what is considered RBF opt-in.
On 2 December 2015 12:43:47 GMT+08:00, Daniel Cousens notifications@github.com wrote:
@petertodd my understanding is you're expanding the non-opt-in space by 1 to allow for possible future usage. Why only increase that space by 8 bits, and not say 64 bits?
Reply to this email directly or view it on GitHub: #7132 (comment)
@petertodd my bad. Lost context.
On that note then, why not 0 as discussed in #6871 (comment)?
@dcousens Because of #7132 (comment)
Remember that all we need is for all users' to be using the same nSequence number for a given type of tx; for privacy the common standard is what matters, not exactly what number we pick.
Sure.
Concept ACK
Tend to NACK. I think there should be an option to selective opt-in a wtx. I guess some users like to use RBF by default, but still want to capability to create a non-RBF transaction if they spend to a "0-conf-merchant" (BitPay, Coinbase, etc.).
I think base work for this (starting with rawtx command) could be #7159.
Agree with @jonasschnelli here, a global option is too coarse, need a way to have control over this per transaction.
Why not both?
On 25 April 2016 05:43:48 GMT-04:00, "Wladimir J. van der Laan" notifications@github.com wrote:
Agree with @jonasschnelli here, a global option is too coarse, need a way to have control over this per transaction.
You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: #7132 (comment)
Especially as it's aimed at third-party scripts it is better if those scripts can specify the option, without requiring the user to change yet another option before they can be used.
Rebased
needs rebase
Rebased
Would this work with -mempoolreplacement=0 ? Seems like the node will reject these. Perhaps check for that flag too.
further nit: anything "optin" will become "optout" if the default changes, so perhaps: "sendfullrbf"? Makes it clearer it's about sending, not mempool replacement.
concept ACK, I'd really like something for 0.13.
2327 | + // Note how the sequence number is set to non-maxint so that 2328 | + // the nLockTime set above actually works. 2329 | BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) 2330 | txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(), 2331 | - std::numeric_limits<unsigned int>::max()-1)); 2332 | + std::numeric_limits<unsigned int>::max() - (fOptIntoFullRbf ? 2 : 1)));
Maybe constants for 1 and 2?
those numbers aren't special, the 1st number just has to be bigger than 1. Not sure if that's a candidate for constant.
Mqybe more documentation solves it. I just cannot look at that line without wondering what the heck 1 and 2 mean...
Fair enough. The comment should be revised further.
How about this comment:
"BIP125 defines opt-in RBF as any nSequence < maxint-1, so we use the highest possible value in that range (maxint-2) to avoid conflicting with other possible uses of nSequence, and in the spirit of "smallest posible change from prior behavior""
Nit: Maybe we could introduce std::numeric_limits<unsigned int>::max()-1 as some constant somewhere. SEQUENCE_OPT_OUT = std::numeric_limits<unsigned int>::max()-1 is used in other places (mempool) as well.
And then comment here "Use any value less than SEQUENCE_OPT_OUT according to BIP125." or use the comment you wrote above.
fOptIntoFullRbf ? SEQUENCE_OPT_OUT -1 : SEQUENCE_OPT_OUT
It's clrearer to me than:
std::numeric_limits<unsigned int>::max() - (fOptIntoFullRbf ? 2 : 1)
Specially with the ""Use any value less than SEQUENCE_OPT_OUT..." comment.
Is there anything blocking this? (besides needing rebase again, sorry)
Concept ACK. Needs rebase.