Skip to content

Commit 28de1b3

Browse files
authored
Merge branch 'master' into add-testnet4-support
2 parents ebf3e84 + cc07f9a commit 28de1b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+896
-620
lines changed

.github/workflows/release.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
---
2+
# https://docs.corelightning.org/docs/release-checklist
3+
name: "Release 🚀"
4+
on:
5+
push:
6+
tags:
7+
- 'v[0-9]+.[0-9]+'
8+
- 'v[0-9]+.[0-9]+.[0-9]+'
9+
- 'v[0-9]+.[0-9]+[0-9a-z]+'
10+
workflow_dispatch:
11+
inputs:
12+
version:
13+
description: 'Release version'
14+
required: true
15+
create_release:
16+
description: Create a draft release
17+
default: no
18+
type: choice
19+
options:
20+
- yes
21+
- no
22+
23+
jobs:
24+
check:
25+
name: Check
26+
outputs:
27+
version: ${{ steps.capture.outputs.version }}
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- name: Git checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-tags: true
34+
35+
- name: Determine version
36+
run: |
37+
if [[ "${{ github.event.inputs.version }}" != "" ]]; then
38+
VERSION="${{ github.event.inputs.version }}"
39+
elif [ "${{ github.ref_type }}" == "tag" ]; then
40+
VERSION="${{ github.ref_name }}"
41+
else
42+
echo "No release version provided and no tag found."
43+
exit 1
44+
fi
45+
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
46+
echo "Determined version: $VERSION"
47+
48+
- name: Validate release
49+
run: tools/check-release.sh --version=${VERSION}
50+
51+
- name: Catpure version output
52+
id: capture
53+
run: echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
54+
55+
releases:
56+
name: Releases
57+
needs: check
58+
runs-on: ubuntu-24.04
59+
strategy:
60+
fail-fast: false # Let each build finish.
61+
matrix:
62+
target:
63+
- 'bin-Fedora-28-amd64'
64+
- 'bin-Ubuntu-focal'
65+
- 'bin-Ubuntu-jammy'
66+
- 'bin-Ubuntu-noble'
67+
steps:
68+
- name: Git checkout
69+
uses: actions/checkout@v4
70+
with:
71+
fetch-tags: true
72+
73+
# tools/build-release.sh requires lowdown
74+
- name: Prepare base environment
75+
run: |
76+
sudo apt-get install -y lowdown
77+
./configure
78+
79+
- name: Build environment setup
80+
run: |
81+
distribution=$(echo ${{ matrix.target }} | cut -d'-' -f3)
82+
echo "Building base image for ${distribution}"
83+
sudo docker run --rm -v $(pwd):/build ubuntu:${distribution} bash -c "\
84+
apt-get update && \
85+
apt-get install -y debootstrap && \
86+
debootstrap ${distribution} /build/${distribution}"
87+
sudo tar -C ${distribution} -c . | docker import - ${distribution}
88+
89+
# Build Docker image
90+
docker build -t cl-repro-${distribution} - < contrib/reprobuild/Dockerfile.${distribution}
91+
if: contains(matrix.target, 'Ubuntu')
92+
93+
- name: Build release
94+
run: tools/build-release.sh ${{ matrix.target }}
95+
96+
- name: Upload target artifacts
97+
uses: actions/upload-artifact@v4
98+
with:
99+
path: release/
100+
name: ${{ matrix.target }}
101+
if-no-files-found: error
102+
103+
artifact:
104+
name: Construct release artifact
105+
needs:
106+
- check
107+
- releases
108+
env:
109+
version: ${{ needs.check.outputs.version }}
110+
runs-on: ubuntu-24.04
111+
steps:
112+
- name: Merge artifacts
113+
uses: actions/upload-artifact/merge@v4
114+
with:
115+
name: c-lightning-${{ env.version }}
116+
pattern: bin-*
117+
delete-merged: true
118+
119+
release:
120+
name: Sign and prepare release draft
121+
needs:
122+
- check
123+
- artifact
124+
env:
125+
version: ${{ needs.check.outputs.version }}
126+
runs-on: ubuntu-24.04
127+
steps:
128+
- name: Git checkout
129+
uses: actions/checkout@v4
130+
with:
131+
fetch-tags: true
132+
133+
- name: Download artifact
134+
uses: actions/download-artifact@v4
135+
with:
136+
name: c-lightning-${{ env.version }}
137+
path: release/
138+
139+
- name: Import GPG keys
140+
id: gpg
141+
uses: crazy-max/ghaction-import-gpg@v6
142+
with:
143+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
144+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
145+
trust_level: 5
146+
147+
- name: Set default GPG key
148+
run: echo "default-key ${{ steps.gpg.outputs.keyid }}" >> ~/.gnupg/gpg.conf
149+
150+
- name: Sign release
151+
run: |
152+
sudo apt-get install -y lowdown
153+
./configure
154+
tools/build-release.sh --without-zip sign
155+
mv release/SHA256SUMS.asc${{ steps.gpg.outputs.keyid }} release/SHA256SUMS.asc
156+
157+
- name: Upload signed artifact
158+
uses: actions/upload-artifact@v4
159+
with:
160+
name: c-lightning-${{ env.version }}
161+
overwrite: true
162+
path: release/
163+
164+
- name: Determine release data
165+
id: release_data
166+
run: |
167+
VERSION=${{ env.version }}
168+
CHANGELOG_VERSION=${VERSION#v}
169+
echo "CHANGELOG_VERSION=$CHANGELOG_VERSION"
170+
echo "changelog_version=$CHANGELOG_VERSION" >> "$GITHUB_OUTPUT"
171+
172+
CHANGELOG_TITLE=$(grep "## \[${CHANGELOG_VERSION}\]" CHANGELOG.md)
173+
echo "CHANGELOG_TITLE=$CHANGELOG_TITLE"
174+
echo "changelog_title=$CHANGELOG_TITLE" >> "$GITHUB_OUTPUT"
175+
176+
RELEASE_TITLE=$(echo $CHANGELOG_TITLE | cut -d'"' -f2)
177+
echo "RELEASE_TITLE=$RELEASE_TITLE"
178+
echo "release_title=$RELEASE_TITLE" >> "$GITHUB_OUTPUT"
179+
180+
- name: Prepare release draft
181+
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'yes')
182+
uses: softprops/action-gh-release@v2
183+
with:
184+
name: "${{ env.version }} ${{ steps.release_data.outputs.release_title }}"
185+
tag_name: ${{ env.version }}
186+
draft: true
187+
prerelease: contains(env.version, "-rc")
188+
files: release/*
189+
fail_on_unmatched_files: true

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
24.11rc1
1+
24.11rc4

CHANGELOG.md

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,7 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6-
## v24.11rc1 - 2024-11-26
7-
8-
This release named by Dusty Daemon.
9-
10-
### Added
11-
12-
- Documentation: Test script generates all RPC documentation examples now (so they should now stay accurate and complete). ([#7756])
13-
- JSON-RPC: `listaddresses` to list issued addresses from the node. ([#7800])
14-
- Config: `autoconnect-seeker-peers`, allowing seeker to reach out to new nodes for additional gossip (default: 10). ([#7798])
15-
- Protocol: `option_quiesce` enabled by default. ([#7586])
16-
- JSON-RPC: `fetchinvoice` allows setting invreq_metadata via `payer_metadata` parameter. ([#7786])
17-
- hsmtool: generatehsm can run non-interactive, taking options on the cmdline. ([#7102])
18-
- Plugins: `pay` now has tracing support for various payment steps. ([#7803])
19-
- JSON-RPC: `exposesecret` command for encouraging hsm_secret backups. ([#7647])
20-
- JSON-RPC: `listpays` has `index`, `start` and `limit` parameters for listing control. ([#7385])
21-
- Plugins: bookkeeper has a new RPC `bkpr-editdescriptionbypaymentid` which will update the description for any event with matching payment_id ([#7604])
22-
- Config: `grpc-host` option for grpc plugin ([#7479])
23-
- JSON-RPC: A new magic `dev-splice` command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time. ([#6980])
24-
- JSON-RPC: low-level RPC command `addpsbtinput` to fund PSBTs directly and help with complex splices & dual-opens. ([#6980])
25-
- JSON-RPC: `stfu_channels` and `abort_channels` are added for bulk multi-channel splice commands. These allow the user to pause (and resume) multiple channels in place. ([#6980])
26-
- JSON-RPC: `injectpaymentonion` for initiating an HTLC like a peer would do. ([#7749])
27-
- Documentation: Example documentation on generating custom gRPC ([#7731])
28-
- Installation: Nix users can now install CLN from the new flake. ([#7656])
29-
- JSON-RPC: `decode` now used modern BOLT 4 language for blinded paths, `first_path_key`. ([#7586])
30-
- Plugins: `onion_message_recv` and `onion_message_recv_secret` hooks now used modern BOLT 4 language for blinded paths, `first_path_key`. ([#7586])
31-
- JSON-RPC: keysend `maxfee` parameter for consistency with pay. ([#7227]) ([#7653])
32-
- `hsmtool`: `getnodeid` command derives the node id from the hsm_secret, to verify it's the correct secret. ([#7644])
33-
34-
## v24.11rc1 - 2024-11-26
6+
## [24.11rc4] - 2024-12-02: "The lightning-dev Mailing List"
357

368
This release named by Dusty Daemon.
379

@@ -43,6 +15,7 @@ This release named by Dusty Daemon.
4315
- JSON-RPC: `fetchinvoice` allows setting invreq_metadata via `payer_metadata` parameter. ([#7786])
4416
- hsmtool: generatehsm can run non-interactive, taking options on the cmdline. ([#7102])
4517
- Plugins: `pay` now has tracing support for various payment steps. ([#7803])
18+
- Plugins: new notification `onionmessage_forward_fail`.
4619
- JSON-RPC: `exposesecret` command for encouraging hsm_secret backups. ([#7647])
4720
- JSON-RPC: `listpays` has `index`, `start` and `limit` parameters for listing control. ([#7385])
4821
- Plugins: bookkeeper has a new RPC `bkpr-editdescriptionbypaymentid` which will update the description for any event with matching payment_id ([#7604])
@@ -64,12 +37,16 @@ This release named by Dusty Daemon.
6437
- Plugins: grpc now starts on port 9736 by default (localhost, see `grpc-host`) ([#7479])
6538
- Config: bolt12 now enabled by default (finally!) ([#7833])
6639
- Protocol: we now connect to additional nodes for improved gossip (see `autoconnect-seeker-peers`) ([#7798])
40+
- Protocol: Own-channel gossip is broadcast to more peers (up to 50, not 5). ([#7873])
41+
- Build: Added architecture identifier to Ubuntu release ([#7797])
42+
- Logging: connectd now logs unknown messages as "UNKNOWN" not "INVALID" to avoid freaking people out. ([#7892])
6743
- Protocol: we now create a low-priority (2016 down to 12 blocks fee target) anchor for low-fee unilateral closes even if there's no urgency. ([#7832])
6844
- Protocol: splicing moved from test numbers to spec numbers. ([#7719])
6945
- Protocol: Support added for peers that wish to rotate their funding pubkey during a splice. ([#7719])
7046
- Startup: reconnecting to peers at startup should be significantly faster (dependent on machine speed). ([#7630])
7147
- Protocol: we remember the last successful address we connected to for important peers. ([#7630])
7248
- Protocol: Gossipd requests a full sync from a random peer every hour. ([#7768])
49+
- JSON-RPC: `injectonionmessage` API simplified and documented.
7350
- JSON-RPC: Improved error messaging for splice commands. ([#7719])
7451
- JSON-RPC: built-in plugins can now be stopped using "plugin stop". ([#7799])
7552
- Wallet: Taproot addresses are used for unilateral-close change addresses. ([#7800])
@@ -94,6 +71,7 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
9471

9572
### Fixed
9673

74+
- JSON-RPC: `decode` refused to decode expired bolt12 invoices. ([#7890])
9775
- JSON-RPC: `listforwards` `received-time` is always present (it could be missing for ancient nodes, now it will be 0) ([#7744])
9876
- Plugins: `cln-grpc` now understands channel type `anchors/even` ([#7628])
9977
- Plugins: `cln-grpc` no longer logs a warning if a notification does not have a handler ([#7867])
@@ -123,6 +101,7 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
123101
- lightningd: no longer crash if a plugin dies during lightningd startup. ([#7673])
124102
- cln-plugin: Change default log level filter back to INFO ([#7668])
125103
- Logging: removed bogus "**BROKEN** plugin-topology: DEPRECATED API USED: listchannels.include_private" message. ([#7663])
104+
- Logging: When DEBUG printing first tx depth, we printed the wrong value ([#7910])
126105
- Documentation: schemas: Make description in `Wait(any)invoiceResponse` optional to handle BOLT12 ([#7667])
127106
- Fixed intermittant bug where hsmd (particularly, but also lightningd) could use 100% CPU. ([#7661])
128107
- Docker image created via github actions correctly reads the tag available on the HEAD. ([#7625])
@@ -196,7 +175,12 @@ Note: You should always set `allow-deprecated-apis=false` to test for changes.
196175
[#7740]: https://github.com/ElementsProject/lightning/pull/7740
197176
[#7704]: https://github.com/ElementsProject/lightning/pull/7704
198177
[#7756]: https://github.com/ElementsProject/lightning/pull/7756
199-
[24.11rc1]: https://github.com/ElementsProject/lightning/releases/tag/v24.11rc1
178+
[#7873]: https://github.com/ElementsProject/lightning/pull/7873
179+
[#7890]: https://github.com/ElementsProject/lightning/pull/7890
180+
[#7797]: https://github.com/ElementsProject/lightning/pull/7797
181+
[#7892]: https://github.com/ElementsProject/lightning/pull/7892
182+
[#7910]: https://github.com/ElementsProject/lightning/pull/7910
183+
[24.11rc4]: https://github.com/ElementsProject/lightning/releases/tag/v24.11rc4
200184

201185

202186
## [24.08.2] - 2024-10-18: "Steel Backed-up Channels"

action.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

channeld/full_channel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,13 +1658,13 @@ bool channel_force_htlcs(struct channel *channel,
16581658

16591659
const char *channel_add_err_name(enum channel_add_err e)
16601660
{
1661-
static char invalidbuf[sizeof("INVALID ") + STR_MAX_CHARS(e)];
1661+
static char invalidbuf[sizeof("UNKNOWN ") + STR_MAX_CHARS(e)];
16621662

16631663
for (size_t i = 0; enum_channel_add_err_names[i].name; i++) {
16641664
if (enum_channel_add_err_names[i].v == e)
16651665
return enum_channel_add_err_names[i].name;
16661666
}
1667-
snprintf(invalidbuf, sizeof(invalidbuf), "INVALID %i", e);
1667+
snprintf(invalidbuf, sizeof(invalidbuf), "UNKNOWN %i", e);
16681668
return invalidbuf;
16691669
}
16701670

common/bolt12.c

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
489489
char **fail)
490490
{
491491
struct tlv_invoice *invoice;
492-
u64 expiry, now;
493492

494493
invoice = invoice_decode_minimal(ctx, b12, b12len, our_features,
495494
must_be_chain, fail);
@@ -527,27 +526,6 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
527526
return tal_free(invoice);
528527
}
529528

530-
/* BOLT-offers #12:
531-
* - if `invoice_relative_expiry` is present:
532-
* - MUST reject the invoice if the current time since 1970-01-01 UTC
533-
* is greater than `invoice_created_at` plus `seconds_from_creation`.
534-
* - otherwise:
535-
* - MUST reject the invoice if the current time since 1970-01-01 UTC
536-
* is greater than `invoice_created_at` plus 7200.
537-
*/
538-
if (invoice->invoice_relative_expiry)
539-
expiry = *invoice->invoice_relative_expiry;
540-
else
541-
expiry = 7200;
542-
now = time_now().ts.tv_sec;
543-
/* If it overflows, it's forever */
544-
if (!add_overflows_u64(*invoice->invoice_created_at, expiry)
545-
&& now > *invoice->invoice_created_at + expiry) {
546-
*fail = tal_fmt(ctx, "expired %"PRIu64" seconds ago",
547-
now - (*invoice->invoice_created_at + expiry));
548-
return tal_free(invoice);
549-
}
550-
551529
/* BOLT-offers #12:
552530
* - MUST reject the invoice if `invoice_paths` is not present or is
553531
* empty. */
@@ -583,6 +561,30 @@ struct tlv_invoice *invoice_decode(const tal_t *ctx,
583561
return invoice;
584562
}
585563

