Commit Graph

14607 Commits

Author SHA1 Message Date
daywalker90
2d0778ec38 msggen: add delpay method 2024-04-22 13:28:58 +02:00
ShahanaFarooqui
c8337aaf7f plugin/wss-proxy: Documentation
Changelog-Added: Add WSS Proxy server with `wss-bind-addr` and `wss-certs` configurations.
2024-04-22 09:12:09 +09:30
ShahanaFarooqui
6b837ec024 plugin/wss-proxy: Testing WSS connection 2024-04-22 09:12:09 +09:30
ShahanaFarooqui
720af34d43 plugins/wss-proxy: Plugin included in core lightning 2024-04-22 09:12:09 +09:30
ShahanaFarooqui
c0d59fe4cc plugins/wss-proxy: Adding WSS Proxy plugin 2024-04-22 09:12:09 +09:30
daywalker90
fe180e189c msggen: add low level openchannel methods
Changelog-None
2024-04-22 09:04:43 +09:30
daywalker90
70faab55e4 msggen: fix for methods that contain '_' in their name 2024-04-22 09:04:43 +09:30
Rusty Russell
a55c0d005d spelling: its listinvoices and listinvoicerequests
Not singular (though we used to have a listinvoice, removed in v0.6.1).

Reported-by: "Plant" via email
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-20 10:49:50 -04:00
Rusty Russell
cd7175be88 lightningd: use return value of peer_start_channeld()
It tells us if it's failed, so we should use that rather than
reporting failure twice.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-20 16:36:57 +09:30
Rusty Russell
86c29b6acc lightningd: trivial cleanup: use tmpctx.
No need to explicitly free this var, we can use tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-20 16:36:57 +09:30
Rusty Russell
901342b50d pyln-testing: require explicit pattern for BROKEN messages.
Rather than `allow_broken_log`, we have `broken_log` which is a regex
indicating what log lines are expected.  This tightens our tests
significantly, as it will catch *unexpected* brokenness.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-20 16:36:57 +09:30
daywalker90
ada4de1588 msggen: fix walk through nested json schemas
Changelog-None
2024-04-18 18:16:30 +02:00
daywalker90
507c2de9c1 newaddr: various fixes for msggen and docs
Changelog-None
2024-04-17 14:47:52 +02:00
daywalker90
9ad5c6bc75 msggen: use field numbers from .msggen.json for rust model if available 2024-04-17 14:47:52 +02:00
daywalker90
58b78d2b32 schema: add multifundchannel generation
Changelog-None
2024-04-17 13:06:02 +02:00
daywalker90
4d306e2691 mssgen: preserve existing camel cases
an edge case like MultifundchannelChannel_idsChannel_type
was previously converted to MultifundchannelChannelIdschannelType
instead of the correct MultifundchannelChannelIdsChannelType
2024-04-17 13:06:02 +02:00
Rusty Russell
c4edec8e22 plugins/clnrest: simple wrapper to handle missing python3.
Apparently NixOS didn't have Python (sometimes!) so let's not assume.
By reusing the JSON "parsing" code from cowsay, we can self-disable
to handle this case.

Reported-by: Shahana Farooqui <shahana.farooqui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `clnrest` now correctly self-disables if Python not present at all.
2024-04-12 10:32:32 +02:00
Rusty Russell
7d8c723018 libplugin: cleanly separate apply and unapplying payment route.
They're close, but different.  In particular:
- Removal can't fail.
- Removal is much simpler.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-04 10:31:27 +02:00
ShahanaFarooqui
aff8f0ff5e doc: Updated dev command warning
Changelog-Changed: Documentation: Merged `example_json_request` and `example_json_response` in a single `json_examples` array to maintain the request and its corresponding response together.
2024-04-04 13:16:27 +10:30
ShahanaFarooqui
9e782f491b doc: updated schemas for json_examples 2024-04-04 13:16:27 +10:30
fanquake
dbcef94d8e ci: use Bitcoin Core 26.1
Changelog-None
2024-04-04 12:53:44 +10:30
Jesse de Wit
09d6bb9aed tests: add test_pay_avoid_low_fee_chan
Tests whether we're able to route around a low-fee channel in the graph. We
should be able to find the more expensive route if the cheaper route is
depleted.
2024-04-04 12:49:57 +10:30
Jesse de Wit
3b139277f5 pay: fix removal of channel hint estimated capacity
Changelog-Fixed: Plugins: pay now correctly estimates channel capacity
after payment failure, fixing some retry cases.

