Skip to content

Attributable errors #8291

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

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

adi2011 added 5 commits May 21, 2025 19:58
Adding the optional TLVs to update_fail_htlc and struct onionreply
so that we can parse and store it.

Key Changes:
 - Add tlvtype 'attribution_data' to 'update_fail_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.
Key changes:
 - Add test to check correct serialization and deserialization of attr data inside onionreply.
@adi2011 adi2011 force-pushed the attributable-errors branch from 3e1927f to 5368e11 Compare May 21, 2025 14:31
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.

1 participant