Skip to content
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

Relax single tx input requirements #1677

Merged
merged 1 commit into from
Feb 18, 2021
Merged

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Jan 27, 2021

In some places of the codebase we relied on the fact that lightning transactions had a single input. That was correct with the standard commitments format, but will not be the case with anchor outputs: 2nd-stage txs (htlc-txs) and 3rd-stage txs (claim-htlc-txs) can be RBF-ed and have any number of inputs and outputs.

@t-bast t-bast force-pushed the anchor-output-multiple-txin branch from d5e1c12 to 1c77dbb Compare February 4, 2021 16:27
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works but may generate warnings in logs. Another strategy would have been to handle delayed input one-by-one, and keep track of the remaining inputs in the BITCOIN_PARENT_TX_CONFIRMED event.

Something like:

case class BITCOIN_PARENT_TX_CONFIRMED(childTx: Transaction, nextCsvTimeouts: Map[ByteVector32, Long]) extends BitcoinEvent

@t-bast
Copy link
Member Author

t-bast commented Feb 15, 2021

This works but may generate warnings in logs. Another strategy would have been to handle delayed input one-by-one, and keep track of the remaining inputs in the BITCOIN_PARENT_TX_CONFIRMED event.

TBH this code is very temporary; I'll completely remove and change how we track and publish txs to support regularly bumping tx fees for anchor outputs, so I'd rather go with the simplest approach / the less code changes for now.

In some places of the codebase we relied on the fact that lightning transactions
had a single input. That was correct with the standard commitments format,
but will not be the case with anchor outputs: 2nd-stage txs (htlc-txs) and
3rd-stage txs (claim-htlc-txs) can be RBF-ed and have any number of inputs
and outputs.
@t-bast t-bast requested review from sstone and pm47 February 18, 2021 14:10
@t-bast t-bast merged commit ab89851 into master Feb 18, 2021
@t-bast t-bast deleted the anchor-output-multiple-txin branch February 18, 2021 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants