Commit Graph

262 Commits

Author SHA1 Message Date
Rusty Russell
7b2c791dcf doc: fix up missing fields from schemas.
This allows the next patch (which makes the schemas stricter) to not
break our tests.

We add some missing fields (including dev fields, but they're empty and hidden),
and add a few minor clarifications and a spelling fix.  Most of these are new
schemas for this release, so no mention in Changelog.

Here is the difference in the man pages:

    --- doc/lightning-askrene-inform-channel.7.md.old	2024-10-29 17:33:07.714521584 +1030
    +++ doc/lightning-askrene-inform-channel.7.md	2024-10-29 17:42:37.434280109 +1030
    @@ -24,6 +24,8 @@
     - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
    +- **layer** (string): The name of the layer to apply this change to.
    +- **timestamp** (u64): The UNIX timestamp when this constraint was created.
     - **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
    --- doc/lightning-askrene-listlayers.7.md.old	2024-10-29 17:33:07.716521571 +1030
    +++ doc/lightning-askrene-listlayers.7.md	2024-10-29 17:42:37.424280316 +1030
    @@ -29,13 +29,16 @@
     - **channel\_updates** (array of objects):
    +  - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction this update applies to.
    +  - **enabled** (boolean, optional): True if this can be used, false otherwise.
       - **htlc\_minimum\_msat** (msat, optional): The minimum value allowed in this direction.
       - **htlc\_maximum\_msat** (msat, optional): The maximum value allowed in this direction.
       - **fee\_base\_msat** (msat, optional): The base fee to apply to use the channel in this direction.
       - **fee\_proportional\_millionths** (u32, optional): The proportional fee (in parts per million) to apply to use the channel in this direction.
    -  - **delay** (u16, optional): The CLTV delay required for this direction.
    +  - **cltv\_expiry\_delta** (u16, optional): The CLTV delay required for this direction.
     - **constraints** (array of objects):
       - **short\_channel\_id\_dir** (short\_channel\_id\_dir): The short channel id and direction
    +  - **timestamp** (u64, optional): The UNIX timestamp when this constraint was created.
       - **maximum\_msat** (msat, optional): The maximum value which this channel could pass.
    --- doc/lightning-askrene-listreservations.7.md.old	2024-10-29 17:33:07.719521550 +1030
    +++ doc/lightning-askrene-listreservations.7.md	2024-10-29 17:42:37.428280233 +1030
    @@ -16,7 +16,7 @@
    -On success, an object containing **layers** is returned. It is an array of objects, where each object contains:
    +On success, an object containing **reservations** is returned. It is an array of objects, where each object contains:
    --- doc/lightning-autoclean-status.7.md.old	2024-10-29 17:33:07.732521462 +1030
    +++ doc/lightning-autoclean-status.7.md	2024-10-29 17:42:37.441279965 +1030
    @@ -9,7 +9,7 @@
     
    -The **autoclean-status** RPC command tells you about the status of the autclean plugin, optionally for only one subsystem.
    +The **autoclean-status** RPC command tells you about the status of the autoclean plugin, optionally for only one subsystem.
     
    --- doc/lightning-renepay.7.md.old	2024-10-29 17:33:07.927520140 +1030
    +++ doc/lightning-renepay.7.md	2024-10-29 17:42:37.996268504 +1030
    @@ -58,6 +58,9 @@
     - **status** (string) (one of "complete", "pending", "failed"): Status of payment.
    +- **bolt11** (string, optional): The bolt11 invoice paid. *(added v23.08)*
    +- **bolt12** (string, optional): The bolt12 invoice paid. *(added v23.08)*
    +- **groupid** (u64, optional): The groupid used for these payment parts (as can be seen in listsendpays) *(added v23.08)*
     - **destination** (pubkey, optional): The final destination of the payment.
    --- doc/lightning-sendonion.7.md.old	2024-10-29 17:33:07.937520073 +1030
    +++ doc/lightning-sendonion.7.md	2024-10-29 17:42:37.957269309 +1030
    @@ -22,7 +22,7 @@
    -- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute*.:
    +- **first\_hop** (object): Instructs Core Lightning which peer to send the onion to. It is a JSON dictionary that corresponds to the first element of the route array returned by *getroute* (so fields not mentioned here are ignored).:
    
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `renepay` return fields documented in schema (`bolt11`, `bolt12` and `groupid`)
2024-10-30 15:39:12 +10:30
Rusty Russell
fd717c71af global: deprecate old names in JSON fields, add new ones.
Changelog-Added: JSON-RPC: `decode` now used modern BOLT 4 language for blinded paths, `first_path_key`.
Changelog-Deprecated: JSON-RPC: `decode` `blinding` in blinded path: use `first_path_key`.
Changelog-Added: Plugins: `onion_message_recv` and `onion_message_recv_secret` hooks now used modern BOLT 4 language for blinded paths, `first_path_key`.
Changelog-Deprecated: JSON-RPC: `onion_message_recv` and `onion_message_recv_secret` hooks `blinding` in blinded path: use `first_path_key`.
2024-10-16 07:14:32 +10:30
Se7enZ
f9e28b9bfa keysend: Add maxfee to keysend for consistency with pay. ([#7227])
Changelog-Added: keysend: Add `maxfee` to keysend for consistency with pay. ([#7227])
2024-10-14 11:58:00 +02:00
Tommy Volk
6bd5933a50 chore: bump rust bitcoin to 0.31 2024-10-08 18:56:05 +02:00
Rusty Russell
21fcd4594b cln-rpc/src/model.rs: fix difference between master and my machine.
Not sure why this differs from master, so trying pushing my version
to master?

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-09-24 10:24:51 +09:00
Peter Neuroth
0a6870f13d rust-libs: Bump versions
We bump the version to minor version 0.2 to allow ourselves to bump on
patch level when we need to fix a bug or update a dependency.

Changelog-Changed: Plugins: `cln-grpc` Upgrade tonic version and
introduce new versioning scheme.

Signed-off-by: Peter Neuroth <pet.v.ne@gmail.com>
2024-09-22 00:12:39 -07:00
Jesse de Wit
2798b4b7be cln-grpc: add anchors/even to primitives
The `anchors/even` channel type was missing from the grpc bindings.
It is now the default channel type, so `fundchannel` over grpc fails
with:

```
Failed to deserialize response : unknown variant `anchors/even`,
expected one of `static_remotekey/even`, `anchor_outputs/even`,
`anchors_zero_fee_htlc_tx/even`, `scid_alias/even`, `zeroconf/even`
```

Changelog-Changed: Channel type `anchors/even` was added
to the grpc bindings.
2024-09-20 17:01:04 -07:00
Rusty Russell
4578748aca plugins/Makefile: fail if jq command fails.
Nested within the loop, jq would fail silently.

This can happen if jq is too old.

Fixes: https://github.com/ElementsProject/lightning/issues/7657
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-09-17 17:02:22 +02:00
laanwj
c8660c85ba schemas: "description" field in "wait(any)invoice" is optional since BOLT12
For BOLT12 invoices, the "description" is field missing in the invoice
responses. Update the schemas accordingly:

- `doc/schemas/lightning-waitanyinvoice.json`
- `doc/schemas/lightning-waitinvoice.json`

Also commit the generated msggen, cln-grpc, cln-rpc and pyln-grpc-proto files.

Changelog-Fixed: schemas: Make description in `Wait(any)invoiceResponse` optional to handle BOLT12
2024-09-16 16:03:07 +09:30
Lagrang3
9afc10bf99 renepay: add cli option exclude
msggen cannot handle the complex type in renepay-exclude,
therefore I added a rule override for it, just like pay-exclude.

```
msggen cln-grpc/proto/node.proto
Traceback (most recent call last):
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 131, in <module>
    main()
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 115, in main
    run()
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/__main__.py", line 72, in run
    service = load_jsonrpc_service(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/utils/utils.py", line 241, in load_jsonrpc_service
    methods = [load_jsonrpc_method(name) for name in grpc_method_names]
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/utils/utils.py", line 209, in load_jsonrpc_method
    request = CompositeField.from_js(schema["methods"][rpc_name]['request'], path=name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 297, in from_js
    field = ArrayField.from_js(fpath, ftype)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 464, in from_js
    itemtype = UnionField.from_js(child_js, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rusty/devel/cvs/lightning/contrib/msggen/msggen/model.py", line 393, in from_js
    itemtype = PrimitiveField(
               ^^^^^^^^^^^^^^^
TypeError: PrimitiveField.__init__() missing 2 required positional arguments: 'added' and 'deprecated'
```

Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
Changelog-EXPERIMENTAL: renepay: add cli option "exclude" to manually disable channels and nodes.
2024-08-12 22:44:58 -07:00
michael1011
d32433a553 bkpr: add payment_id parameter to listaccountevents to filter events.
When you have *lots* of events in your bkpr database looking up a
specific event via calling bkpr-listaccountevents and using jq or
grep to filter gets very slow (and wasteful of CPU and disk resources).
This commit adds the paremeter payment_id to the call to filter for a
specific payment id via a where clause in the request to the database of bkpr.

Changelog-Added: Plugins: Add payment_id parameter to bkpr-listaccountevents to filter events.
2024-08-12 10:22:55 -07:00
ShahanaFarooqui
1ec508eb54 doc: Fixing schema definition
- `Notes` is not a required field in renepaystatus response
2024-08-09 23:56:45 -07:00
Rusty Russell
bf549130d6 global: update BOLT12 quotes.
This is a final sweep to match the current BOLT12 text:

	1563d13999d342680140c693de0b9d65aa522372 ("More bolt12 test vectors.")

Only two code changes, to change the order of checks to match the bolt,
and to give a warning on decode if a path is empty.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-08-01 12:31:48 +09:30
Rusty Russell
f2a7b19281 plugins/offers: handle invreq_paths in invoice_requests, set them if necessary.
Changelog-EXPERIMENTAL: offers: `invoicerequest` will set a blinded path if we're an unannounced node.
Changelog-EXPERIMENTAL: offers: `sendinvoice` will use a blinded path in an invoice_request, if specified.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-08-01 12:31:48 +09:30
Rusty Russell
0f0a0cf153 doc: mark schema offer_node_id and warning_missing_offer_node_id deprecated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-08-01 12:31:48 +09:30
Rusty Russell
925e90ee8b wire: rename "offer_node_id" to "offer_issuer_id" to match latest BOLT.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-08-01 12:31:48 +09:30
ShahanaFarooqui
b485a026f7 rpc: Removing description from json_command struct 2024-07-31 14:42:58 +09:30
ShahanaFarooqui
89c182e2be rpc: Removing category and verbose from json_command struct 2024-07-31 14:42:58 +09:30
Rusty Russell
3c04b6f8d3 lightningd: remove expermential "sendonionmessage" function.
It was only ever expermental, so I don't feel bad about just removing it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Removed: JSON-RPC: `sendonionmessage` (was experimental only, use `injectonionmessage`)
2024-07-18 10:53:55 +09:30
Dusty Daemon
21bc89f189 splice: Add funding outnum
Fixes #7005

Changelog-Changed: Added outnum of new funding output to splice_signed RPC command
2024-07-15 13:31:01 -05:00
Vincenzo Palazzo
05f5976a9c bolt12: partial support for minimal offer
Making sure that we are able to fetch the invoice
from an offer without description

E           pyln.client.lightning.RpcError: RPC call failed: method:
offer, payload: {'amount': '2msat'}, error: {'code': -32602, 'message':
'bolt12: Offer does not contain a description: invalid token
\'"lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqyppvggz953rvg9rtxj8lalh43z8epwydjfrmffn3y3p5qz5cywpu09rr4vs"\''}

Link: https://github.com/ElementsProject/lightning/issues/7405
Link: https://github.com/ElementsProject/lightning/issues/7404
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2024-07-11 14:51:56 +09:30
Tommy Volk
a3c15e8a4a chore: add ShortChannelId::to_u64 2024-07-10 11:49:19 +02:00
Rusty Russell
7f71e6353a doc: fix schema for listconfigs.
We never call `listconfigs` in our tests with `experimental-offers` enabled,
so we didn't notice that the schema is wrong: it does not expect the
"plugin" field in 'fetchinvoice-noconnect'.

The next patch folds the fetchinvoice plugin into the offers plugin,
which is enabled even if `experimental-offers` isn't (for `decode`),
so we notice it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-09 15:09:29 +02:00
Erik De Smedt
62e82c20d7 Fix: Add notifications.rs to $(CHECK_GEN_ALL) target
The file `cln-rpc/src/notifications.rs` is generated by `msggen`.

The `Makefile` has tooling to update the file when needed
- `make check-gen-updated` should error if file isn't properly updated
- `make gen` updates the file

This comit fixes both behaviors mentioned above.
2024-07-02 11:42:14 +09:30
ShahanaFarooqui
51e46339a7 docs: notifications schema update
Changelog-None.
2024-06-26 21:06:16 -07:00
Rusty Russell
84b6601bb3 autoclean: remove autocleaninvoice command.
Changelog-Removed: JSON-RPC: `autocleaninvoice` command (deprecated v22.11, EOL v24.02)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-06-20 16:14:38 +09:30
Rusty Russell
0afaf2f3ca msggen: don't spam every time we rebuild.
2923 lines of output?  Even with warnings-only, it's 59 lines, so only
enable that with `make V=1`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-06-19 12:34:41 +02:00
Rusty Russell
d1d9d7ee6f offers: remove deprecated @ prefix.
Somehow, this documentation got lost during the Great Rewrite, so
restore that too.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSON-RPC: `offer` removed `@` prefix support from `recurrence_base` (use `recurrence_start_any_period` set to `false`)
2024-06-14 11:30:26 +09:30
Alex Myers
b17bc9cc69 meta: bump rust versions for 24.05 release 2024-06-04 20:23:24 -05:00
Se7enZ
e5a1d9331f msggen: Include AddPsbtOutput to RPC list and meta field map; regenerate libraries 2024-05-23 15:55:57 -05:00
daywalker90
5430b65b4c msggen: add checkrune method 2024-05-17 16:30:43 +02:00
daywalker90
b4c061798c msggen: add blacklistrune method 2024-05-17 16:30:43 +02:00
daywalker90
473694c39a msggen: add createrune method 2024-05-17 16:30:43 +02:00
daywalker90
19646f93c6 msggen: add showrunes method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
21446c3401 msggen: add multiwithdraw method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
f83732f990 msggen: add makesecret method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
1dd16f72fb msggen: add listconfigs method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
c9a9d62367 msggen: add listinvoicerequests, disableinvoicerequest, invoicerequest methods
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
6acfca7517 msggen: add routes to decode and decodepay
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
c8d88c9130 msggen: fix invoice request missing exposeprivatechannels
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
bd1123cf32 msggen: add help method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
5510445bbc msggen: add funderupdate method
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
5047bc6dd1 msggen: add emergencyrecover, recover, recoverchannel methods
Changelog-None
2024-05-17 16:30:43 +02:00
daywalker90
16c036eed8 msggen: add dev-forget-channel method
Changelog-None
2024-05-17 16:30:43 +02:00
Erik De Smedt
151975b282 msggen: Allow non_camel_case for notification
In rust enum are expected to be CamelCase.
However, we are generating enum's using CAPITAL_SNAKE_CASE.

This generates a warning and breaks CI.

See `cln_rpc::notifications::ConnectAddressType::LOCAL_SOCKET`
2024-05-16 14:00:18 +02:00
Erik De Smedt
867465c0ed cln_rpc: Test deserialize_connect_notification 2024-05-16 14:00:18 +02:00
Erik De Smedt
83cc6c44e0 msggen: Schema for ConnectNotification + collisions
The schema in the docs for the `ConnectNotification` was faulty.
I've already fix this in https://github.com/ElementsProject/lightning/pull/7085

The new schema is

```
{
  "connect" :  {
    "address" : {
      "address" : "127.0.0.1",
      "port" : 38012,
      "type" : "ipv4"
  },
  "direction" : "in",
  "id" : "022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59"
  }
}
```

The `address` in the `connect` field will be encoded in protobuf as
`ConnectAddress`. However, this collides with the `ConnectAddress` that
is defined in the `connect` rpc-method.

This commit
- Updates the schema in `doc/schemas/notification/connect.json`
- Changes `msggen` to include an override to `PeerConnect` for any
  notification typename that starts with `Connect`

Both have an `address` field which is a composite type. This results in
naming collisions

schema's: Updated schema for connect-notification

schema for connect notification + overrides

Override ConnectAddress to `PeerConnectAddress` in protobuf
for notifications
2024-05-16 14:00:18 +02:00
Erik De Smedt
c5a47c3149 msggen: RequestStructs for notification-streams
I'm working to expose a stream of notifications over grpc.
This requries me to define structs that can be used to request
a stream of notifications.

These structs are all empty.
2024-05-16 14:00:18 +02:00
Erik De Smedt
6b34c722f3 cln-rpc: Test for serialization of block_added 2024-05-16 14:00:18 +02:00
Erik De Smedt
d743cf253f msggen: Add test for serialization of notifications 2024-05-16 14:00:18 +02:00