Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Jun 4, 2025

We previously stored the commitment transaction and HTLC transactions in our channel data along with the remote signatures, without our local signatures. It is unnecessary to store those transactions, as we have all the data we need to recompute them on-the-fly if we need to force close.

Storing those transactions can easily use a few hundreds of kB per channel, which adds up to the post-restart latency when channels need to be read from the DB.

By not storing those transactions in our commitments, we also remove the need to support encoding them, which gives us greater flexibility to change their format in the future.

It also made it confusing in tests, where we sometimes use unsigned transactions as if they were signed.

The added codec tests have been generated on master before being imported into this branch.

@t-bast t-bast force-pushed the remove-htlc-tx-with-remote-sig branch from 4b0ae7c to f957d16 Compare June 5, 2025 08:13
@t-bast t-bast marked this pull request as ready for review June 5, 2025 10:15
@t-bast t-bast requested review from pm47 and sstone June 5, 2025 10:15
@t-bast t-bast force-pushed the remove-htlc-tx-with-remote-sig branch 2 times, most recently from a3d2d41 to 7d9a628 Compare June 13, 2025 07:57
We previously stored the commitment transaction and HTLC transactions
in our channel data along with the remote signatures, without our local
signatures. It is unnecessary to store those transactions, as we have
all the data we need to recompute them on-the-fly if we need to force
close.

Storing those transactions can easily use a few hundreds of kB per
channel, which adds up to the post-restart latency when channels need
to be read from the DB.

By not storing those transactions in our commitments, we also remove
the need to support encoding them, which gives us greater flexibility
to change their format in the future.

It also made it confusing in tests, where we sometimes use unsigned
transactions as if they were signed.
@t-bast t-bast force-pushed the remove-htlc-tx-with-remote-sig branch from 7d9a628 to 84317b5 Compare June 13, 2025 08:19
@t-bast t-bast merged commit 7b67f33 into master Jun 16, 2025
1 check passed
@t-bast t-bast deleted the remove-htlc-tx-with-remote-sig branch June 16, 2025 15:44
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.

4 participants