This fixes #28638. The issue was originally raised by dooglus, who also suggested the patch found in this code. Additionally, test coverage has been added and documentation has been updated.
Make bitcoin-tx replaceable value optional #29022
pull kashifs wants to merge 3 commits into bitcoin:master from kashifs:bitcoin-tx-replaceable-value changing 7 files +92 −4-
kashifs commented at 11:24 AM on December 7, 2023: contributor
-
bitcoin-tx: Make replaceable value optional c2b836b119
-
DrahtBot commented at 11:24 AM on December 7, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
Code Coverage
For detailed information about the code coverage, see the test coverage report.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK pinheadmz, hernanmarino, instagibbs, achow101 If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- fanquake renamed this:
Make bitcoin-tx replaceable value optional, #fixes 28638
Make bitcoin-tx replaceable value optional
on Dec 7, 2023 - DrahtBot added the label CI failed on Dec 7, 2023
- kashifs force-pushed on Dec 7, 2023
-
in src/bitcoin-tx.cpp:71 in 605a147b3b outdated
65 | @@ -66,7 +66,9 @@ static void SetupBitcoinTxArgs(ArgsManager &argsman) 66 | argsman.AddArg("outscript=VALUE:SCRIPT[:FLAGS]", "Add raw script output to TX. " 67 | "Optionally add the \"W\" flag to produce a pay-to-witness-script-hash output. " 68 | "Optionally add the \"S\" flag to wrap the output in a pay-to-script-hash.", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); 69 | - argsman.AddArg("replaceable(=N)", "Set RBF opt-in sequence number for input N (if not provided, opt-in all available inputs)", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS); 70 | + argsman.AddArg("replaceable(=N)", "Sets Replace-By-Fee (RBF) opt-in sequence number for input N. " 71 | + "If N is not provided, the command attempts to opt-in all available inputs for RBF. " 72 | + "If the transaction has no inputs, no action will be taken by this command. ", ArgsManager::ALLOW_ANY, OptionsCategory::COMMANDS);
pinheadmz commented at 4:50 PM on December 8, 2023:I think you can just remove this last sentence. The command DOES take an action if no inputs are provided (you added a test for this!), and the impact of this option in that case I think is handled already by the first two sentences.
kashifs commented at 12:38 AM on December 9, 2023:Hi @pinheadmz, Thanks for taking the time to review this. I've updated the Makefile.
For the documentation, I wanted to make it clear to the end user that if a transaction with no inputs called
tx_noinputs_replaceableis created by running the following command:./bitcoin-tx -create replaceable, it should NOT be assumed that inputs later added totx_noinputs_replaceablewill default to being replaceable.Is this already obvious? If so, I can remove the line. If not, is there other language that I should use to make this clear?
Thanks!
pinheadmz commented at 3:05 PM on December 11, 2023:Ok I see maybe then
"If the transaction has no inputs, this option is ignored"? is that correct?
kashifs commented at 6:22 PM on December 11, 2023:Yes, that's correct. I've updated the text to read as you suggested. Thanks!
pinheadmz commented at 5:12 PM on December 8, 2023: memberconcept ACK 605a147b3bf93b7e4325afa4a4df61ffb3523012
I think the test failures are because on CI we copy everything we need for testing into a new directory in the container, and the files you added need to be listed as well in Makefile.md under
EXTRA_DIST.For extra context, this is the command that copies the files from
EXTRA_DISTinto the ci scratch/build working directory.You can run CI locally with docker (see
ci/README.md). Just for sanity check I entered the test container to prove the files were missing:root@3e18724095c4:/# diff /Users/matthewzipkin/Desktop/work/bitcoin/test/util/data/ /ci_container_base/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/test/util/data/ Only in /Users/matthewzipkin/Desktop/work/bitcoin/test/util/data/: txreplace1.hex Only in /Users/matthewzipkin/Desktop/work/bitcoin/test/util/data/: txreplacenoinputs.hex Only in /Users/matthewzipkin/Desktop/work/bitcoin/test/util/data/: txreplaceomittedn.hex Only in /Users/matthewzipkin/Desktop/work/bitcoin/test/util/data/: txreplacesingleinput.hexkashifs force-pushed on Dec 9, 2023kashifs force-pushed on Dec 9, 2023kashifs force-pushed on Dec 9, 2023kashifs force-pushed on Dec 9, 2023tests: Add unit tests for bitcoin-tx replaceable command 94feaf2b66kashifs force-pushed on Dec 9, 2023DrahtBot removed the label CI failed on Dec 9, 2023doc: Update bitcoin-tx replaceable documentation 98afe78661kashifs force-pushed on Dec 11, 2023pinheadmz approvedpinheadmz commented at 6:35 PM on December 13, 2023: memberACK 98afe7866185ed4157ffc581763e11dc02fcbae0
Great work Kashif! Built and ran all tests locally. Confirmed that some new tests fail without the patch, and additional tests were added that expand coverage for the
bitcoin-txutility with "replaceable" option. I also played with the updated utility on the command line, and confirmed that this patch closes the issue linked in the PR description. 👍<details><summary>Show Signature</summary>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 ACK 98afe7866185ed4157ffc581763e11dc02fcbae0 -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmV5+OwACgkQ5+KYS2KJ yTqnCBAA4GMxNjFMRiTs1Uw+LX+OXFGBDbnX3Ez2iO/8YRyTGF6kFb5uyRFVXZoC HByu7oG4ATOND6ge0JENVq7muiJ7odD3qitvUTKU2v6NscOkdDXSyUyxRVj3mnMI lTrpGCkyS1FbNEvZXr6tbY2wul5HLGzVJ5/B5BA2oNxgYnm2TLB1hu1h4x0h/6Va xNkpVVVOufRqmxyZtL4wjS8rRQb4zg2vg2Netcfli5mHGEpYYMkv+BDjykz9T0zg Qs13eJIp78kf2/X0xTMJgwiCdccefx02vFOABBtPT1sHJnh1YrmDRxCOxJFsEDTi 0nJYFZUEz236zKVKzwnQakUFLNHtFDrQiy+VWAcilIfY1gJp534dXzz7XsdKBtN+ ZRqiLsf8aOBHxzetE9j19oV7/J1Nyof0O4dMHZcX7ZkNoH0O7ZpyGg6+9fi46NGP nDJq+VehUAToJKDTtwGJt5kNumXIlFPdbL2GvGiz/8NI2qUXqBW7RCenWZj5Ht4i +h847pO4U3A4op6lZRk8dmBdIR7vUeczeMarUeSJDgcoCR2d1oLpySwMiGyEOFLt vhoXMYo0Ky7958mxYP+ZpsE6M4RuDdvAdP0ofQs0kh+N+Jd7LcuIBkVZsThFhuGm tMGDyn0jEdC0T8x68B3wZ3h6hXtbpDz4vbsTkYwO04mc53+uA8k= =vCYW -----END PGP SIGNATURE-----pinheadmz's public key is on keybase
</details>
hernanmarino approvedhernanmarino commented at 2:57 PM on December 14, 2023: contributorTested ACK 98afe7866185ed4157ffc581763e11dc02fcbae0
instagibbs approvedinstagibbs commented at 3:32 PM on December 14, 2023: memberuntested ACK https://github.com/bitcoin/bitcoin/pull/29022/commits/98afe7866185ed4157ffc581763e11dc02fcbae0
Test coverage looks good, thanks!
achow101 commented at 6:47 PM on December 14, 2023: memberACK 98afe7866185ed4157ffc581763e11dc02fcbae0
achow101 merged this on Dec 14, 2023achow101 closed this on Dec 14, 2023kashifs deleted the branch on Dec 14, 2023Retropex referenced this in commit 15d49e440e on Mar 28, 2024Retropex referenced this in commit fff4dc9760 on Mar 28, 2024Retropex referenced this in commit 52e1275e2b on Mar 28, 2024bitcoin locked this on Dec 13, 2024
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:13 UTC
More mirrored repositories can be found on mirror.b10c.me