Skip to content

Add test for malformed update error with NODE bit set - #2

Merged
TheBlueMatt merged 1 commit into
TheBlueMatt:2022-09-badonion-first-checkfrom
dunxen:2022-09-badonion-first-check
Sep 12, 2022
Merged

TheBlueMatt merged 1 commit into
TheBlueMatt:2022-09-badonion-first-checkfrom
dunxen:2022-09-badonion-first-check

Conversation

@dunxen

@dunxen dunxen commented Sep 12, 2022

Copy link
Copy Markdown

Think this is the easiest way to get it into your PR other than a manual patch.

// the node originating the error to its next hop.
match events_5[0] {
Event::PaymentPathFailed { network_update: Some(NetworkUpdate::ChannelFailure {
short_channel_id, is_permanent }), .. } => {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Can you check the error code that's here?

@TheBlueMatt TheBlueMatt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Just one note there otherwise LGTM.

@TheBlueMatt

Copy link
Copy Markdown
Owner

Just gonna do it locally.

@TheBlueMatt
TheBlueMatt merged commit baff002 into TheBlueMatt:2022-09-badonion-first-check Sep 12, 2022
@dunxen
dunxen deleted the 2022-09-badonion-first-check branch January 20, 2025 08:33
TheBlueMatt pushed a commit that referenced this pull request Mar 17, 2026
When the counterparty initiates an RBF and we have no new contribution
queued via QuiescentAction, we must re-use our prior contribution so
that our splice is not lost. Track contributions in a new field on
PendingFunding so the last entry can be re-used in this scenario.

Each entry stores the feerate-adjusted version because that reflects
what was actually negotiated and allows correct feerate re-adjustment
on subsequent RBFs. Only explicitly provided contributions (from a
QuiescentAction) append to the vec. Re-used contributions are replaced
in-place with the version adjusted for the new feerate so they remain
accurate for further RBF rounds, without growing the vec.

Add test_splice_rbf_acceptor_recontributes to verify that when the
counterparty initiates an RBF and we have no new QuiescentAction
queued, our prior contribution is automatically re-used so the splice
is preserved.

Add test_splice_rbf_recontributes_feerate_too_high to verify that when
the counterparty RBFs at a feerate too high for our prior contribution
to cover, the RBF is rejected rather than proceeding without our
contribution.

Add test for sequential RBF splice attempts

Add test_splice_rbf_sequential that exercises three consecutive RBF
rounds on the same splice (initial → RBF #1 → RBF #2) to verify:
- Each round requires the 25/24 feerate increase (253 → 264 → 275)
- DiscardFunding events reference the correct funding txid from each
  replaced candidate
- The final RBF splice can be mined and splice_locked successfully

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

2 participants