pub struct BufferedDelta {
pub id: [u8; 32],
pub parents: Vec<[u8; 32]>,
pub hlc: u64,
pub payload: Vec<u8>,
pub nonce: Nonce,
pub author_id: PublicKey,
pub root_hash: Hash,
pub events: Option<Vec<u8>>,
pub source_peer: PeerId,
}Expand description
A single buffered delta.
Contains ALL fields needed for replay after snapshot sync completes. Previously missing fields (nonce, author_id, root_hash, events) caused data loss because deltas couldn’t be decrypted or processed.
POC Bug 7: This struct MUST include all fields for replay - not just
id, parents, hlc, payload, but also nonce, author_id, root_hash,
events, and source_peer.
Fields§
§id: [u8; 32]Delta ID.
parents: Vec<[u8; 32]>Parent IDs.
hlc: u64HLC timestamp.
payload: Vec<u8>Serialized (encrypted) payload.
nonce: NonceNonce for decryption (12 bytes for XChaCha20-Poly1305).
Author public key (needed to get sender key for decryption).
root_hash: HashExpected root hash after applying this delta.
events: Option<Vec<u8>>Optional serialized events (for handler execution after replay).
source_peer: PeerIdSource peer ID (for requesting sender key if needed).
Trait Implementations§
Source§impl Clone for BufferedDelta
impl Clone for BufferedDelta
Source§fn clone(&self) -> BufferedDelta
fn clone(&self) -> BufferedDelta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BufferedDelta
impl RefUnwindSafe for BufferedDelta
impl Send for BufferedDelta
impl Sync for BufferedDelta
impl Unpin for BufferedDelta
impl UnsafeUnpin for BufferedDelta
impl UnwindSafe for BufferedDelta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more