Skip to content

htlcswitch: avoid overloading auto_fail_height for on-chain intercepted HTLCs #10921

Description

@ziggie1984

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Backlog

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions