pub enum MirrorBondState {
Bonded {
coin_id: String,
epoch: u64,
amount_dig_base_units: u64,
},
Pending,
Unfunded {
short_dig_base_units: u64,
},
Deferred {
reason: CollateralUnknownReason,
},
Withheld,
Disabled,
Reclaiming {
coin_id: String,
epoch: u64,
amount_dig_base_units: u64,
},
}Expand description
What this node can say about ONE (store, root) bond right now.
§The whole point is that “no coin yet” is never one answer
Six of these seven variants mean “there is no current-epoch coin”, and every one of them calls for a different response from a person: add funds, wait, do nothing, turn a switch back on, or nothing at all because the capsule was never this node’s to advertise. Collapsing any two of them is what produces an hourly out-of-funds alarm about a perfectly healthy node (dig-app#300), which is the defect this method exists to remove.
§Vocabulary: withheld, disabled and reclaiming are three different things
dig-node’s internal BondState (mirror/pass.rs) used the single word Withheld for the
node-wide collateralisation switch being OFF, while dig-node SPEC.md §25.8 used the same word
for a capsule of Relayed provenance — one this node holds but deliberately never advertises.
They are not the same state. They differ in SCOPE (one switch for the node, versus one
capsule’s provenance) and, more importantly, in REMEDY: an operator told “withheld” about a
disabled node goes looking at content, and one told “withheld” about a relayed capsule goes
looking for a switch. This contract keeps them apart, and neither existing use survives
unchanged:
Withheldcarries §25.8’s meaning —Relayedprovenance, per capsule.Disabledis the node-wide switch, which §25.8 could not express at all.Reclaimingis §25.8’s seventh state, whichBondStatehad no variant for even though the money is still locked while it lasts.
So dig-node MUST rename BondState::Withheld to Disabled and add Withheld + Reclaiming,
and §25.8 MUST gain disabled. Serving the old enum under §25.8’s words would publish a
contract whose terms mean something else — the drift class this crate exists to prevent.
Withheld is VACUOUS until dig-node’s surface enumerates its SERVED set
rather than its Held set. A relayed capsule is by construction absent from the desired-bond
set, so a derivation keyed on Held bonds can never emit this variant — it would silently
answer “no such row” where §25.8 promises “withheld on purpose”. Declaring it here is correct;
a producer that cannot reach it MUST say so rather than report the state as satisfied.
Variants§
Bonded
A coin bonding this (store, root) for the CURRENT epoch is on chain.
Fields
Pending
A create for this bond has been submitted and has not confirmed.
Nothing is wrong and no money is missing. A client MUST NOT render this as a shortfall.
Unfunded
The wallet cannot cover the create for this bond.
The genuine out-of-funds state, and the ONLY one a client may raise a funding alarm on.
Fields
short_dig_base_units: u64How many more DIG base units THIS BOND alone needs.
DIG base units — $DIG has 3 decimals, so one unit is 0.001 DIG. It is NOT a mojo,
which is XCH’s 1e-12 unit, nine orders of magnitude away. A mirror amount is never
quoted in mojos.
Per bond, never a total. “How short is this node overall” is
control.collateral.buffer’s question, and it answers it authoritatively.
Deferred
The 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 a shortfall tells an operator to send money that would change nothing.
Fields
reason: CollateralUnknownReasonWhy the requirement is unknown, in the SAME taxonomy
CollateralRequirementResult::Unknown uses.
Reused rather than restated: a second copy of that taxonomy here would drift from the
original, and a client already renders these tokens for
control.collateral.requirement.
Withheld
This node holds the capsule with Relayed provenance: it does not claim to serve it, and
deliberately never advertises it.
§25.8’s withheld. Nothing is wrong, nothing is owed, and there is no remedy — which is
exactly why conflating it with Unfunded is the dig-app#300 defect.
Disabled
Collateralisation is switched OFF for this node, so no bond is advertised regardless of funds, provenance or price.
Node-wide, not per capsule: every row reads disabled together. The remedy is a switch, and
it is the operator’s own earlier decision — a client MUST NOT present it as a fault.
Reclaiming
A live coin is being reclaimed: the bond is going away and the money is not back yet.
Carries the coin because the funds are STILL LOCKED for the duration. A surface that showed this as unbonded-and-unlocked would report money as available that cannot be spent, and a reclaim that fails leaves the coin exactly where this says it is.
Trait Implementations§
Source§impl Clone for MirrorBondState
impl Clone for MirrorBondState
Source§fn clone(&self) -> MirrorBondState
fn clone(&self) -> MirrorBondState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more