common: move gossip_store_wire.csv into common/ from gossipd/

It's used by common/gossip_store.c, which is used by many things other than
gossipd.  This file belongs in common.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2026-02-12 09:17:10 +10:30
parent 5dcf39867c
commit e8fd235d4e
26 changed files with 33 additions and 39 deletions

View File

@@ -489,9 +489,14 @@ mkdocs.yml: $(MANPAGES:=.md)
# Every single object file.
ALL_OBJS := $(ALL_C_SOURCES:.c=.o)
WIREGEN_FILES := $(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(ALL_C_HEADERS) $(ALL_C_SOURCES))
# Always make wiregen files before any object file
$(ALL_OBJS): $(WIREGEN_FILES)
# We always regen wiregen and printgen files, since SHA256STAMP protects against
# spurious rebuilds.
$(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(ALL_C_HEADERS) $(ALL_C_SOURCES)): $(FORCE)
$(WIREGEN_FILES): $(FORCE)
ifneq ($(TEST_GROUP_COUNT),)
PYTEST_OPTS += --test-group=$(TEST_GROUP) --test-group-count=$(TEST_GROUP_COUNT)

View File

@@ -111,7 +111,7 @@ COMMON_SRC_NOGEN := \
common/wire_error.c
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c common/scb_wiregen.c
COMMON_SRC_GEN := common/status_wiregen.c common/peer_status_wiregen.c common/scb_wiregen.c common/gossip_store_wiregen.c
COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
common/closing_fee.h \
@@ -124,7 +124,7 @@ COMMON_HEADERS_NOGEN := $(COMMON_SRC_NOGEN:.c=.h) \
common/jsonrpc_errors.h \
common/overflows.h
COMMON_HEADERS_GEN := common/htlc_state_names_gen.h common/status_wiregen.h common/peer_status_wiregen.h common/scb_wiregen.h
COMMON_HEADERS_GEN := common/htlc_state_names_gen.h common/status_wiregen.h common/peer_status_wiregen.h common/scb_wiregen.h common/gossip_store_wiregen.h
COMMON_HEADERS := $(COMMON_HEADERS_GEN) $(COMMON_HEADERS_NOGEN)
COMMON_SRC := $(COMMON_SRC_NOGEN) $(COMMON_SRC_GEN)
@@ -157,8 +157,6 @@ ALL_C_SOURCES += $(COMMON_SRC)
common/htlc_state_names_gen.h: common/htlc_state.h ccan/ccan/cdump/tools/cdump-enumstr
ccan/ccan/cdump/tools/cdump-enumstr common/htlc_state.h > $@
common/gossip_store.o: gossipd/gossip_store_wiregen.h
check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%)
check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%)

View File

@@ -1,6 +1,6 @@
#include "config.h"
#include <common/gossip_store.h>
#include <gossipd/gossip_store_wiregen.h>
#include <common/gossip_store_wiregen.h>
#include <unistd.h>
/* We cheat and read first two bytes of message too. */

View File

@@ -6,12 +6,12 @@
#include <ccan/tal/str/str.h>
#include <common/features.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/gossmap.h>
#include <common/sciddir_or_pubkey.h>
#include <common/utils.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/mman.h>

View File

@@ -47,7 +47,7 @@ common/test/run-route common/test/run-route-specific common/test/run-route-inflo
common/node_id.o \
common/pseudorand.o \
common/route.o \
gossipd/gossip_store_wiregen.o \
common/gossip_store_wiregen.o \
wire/fromwire.o \
wire/peer_wiregen.o \
wire/towire.o

View File

@@ -7,22 +7,22 @@
*/
#include "config.h"
#include <assert.h>
#include <bitcoin/chainparams.h>
#include <ccan/crc32c/crc32c.h>
#include <common/channel_type.h>
#include <common/dijkstra.h>
#include <common/gossmap.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/gossmap.h>
#include <common/memleak.h>
#include <common/randbytes.h>
#include <common/route.h>
#include <common/sciddir_or_pubkey.h>
#include <common/setup.h>
#include <common/utils.h>
#include <bitcoin/chainparams.h>
#include <gossipd/gossip_store_wiregen.h>
#include <stdio.h>
#include <wire/peer_wiregen.h>
#include <unistd.h>
#include <wire/peer_wiregen.h>
/* AUTOGENERATED MOCKS START */
/* Generated stub for fromwire_bigsize */