564+
u64 invoice_expiry(const struct tlv_invoice *invoice)
565+
{
566+
u64 expiry;
567+
568+
/* BOLT-offers #12:
569+
* - if `invoice_relative_expiry` is present:
570+
* - MUST reject the invoice if the current time since 1970-01-01 UTC
571+
* is greater than `invoice_created_at` plus `seconds_from_creation`.
572+
* - otherwise:
573+
* - MUST reject the invoice if the current time since 1970-01-01 UTC
574+
* is greater than `invoice_created_at` plus 7200.
575+
*/
576+
if (invoice->invoice_relative_expiry)
577+
expiry = *invoice->invoice_relative_expiry;
578+
else
579+
expiry = 7200;
580+
581+
/* If it overflows, it's forever */
582+
if (add_overflows_u64(*invoice->invoice_created_at, expiry))
583+
return UINT64_MAX;
584+
585+
return *invoice->invoice_created_at + expiry;
586+
}
587+
586588
static bool bolt12_has_invoice_prefix(const char *str)
587589
{
588590
return strstarts(str, "lni1") || strstarts(str, "LNI1");

common/bolt12.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@ char *invoice_encode(const tal_t *ctx, const struct tlv_invoice *bolt12_tlv);
7575
* is not expired). It also checks signature.
7676
*
7777
* Note: blinded path features need to be checked by the caller before use!
78+
* Note: expiration must be check by caller before use!
7879
*/
7980
struct tlv_invoice *invoice_decode(const tal_t *ctx,
8081
const char *b12, size_t b12len,
8182
const struct feature_set *our_features,
8283
const struct chainparams *must_be_chain,
8384
char **fail);
8485

86+
/* UINT64_MAX if no expiry. */
87+
u64 invoice_expiry(const struct tlv_invoice *invoice);
88+
8589
/* This one only checks it decides, and optionally is correct chain/features */
8690
struct tlv_invoice *invoice_decode_minimal(const tal_t *ctx,
8791
const char *b12, size_t b12len,

0 commit comments

Comments
 (0)