Skip to content

Commit 07d08be

Browse files
committed
Revert "lightningd: don't allow enableoffer on single-use offer."
This reverts commit d76e4e7 (except .github dir) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 2971f5d commit 07d08be

197 files changed

Lines changed: 4234 additions & 6530 deletions

File tree

Some content is hidden

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

.msggen.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,6 @@
30453045
"ListPeerChannels.channels[].updates.remote.htlc_minimum_msat": 1
30463046
},
30473047
"ListpeerchannelsRequest": {
3048-
"ListPeerChannels.channel_id": 3,
30493048
"ListPeerChannels.id": 1,
30503049
"ListPeerChannels.short_channel_id": 2
30513050
},
@@ -3338,7 +3337,6 @@
33383337
"Offer.absolute_expiry": 6,
33393338
"Offer.amount": 1,
33403339
"Offer.description": 2,
3341-
"Offer.fronting_nodes[]": 15,
33423340
"Offer.issuer": 3,
33433341
"Offer.label": 4,
33443342
"Offer.optional_recurrence": 14,
@@ -10758,10 +10756,6 @@
1075810756
"added": "v23.02",
1075910757
"deprecated": null
1076010758
},
10761-
"ListPeerChannels.channel_id": {
10762-
"added": "v26.03",
10763-
"deprecated": null
10764-
},
1076510759
"ListPeerChannels.channels[]": {
1076610760
"added": "v23.02",
1076710761
"deprecated": null
@@ -11994,10 +11988,6 @@
1199411988
"added": "pre-v0.10.1",
1199511989
"deprecated": null
1199611990
},
11997-
"Offer.fronting_nodes[]": {
11998-
"added": "v26.04",
11999-
"deprecated": null
12000-
},
1200111991
"Offer.issuer": {
1200211992
"added": "pre-v0.10.1",
1200311993
"deprecated": null

Cargo.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
[profile.release]
22
strip = "debuginfo"
33

4-
[profile.small]
5-
inherits = "dev"
6-
opt-level = 0
7-
debug = 0
8-
codegen-units = 32
9-
104
[workspace]
115
resolver = "2"
126
members = [

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ ARG target_arch=arm-linux-gnueabihf
9191
ARG target_arch_gcc=arm-linux-gnueabihf
9292
ARG target_arch_dpkg=armhf
9393
ARG target_arch_rust=armv7-unknown-linux-gnueabihf
94-
ARG COPTFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
94+
#TODO: bug with -O2 in armv7, see https://github.com/ElementsProject/lightning/issues/8501
95+
ARG COPTFLAGS="-O1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard"
9596

9697
FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
9798

Makefile

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ ECHO := echo
2121
SUPPRESS_OUTPUT :=
2222
endif
2323

24-
CARGO := cargo
2524
DISTRO=$(shell lsb_release -is 2>/dev/null || echo unknown)-$(shell lsb_release -rs 2>/dev/null || echo unknown)
2625
OS=$(shell uname -s)
2726
ARCH=$(shell uname -m)
@@ -105,7 +104,6 @@ CCAN_OBJS := \
105104
ccan-bitmap.o \
106105
ccan-bitops.o \
107106
ccan-breakpoint.o \
108-
ccan-cdump.o \
109107
ccan-closefrom.o \
110108
ccan-crc32c.o \
111109
ccan-crypto-hmac.o \
@@ -231,6 +229,8 @@ CCAN_HEADERS := \
231229
$(CCANDIR)/ccan/typesafe_cb/typesafe_cb.h \
232230
$(CCANDIR)/ccan/utf8/utf8.h
233231

232+
CDUMP_OBJS := ccan-cdump.o ccan-strmap.o
233+
234234
BOLT_GEN := tools/generate-wire.py
235235
WIRE_GEN := $(BOLT_GEN)
236236

@@ -468,7 +468,6 @@ PKGLIBEXEC_PROGRAMS = \
468468
lightningd/lightning_connectd \
469469
lightningd/lightning_dualopend \
470470
lightningd/lightning_gossipd \
471-
lightningd/lightning_gossip_compactd \
472471
lightningd/lightning_hsmd \
473472
lightningd/lightning_onchaind \
474473
lightningd/lightning_openingd \
@@ -483,17 +482,16 @@ mkdocs.yml: $(MANPAGES:=.md)
483482
)
484483

485484

486-
# Every single object file.
487-
ALL_OBJS := $(ALL_C_SOURCES:.c=.o)
488485

489-
WIREGEN_FILES := $(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(ALL_C_HEADERS) $(ALL_C_SOURCES))
486+
# Don't delete these intermediaries.
487+
.PRECIOUS: $(ALL_GEN_HEADERS) $(ALL_GEN_SOURCES) $(PYTHON_GENERATED)
490488

491-
# Always make wiregen files before any object file
492-
$(ALL_OBJS): $(WIREGEN_FILES)
489+
# Every single object file.
490+
ALL_OBJS := $(ALL_C_SOURCES:.c=.o)
493491

494492
# We always regen wiregen and printgen files, since SHA256STAMP protects against
495493
# spurious rebuilds.
496-
$(WIREGEN_FILES): $(FORCE)
494+
$(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(ALL_C_HEADERS) $(ALL_C_SOURCES)): $(FORCE)
497495

498496
ifneq ($(TEST_GROUP_COUNT),)
499497
PYTEST_OPTS += --test-group=$(TEST_GROUP) --test-group-count=$(TEST_GROUP_COUNT)
@@ -645,8 +643,10 @@ update-doc-examples:
645643
check-doc-examples: update-doc-examples
646644
git diff --exit-code HEAD
647645

648-
# This should NOT compile things!
649-
check-source: check-makefile check-whitespace check-spelling check-python-flake8 check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf
646+
# For those without working cppcheck
647+
check-source-no-cppcheck: check-makefile check-source-bolt check-whitespace check-spelling check-python check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf
648+
649+
check-source: check-source-no-cppcheck
650650

651651
full-check: check check-source
652652

@@ -719,7 +719,7 @@ TAGS:
719719
tags:
720720
$(RM) tags; find * -name test -type d -prune -o \( -name '*.[ch]' -o -name '*.py' \) -print0 | xargs -0 ctags --append
721721

722-
ccan/ccan/cdump/tools/cdump-enumstr: ccan/ccan/cdump/tools/cdump-enumstr.o libccan.a
722+
ccan/ccan/cdump/tools/cdump-enumstr: ccan/ccan/cdump/tools/cdump-enumstr.o $(CDUMP_OBJS) $(CCAN_OBJS)
723723

724724
ALL_PROGRAMS += ccan/ccan/cdump/tools/cdump-enumstr
725725
# Can't add to ALL_OBJS, as that makes a circular dep.
@@ -741,9 +741,6 @@ endif
741741
header_versions_gen.h: tools/headerversions $(FORCE)
742742
@tools/headerversions $@
743743

744-
# Once you have libccan.a, you don't need these.
745-
.INTERMEDIATE: $(CCAN_OBJS)
746-
747744
# We make a static library, this way linker can discard unused parts.
748745
libccan.a: $(CCAN_OBJS)
749746
@$(call VERBOSE, "ar $@", $(AR) r $@ $(CCAN_OBJS))
@@ -965,21 +962,25 @@ install-data: installdirs $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(
965962

966963
install: install-program install-data
967964

968-
# We exclude most of target/ and external, but we need:
969-
# 1. config files (we only tar up files *newer* than these)
970-
# 2. $(DEFAULT_TARGETS) for rust stuff.
971-
# 3. $(EXTERNAL_LIBS) for prebuild external libraries.
972-
TESTPACK_EXTRAS := \
973-
config.vars ccan/config.h \
974-
header_versions_gen.h \
975-
$(DEFAULT_TARGETS) \
976-
$(EXTERNAL_LIBS)
965+
# Non-artifacts that are needed for testing. These are added to the
966+
# testpack.tar, used to transfer things between builder and tester
967+
# phase. If you get a missing file/executable while testing on CI it
968+
# is likely missing from this variable.
969+
TESTBINS = \
970+
$(CLN_PLUGIN_EXAMPLES) \
971+
tests/plugins/test_libplugin \
972+
tests/plugins/channeld_fakenet \
973+
tests/plugins/test_selfdisable_after_getmanifest
977974

978975
# The testpack is used in CI to transfer built artefacts between the
979-
# build and the test phase. Only useful on a freshly build tree!
980-
# We use Posix format for timestamps with subsecond accuracy.
981-
testpack.tar.gz: all-programs all-fuzz-programs all-test-programs default-targets
982-
(find * -path external -prune -o -path target -prune -o -newer config.vars -type f -print; ls $(TESTPACK_EXTRAS)) | tar --verbatim-files-from -T- -c --format=posix -f - | gzip -5 > $@
976+
# build and the test phase. This is necessary because the fixtures in
977+
# `tests/` explicitly use the binaries built in the current directory
978+
# rather than using `$PATH`, as that may pick up some other installed
979+
# version of `lightningd` leading to bogus results. We bundle up all
980+
# built artefacts here, and will unpack them on the tester (overlaying
981+
# on top of the checked out repo as if we had just built it in place).
982+
testpack.tar.bz2: $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(DOC_DATA) config.vars $(TESTBINS) $(DEVTOOLS) $(TOOLS)
983+
tar -caf $@ $^
983984

984985
uninstall:
985986
@$(NORMAL_UNINSTALL)
@@ -1155,9 +1156,6 @@ ccan-rune-rune.o: $(CCANDIR)/ccan/rune/rune.c
11551156
ccan-rune-coding.o: $(CCANDIR)/ccan/rune/coding.c
11561157
@$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<)
11571158

1158-
canned-gossmap: devtools/gossmap-compress
1159-
DATE=`date +%Y-%m-%d` && devtools/gossmap-compress compress --output-node-map /tmp/gossip_store tests/data/gossip-store-$$DATE.compressed > tests/data/gossip-store-$$DATE-node-map && xz -9 tests/data/gossip-store-$$DATE-node-map && ls -l tests/data/gossip-store-$$DATE*
1160-
11611159
print-binary-sizes: $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) $(BIN_PROGRAMS)
11621160
@echo User programs:
11631161
@size -t $(PKGLIBEXEC_PROGRAMS) $(filter-out tools/reckless,$(BIN_PROGRAMS)) $(PLUGINS)

