pub enum MirrorReconcileResult {
Planned {
capsules: u32,
reclaims: u32,
creates: u32,
estimated_cost_dig_base_units: u64,
url_advertised: Vec<String>,
url_current: Vec<String>,
},
Refused {
reason: MirrorReconcileRefusal,
url_current: Option<Vec<String>>,
},
Completed {
reclaimed: u32,
created: u32,
url: Vec<String>,
},
Partial {
reclaimed: u32,
created: u32,
remaining: u32,
reason: String,
},
}Expand description
control.mirror.reconcile — reconcile this node’s mirror coins to its CURRENT advertise URL:
reclaim every coin advertising a stale URL, then recreate it advertising the URL this node
advertises TODAY. Shared by the manual “reset mirrors” action and dig-node#570’s automatic
epoch-boundary pass — ONE reconcile primitive, exposed two ways (dig_ecosystem#3203).
§Four outcomes, and a client MUST be able to tell them apart
They mean different things about the user’s money, which is why this is a tagged union rather than a single struct with optional fields:
Planned—dry_run: trueonly. A PRICED PLAN; nothing was spent.Refused— nothing was spent. SeeMirrorReconcileRefusalfor why.Completed— the whole plan ran: every reclaim confirmed, every create confirmed.Partial— the affordable PREFIX ran; the rest did not start.
§Refused MUST mean nothing was spent, unconditionally
A caller distinguishes refused from partial precisely so it never has to guess whether a
“no” cost money. An implementation that spends anything under a Refused outcome breaks the
one guarantee this contract exists to give the operator.
§A dry run that would in fact refuse reports Refused, never Planned
Planned prices a plan the node believes it CAN execute — computed against the same
validation (corroborated URL, changed URL, affordability) a real run performs. A dry run whose
candidate URL is uncorroborated, unchanged, or otherwise refusable answers Refused exactly
like a real run would, so a caller previewing a reset sees the same refusal a real attempt
would hit rather than a plan for a call that cannot execute.
§Reclaim-first ordering is why Partial is safe to report at all
dig-node’s mirror-collateral runner reclaims before it creates — a reclaim returns collateral, which may fund the create behind it — so a partial run still leaves the node in a COHERENT state, never worse off than before the call: every reclaim that ran completed, and no create ran without its funding reclaim already having confirmed.
Variants§
Planned
dry_run: true only — a priced plan. Nothing was spent.
Fields
estimated_cost_dig_base_units: u64The total cost of the whole plan, in DIG base units (3 decimals, one base unit is 0.001 DIG — NEVER mojos, which are XCH’s 1e-12 unit).
url_current: Vec<String>The URL(s) this node’s existing mirror coins advertise TODAY — the plan exists to
close the gap between this and url_advertised.
Refused
Refused. Nothing was spent — see MirrorReconcileRefusal for why.
Fields
reason: MirrorReconcileRefusalWhich of the six reasons this refusal is.
Completed
The whole plan completed: every reclaim confirmed, every create confirmed.
Fields
Partial
The AFFORDABLE PREFIX completed; the rest did not run.
Trait Implementations§
Source§impl Clone for MirrorReconcileResult
impl Clone for MirrorReconcileResult
Source§fn clone(&self) -> MirrorReconcileResult
fn clone(&self) -> MirrorReconcileResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more