Background
In #10895 the HTLC interceptor was reworked to cleanly distinguish
between on-chain and off-chain intercepted HTLCs. During review
(#10895 (review))
a concern was raised about the RPC design: the auto_fail_height field
is currently overloaded to carry two different meanings depending on
whether the intercepted HTLC is off-chain or on-chain.
Problem
Using a single field to express two distinct concepts is a poor design.
The name auto_fail_height describes the off-chain behavior (the height
at which an intercepted HTLC is automatically failed back), but it is
also reused for the on-chain case — a state in which no auto-fail
actually happens. A field whose name contradicts its behavior in one of
its uses is confusing for API consumers and error-prone to maintain.
Proposed solution
Keep auto_fail_height for the existing off-chain meaning and introduce
a new dedicated field (e.g. settle_deadline) for the on-chain case.
This preserves backwards compatibility while giving each semantic its
own, correctly-named field.
Why this is a separate issue
PR #10895 targets a minor release, where adding a new RPC field is
considered too heavy a change. This cleanup should instead be scheduled
for the next (non-minor) release.
Follow-up to #10895.
Background
In #10895 the HTLC interceptor was reworked to cleanly distinguish
between on-chain and off-chain intercepted HTLCs. During review
(#10895 (review))
a concern was raised about the RPC design: the
auto_fail_heightfieldis currently overloaded to carry two different meanings depending on
whether the intercepted HTLC is off-chain or on-chain.
Problem
Using a single field to express two distinct concepts is a poor design.
The name
auto_fail_heightdescribes the off-chain behavior (the heightat which an intercepted HTLC is automatically failed back), but it is
also reused for the on-chain case — a state in which no auto-fail
actually happens. A field whose name contradicts its behavior in one of
its uses is confusing for API consumers and error-prone to maintain.
Proposed solution
Keep
auto_fail_heightfor the existing off-chain meaning and introducea new dedicated field (e.g.
settle_deadline) for the on-chain case.This preserves backwards compatibility while giving each semantic its
own, correctly-named field.
Why this is a separate issue
PR #10895 targets a minor release, where adding a new RPC field is
considered too heavy a change. This cleanup should instead be scheduled
for the next (non-minor) release.
Follow-up to #10895.