devtools/gossmap-compress: generate better scids.

Our poor scid generation clashes badly with simplified hashing (the
next patch) leading to l1's startup time when using a generated map
moving from 4 seconds to 14 seconds.  Under CI it actually timed out
several tests.

Fixing our fake scids to be more "random" reduces it to 1.5 seconds.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2026-02-12 09:11:10 +10:30
parent ae957161e6
commit 120c9d8ce4
3 changed files with 36 additions and 36 deletions

View File

@@ -353,7 +353,7 @@ static void write_announce(int outfd,
node_id_from_pubkey(&nodeid2, &id1);
}
/* Use i to avoid clashing scids even if two nodes have > 1 channel */
if (!mk_short_channel_id(&scid, node1, node2, i & 0xFFFF))
if (!mk_short_channel_id(&scid, i + node1, node2, i & 0xFFFF))
abort();
msg = towire_channel_announcement(NULL, &vals.sig, &vals.sig, &vals.sig, &vals.sig,
@@ -406,7 +406,7 @@ static void write_update(int outfd,
memset(&vals, 0, sizeof(vals));
/* Use i to avoid clashing scids even if two nodes have > 1 channel */
if (!mk_short_channel_id(&scid, node1, node2, i & 0xFFFF))
if (!mk_short_channel_id(&scid, i + node1, node2, i & 0xFFFF))
abort();
/* If node ids are backward, dir is reversed */