Skip to main content

GetRewardDistributorResult

Struct GetRewardDistributorResult 

Source
pub struct GetRewardDistributorResult {
Show 16 fields pub launcher_id: HexId, pub store_id: HexId, pub root: HexId, pub epoch_seconds: u64, pub first_epoch_start: u64, pub payout_threshold: u64, pub fee_bps: u16, pub withdrawal_share_bps: u16, pub reserve_base_units: u64, pub entry_count: u64, pub current_distributor_epoch: u64, pub last_entry_write_at: Option<u64>, pub entry_set_stale: bool, pub observed_at: u64, pub chain_peak_height: u64, pub chain_peak_timestamp: u64,
}
Expand description

Result for dig.getRewardDistributor — SPEC §2.6, third method: chain-derived distributor state only, never the local prover loop’s own state (see RewardProverStatus for that).

§entry_set_stale lives HERE, never on RewardProverStatus

This is the one boolean in the reward-distributor surface, and it belongs here specifically: per SPEC §12.4 it is computed by the responder from the distributor singleton’s on-chain spend history at read time, not self-reported by a possibly-wedged writer. Copying it onto RewardProverStatus would reintroduce exactly the self-reported-health failure that type’s doc comment forbids — see that type for the full argument.

§The chain-view anchor (chain_peak_height / chain_peak_timestamp) — SPEC §4.5

observed_at dates when THIS REPLY was assembled — a wall clock, and nothing else. entry_set_stale above is computed on a different clock entirely: the distributor singleton’s on-chain peak. A stalled chain source freezes that peak while the wall clock keeps advancing, which freezes entry_set_stale at false under a freshly stamped observed_at — the optimistic-staleness defect this field pair exists to close (dig_ecosystem#3262). chain_peak_height and chain_peak_timestamp expose the clock entry_set_stale was actually computed against, so a reader can check the two are self-consistent:

entry_set_stale == (reserve_base_units > 0
    && chain_peak_timestamp - last_entry_write_at.unwrap_or(0) >= 172_800)

What this check is, and is not. Every value on the right-hand side — chain_peak_timestamp included — comes from the SAME response and the SAME responder as entry_set_stale itself. Re-deriving the formula from the responder’s own numbers catches an INTERNALLY INCONSISTENT responder only; it is not evidence against a lying, wedged, or compromised one, which can report any self-consistent triple it likes and pass this check every time. What the anchor genuinely fixes is narrower, and real: an HONEST but chain-stalled responder can no longer freeze entry_set_stale at false under a freshly stamped observed_at, because its own stalled chain clock now travels on the wire beside it — the defect dig_ecosystem#3262 was filed for, and it is closed. Real protection against a dishonest responder requires comparing chain_peak_height against a chain view the consumer obtained INDEPENDENTLY of this response — see Self::chain_peak_height. SPEC §4.5.

Both fields are required, never Option, never 0. A responder that cannot obtain the chain peak (dig-rewards-coin’s read_distributor refuses without one) MUST answer a JSON-RPC error, not a result with a missing or zeroed anchor — there is no result arm for “I could not look”.

Fields§

§launcher_id: HexId

The distributor singleton’s launcher id (64-hex).

§store_id: HexId

The backing store’s launcher id (64-hex).

§root: HexId

The store’s current generation root (64-hex).

§epoch_seconds: u64

The payout epoch length, in seconds.

§first_epoch_start: u64

Unix seconds the first epoch started.

§payout_threshold: u64

The reserve threshold, in base units, that triggers a payout.

§fee_bps: u16

The distributor’s fee, in basis points.

§withdrawal_share_bps: u16

The share of a clawed-back commitment the committer recovers, in basis points — SPEC §7.5. withdrawal_share_bps = 9000 means a clawback returns 90% of the committed value; the remaining 10% is forfeited to the reserve as a deterrent against the funder (SPEC §7.5 clause 1: it is priced correctly and is not compensation to induced mirrors). Curried at launch and immutable, same as Self::fee_bps beside it.

§reserve_base_units: u64

The current reserve, in base units.

§entry_count: u64

The current entry-set size.

§current_distributor_epoch: u64

The current epoch index (0-based from first_epoch_start).

§last_entry_write_at: Option<u64>

Unix seconds of the most recent entry-set write on chain, if any. None together with a non-zero reserve_base_units implies stale: an entry set that has never been written is maximally stale, not unknown, and a consumer MUST NOT render it as blank or “unknown” (SPEC §2.4 cl. 1 — silence is not an acceptable representation of “not distributing”).

§entry_set_stale: bool

true when the entry set has not changed in STALE_ENTRY_SET_SECONDS = 172_800 (48 h) while the reserve is non-zero — SPEC §12.4. A drained distributor with a frozen entry set is not stale, it is Unfunded; the non-zero-reserve conjunct exists to keep the two states distinct. The responder computes this at read time from the singleton’s own on-chain spend history — it is not self-reported, so a wedged prover cannot fake it. See the type doc for why this boolean is safe here and forbidden on RewardProverStatus.

§observed_at: u64

Unix seconds this result was assembled — a WALL clock. Says nothing about chain freshness; read chain_peak_timestamp for that (see the type doc’s “chain-view anchor” section).

§chain_peak_height: u64

The distributor singleton’s chain peak height at read time (ChainObservation::peak_height, widened losslessly from u32). Required — a responder with no chain peak in hand errors instead of answering. This is the field that carries REAL protection against a dishonest responder: compare it against a chain view the consumer obtained independently, not against anything else in this response. See the type doc’s trust-boundary section. SPEC §4.5.

§chain_peak_timestamp: u64

block_timestamp(chain_peak_height) — the CHAIN clock, never the wall clock, and the exact clock Self::entry_set_stale is computed against. Required, never 0: a responder with no chain peak errors instead of answering. Self-consistency against entry_set_stale only catches an internally inconsistent responder — see the type doc’s trust-boundary section. SPEC §4.5.

Trait Implementations§

Source§

impl Clone for GetRewardDistributorResult

Source§

fn clone(&self) -> Self

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 Debug for GetRewardDistributorResult

Source§

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

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

impl<'de> Deserialize<'de> for GetRewardDistributorResult

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 GetRewardDistributorResult

Source§

impl PartialEq for GetRewardDistributorResult

Source§

fn eq(&self, other: &Self) -> 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 GetRewardDistributorResult

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 GetRewardDistributorResult

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.