Commit graph

167 commits

Author SHA1 Message Date
daywalker90
7241ae39d3 bump to version 0.2.0 2026-08-09 20:15:55 +02:00
daywalker90
cc7d075bf4 CHANGELOG update 2026-08-09 20:15:55 +02:00
daywalker90
e98d4a1a54 refactor read to receive in code to match docs 2026-08-09 18:01:53 +02:00
daywalker90
7d132a60e4 add note for global notifications 2026-08-09 18:01:53 +02:00
daywalker90
d93a03014b fix reuse of retries counter in check_hold_support 2026-08-09 18:01:53 +02:00
daywalker90
1d5bd7c821 remove since filter because we now dedup all events by id 2026-08-09 18:01:53 +02:00
daywalker90
a26eb7a539 fix nwc-create rpc erroring if running nwc failed, log instead since we already persist it 2026-08-09 18:01:53 +02:00
daywalker90
101234e8ef fix error type if payment route was too expensive 2026-08-09 18:01:53 +02:00
daywalker90
ae4e00967d fix paying of amount-less invoices with a request amount 2026-08-09 18:01:53 +02:00
daywalker90
ffd9bd21e9 fix legacy keysend tlv byte decoding 2026-08-09 18:01:53 +02:00
daywalker90
102de7345d fix holdinvoice always having 0 deadline 2026-08-09 18:01:53 +02:00
daywalker90
2fcc48ce34 don't fail sending notifications on the first client error 2026-08-09 18:01:53 +02:00
daywalker90
2044151b4a use cln-rpc structs for notification deserialization 2026-08-09 18:01:53 +02:00
daywalker90
e175198c45 misc: fix log levels, substraction overflow, invoice valid check 2026-08-09 15:56:34 +02:00
daywalker90
b31f42691f fix unaccepted hold invoices in the accepted handler
holdinvoice_accepted_handler waited on the hold plugin track stream and
sent a HoldInvoiceAccepted notification afterwards, without checking the
reason the stream ended. When an invoice was cancelled, the stream just closes and the handler still sent
a spurious accepted notification.

Only send the notification if the stream actually reported the invoice
as accepted.

The hold plugin has no expired state: an invoice that expires without
ever being accepted stays Unpaid and the track stream never ends, so the
handler previously hung forever, holding a task and a gRPC stream open.

Pass the invoice's expiry into the handler and time out the track stream
at that point (capped), so it gives up on expired invoices and never
sends a spurious accepted notification. When re-spawning pending
invoices at startup, derive the expiry from the decoded bolt11.

Add test_hold_invoice_expiry which creates an invoice with a short
expiry and asserts the handler gives up without sending the notification.
2026-08-09 15:39:01 +02:00
daywalker90
29c1ace33c bound list_transactions work to prevent DoS
list_transactions was a DoS vector: it loaded the full invoice and
payment history, made one decode rpc-call per entry, and re-serialized
the whole result set for every trimmed entry (O(n^2)), all while holding
the global rpc lock that serializes every other nwc request and command.

- run list_transactions on a dedicated rpc connection so it no longer
  stalls the rest of the plugin
- page backwards through listinvoices by created_index instead of
  fetching the whole history, using the wait rpc to get the newest index
- only decode the kept candidates and honor the from/until and unpaid
  filters while collecting them
- cap work per request at MAX_TRANSACTIONS (500) regardless of node
  history size
