Skip to content

Attributable errors#8291

Open
adi2011 wants to merge 9 commits intoElementsProject:masterfrom
adi2011:attributable-errors
Open

Attributable errors#8291
adi2011 wants to merge 9 commits intoElementsProject:masterfrom
adi2011:attributable-errors

Conversation

@adi2011
Copy link
Collaborator

@adi2011 adi2011 commented May 16, 2025

Attributable errors: lightning/bolts#1044

Still a bit rough — needs comments, a flow polish, and maybe a cup of coffee. Hoping for an approach ACK, especially based on run-sphinx.c.

Addresses: #8153

@madelinevibes
Copy link
Collaborator

Hi @adi2011 I'm wondering if you are planning on returning to this work? :)

@adi2011
Copy link
Collaborator Author

adi2011 commented Dec 9, 2025

Hi @madelinevibes, I am planning to work on all my PRs for this upcoming release. :)

@madelinevibes
Copy link
Collaborator

Hi @madelinevibes, I am planning to work on all my PRs for this upcoming release. :)

excellent!

  • Code freeze 11 March
  • First Release Candidate: 23 March
  • Release Date 15 April

adi2011 added 9 commits March 5, 2026 16:29
Adding the optional TLVs to update_fail_htlc, update_fulfill_htlc and struct onionreply
so that we can parse and store it.

Key Changes:
 - Add tlvtype 'attribution_data' to 'update_fail_htlc' and 'update_fulfill_htlc' msgtype.
 - Add 'htlc_hold_time' & 'truncated_hmac' to struct onionreply.
We initialise time of creating htlc_out and calculate the time when
this htlc_out is failed.

Key Changes:
 - Add 'send_timestamp' to htlc_out.
 - Calculate hold_time when htlc_out is failed.
Implemented methods to wrap attribution data, update the attribution data.

Key Changes:
 - Use 'ammagext' subkey to crypt the attr data.
 - Write method to add HMACs to the attr data.
 - Update attribution data to a given onionreply.
 - Write method to verify attr data to find erring node.
 - Use all these helpers inside unwrap_onionreply().
Sending attr data while sending update_fail_htlc and processing the attr data
when received a update_fail_htlc msg.

Key Changes:
 - Serializing updated attr data inside send_fail_or_fulfill.
 - Deserializing and processing the TLVs while parsing recvd update_fail_htlc msg.
This is required to send attribution data from channeld to lightningd.

Key Changes:
 - Add attribution_data to fulfilled_htlc and htlc
 - Modify fromwire/towire_fulfilled_htlc to accommodate the change
 - Make channeld handle attribution data
Key Changes:
 - Add fulfill_onion to htlc_in, this would include the wrapped attribution data
 - Add attribution_data to htlc_out, we store the incoming attr data here
Key changes:
 - Add test to check correct serialization and deserialization of attr data inside onionreply.
@adi2011 adi2011 force-pushed the attributable-errors branch from 5368e11 to eaca46a Compare March 5, 2026 11:14
@adi2011 adi2011 marked this pull request as ready for review March 5, 2026 11:15
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