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

bolt3: test vector fixes #1056

Merged
merged 4 commits into from
Feb 28, 2023

Conversation

ellemouton
Copy link
Contributor

It seems as if the test vectors were not correctly updated after the change in this PR was applied. This could lead to different
test results depending on if the test used the ToLocalBalance defined by the test or
instead derived the balance by taking the funding amount and subtracting the htlc
amounts, remote balance and fees.

The PR also fixes the test called "simple commitment tx with no HTLCs and single anchor"
which currently does not have the correct channel capacity.

The commitment transaction tests are all meant to use the same funding
transaction which has an amount of 10000000000 msat. The LocalBalance
and RemoteBalance along with the value of any htlcs should always add up
to this amount.

This commit updates the `simple commitment tx with no HTLCs and single
anchor` anchors test to comply with the above.
The `commitment tx with 3 htlc outputs, 2 offered having the same amount
and preimage` test was not correctly updated after the value of test
htlc 6 was changed to 5000001 and the cltv expiry of test htlc 5 was
changed to 506. This commit updates the legacy test accordingly.
Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

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

Since rust-lightning only supports static remote key out of all of the test vectors updated here (legacy, static remote key, simple anchors), I was only able to verify those match.

03-transactions.md Outdated Show resolved Hide resolved
03-transactions.md Show resolved Hide resolved
The `commitment tx with 3 htlc outputs, 2 offered having the same amount
and preimage` test was not correctly updated after the value of test
htlc 6 was changed to 5000001 and the cltv expiry of test htlc 5 was
changed to 506. This commit updates the static-remote test accordingly.
The `commitment tx with 3 htlc outputs, 2 offered having the same amount
and preimage` test was not correctly updated after the value of test
htlc 6 was changed to 5000001 and the cltv expiry of test htlc 5 was
changed to 506. This commit updates the anchors test accordingly.
t-bast added a commit to ACINQ/eclair that referenced this pull request Feb 28, 2023
Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Thanks, I've updated eclair to match these tests, LGTM 👍

@t-bast t-bast merged commit 33098ad into lightning:master Feb 28, 2023
@ellemouton ellemouton deleted the fix-bolt3-commitment-tx-tests branch February 28, 2023 10:30
t-bast added a commit to ACINQ/eclair that referenced this pull request Feb 28, 2023
Add latest changes from lightning/bolts#1018
Add latest fixes from lightning/bolts#1056
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