pub struct MemoryPoolStateStore { /* private fields */ }Expand description
In-memory PoolStateStore for tests and the trait’s reference semantics.
Not durable — drops with the process. The runtime uses the redb-backed impl
in crates/node.
Implementations§
Trait Implementations§
Source§impl Debug for MemoryPoolStateStore
impl Debug for MemoryPoolStateStore
Source§impl Default for MemoryPoolStateStore
impl Default for MemoryPoolStateStore
Source§impl PoolStateStore for MemoryPoolStateStore
impl PoolStateStore for MemoryPoolStateStore
Source§fn load_all(&self) -> Result<Vec<LaneState>, StoreError>
fn load_all(&self) -> Result<Vec<LaneState>, StoreError>
Load every persisted lane. Called once during node bring-up so the
runtime can hydrate its in-memory map before the voucher-accepting
handler starts. Read more
Source§fn record(&self, state: &LaneState) -> Result<(), StoreError>
fn record(&self, state: &LaneState) -> Result<(), StoreError>
Record the post-acceptance state for one lane in the store’s working set.
A disk-backed store MAY buffer this in memory and make it durable later
via
flush; it is not required to fsync before
returning Ok. Frontier state is safe to lose on a crash (an honest
client resumes forward; an un-redeemed replay is still on-chain-payable). Read moreSource§fn set_registered_until(
&self,
key: LaneKey,
registered_until: u64,
) -> Result<(), StoreError>
fn set_registered_until( &self, key: LaneKey, registered_until: u64, ) -> Result<(), StoreError>
Raise this lane’s observed on-chain registration expiry
(
LaneState::registered_until) to registered_until, monotonically — a
lower or equal value is a no-op, and 0 (unknown) never lowers a known
value. Touches ONLY that field, never the replay-critical last_* tuple,
so the seller redeemer can record a fresh registration without racing a
concurrent voucher advance into a lost update. A no-op for a lane with no
record. Buffered like record; durability is the next flush’s job. Read moreSource§fn set_paid_cumulative(
&self,
key: LaneKey,
paid_cumulative: U256,
) -> Result<(), StoreError>
fn set_paid_cumulative( &self, key: LaneKey, paid_cumulative: U256, ) -> Result<(), StoreError>
Raise this lane’s paid cumulative (
LaneState::paid_cumulative) to
paid_cumulative, monotonically — a lower or equal value is a no-op.
Touches ONLY that field, never the replay-critical last_* tuple, so the
seller PoolRedeemed watcher can record an observed redemption without
racing a concurrent voucher advance into a lost update. A no-op for a lane
with no record. Buffered like record; durability is the next flush’s
job. Persisting it is what stops a restarted node from forgetting prior
redemptions and re-submitting already-redeemed lanes (#2052). Read moreSource§fn forget(&self, key: LaneKey) -> Result<(), StoreError>
fn forget(&self, key: LaneKey) -> Result<(), StoreError>
Drop the persisted entry for a settled lane. A no-op if the lane has no
record. Read more
Source§fn get(&self, key: LaneKey) -> Result<Option<LaneState>, StoreError>
fn get(&self, key: LaneKey) -> Result<Option<LaneState>, StoreError>
Point-lookup the persisted state for one lane, or
None if no record
exists. Used by the on-chain seller redemption path to read the latest
accepted voucher (last_amount / last_bytes_delivered /
last_signature) when deciding whether an accrued claim crosses the
redemption threshold — always the freshest committed voucher. Read moreAuto Trait Implementations§
impl !Freeze for MemoryPoolStateStore
impl RefUnwindSafe for MemoryPoolStateStore
impl Send for MemoryPoolStateStore
impl Sync for MemoryPoolStateStore
impl Unpin for MemoryPoolStateStore
impl UnsafeUnpin for MemoryPoolStateStore
impl UnwindSafe for MemoryPoolStateStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more