View File

@@ -1,21 +1,21 @@
#include "config.h"
#include <assert.h>
#include <bitcoin/chainparams.h>
#include <ccan/crc32c/crc32c.h>
#include <common/channel_type.h>
#include <common/dijkstra.h>
#include <common/gossmap.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/gossmap.h>
#include <common/memleak.h>
#include <common/randbytes.h>
#include <common/route.h>
#include <common/sciddir_or_pubkey.h>
#include <common/setup.h>
#include <common/utils.h>
#include <bitcoin/chainparams.h>
#include <gossipd/gossip_store_wiregen.h>
#include <stdio.h>
#include <wire/peer_wiregen.h>
#include <unistd.h>
#include <wire/peer_wiregen.h>
/* AUTOGENERATED MOCKS START */
/* Generated stub for fromwire_bigsize */

View File

@@ -35,7 +35,7 @@ ALL_PROGRAMS += lightningd/lightning_websocketd
LIGHTNINGD_CONTROL_HEADERS += connectd/connectd_wiregen.h
LIGHTNINGD_CONTROL_OBJS += connectd/connectd_wiregen.o
lightningd/lightning_connectd: $(CONNECTD_OBJS) $(HSMD_CLIENT_OBJS) gossipd/gossipd_wiregen.o gossipd/gossip_store_wiregen.o libcommon.a
lightningd/lightning_connectd: $(CONNECTD_OBJS) $(HSMD_CLIENT_OBJS) gossipd/gossipd_wiregen.o libcommon.a
lightningd/lightning_websocketd: $(WEBSOCKETD_OBJS) libcommon.a

View File

@@ -1,11 +1,11 @@
#include "config.h"
#include <ccan/crc32c/crc32c.h>
#include <common/gossip_store_wiregen.h>
#include <common/status.h>
#include <common/utils.h>
#include <connectd/gossip_store.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <inttypes.h>
#include <unistd.h>
#include <wire/peer_wire.h>

View File

@@ -18,7 +18,7 @@ GOSSIP_STORE_LEN_DELETED_BIT = 0x8000
GOSSIP_STORE_LEN_PUSH_BIT = 0x4000
GOSSIP_STORE_LEN_COMPLETE_BIT = 0x2000
# These duplicate constants in lightning/gossipd/gossip_store_wiregen.h
# These duplicate constants in lightning/common/gossip_store_wiregen.h
WIRE_GOSSIP_STORE_PRIVATE_CHANNEL = 4104
WIRE_GOSSIP_STORE_PRIVATE_UPDATE = 4102
WIRE_GOSSIP_STORE_DELETE_CHAN = 4103

View File

@@ -20,11 +20,6 @@ $(DEVTOOLS): %: %.o libcommon.a
$(DEVTOOLS_TOOL_OBJS): wire/wire.h
# Some devtools require extra objects
DEVTOOLS_NEEDS_GOSSIP_STORE := devtools/gossmap-compress devtools/dump-gossipstore devtools/convert-gossmap devtools/create-gossipstore
$(DEVTOOLS_NEEDS_GOSSIP_STORE): gossipd/gossip_store_wiregen.o
$(DEVTOOLS_NEEDS_GOSSIP_STORE:=.o): gossipd/gossip_store_wiregen.h
devtools/decodemsg: devtools/print_wire.o
devtools/decodemsg.o: devtools/print_wire.h

View File

@@ -3,8 +3,8 @@
#include <ccan/err/err.h>
#include <ccan/read_write_all/read_write_all.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/utils.h>
#include <gossipd/gossip_store_wiregen.h>
#include <unistd.h>
#include <wire/peer_wire.h>

View File

@@ -4,9 +4,9 @@
#include <ccan/opt/opt.h>
#include <ccan/read_write_all/read_write_all.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/utils.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>

View File

@@ -3,10 +3,10 @@
#include <ccan/err/err.h>
#include <ccan/opt/opt.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/setup.h>
#include <common/utils.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <inttypes.h>
#include <stdio.h>
#include <unistd.h>

View File

@@ -7,12 +7,12 @@
#include <ccan/read_write_all/read_write_all.h>
#include <ccan/tal/str/str.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/gossmap.h>
#include <common/setup.h>
#include <common/utils.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <stdio.h>
#include <unistd.h>
#include <wire/peer_wiregen.h>

