Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"cltv_incorrect": 6,
"dust_limit": 2,
"fee_insufficient": 5,
"funding_not_broadcast": 16,
"htlc_above_maximum": 4,
"htlc_below_minimum": 3,
"insufficient_outgoing_liquidity": 0,
Expand Down Expand Up @@ -270,6 +271,7 @@
"cltv_incorrect": 6,
"dust_limit": 2,
"fee_insufficient": 5,
"funding_not_broadcast": 16,
"htlc_above_maximum": 4,
"htlc_below_minimum": 3,
"insufficient_outgoing_liquidity": 0,
Expand Down Expand Up @@ -2652,7 +2654,8 @@
"ListConfigs.configs.testnet": 8,
"ListConfigs.configs.tor-service-password": 66,
"ListConfigs.configs.wallet": 19,
"ListConfigs.configs.watchtime-blocks": 33
"ListConfigs.configs.watchtime-blocks": 33,
"ListConfigs.configs.zeroconf-require-funding-seen": 85
},
"ListconfigsConfigsAccept-htlc-tlv-type": {
"ListConfigs.configs.accept-htlc-tlv-type.sources[]": 1,
Expand Down Expand Up @@ -2997,6 +3000,10 @@
"ListConfigs.configs.watchtime-blocks.source": 2,
"ListConfigs.configs.watchtime-blocks.value_int": 1
},
"ListconfigsConfigsZeroconf-require-funding-seen": {
"ListConfigs.configs.zeroconf-require-funding-seen.source": 1,
"ListConfigs.configs.zeroconf-require-funding-seen.value_bool": 2
},
"ListconfigsImportant-plugins": {
"ListConfigs.important-plugins[].name": 2,
"ListConfigs.important-plugins[].options": 3,
Expand Down Expand Up @@ -6696,6 +6703,7 @@
"82": "optional message",
"83": "optional message",
"84": "optional message",
"85": "optional message",
"9": "optional message"
},
"ListconfigsConfigsAccepthtlctlvtype": {
Expand Down Expand Up @@ -7019,6 +7027,10 @@
"1": "plain uint32",
"2": "plain string"
},
"ListconfigsConfigsZeroconfrequirefundingseen": {
"1": "plain string",
"2": "plain bool"
},
"ListconfigsRequest": {
"1": "optional string"
},
Expand Down Expand Up @@ -14773,6 +14785,18 @@
"added": "v23.08",
"deprecated": null
},
"ListConfigs.configs.zeroconf-require-funding-seen": {
"added": "v26.12",
"deprecated": null
},
"ListConfigs.configs.zeroconf-require-funding-seen.source": {
"added": "v26.12",
"deprecated": null
},
"ListConfigs.configs.zeroconf-require-funding-seen.value_bool": {
"added": "v26.12",
"deprecated": null
},
"ListConfigs.daemon": {
"added": "pre-v0.10.1",
"deprecated": "v23.08"
Expand Down
8 changes: 8 additions & 0 deletions cln-grpc/proto/node.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions cln-grpc/src/convert.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions cln-rpc/src/model.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cln-rpc/src/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ pub enum ForwardEventFailureReason {
MAX_HTLC_VALUE_IN_FLIGHT = 14,
#[serde(rename = "peer_cannot_afford_fee")]
PEER_CANNOT_AFFORD_FEE = 15,
#[serde(rename = "funding_not_broadcast")]
FUNDING_NOT_BROADCAST = 16,
}

impl TryFrom<i32> for ForwardEventFailureReason {
Expand All @@ -516,6 +518,7 @@ impl TryFrom<i32> for ForwardEventFailureReason {
13 => Ok(ForwardEventFailureReason::CHANNEL_SHUTTING_DOWN),
14 => Ok(ForwardEventFailureReason::MAX_HTLC_VALUE_IN_FLIGHT),
15 => Ok(ForwardEventFailureReason::PEER_CANNOT_AFFORD_FEE),
16 => Ok(ForwardEventFailureReason::FUNDING_NOT_BROADCAST),
o => Err(anyhow::anyhow!("Unknown variant {} for enum ForwardEventFailureReason", o)),
}
}
Expand All @@ -540,6 +543,7 @@ impl ToString for ForwardEventFailureReason {
ForwardEventFailureReason::CHANNEL_SHUTTING_DOWN => "CHANNEL_SHUTTING_DOWN",
ForwardEventFailureReason::MAX_HTLC_VALUE_IN_FLIGHT => "MAX_HTLC_VALUE_IN_FLIGHT",
ForwardEventFailureReason::PEER_CANNOT_AFFORD_FEE => "PEER_CANNOT_AFFORD_FEE",
ForwardEventFailureReason::FUNDING_NOT_BROADCAST => "FUNDING_NOT_BROADCAST",
}.to_string()
}
}
Expand Down
1 change: 1 addition & 0 deletions common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
common/ecdh.h \
common/errcode.h \
common/forward_failure_reason.h \
common/funding_tx_status.h \
common/gossip_constants.h \
common/hash_str.h \
common/hsm_version.h \
Expand Down
5 changes: 5 additions & 0 deletions common/forward_failure_reason.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ enum forward_failure_reason {
* channel and can't pay the commitment fee for another HTLC output.
* Our own balance was sufficient */
FORWARD_FAIL_PEER_CANNOT_AFFORD_FEE = 16,
/* Outgoing channel is a zero-conf channel whose funding transaction
* has never been observed broadcast (mempool or confirmed) */
FORWARD_FAIL_FUNDING_NOT_BROADCAST = 17,
};