- limit pays and hold invoices to the same bound before decoding
- make trim_to_size a single serialization pass instead of O(n^2)
2026-08-09 14:24:15 +02:00
daywalker90
c1bb7606cf reserve budget during in-flight payments, drop lock while paying 2026-08-09 12:29:09 +02:00
daywalker90
f79db424cd determine available methods from help rpc isntead of version string 2026-08-09 12:29:09 +02:00
daywalker90
b2078bab81 remove budget task, update budget on demand 2026-08-09 12:29:09 +02:00
daywalker90
651b11b229 return error on unsupported invoice type lookup for holdinvoices
Some checks are pending
master on CLN v25.09.x / call-ci (push) Waiting to run
master on CLN v25.12.x / call-ci (push) Waiting to run
master on CLN v26.04.x / call-ci (push) Waiting to run
master on CLN v26.06.x / call-ci (push) Waiting to run
2026-08-08 17:43:02 +02:00
daywalker90
408b015d91 improve handling of stale or duplicate events 2026-08-08 17:43:02 +02:00
daywalker90
6ff3069fa8 README: update binaries notes 2026-08-08 15:19:11 +02:00
daywalker90
76f10bc2c5 README: update CLN version 2026-08-08 15:19:11 +02:00
dependabot[bot]
66edfb7c5e Bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-08 15:18:53 +02:00
dependabot[bot]
0a078e0b76 Bump actions/cache from 5 to 6
Bumps [actions/cache](https://github.com/actions/cache) from 5 to 6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-08 15:16:39 +02:00
dependabot[bot]
07bf8288f5 Bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-08 15:16:06 +02:00
daywalker90
18c00d3442 SECURITY.md: init 2026-08-08 15:08:48 +02:00
daywalker90
5c65a94c13 add retry logic for hold server connect 2026-08-08 15:06:37 +02:00
daywalker90
f5b64586fc tests: update to nostr sdk 0.45 2026-08-08 15:06:37 +02:00
daywalker90
edd95056ab update for nostr 0.45 release version 2026-08-08 15:06:37 +02:00
daywalker90
6d984a0900 CI: download hold binary 2026-08-08 15:06:37 +02:00
daywalker90
61c07f6079 refactor, clippy and ruff fixes 2026-08-08 15:06:37 +02:00
daywalker90
f6517cab7e update dependencies 2026-08-08 15:06:37 +02:00
daywalker90
f85b2efcb3 update dependencies, upgrade nostr and cln dependencies 2026-08-08 15:06:37 +02:00
daywalker90
fb972c5ed1 CI: use specific python versions per CLN version 2026-08-08 15:06:37 +02:00
daywalker90
af306edd3a use xkeysend on CLN v26.06+ 2026-08-08 15:06:37 +02:00
daywalker90
b16db82693 more nostr v0.45 prep 2026-08-08 15:06:37 +02:00
daywalker90
6690c9d49d removed multi_* methods 2026-08-08 15:06:37 +02:00
daywalker90
78ac7cac05 prepare for nostr 0.45 2026-08-08 15:06:37 +02:00
daywalker90
5c5f49de29 wait for hold certs to be generated 2026-08-08 15:06:37 +02:00
daywalker90
c956338bcd add support for holdinvoices 2026-08-08 15:06:37 +02:00
dependabot[bot]
140d295eec Bump zerofrom from 0.1.7 to 0.1.8 in the all-dependencies group
Bumps the all-dependencies group with 1 update: [zerofrom](https://github.com/unicode-org/icu4x).


Updates `zerofrom` from 0.1.7 to 0.1.8
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: zerofrom
  dependency-version: 0.1.8
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-25 11:13:23 +02:00
dependabot[bot]
004e403d48 Bump the all-dependencies group with 3 updates
Bumps the all-dependencies group with 3 updates: [tokio](https://github.com/tokio-rs/tokio), [bitcoin](https://github.com/rust-bitcoin/rust-bitcoin) and [cc](https://github.com/rust-lang/cc-rs).


Updates `tokio` from 1.52.1 to 1.52.3
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.52.1...tokio-1.52.3)

Updates `bitcoin` from 0.32.8 to 0.32.9
- [Release notes](https://github.com/rust-bitcoin/rust-bitcoin/releases)
- [Changelog](https://github.com/rust-bitcoin/rust-bitcoin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-bitcoin/rust-bitcoin/compare/bitcoin-0.32.8...bitcoin-0.32.9)

Updates `cc` from 1.2.61 to 1.2.62
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.61...cc-v1.2.62)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.52.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: bitcoin
  dependency-version: 0.32.9
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: cc
  dependency-version: 1.2.62
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-18 11:24:31 +02:00
dependabot[bot]
a2781bee20 Bump rustls from 0.23.39 to 0.23.40 in the all-dependencies group
Bumps the all-dependencies group with 1 update: [rustls](https://github.com/rustls/rustls).


Updates `rustls` from 0.23.39 to 0.23.40
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.39...v/0.23.40)

---
updated-dependencies:
- dependency-name: rustls
  dependency-version: 0.23.40
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-11 09:34:45 +02:00
dependabot[bot]
0c2a2a15fb Bump the all-dependencies group with 4 updates
Bumps the all-dependencies group with 4 updates: [cc](https://github.com/rust-lang/cc-rs), [data-encoding](https://github.com/ia0/data-encoding), [libc](https://github.com/rust-lang/libc) and [rustls-pki-types](https://github.com/rustls/pki-types).


Updates `cc` from 1.2.60 to 1.2.61
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.60...cc-v1.2.61)

Updates `data-encoding` from 2.10.0 to 2.11.0
- [Commits](https://github.com/ia0/data-encoding/compare/v2.10.0...v2.11.0)

Updates `libc` from 0.2.185 to 0.2.186
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.186/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.185...0.2.186)

Updates `rustls-pki-types` from 1.14.0 to 1.14.1
- [Release notes](https://github.com/rustls/pki-types/releases)
- [Commits](https://github.com/rustls/pki-types/compare/v/1.14.0...v/1.14.1)

---
updated-dependencies:
- dependency-name: cc
  dependency-version: 1.2.61
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: data-encoding
  dependency-version: 2.11.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
- dependency-name: libc
  dependency-version: 0.2.186
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: rustls-pki-types
  dependency-version: 1.14.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-04 09:07:15 +02:00
dependabot[bot]
07159082d8 Bump the all-dependencies group with 2 updates
Bumps the all-dependencies group with 2 updates: [bitcoin-units](https://github.com/rust-bitcoin/rust-bitcoin) and [typenum](https://github.com/paholg/typenum).


Updates `bitcoin-units` from 0.1.2 to 0.1.3
- [Release notes](https://github.com/rust-bitcoin/rust-bitcoin/releases)
- [Changelog](https://github.com/rust-bitcoin/rust-bitcoin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-bitcoin/rust-bitcoin/compare/io-0.1.2...bitcoin-units-0.1.3)

Updates `typenum` from 1.19.0 to 1.20.0
- [Release notes](https://github.com/paholg/typenum/releases)
- [Changelog](https://github.com/paholg/typenum/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paholg/typenum/compare/v1.19.0...v1.20.0)

---
updated-dependencies:
- dependency-name: bitcoin-units
  dependency-version: 0.1.3
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: typenum
  dependency-version: 1.20.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-27 13:40:36 +02:00
daywalker90
7ec1e68d6c fix budget race condition 2026-04-23 11:04:47 +02:00
daywalker90
ce0e1fe585 Cargo.lock: update tokio to v1.52.1 2026-04-23 11:04:47 +02:00
dependabot[bot]
aff911ed90 Bump the all-dependencies group with 10 updates
Bumps the all-dependencies group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [tokio](https://github.com/tokio-rs/tokio) | `1.50.0` | `1.52.0` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.23.0` | `1.23.1` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.11.0` | `2.11.1` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.58` | `1.2.60` |
| [indexmap](https://github.com/indexmap-rs/indexmap) | `2.13.1` | `2.14.0` |
| [libc](https://github.com/rust-lang/libc) | `0.2.184` | `0.2.185` |
| [lru](https://github.com/jeromefroe/lru-rs) | `0.16.3` | `0.16.4` |
| [rustls](https://github.com/rustls/rustls) | `0.23.37` | `0.23.38` |
| [semver](https://github.com/dtolnay/semver) | `1.0.27` | `1.0.28` |
| [tokio-macros](https://github.com/tokio-rs/tokio) | `2.6.1` | `2.7.0` |


Updates `tokio` from 1.50.0 to 1.52.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.50.0...tokio-1.52.0)

Updates `uuid` from 1.23.0 to 1.23.1
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.23.0...v1.23.1)

Updates `bitflags` from 2.11.0 to 2.11.1
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.11.0...2.11.1)

Updates `cc` from 1.2.58 to 1.2.60
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.58...cc-v1.2.60)

Updates `indexmap` from 2.13.1 to 2.14.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/main/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.13.1...2.14.0)

Updates `libc` from 0.2.184 to 0.2.185
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.185/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.184...0.2.185)

Updates `lru` from 0.16.3 to 0.16.4
- [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jeromefroe/lru-rs/compare/0.16.3...0.16.4)

Updates `rustls` from 0.23.37 to 0.23.38
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.37...v/0.23.38)

Updates `semver` from 1.0.27 to 1.0.28
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.27...1.0.28)

Updates `tokio-macros` from 2.6.1 to 2.7.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-macros-2.6.1...tokio-macros-2.7.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.52.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
- dependency-name: uuid
  dependency-version: 1.23.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: bitflags
  dependency-version: 2.11.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: cc
  dependency-version: 1.2.60
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: indexmap
  dependency-version: 2.14.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
- dependency-name: libc
  dependency-version: 0.2.185
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: lru
  dependency-version: 0.16.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: rustls
  dependency-version: 0.23.38
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: semver
  dependency-version: 1.0.28
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: tokio-macros
  dependency-version: 2.7.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 11:04:47 +02:00
dependabot[bot]
f26b82bb51 Bump the cargo group across 1 directory with 2 updates
Bumps the cargo group with 2 updates in the / directory: [rand](https://github.com/rust-random/rand) and [rustls-webpki](https://github.com/rustls/webpki).


Updates `rand` from 0.8.5 to 0.8.6
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/0.8.6/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.8.6)

Updates `rustls-webpki` from 0.103.10 to 0.103.13
- [Release notes](https://github.com/rustls/webpki/releases)
- [Commits](https://github.com/rustls/webpki/compare/v/0.103.10...v/0.103.13)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.8.6
  dependency-type: indirect
  dependency-group: cargo
- dependency-name: rustls-webpki
  dependency-version: 0.103.13
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 00:40:13 +02:00