-
Notifications
You must be signed in to change notification settings - Fork 409
Add missing pending FundingScope
checks
#3811
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?
Add missing pending FundingScope
checks
#3811
Conversation
If there are any pending splices when an update_add_htlc message is received, it must be validated against each pending FundingScope. Otherwise, the HTLC could be invalid once the splice is locked.
👋 Thanks for assigning @wpaulino as a reviewer! |
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
bc3ede2
to
30ac751
Compare
Good to squash |
If there are any pending splices when a revoke_and_ack message is received, FundingScope::value_to_self_msat needs to be updated for each. Otherwise, the promoted FundingScope will be invalid when the splice is locked.
If there are any pending splices when an update_fee message is received, it must be validated against each pending FundingScope. Otherwise, it may be invalid once the splice is locked.
If there are any pending splices when an sending an update_fee message, the new fee rate must be validated against each pending FundingScope. Otherwise, it may be invalid once the splice is locked.
If there are any pending splices when an accepting an incoming HTLC, the HTLC needs to be validated against each pending FundingScope. Otherwise, once the splice is locked, the HTLC could have been failed when it should have been forwarded / claimed, or vice versa, under the promoted FundingScope.
If there are any pending splices when an sending an update_add_htlc message, the HTLC amount must be validated against each pending FundingScope. Otherwise, it may be invalid once the splice is locked.
30ac751
to
c6b2d01
Compare
Oops, sorry more fixups to address lint checks. |
@wpaulino Any thoughts on moving the helpers to |
When sending or receiving
update_add_htlc
,update_fee
, orrevoke_and_ack
messages, check that the messages (or amount or fee rates, as is appropriate) are valid for any pendingFundingScope
. Otherwise, the promotedFundingScope
will be invalid when the splice is locked.This assumes
FundingScope::is_outbound
is the same across allFundingScope
s. This PR does not fix similar issues for funding negotiation and funding confirmation, which should be handled in #3736 and #3741, respectively.