-
Notifications
You must be signed in to change notification settings - Fork 902
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
Zero fee htlc preparation: Part 1 #6073
Merged
rustyrussell
merged 13 commits into
ElementsProject:master
from
rustyrussell:zero-fee-htlc-prep-1
Apr 5, 2023
Merged
Zero fee htlc preparation: Part 1 #6073
rustyrussell
merged 13 commits into
ElementsProject:master
from
rustyrussell:zero-fee-htlc-prep-1
Apr 5, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It was once only called on failure, now it's always called (if set). It was called different things in different places, so unify it. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
We'll use this to do RBF. Signed-off-by: Rusty Russell <[email protected]>
We can add the htable to the memleak detection, and we already do this for the watches. Signed-off-by: Rusty Russell <[email protected]>
Fun story. We're changing onchaind to hand txs to us, and we will construct them and do the broadcast for it. lightningd tells onchaind the witness it used (with flags to indicate which fields were signatures so should be ignored) so onchaind can recognize the tx when/if it is mined. And when onchaind was waiting for a CLTV delay, it wouldn't tell lightningd yet, but wait until the parent was sufficiently deep But this caused bugs! In particular, on replay, onchaind would see transactions which it hasn't sent yet. This was not a problem before, as onchaind had created the tx, even if it hadn't told lightningd to broadcast it, so recognized the variant when it came in. When we're relying on lightningd to tell us what the tx will look like, this doesn't work any more. The cause of this is that we fire off txowatches ("this output was spent!") while we process blocks, and only fire off txwatches ("this tx increased depth") once all the current blocks are processed. Often this didn't matter, since we replay messages to onchaind from the database, *but* we trim the last few blocks on restart (or, if there's a small reorg while we're stopped), and we can hit this misordering. Changing our topology code to only ever process one block at a time would be a solution, but slows down catchup (and tests, where we often mine a run of blocks). So, this seems like a premature optimization, but it's really required! And in future, lightningd can use this knowledge of pending transactions to combine them in more clever ways. Note that if a tx is valid at block N, we broadcast it once we see block N-1, to get it in the mempool for block N. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
…haind. Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
We need to actually steal it onto requested context in this case! Signed-off-by: Rusty Russell <[email protected]>
We only do this in one place now, but we're going to add another. Also, make queued messages const. Signed-off-by: Rusty Russell <[email protected]>
Firstly, amount should not be `static`, so use a separate line to declare those (fee is static, as it's cached across calls). Secondly, new_tracked_output doesn't take(), it copies. Signed-off-by: Rusty Russell <[email protected]>
Fixes: ElementsProject#4473 Signed-off-by: Rusty Russell <[email protected]> Changelog-Fixed: wallet: we no longer make txs below minrelaytxfee or mempoolminfee.
rustyrussell
force-pushed
the
zero-fee-htlc-prep-1
branch
from
March 23, 2023 05:48
3053862
to
85e2833
Compare
ACK 85e2833 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Based on #5708, starts at chaintopology: rename broadcast_tx callback name. )Merged!This is infrastructure neatening, plus enhancements to broadcast_tx to allow us to specify a minumum target block, and a hook for replacing txs (which we'll use for RBF).