diff options
| author | tv <tv@krebsco.de> | 2026-11-07 22:35:21 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-07 22:35:21 +0100 |
| commit | 63b34dfa41e1595145507a88901e332bf4bd3b14 (patch) | |
| tree | e33955ead52d4155a2c5cb5b1abaa3cb7e83f8a6 /src/node.rs | |
| parent | c9b05d33f57b7efd69301b56725614a0d9938599 (diff) | |
signatures: kept in the document file
A node's signatures are saved with its document (--document-file) and
loaded with it.
Auth plan M5.
Diffstat (limited to 'src/node.rs')
| -rw-r--r-- | src/node.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/node.rs b/src/node.rs index c1a26de..32a82b2 100644 --- a/src/node.rs +++ b/src/node.rs @@ -40,6 +40,8 @@ pub(crate) struct NodeConfig { pub(crate) initial_doc: Document, /// Actors this node wrote with in earlier runs (`--document-file`). pub(crate) earlier_actors: Vec<ActorId>, + /// The signatures of `initial_doc`'s changes (`--document-file`). + pub(crate) initial_signatures: Vec<(crate::document::ChangeHash, [u8; 64])>, /// `Timing::new(--keepalive, the transports' sync reply timeout and delivery /// limit)`. pub(crate) timing: Timing, @@ -110,7 +112,9 @@ impl Node { None => config.transport, }; - let replica = Replica::new(config.initial_epoch, config.initial_doc); + let mut replica = Replica::new(config.initial_epoch, config.initial_doc); + replica.signatures = + crate::document::signatures::Signatures::from_kept(config.initial_signatures); let stamp = replica.stamps(); let state = AppState { doc: Arc::new(crate::document::lock::DocumentLock::new(replica)), |