The `estimated_capacity` was properly substracted from the channel
hint, but adding the amount back did not work. The amount was added back
and then immediately substracted again. This caused the
`estimated_capacity` to ever decrease. This commit makes sure re-adding
the amount to the `estimated_capacity` works as expected.
2024-04-04 12:49:57 +10:30
Lagrang3
bb31856b80 remove is_local variable from listpeerchannels cb
is_local, ie. "is this side of the channel ours?" is not needed since we
can determine that predicate by evaluating
`scidd->dir == node_id_idx(self, peer)`
2024-04-03 10:07:13 +10:30
Lagrang3
22a70339de renepay: limit arc capacities by htlc_max
In the Min. Cost Flow solver we put a constraint on arcs capacities,
such that the total flow that can be allocated through a channel does
not exceed htlc_max. This solves two previous problem of the htlc_max
constraint at the MCF level.
2024-04-03 10:07:13 +10:30
Lagrang3
56ac5eebef add more fields to gossmods_listpeerchannels
Add spendable/receivable and is_local fields to the callback function
used in gossmods_from_listpeerchannels. This allows to do more fine
grained use of the listpeerchannels call.
The first use case is renepay, for which we need to ignore the htlc_max
of the local channels only.
2024-04-03 10:07:13 +10:30
Rusty Russell
5b76c2fbfa lightningd: fix memleak where we didn't free plugin_hook_request when it was finished.
Covered up by notleak() :(

Changelog-Fixed: lightingd: slow memory leak when using plugin hooks fixed (introduced in v23.11)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-03 08:48:46 +10:30
Rusty Russell
9a4be1a4ac lightningd: don't allow mindepth != 0 if they specify channel_type zeroconf.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `fundchannel_start` now disallows a non-zero `mindepth` parameter if you ask for a zeroconf `channel_type`.
2024-04-01 13:20:53 +02:00
Rusty Russell
06136ed3e3 fundchannel_start: delay, don't refuse, if node not synced.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
f3cedb9aa7 pytest: rename lightning nodes to reduce confusion.
I was trying to debug test_zeroconf_open and getting very confused.
The reason: l0 is lightning-1, l1 is lightning-2, etc!  And there are
two other tests where an l0 has been added at the front: fix them all
to avoid future confusion!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
2a92ccf9f2 openchannel_bump: delay, don't refuse, if node not synced.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
b9b86ca526 openchannel: delay, don't refuse, if node not synced.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
239f1a6ee6 lightningd: debug log when we send a notification to a command.
For testing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
ef45eacc95 lightningd: allow *outgoing* HTLCs before full bitcoind sync.
This allows for faster startup for Greenlight.  We still require full sync
before *incoming* htlcs, and onchain operations.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
Rusty Russell
05ef69fde1 lightningd: use get_network_blockheight() not get_block_height() for pay.
This is useful once we allow pay before full sync.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-04-01 13:20:53 +02:00
snoppy
bd12b0065d fix some typos 2024-04-01 07:23:42 +02:00
Rusty Russell
a9f76c7541 gossipd: be stricter with non-gossip_query nodes.
We now *never* consider asking them anything, even if they are
capable (e.g. enabling full gossip stream).  This aligns with
the latest spec proposal, where lack of `gossip_queries` means
"we don't have anything useful to say".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-31 12:32:05 +02:00
Rusty Russell
0d7d3f5c00 lightningd: revert f450dfeb55 to allow non-gossip_query nodes.
LDK doesn't set this feature if they don't have any useful gossip (mobile nodes)
and it was agreed at the spec meeting that we should repurpose this feature
to mean "I don't have any useful gossip".

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-31 12:32:05 +02:00
Erik De Smedt
4b8d2617bb Remove spurious import
The import is spurious and results in a warning when building the code.
I have removed the line to make the warning disappear
2024-03-29 14:29:00 +01:00
Jesse de Wit
2ee0033aac gitignore: Ignore clangd related things
- gitignore compile_commands.json
- gitignore .cache directory
2024-03-28 15:04:27 +01:00
Rusty Russell
7fe22b29e7 pytest: test parsing of bolt12 invoice strings in runes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
1f53c275ef runes: bolt12 parsing.
Changelog-Added: JSON-RPC: `createrune` new restriction `pinv` to examine bolt11/bolt12 invoice fields (e.g. amount of invoice).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
a3332dcc34 runes: handle lightning: prefix in invoice arguments
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
8114b3b437 pytest: add test for rune pinv bolt11 parsing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
7b4bd38162 runes: add support for pinv bolt11 parsing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
3483bff66b doc: document the rune conditions for parsing invoice strings.
This pre-promises an implementation, which we are now going to write!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-27 16:09:23 +10:30
Rusty Russell
22b713d6b7 plugins: remove allowance for missing JSON id in commando.
Changelog-Removed: Plugins: no longer allow missing `id` field in commando requests (deprecated v23.02, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30
Rusty Russell
9960454159 lightningd: remove createrune restrictions as strings.
Changelog-Removed: JSON-RPC: `createrune` restrictions as raw strings (use arrays) (deprecated v23.05, EOL 24.02).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30
Rusty Russell
4e086f28c3 lightningd: remove channels from listpeers.
Changelog-Removed: JSON-RPC: `listpeers` `channels` (deprecated v23.02, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30
Rusty Russell
99db9b795e lightningd: remove handling of invalid sendpay route first channel
Changelog-Removed: JSON-RPC: `sendpay` ignoring first channel (deprecated v0.12, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-03-25 15:02:35 +10:30