-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve fee sniping deterrence [BIP326] #1251
base: master
Are you sure you want to change the base?
Conversation
This change adds two tests to wallet.rs. In `test_create_tx_fee_sniping_tr` we check that for a taproot transaction with rbf enabled, either the tx LockTime is set to the most recent checkpoint, or the input's Sequence is set to its confirmations (allowing for randomness in both cases). In `test_create_tx_fee_sniping_tr_csv` we check that policy csv requirements take precedence over a default nSequence. A new test descriptor getter is added to common.rs `get_test_tr_with_taptree_csv` that contains a script path with a csv condition.
// Occasionally, randomly pick a lower sequence. | ||
confs = confs.saturating_sub(rng.gen_range(0u16..100)); | ||
} | ||
transaction.input[idx].sequence = Sequence::from_height(confs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to find the input corresponding to the randomly selected utxo above, rather than assume the same idx
@ValuedMammal since lightning doesn't us taproot yet is there a strong motivation for doing this now? |
I propose we push to to a post 1.0 release since it's a functional improvement that shouldn't change the current wallet API. |
Description
First attempt at bip326
for reference:
BIP326
Bitcoin Core
Sparrow
Notes to the reviewers
Changelog notice
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingcloses #1134