devtools/gossmap-compress: create latest gossip_store version
What changed, and why it matters
This is a developer tool change that updates an internal file-format version number and adds a required header record so compressed gossip files match the format Core Lightning expects. It avoids a startup-time conversion step and has no apparent security relevance.
No security action required; review as normal code-quality/format-compatibility change.
Security signals we found
No security signals present: change is a version/format compatibility update in a developer tool
Evidence from the diff
The patch modifies devtools/gossmap-compress.c to bump GOSSIP_STORE_VER from 14 to 16, set the GOSSIP_STORE_COMPLETED_BIT flag on written records, and emit a gossip_store_uuid message immediately after the version byte. These align the tool’s output with the current gossip_store format consumed by gossipd, eliminating a 890 ms on-the-fly conversion at node startup. The UUID is hard-coded to all zeros, which is consistent with the tool’s deterministic/test-utility nature.
Changed components
devtools/gossmap-compress.cInspect captured patch +14 / −2
diff --git a/devtools/gossmap-compress.c b/devtools/gossmap-compress.c
index 146dad47..5c0be91b 100644
--- a/devtools/gossmap-compress.c
+++ b/devtools/gossmap-compress.c
@@ -79,7 +79,7 @@ static unsigned int verbose = 0;
#define GC_HEADER "GOSSMAP_COMPRESSv1"
#define GC_HEADERLEN (sizeof(GC_HEADER))
-#define GOSSIP_STORE_VER ((0 << 5) | 14)
+#define GOSSIP_STORE_VER ((0 << 5) | 16)
/* Backwards, we want larger first */
static int cmp_node_num_chans(struct gossmap_node *const *a,
@@ -295,7 +295,7 @@ static void write_msg_to_gstore(int outfd, const u8 *msg TAKES)
{
struct gossip_hdr hdr;
- hdr.flags = 0;
+ hdr.flags = CPU_TO_BE16(GOSSIP_STORE_COMPLETED_BIT);
hdr.len = cpu_to_be16(tal_bytelen(msg));
hdr.timestamp = 0;
hdr.crc = cpu_to_be32(crc32c(0, msg, tal_bytelen(msg)));
@@ -513,6 +513,17 @@ static const char *get_alias(const tal_t *ctx,
return tal_strndup(ctx, (const char *)alias, 32);
}
+static void write_uuid(int outfd)
+{
+ const u8 uuid[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ write_msg_to_gstore(outfd, take(towire_gossip_store_uuid(NULL, uuid)));
+}
+
int main(int argc, char *argv[])
{
int outfd;
@@ -791,6 +802,7 @@ int main(int argc, char *argv[])
/* Now write out gossmap */
if (write(outfd, &version, 1) != 1)
err(1, "Failed to write output");
+ write_uuid(outfd);
for (size_t i = 0; i < channel_count; i++) {
write_announce(outfd,
chans[i].node1,
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.