From 5dbf6a536627f9a29f7358c547426218aa6f23c1 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Tue, 29 Sep 2026 07:22:19 +0100 Subject: Make the load generator's devices real link senders, many on one thread links.c was a second implementation of the packet format; each device is now a PureLinkSender on a socket of its own, keyed with a secret made outside (pure_link_sender_shared: a key kept elsewhere, or a test's many). M1 (1k, 10k) and M2 (10k, kill -9) pass with it: no silent step, caught up in 0.2 s, every order applied once; the slowest store after the restart is now the sender's 1 s wait for a word of the save (STORED_WAIT), where the old devices tried again after 200 ms. --- link/link-protocol.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'link/link-protocol.h') diff --git a/link/link-protocol.h b/link/link-protocol.h index b0f8ef3..3037926 100644 --- a/link/link-protocol.h +++ b/link/link-protocol.h @@ -67,14 +67,18 @@ typedef struct { /* ---- The sending side: one output's saved sends to a receiver's input, as * source (the receiver's name for it), their messages of shape (the * receiver's input must have the same: core/module.h's pure_module_shape), - * from own (this node's key, whose public half is own_public). NULL when - * the names are not 1 to PURE_LINK_NAME bytes, or memory runs out. */ + * from own (this node's key, whose public half is own_public; NULL when + * the secret comes from elsewhere). NULL when the names are not 1 to + * PURE_LINK_NAME bytes, or memory runs out. */ typedef struct PureLinkSender PureLinkSender; PureLinkSender *pure_link_sender(const char *source, const char *input, uint32_t shape, const PureSealKey *own, const unsigned char own_public[PURE_SEAL_KEY]); /* The receiver's public key: the keys made from it (one X25519). A sender * makes no packet before it has one. */ bool pure_link_sender_peer(PureLinkSender *, const unsigned char peer[PURE_SEAL_KEY]); +/* The same with the secret own's key shares with peer's made elsewhere (by + * a key kept in hardware, say, or a test's many keys): no X25519 here. */ +bool pure_link_sender_shared(PureLinkSender *, const unsigned char peer[PURE_SEAL_KEY], const unsigned char secret[32]); /* A saved send, numbered one past the last queued (any number when none * waits); false when it cannot be kept. */ bool pure_link_sender_queue(PureLinkSender *, uint64_t seq, const unsigned char *bytes, size_t size); -- cgit v1.2.3