View File

@@ -1,7 +1,6 @@
#! /usr/bin/make
GOSSIPD_HEADERS_WSRC := gossipd/gossipd_wiregen.h \
gossipd/gossip_store_wiregen.h \
gossipd/gossipd.h \
gossipd/gossip_store.h \
gossipd/gossmap_manage.h \

View File

@@ -5,12 +5,12 @@
#include <ccan/tal/str/str.h>
#include <common/clock_time.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/status.h>
#include <common/utils.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossip_store.h>
#include <gossipd/gossip_store_wiregen.h>
#include <gossipd/gossipd.h>
#include <inttypes.h>
#include <sys/stat.h>

View File

@@ -5,6 +5,7 @@
#include <common/clock_time.h>
#include <common/daemon_conn.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/gossmap.h>
#include <common/memleak.h>
#include <common/status.h>
@@ -12,7 +13,6 @@
#include <common/utils.h>
#include <common/wire_error.h>
#include <gossipd/gossip_store.h>
#include <gossipd/gossip_store_wiregen.h>
#include <gossipd/gossipd.h>
#include <gossipd/gossipd_wiregen.h>
#include <gossipd/gossmap_manage.h>

View File

@@ -231,7 +231,7 @@ plugins/sql-schema_gen.h: $(SQL_SCHEMA_PARTS)
)
plugins/sql.o: plugins/sql-schema_gen.h
plugins/sql: $(PLUGIN_SQL_OBJS) $(PLUGIN_LIB_OBJS) gossipd/gossip_store_wiregen.o libcommon.a
plugins/sql: $(PLUGIN_SQL_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a
# Generated from PLUGINS definition in plugins/Makefile
ALL_C_HEADERS += plugins/list_of_builtin_plugins_gen.h

View File

@@ -11,7 +11,6 @@ $(PLUGIN_RENEPAY_TEST_OBJS): $(PLUGIN_RENEPAY_SRC) plugins/renepay/test/common.h
$(PLUGIN_RENEPAY_TEST_PROGRAMS): \
plugins/renepay/dijkstra.o \
plugins/renepay/chan_extra.o \
gossipd/gossip_store_wiregen.o \
libcommon.a
check-renepay: $(PLUGIN_RENEPAY_TEST_PROGRAMS:%=unittest/%)

View File

@@ -3,7 +3,7 @@
#include "config.h"
#include <ccan/crc32c/crc32c.h>
#include <common/gossip_store.h>
#include <gossipd/gossip_store_wiregen.h>
#include <common/gossip_store_wiregen.h>
#include <stdio.h>
#include <unistd.h>
#include <wire/peer_wiregen.h>

View File

@@ -5,13 +5,13 @@
#include <ccan/tal/str/str.h>
#include <common/deprecation.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/json_param.h>
#include <common/json_stream.h>
#include <common/memleak.h>
#include <common/setup.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossip_store_wiregen.h>
#include <inttypes.h>
#include <plugins/libplugin.h>
#include <sqlite3.h>

View File

@@ -8,7 +8,6 @@ ALL_C_SOURCES += $(PLUGIN_TEST_SRC)
ALL_TEST_PROGRAMS += $(PLUGIN_TEST_PROGRAMS)
plugins/test/run-route-overlong: \
gossipd/gossip_store_wiregen.o \
plugins/channel_hint.o
plugins/test/run-route-calc: \
@@ -16,7 +15,6 @@ plugins/test/run-route-calc: \
common/gossmap.o \
common/node_id.o \
common/route.o \
gossipd/gossip_store_wiregen.o \
plugins/channel_hint.o
$(PLUGIN_TEST_PROGRAMS): libcommon.a

View File

@@ -7,9 +7,9 @@
#include <ccan/array_size/array_size.h>
#include <ccan/crc32c/crc32c.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/setup.h>
#include <common/utils.h>
#include <gossipd/gossip_store_wiregen.h>
#include <stdio.h>
#include <unistd.h>

View File

@@ -3,9 +3,9 @@
#include <bitcoin/chainparams.h>
#include <ccan/crc32c/crc32c.h>
#include <common/gossip_store.h>
#include <common/gossip_store_wiregen.h>
#include <common/setup.h>
#include <common/utils.h>
#include <gossipd/gossip_store_wiregen.h>
#include <stdio.h>
#include <unistd.h>