pub enum CollateralRequirementResult {
Known {
epoch: u64,
protocol_version: u16,
required_per_store_dig_base_units: u64,
stores: u64,
owners: u64,
multiplier_micros: u64,
handicap_dig_base_units: u64,
},
Unknown {
reason: CollateralUnknownReason,
},
}Expand description
control.collateral.requirement — this epoch’s per-store collateral requirement, or a named
reason the node cannot state it.
UNKNOWN is a first-class answer, not an error. A node that has not censused the epoch, or
that is inside the census finality depth, is not broken; it simply does not know yet. Making
that a tagged variant rather than an optional number means there is no representable state in
which a client holds a figure it has not been given — which is what dig-app SPEC.md §3.7b
requires when it forbids any path that renders an absent requirement as a zero cost.
The census inputs travel with the figure on purpose. A client that can show only the number
can say the price moved; a client holding stores, owners, multiplier_micros and
handicap_dig_base_units can say WHY it moved. The per-epoch record already holds all four, so
carrying them costs the node nothing and is the difference between a figure an operator can
weigh and one they can only accept.
The margin is deliberately absent here. The requirement is a consensus-derived value every
node derives identically; the margin is a local operator preference that MUST NOT be a consensus
input. Returning them from one method would invite exactly the conflation dig-app SPEC.md
§3.7b forbids — read the margin from
CollateralMarginResult instead.
Variants§
Known
The node holds a final record for the epoch and states its requirement.
Fields
protocol_version: u16The collateral protocol version that COMPUTED this epoch.
Travels with the figure because the model is versioned and upgradable: a client that knows only the number cannot tell a disagreement from a rule change.
required_per_store_dig_base_units: u64The per-store requirement, in DIG base units, BEFORE any local safety margin.
stores: u64Qualifying (owner, store, root) advertisements counted in the census.
An advertisement count, never a node count: one owner publishing two roots for one store id contributes two.
owners: u64Distinct owner puzzle hashes across those advertisements.
Not a node count and not an operator count. A surface displaying it MUST say “collateralised owners”.
Unknown
The node cannot state the requirement, and names which fact is missing.
Fields
reason: CollateralUnknownReasonWhich fact the node is missing.
Trait Implementations§
Source§impl Clone for CollateralRequirementResult
impl Clone for CollateralRequirementResult
Source§fn clone(&self) -> CollateralRequirementResult
fn clone(&self) -> CollateralRequirementResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more