Commit graph

169 commits

Author SHA1 Message Date
daywalker90
27768bb95d CI: fix mkdir error
Some checks failed
master on CLN v25.09.x / call-ci (push) Has been cancelled
master on CLN v25.12.x / call-ci (push) Has been cancelled
master on CLN v26.04.x / call-ci (push) Has been cancelled
master on CLN v26.06.x / call-ci (push) Has been cancelled
2026-08-12 00:27:11 +02:00
daywalker90
7c100cf5d2 add default relays
Some checks failed
master on CLN v25.09.x / call-ci (push) Has been cancelled
master on CLN v25.12.x / call-ci (push) Has been cancelled
master on CLN v26.04.x / call-ci (push) Has been cancelled
master on CLN v26.06.x / call-ci (push) Has been cancelled
2026-08-09 20:15:55 +02:00
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