pub struct WalDuplicityAlarmSink { /* private fields */ }Expand description
Durable, tamper-evident B4 duplicity-alarm sink.
Each alarm is appended to a length-delimited WAL, linked to the previous
entry by BLAKE3 (entry_hash = BLAKE3(prev_hash || payload)), and signed
with the pinned hybrid composite (EdDSA + ML-DSA-65). raise returns only
after sync_all, so a successfully recorded alarm survives a crash. Opening
an existing WAL verifies every link AND every signature and refuses a
truncated, forged, or modified journal (see the module-level tamper-evidence
section for the exact guarantee and its residual limit). The same call emits
a structured ERROR event on the hyprstream.at9p.duplicity target, which
reaches stderr and OTLP through the process tracing subscriber and is
therefore visible to operators.
Implementations§
Source§impl WalDuplicityAlarmSink
impl WalDuplicityAlarmSink
Sourcepub fn open(
path: impl AsRef<Path>,
ed_sk: SigningKey,
pq_sk: MlDsaSigningKey,
) -> Result<Self>
pub fn open( path: impl AsRef<Path>, ed_sk: SigningKey, pq_sk: MlDsaSigningKey, ) -> Result<Self>
Open (or create) an alarm WAL, verifying its complete hash chain and every entry/checkpoint signature before accepting new records. A corrupt, forged, or truncated journal fails closed at startup.
ed_sk / pq_sk are the node’s audit signing keys (the same pinned
hybrid pair the at9p record path uses). Requiring them here is what makes
the durable route a real, signed construction path rather than an
unauthenticated sidecar.
§Crash-window recovery
A crash between an entry’s WAL fsync and its checkpoint persist leaves
the WAL exactly one entry ahead of the checkpoint. That is a valid,
recoverable state: open accepts an exact checkpoint match or a
verified one-entry lag (the durable WAL head is authoritative), then
advances the checkpoint to the WAL head. Any larger divergence — or a
checkpoint that names a head the WAL does not reach — fails closed as
truncation/tamper.
Trait Implementations§
Source§impl DuplicityAlarmSink for WalDuplicityAlarmSink
impl DuplicityAlarmSink for WalDuplicityAlarmSink
Source§fn raise(&self, alarm: &DuplicityAlarm)
fn raise(&self, alarm: &DuplicityAlarm)
Auto Trait Implementations§
impl !Freeze for WalDuplicityAlarmSink
impl !RefUnwindSafe for WalDuplicityAlarmSink
impl Send for WalDuplicityAlarmSink
impl Sync for WalDuplicityAlarmSink
impl Unpin for WalDuplicityAlarmSink
impl UnsafeUnpin for WalDuplicityAlarmSink
impl UnwindSafe for WalDuplicityAlarmSink
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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