2023 Jan 09
Watched this video on Rust 2024. I didn’t even really consider that there is still so much development to do on Rust, and that some of the “accidental complexity” scenarios that were mentioned existed.
SCID stands for short channel ID.
Looking into this issue: https://github.com/lightningdevkit/rust-lightning/issues/1570
This is kind of tough. I feel like it’s not that bad, but I just am not familiar with the whole repo so I don’t know what exists and where things are.
I’m looking at
pub fn fail_htlc_backwards(&self, payment_hash: &PaymentHash)
onChannelManager
. This seems to be what the issue is talking about, i.e. an exposed function for the user to tell theChannelManager
to fail back a payment. From what I understand, this function removes the payment from theChannelManager
’sclaimable_payments
–the (inbound) payments it thinks are able to be/in the midst of being claimed, then for each source of the payment (can be multiple for a MPP) it “fails back” HTLCs to free up resources on channels along the path from here to the original sender.Purpose of the function: Indicates that the preimage for payment_hash is unknown or the received amount is incorrect after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources along the path (including in our own channel on which we received it).
For each source currently, it marks the reason as
HTLCFailReason::reason(0x4000 | 15, htlc_msat_height_data);
which I don’t really get, however I believe this might be something we would change to allow the user to input?
Have a lot more to say, left my summarized thoughts as a comment.
Trying to go about my first issue is leaving me with a good amount of questions that I’m realizing could probably be answered by doing a lot of review. Definitely going to prioritize trying to do that tomorrow.