-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
wallet: RBF batch payments manager #9298
base: master
Are you sure you want to change the base?
Conversation
b71b11f
to
45c7543
Compare
a48e7ca
to
5c7a247
Compare
3bdbf87
to
3ad4406
Compare
4a623fe
to
0f27755
Compare
c065b4a
to
689d93e
Compare
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.
some preliminary comments
cls.sign_tx(tx, swap) | ||
return tx | ||
self.add_txin_info(swap, txin) | ||
txin.privkey = swap.privkey |
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.
where is this field used?
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.
see sign_transaction
in wallet.py
outputs=outputs, | ||
password=password, | ||
locktime=locktime, | ||
BIP69_sort=False, |
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.
why disable bip69 sort?
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.
when sweeping htlc outputs with sighash single-anyonecanpay, the order must be preserved.
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.
oh right, the input-output pairings need to be kept for those.
we should have a unit test that would fail if this was set to True
self.config.FEE_EST_DYNAMIC = False | ||
self.config.FEE_EST_STATIC_FEERATE = 1000 | ||
|
||
def test_claim_tx_for_successful_reverse_swap(self): |
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.
Why delete these tests?
Just because SwapManager._create_and_sign_claim_tx
is being removed?
The tests could be adapted to test create_claim_txin
instead. Maybe feed the txin to wallet.create_transaction
along with some hardcoded values.
The point is to test that the txin is constructed correctly, but the easiest way of doing that is comparing a full tx.
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.
The point is to test that the txin is constructed correctly, but the easiest way of doing that is comparing a full tx.
Creating a full tx in order to check the construction of a tx input is indeed the easiest way, but it is completely overkill.
I think we should try to put a little bit more efforts in writing tests.
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.
RELEASE-NOTES
# To make payments reorg-safe, we would need to persist more data and redo failed payments. | ||
|
||
|
||
class TxEngine(Logger): |
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.
Could we put "RBF" or "batch" into the name? E.g. I find "RBFEngine" or "TxBatcher" more intuitive.
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.
ok let's call it TxBatcher
outputs=outputs, | ||
password=password, | ||
locktime=locktime, | ||
BIP69_sort=False, |
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.
oh right, the input-output pairings need to be kept for those.
we should have a unit test that would fail if this was set to True
b706662
to
22b3527
Compare
- delegate tx creation/broadcast to the wallet - callers use add_payment_output and add_sweep_input tests: - remove test_sswap.py: cannot be tested that way anymore - force regtests to use MPP, so that we sweep transactions with several HTLCs. This forces the payment manager to aggregate HTLC tx inputs.
- use separate pools, - fix future tx
- if coin control is active, disable batching - forward submarine swaps can be batched
9691a83
to
7a40399
Compare
note: this is not "reorg safe", meaning that there is no guarantee that all payments will end up in in the blockchain.
However, I believe this is "double send safe", meaning that we will never send a payment twice.