/* Returns NULL for FORWARD_FAIL_UNKNOWN - it is never serialized
Expand Down Expand Up @@ -94,6 +97,8 @@ static inline const char *forward_failure_reason_name(enum forward_failure_reaso
return "max_htlc_value_in_flight";
case FORWARD_FAIL_PEER_CANNOT_AFFORD_FEE:
return "peer_cannot_afford_fee";
case FORWARD_FAIL_FUNDING_NOT_BROADCAST:
return "funding_not_broadcast";
}

snprintf(invalidbuf, sizeof(invalidbuf), "unknown_reason_%i", (int)r);
Expand Down
17 changes: 17 additions & 0 deletions common/funding_tx_status.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#ifndef LIGHTNING_COMMON_FUNDING_TX_STATUS_H
#define LIGHTNING_COMMON_FUNDING_TX_STATUS_H
#include "config.h"

/* This is a DB ENUM!!!, please do not change the numbering of any
* already defined elements (adding is ok) */
enum funding_tx_status {
/* Never observed broadcast (or observed, but not yet accepted
* into our bitcoind's mempool) */
FUNDING_TX_STATUS_UNKNOWN = 0,
/* Our bitcoind accepted it into its mempool */
FUNDING_TX_STATUS_MEMPOOL = 1,
/* Seen in a scanned block */
FUNDING_TX_STATUS_CONFIRMED = 2,
};

#endif /* LIGHTNING_COMMON_FUNDING_TX_STATUS_H */
35 changes: 33 additions & 2 deletions contrib/msggen/msggen/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -22597,6 +22597,31 @@
]
}
}
},
"zeroconf-require-funding-seen": {
"added": "v26.12",
"type": "object",
"additionalProperties": false,
"required": [
"value_bool",
"source"
],
"properties": {
"value_bool": {
"added": "v26.12",
"type": "boolean",
"description": [
"Field from config or cmdline, or default."
]
},
"source": {
"added": "v26.12",
"type": "string",
"description": [
"Source of configuration setting."
]
}
}
}
}
}
Expand Down Expand Up @@ -22937,6 +22962,10 @@
"value_bool": false,
"source": "default"
},
"zeroconf-require-funding-seen": {
"value_bool": false,
"source": "default"
},
"dev-no-plugin-checksum": {
"set": true,
"source": "cmdline"
Expand Down Expand Up @@ -23760,7 +23789,8 @@
"invalid_onion",
"channel_shutting_down",
"max_htlc_value_in_flight",
"peer_cannot_afford_fee"
"peer_cannot_afford_fee",
"funding_not_broadcast"
],
"description": [
"The root cause of the failure, more specific than *failcode*/*failreason*. Only set for *local_failed* forwards, and not always known.",
Expand Down Expand Up @@ -42288,7 +42318,8 @@
"invalid_onion",
"channel_shutting_down",
"max_htlc_value_in_flight",
"peer_cannot_afford_fee"
"peer_cannot_afford_fee",
"funding_not_broadcast"
],
"description": [
"The root cause of the failure, more specific than *failcode*/*failreason*. Only set for *local_failed* forwards, and not always known.",
Expand Down
1,664 changes: 833 additions & 831 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2.py

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -2751,6 +2751,13 @@ def listconfigs_configs_watchtime_blocks2py(m):
})


def listconfigs_configs_zeroconf_require_funding_seen2py(m):
return remove_default({
"source": m.source, # PrimitiveField in generate_composite
"value_bool": m.value_bool, # PrimitiveField in generate_composite
})


def listconfigs_configs2py(m):
return remove_default({
})
Expand Down
12 changes: 12 additions & 0 deletions doc/lightningd-config.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,18 @@ all DNS lookups, to avoid leaking information.
uniform length. Some implementations don't accept these extra bytes,
and our detection of them is not always reliable, so this option defaults to `false`.

* **zeroconf-require-funding-seen**=*BOOL*

If set to `true`, we don't send HTLCs (payments or forwards) over a zero-conf
channel (`minimum_depth` 0) that our peer funded until our own bitcoind has seen
its funding transaction in the mempool or in a block. Forwards over it fail with
`failure_reason` `funding_not_broadcast` until then. We still exchange
`channel_ready` and accept incoming HTLCs over such a channel at once, so
just-in-time channels (e.g. LSPS2), whose funder only broadcasts the funding
transaction once the HTLC over it is accepted, keep working. Channels we funded
ourselves are not affected. Zero-conf means trusting the funder, so this
defaults to `false`.

* **tor-service-password**=*PASSWORD*

Set a Tor control password, which may be needed for *autotor:* to
Expand Down
29 changes: 29 additions & 0 deletions doc/schemas/listconfigs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,31 @@
]
}
}
},
"zeroconf-require-funding-seen": {
"added": "v26.12",
"type": "object",
"additionalProperties": false,
"required": [
"value_bool",
"source"
],
"properties": {
"value_bool": {
"added": "v26.12",
"type": "boolean",
"description": [
"Field from config or cmdline, or default."
]
},
"source": {
"added": "v26.12",
"type": "string",
"description": [
"Source of configuration setting."
]
}
}
}
}
}
Expand Down Expand Up @@ -2304,6 +2329,10 @@
"value_bool": false,
"source": "default"
},
"zeroconf-require-funding-seen": {
"value_bool": false,
"source": "default"
},
"dev-no-plugin-checksum": {
"set": true,
"source": "cmdline"
Expand Down
Loading
Loading