-
Notifications
You must be signed in to change notification settings - Fork 418
Validate negative funding contributions in splice_init
and splice_ack
messages
#4011
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
base: main
Are you sure you want to change the base?
Conversation
tankyleo
commented
Aug 14, 2025
As much as possible, we want to only mutate state once we are done with input validation. It also helps with introducing helper validation functions that take a `&self` in the next commits.
As in `splice_init`, this helps clearly delineate `splice_ack` message validation from the subsequent state mutations. This is a code-move.
👋 Thanks for assigning @wpaulino as a reviewer! |
splice_ack
and splice_init
messagessplice_init
and splice_ack
messages
From BOLT 2: ``` - If `funding_contribution_satoshis` is negative and its absolute value is greater than the sending node's current channel balance: - MUST send a `warning` and close the connection or send an `error` and fail the channel. ``` We allow the remote to be below the new reserve as long as their funding contribution is not negative; we don't care whether they were above or below the previous funding reserve.
From BOLT 2: ``` - If `funding_contribution_satoshis` is negative and its absolute value is greater than the sending node's current channel balance: - MUST send a `warning` and close the connection or send an `error` and fail the channel. ``` We allow the remote to be below the new reserve as long as their funding contribution is not negative; we don't care whether they were above or below the previous funding reserve.
6d6b07c
to
93965c6
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4011 +/- ##
==========================================
+ Coverage 88.85% 88.86% +0.01%
==========================================
Files 175 175
Lines 127710 127710
Branches 127710 127710
==========================================
+ Hits 113475 113493 +18
+ Misses 11672 11661 -11
+ Partials 2563 2556 -7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔔 1st Reminder Hey @wpaulino! This PR has been waiting for your review. |