Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Oct 6, 2025

This PR contains all the changes made during my review of #805: it's better reviewed commit by commit (check the commit messages for details).

I have reviewed all the code but not the tests yet, we need to spend some time on testing now but otherwise the code is looking good!

Builds on top of #805

t-bast added 5 commits October 3, 2025 17:47
It was missing in several cases, and the `OpenChannel` command allowed
using other channel types.
We refactor `Commitments.kt` to better match `eclair` and clean up
pattern matching (use exhaustive, future-proof pattern matching).

We also remove alternative feerate sigs, which aren't necessary
anymore since we can now use package relay. The ACINQ node will
stop sending `update_fee` and will keep the commitment feerate
at `1 sat/byte`.
Error handling was missing from a few places (incorrectly assuming that
nonces were already provided and signature couldn't fail). We also use
exhaustive pattern matching everywhere, and clean-up the nonces and
funding tx index parameters.

We also revert some formatting nits, which make the file inconsistent.
The nonce management was incomplete for mutual close RBF (see changes
to `Negotiating.kt`). We must add unit tests to catch those bugs.

Mutual close was also not working properly because `revoke_and_ack`
nonces weren't taken into account in the `ShuttingDown` state.

We also refactor the nonce fields in the various channel states, in
which some nonces where unnecessary (e.g. already contained in the
`shutdown` message).

We make the ordering of fields consistent: `remoteNextCommitNonces`
always comes right after `commitments`, since it should always be
filled (for taproot channels) and is necessary to update the
`commitments`.
@t-bast t-bast requested a review from sstone October 6, 2025 08:30
We switch almost all existing tests to use the taproot channel type.
We fix a few bugs found by the existing test suite:

- preimage extraction from HTLC transactions was missing
- channel_ready didn't contain local commit nonces
- channel_reestablish nonces had an off-by-one in the commit index
@t-bast t-bast merged commit 27a4a12 into simple-taproot-channels Oct 6, 2025
0 of 2 checks passed
@t-bast t-bast deleted the simple-taproot-channels-bast branch October 6, 2025 16:23
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