pub struct SyncAdvertisementsReport {
pub to_create: usize,
pub to_revoke: usize,
pub create_error: Option<String>,
pub submit_error: Option<String>,
pub admitted: BTreeMap<String, usize>,
pub lookup_error: Option<String>,
pub revoke_skipped: usize,
pub revoke_error: Option<String>,
pub revoke_submit_error: Option<String>,
}Expand description
Outcome of one Engine::sync_advertisements run (bsv-low #320 defect
3a).
The engine used to swallow create/submit failures into error! and
return Ok(()), so the admin route reported success while zero
advertisements were admitted locally; a caller could not tell a
converged no-op (to_create == 0) from a silent failure. Every field
here is observational — the sync’s behavior is unchanged, its outcome is
no longer hidden.
Fields§
§to_create: usizeAdvertisements the diff found missing (attempted this run). A converged node reports 0 here.
to_revoke: usizeStale advertisements the diff said to revoke.
create_error: Option<String>advertiser.create_advertisements failure, verbatim.
submit_error: Option<String>Local Engine::submit failure for the created ads, verbatim — the
path that silently hid the self-admission failure live (our own
ls_ship/ls_slap never gained our ads, so every cycle re-created all
of them).
admitted: BTreeMap<String, usize>Outputs admitted per topic by the local submit (from the STEAK). A successful submit that admitted NOTHING (topic-manager refusal) shows up here as explicit zeros.
lookup_error: Option<String>advertiser.find_all_advertisements failure, verbatim (#320 M2).
When set, creation was REFUSED this run: a blind read must never
become “current ads = none” and re-create (re-pay) the entire set.
revoke_skipped: usizeStale ads the diff wanted revoked but the advertiser declined to build a revocation for (the CF advertiser’s documented v1 no-op — #320 L2). Distinguishes “revoke happened” from “revoke skipped”.
revoke_error: Option<String>advertiser.revoke_advertisements failure, verbatim.
revoke_submit_error: Option<String>Local Engine::submit failure for the revocation, verbatim.
Implementations§
Source§impl SyncAdvertisementsReport
impl SyncAdvertisementsReport
Sourcepub fn ok(&self) -> bool
pub fn ok(&self) -> bool
True when nothing errored. NOTE: a submit that admitted zero outputs
is not an error at this layer — that refusal is Self::effective’s
job.
Sourcepub fn admitted_total(&self) -> usize
pub fn admitted_total(&self) -> usize
Total outputs admitted by the local submit across topics.
Sourcepub fn effective(&self) -> bool
pub fn effective(&self) -> bool
True when the run errored nowhere AND the local submit admitted
EVERY created ad (#320 M1 + delta D1): each advertisement is exactly
one output and change is never a SHIP/SLAP token, so full admission
means admitted_total() >= to_create (defensive >=). A weaker
> 0 bar let a PARTIAL admit pass — the live set is 9 SHIP + 8 SLAP
in ONE tx with independent per-topic admission, so tm_ship admitting
its 9 while tm_slap refused all 8 read as success while the diff
re-created (re-paid for) the refused 8 every cycle. Subsumes the
converged no-op (0 >= 0).