bitcoin/short_channel_id.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static inline bool short_channel_id_eq(struct short_channel_id a,
1717
return a.u64 == b.u64;
1818
}
1919

20-
static inline size_t hash_scid(struct short_channel_id scid)
20+
static inline size_t short_channel_id_hash(struct short_channel_id scid)
2121
{
2222
/* scids cost money to generate, so simple hash works here */
2323
return (scid.u64 >> 32) ^ (scid.u64 >> 16) ^ scid.u64;
@@ -46,12 +46,6 @@ static inline bool short_channel_id_dir_eq(const struct short_channel_id_dir *a,
4646
return short_channel_id_eq(a->scid, b->scid) && a->dir == b->dir;
4747
}
4848

49-
static inline size_t hash_scidd(const struct short_channel_id_dir *scidd)
50-
{
51-
/* Bottom bit is common, so use bit 4 for direction */
52-
return hash_scid(scidd->scid) | (scidd->dir << 4);
53-
}
54-
5549
static inline u32 short_channel_id_blocknum(struct short_channel_id scid)
5650
{
5751
return scid.u64 >> 40;

ccan/README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CCAN imported from http://ccodearchive.net.
22

3-
CCAN version: init-2608-gb35fabb6
3+
CCAN version: init-2606-g5f219f03

ccan/ccan/json_out/json_out.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct json_out {
99
/* Callback if we reallocate. */
1010
void (*move_cb)(struct json_out *jout, ptrdiff_t delta, void *arg);
1111
void *cb_arg;
12-
12+
1313
#ifdef CCAN_JSON_OUT_DEBUG
1414
/* tal_arr of types ( or [ we're enclosed in. NULL if oom. */
1515
char *wrapping;
@@ -246,7 +246,7 @@ bool json_out_addv(struct json_out *jout,
246246
dst = mkroom(jout, fmtlen + 1 + (int)quote*2);
247247
if (!dst)
248248
goto out;
249-
vsnprintf(dst + quote, fmtlen + 1, fmt, ap2);
249+
vsprintf(dst + quote, fmt, ap2);
250250
}
251251

252252
#ifdef CCAN_JSON_OUT_DEBUG
@@ -294,14 +294,7 @@ bool json_out_addstr(struct json_out *jout,
294294
const char *fieldname,
295295
const char *str)
296296
{
297-
return json_out_addstrn(jout, fieldname, str, strlen(str));
298-
}
299-
300-
bool json_out_addstrn(struct json_out *jout,
301-
const char *fieldname,
302-
const char *str,
303-
size_t len)
304-
{
297+
size_t len = strlen(str);
305298
char *p;
306299
struct json_escape *e;
307300

ccan/ccan/json_out/json_out.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,6 @@ bool json_out_addstr(struct json_out *jout,
121121
const char *fieldname,
122122
const char *str);
123123

124-
/**
125-
* json_out_addstrn - convenience helper to add a string field (with length).
126-
* @jout: the json_out object to write into.
127-
* @fieldname: optional fieldname to prepend.
128-
* @str: the string to add (must not be NULL).
129-
* @len: the length of @str
130-
*
131-
* Equivalent to json_out_add(@jout, @fieldname, true, "%.*s", @len, @str);
132-
*/
133-
bool json_out_addstrn(struct json_out *jout,
134-
const char *fieldname,
135-
const char *str,
136-
size_t len);
137-
138124
/**
139125
* json_out_member_direct - add a field, with direct access.
140126
* @jout: the json_out object to write into.

ccan/ccan/json_out/test/run.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void test_json_out_add(const tal_t *ctx,
6969
}
7070
}
7171

72-
static void json_eq(struct json_out *jout, const char *expect)
72+
static void json_eq(const struct json_out *jout, const char *expect)
7373
{
7474
size_t len;
7575
const char *p;

cln-grpc/proto/node.proto

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)