Skip to content

Conversation

@carlaKC
Copy link
Contributor

@carlaKC carlaKC commented Nov 18, 2025

Fixes: #4181. This PR adds relay of the experimental accountable signal to LDK, as outlined in blip-04.

After this PR LDK will:

  • Set zero value accountable signals on its own payments, and for forwards that don't have an incoming accountable signal set.
  • If an incoming accountable signal is set, it'll copy the incoming value to the outgoing update_add_htlc.

One note here is that we don't keep track of the incoming accountable signal once we've forwarded it on our outgoing link. This isn't a requirement for our existing reputation algorithm, so this seems fine (we could add to HTLCSource if we needed it).

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Nov 18, 2025

I've assigned @tankyleo as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Copy link
Contributor

@elnosh elnosh left a comment

Choose a reason for hiding this comment

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

LGTM. There's a test making the CI unhappy

nodes[1].node.handle_update_add_htlc(nodes[0].node.get_our_node_id(), &htlc_ab);
do_commitment_signed_dance(&nodes[1], &nodes[0], &updates_ab.commitment_signed, false, false);
expect_and_process_pending_htlcs(&nodes[1], false);
check_added_monitors!(nodes[1], 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these can use the identically-named function instead of the macro.

Comment on lines 24 to 31
nodes[0]
.node
.send_payment(payment_hash, onion_fields, payment_id, route_params, Retry::Attempts(0))
.unwrap();
check_added_monitors!(nodes[0], 1);

let updates_ab = get_htlc_update_msgs(&nodes[0], &nodes[1].node.get_our_node_id());
assert_eq!(updates_ab.update_add_htlcs.len(), 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be good to check that the signal from the sender is set to 0

@carlaKC carlaKC force-pushed the 4181-experimental-accountable branch from aa7abc3 to 5accf65 Compare November 19, 2025 20:40
@carlaKC carlaKC force-pushed the 4181-experimental-accountable branch from 5accf65 to 9e14c82 Compare November 19, 2025 20:41
@carlaKC
Copy link
Contributor Author

carlaKC commented Nov 19, 2025

Rebased to fix test failure + addressed feedback on test.

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

❌ Patch coverage is 94.91525% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.32%. Comparing base (1f7b249) to head (9e14c82).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/ln/channel.rs 90.69% 2 Missing and 2 partials ⚠️
lightning/src/ln/accountable_tests.rs 97.87% 1 Missing ⚠️
lightning/src/ln/channelmanager.rs 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4232      +/-   ##
==========================================
- Coverage   89.34%   89.32%   -0.02%     
==========================================
  Files         180      181       +1     
  Lines      138620   138751     +131     
  Branches   138620   138751     +131     
==========================================
+ Hits       123846   123941      +95     
- Misses      12149    12187      +38     
+ Partials     2625     2623       -2     
Flag Coverage Δ
fuzzing 35.99% <69.09%> (+0.03%) ⬆️
tests 88.69% <94.91%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Relay experimental accountable signal (blip 04)

3 participants