gossmap: make API more robust against future changes.

Many changes to gossmap (including the pending ones!) don't actually
concern readers, as long as they obey certain rules:

1. Ignore unknown messages.
2. Treat all 16 upper bits of length as flags, ignore unknown ones.

So now we split the version byte into MAJOR and MINOR, and you can
ignore MINOR changes.

We don't expose the internal version (for creating the map)
programmatically: you should really hardcode what major version you
understand!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-09-14 13:20:31 +09:30
parent 3817a690c9
commit 6338758018
9 changed files with 51 additions and 22 deletions

View File

@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
} else
outfd = STDOUT_FILENO;
version = GOSSIP_STORE_VERSION;
version = ((0 << 5) | 10);
if (!write_all(outfd, &version, sizeof(version)))
err(1, "Writing version");