Skip to content

Enhancements for LocalHTLCFailureReason #3753

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Open
carlaKC opened this issue Apr 28, 2025 · 1 comment
Open

Enhancements for LocalHTLCFailureReason #3753

carlaKC opened this issue Apr 28, 2025 · 1 comment

Comments

@carlaKC
Copy link
Contributor

carlaKC commented Apr 28, 2025

Opening up this issue to track a few comments in #3700 and #3744.

1. Add additional metadata to error variants

There are some LocalHTLCFailureReason variants that have metadata that may be interesting for a dashboard, for example HTLCMaximum provides some insight into the amount of liquidity that is available (vs what was needed by the HTLC).

One side effect of not having this data tracked with the failure is that we can't use the enum's display string without losing some information that's probably quite useful to know in our logs.

2. Surface hold time for attributable failures

With attributable failures implemented, we now know how long our downstream peer held the HTLC for. This can be surfaced in the Downstream variant of HTLCHandlingFailureReason.

3. Imperfect Mapping of bad onion failures

In decode_incoming_update_add_htlc_onion and OnionDecodeErr::Malformed there are still some error strings that are more specific than LocalHTLCFailureReason. This happens because we're using the same enum internally and on the API - these errors are more detailed than we care to surface on the API.

As a result, getting rid of their accompanying strings would also result in some information loss in our logs.

If we wanted this to be more internally consistent, I think that the best way to do it would be to add new enums for the different InvalidOnionBlinding and InvalidOnion cases that we see in detail in the codebase, and then add then as fields to the corresponding LocalHTLCFailureReason variant as a field.

@carlaKC
Copy link
Contributor Author

carlaKC commented Apr 28, 2025

Opened this up so that these comments don't get lost in GH, but fwiw I think it's worth waiting on seeing whether there's demand for this level of granularity before investing more dev time!

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant