Skip to content

Jit forward checks - #11001

Open
ecdsa wants to merge 3 commits into
masterfrom
jit_forward_checks
Open

ecdsa wants to merge 3 commits into
masterfrom
jit_forward_checks

Conversation

@ecdsa

@ecdsa ecdsa commented Sep 28, 2026

Copy link
Copy Markdown
Member

issue FWD-2 was only partially fixed; this should cover the rest of the issue

…hannel

open_channel_just_in_time was called before the cltv and amount checks
on the incoming htlc. Now the JIT path runs the same checks, using the
fee and cltv delta of the JIT route hint, and an empty channel_update.
…tingFailure

create_onion_for_route raises exceptions that are not OnionRoutingFailure,
in which case incoming htlcs were never failed:
- PaymentFailure, if the outgoing cltv, which is chosen by the sender,
  is too far in the future. Check it before, and also reject an already
  expired outgoing cltv.
- InvalidPayloadSize, if the inner trampoline onion does not fit in the
  outgoing onion. Fail with INVALID_ONION_PAYLOAD.

Also fail with TEMPORARY_NODE_FAILURE on any other exception.
@ecdsa
ecdsa marked this pull request as ready for review September 28, 2026 14:28
@SomberNight

Copy link
Copy Markdown
Member

minimally related: I think we should somehow mark the JIT code as experimental, to communicate that to readers/llms. I think it's not written anywhere that this code is not expected to be used in production atm.
Maybe we could rename the configvars to contain EXPERIMENTAL_, idk.

# zeroconf channels
OPEN_ZEROCONF_CHANNELS = ConfigVar('open_zeroconf_channels', default=False, type_=bool)
ZEROCONF_TRUSTED_NODE = ConfigVar('zeroconf_trusted_node', default='', type_=str)
# minimum absolute fee in sat for which we will open a channel just in time
ZEROCONF_MIN_OPENING_FEE = ConfigVar('zeroconf_min_opening_fee', default=5000, type_=int)
# fee in ppm of the outgoing htlcs value we charge for opening new channels just in time
ZEROCONF_OPENING_FEE_PPM = ConfigVar('zeroconf_opening_fee_ppm', default=10_000, type_=int)
# size of the channel the lsp opens to the client in percent of the outgoing htlcs value
# (before deducting fees). required to be at least 120% to leave some buffer for the channel reserve
ZEROCONF_CHANNEL_SIZE_PERCENT = ConfigVar('zeroconf_channel_size_percent', default=200, type_=int)

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.

2 participants