Skip to main content

MirrorReconcileRefusal

Enum MirrorReconcileRefusal 

Source
pub enum MirrorReconcileRefusal {
    NotPublishing {
        state: MirrorAdvertiseState,
    },
    UrlUnchanged,
    NoMirrorCoins,
    InsufficientFunds {
        have_dig_base_units: u64,
        need_dig_base_units: u64,
    },
    ReconcileInProgress,
    Disabled,
    ChainUnreadable,
    RequirementUnknown {
        collateral_reason: CollateralUnknownReason,
    },
    WalletUnavailable {
        capability: MirrorReconcileWalletCapability,
    },
    FundsUnmeasured,
}
Expand description

Why control.mirror.reconcile refused — and NOTHING was spent.

Every member is paired with the same guarantee (see MirrorReconcileResult::Refused): the node found a reason it must not even START the reclaim-then-recreate sequence, per dig_ecosystem#3203’s central invariant — establish and validate the new URL BEFORE reclaiming anything, and if it cannot be established, do nothing at all. A reset that half-executes is worse than one that refuses, because the half that runs is the half that destroys value.

§Ten gates, and conflating any two sends an operator to the wrong remedy

0.34.0 shipped six reasons and one of them, advertise_off, silently meant two different things: dig-node SPEC §25.10’s “nothing is publishable” and §25.7’s node-wide collateralisation switch. This version separates them (NotPublishing and Disabled respectively) and adds the reasons 0.34.0 had no words for at all — an unreadable chain, an unpriced epoch, a wallet that cannot spend, and funds this node has not yet measured — each of which 0.34.0 would otherwise have mis-reported as InsufficientFunds, the EXACT conflation dig-node SPEC §25.8 exists to forbid (“the wallet may be full”).

Variants§

§

NotPublishing

This node is not currently publishing an advertise URL at all, for one of MirrorAdvertiseState’s four non-publishing reasons — the SAME enum control.config.get already serves, carried here rather than re-invented so a client rendering one renders the other with no new arm.

state is never AdvertisingOverride or AdvertisingDerived here — either would mean the node IS publishing, and reconcile would not have refused this way.

Fields

§state: MirrorAdvertiseState

Which of the four non-publishing states applies.

§

UrlUnchanged

The URL this node would advertise next is IDENTICAL to the one its existing mirror coins already advertise. Reconciling would spend real $DIG to reach the state the node is already in, so the node refuses rather than charge the operator for a pure-cost no-op.

§

NoMirrorCoins

This node holds no mirror coins at all, so there is nothing to reclaim and no bond whose advertise URL could be stale.

§

InsufficientFunds

The operator wallet cannot afford ANY of the plan, not even its first step. See MirrorReconcileResult::Submitted for the case where it can afford a PREFIX instead.

Fields

§have_dig_base_units: u64

The $DIG this node’s operator wallet actually holds, in DIG base units.

§need_dig_base_units: u64

The $DIG the FIRST reclaim+create pair alone would need, in DIG base units — never the cost of the whole plan, which a wallet that fails at step one was never priced against.

§

ReconcileInProgress

A reconcile this node started earlier is still in flight. Reconciling is not idempotent mid-flight — a second call racing the first could reclaim a coin the first call is still waiting to recreate — so the node serializes reconciles rather than interleaving them.

§

Disabled

This node’s mirror-collateral advertising is switched OFF node-wide (dig-node SPEC §25.7) — the operator’s own earlier decision, not a fault. Distinct from NotPublishing: that gate is about WHAT URL to advertise; this one is about whether the node bonds anything AT ALL, regardless of URL.

§

ChainUnreadable

The node cannot read mirror coins from chain, so it cannot tell which of its coins are stale, or how many mirror coins it holds at all. Reconciling from an unreadable chain view risks reclaiming a coin the node has misjudged.

§

RequirementUnknown

This epoch’s collateral requirement is not Known, so no create can be PRICED. Not an out-of-funds state — the wallet may be full; a client that renders this as InsufficientFunds tells an operator to send money that would price nothing.

Fields

§collateral_reason: CollateralUnknownReason

Why the requirement is unknown, in the SAME taxonomy CollateralRequirementResult::Unknown uses — named collateral_reason rather than reason because this variant already sits inside a reason-tagged enum, and the two concepts (which REFUSAL this is, versus which COLLATERAL fact is missing) must not share one wire key.

§

WalletUnavailable

The node cannot spend at all — it can neither sign nor broadcast — for a reason that is NOT a shortfall. See MirrorReconcileWalletCapability for which capability and why.

Fields

§capability: MirrorReconcileWalletCapability

Which capability is missing.

§

FundsUnmeasured

The node has a wallet, but has not yet MEASURED what it holds (dig-node SPEC §25.12), so it cannot say whether the plan is affordable. This refusal states only that measurement, never affordability, is what is missing — quoting a figure here would be fabricated.

Implementations§

Source§

impl MirrorReconcileRefusal

Source

pub const ALL: &'static [MirrorReconcileRefusal]

Every refusal reason, for exhaustive rendering and the wire-token uniqueness KAT.

Each fixture value is representative rather than load-bearing here — ALL exists to walk the VARIANT set, not to pin any one payload; the golden-vector KAT pins payloads.

Source

pub const fn as_wire(self) -> &'static str

The stable snake_case wire token, matching the reason tag — independent of payload, so this stays a const fn despite most variants now carrying one.

Trait Implementations§

Source§

impl Clone for MirrorReconcileRefusal

Source§

fn clone(&self) -> MirrorReconcileRefusal

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MirrorReconcileRefusal

Source§

impl Debug for MirrorReconcileRefusal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MirrorReconcileRefusal

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for MirrorReconcileRefusal

Source§

impl PartialEq for MirrorReconcileRefusal

Source§

fn eq(&self, other: &MirrorReconcileRefusal) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MirrorReconcileRefusal

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MirrorReconcileRefusal

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.