Struct fil_actor_market_state::v13::State
source · pub struct State {Show 13 fields
pub proposals: Cid,
pub states: Cid,
pub pending_proposals: Cid,
pub escrow_table: Cid,
pub locked_table: Cid,
pub next_id: DealID,
pub deal_ops_by_epoch: Cid,
pub last_cron: ChainEpoch,
pub total_client_locked_collateral: TokenAmount,
pub total_provider_locked_collateral: TokenAmount,
pub total_client_storage_fee: TokenAmount,
pub pending_deal_allocation_ids: Cid,
pub provider_sectors: Cid,
}
Expand description
Market actor state
Fields§
§proposals: Cid
Proposals are deals that have been proposed and not yet cleaned up after expiry or termination. Array<DealID, DealProposal>
states: Cid
Array<DealID, DealState>
pending_proposals: Cid
PendingProposals tracks dealProposals that have not yet reached their deal start date. We track them here to ensure that miners can’t publish the same deal proposal twice
escrow_table: Cid
Total amount held in escrow, indexed by actor address (including both locked and unlocked amounts).
locked_table: Cid
Amount locked, indexed by actor address. Note: the amounts in this table do not affect the overall amount in escrow: only the portion of the total escrow amount that is locked.
next_id: DealID
Deal id state sequential incrementer
deal_ops_by_epoch: Cid
Metadata cached for efficient iteration over deals. SetMultimap
last_cron: ChainEpoch
§total_client_locked_collateral: TokenAmount
Total Client Collateral that is locked -> unlocked when deal is terminated
total_provider_locked_collateral: TokenAmount
Total Provider Collateral that is locked -> unlocked when deal is terminated
total_client_storage_fee: TokenAmount
Total storage fee that is locked in escrow -> unlocked when payments are made
pending_deal_allocation_ids: Cid
Verified registry allocation IDs for deals that are not yet activated.
provider_sectors: Cid
Maps providers to their sector IDs to deal IDs. This supports finding affected deals when a sector is terminated early or has data replaced. Grouping by provider limits the cost of operations in the expected use case of multiple sectors all belonging to the same provider. HAMTActorIDHAMTSectorNumberSectorDealIDs
Implementations§
source§impl State
impl State
pub fn new<BS: Blockstore>(store: &BS) -> Result<Self, ActorError>
pub fn get_total_locked(&self) -> TokenAmount
pub fn load_deal_states<'bs, BS>(
&self,
store: &'bs BS,
) -> Result<DealMetaArray<'bs, BS>, ActorError>where
BS: Blockstore,
pub fn find_deal_state<BS>(
&self,
store: &BS,
deal_id: DealID,
) -> Result<Option<DealState>, ActorError>where
BS: Blockstore,
pub fn put_deal_states<BS>(
&mut self,
store: &BS,
new_deal_states: &[(DealID, DealState)],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn remove_deal_state<BS>(
&mut self,
store: &BS,
deal_id: DealID,
) -> Result<Option<DealState>, ActorError>where
BS: Blockstore,
pub fn load_proposals<'bs, BS>(
&self,
store: &'bs BS,
) -> Result<DealArray<'bs, BS>, ActorError>where
BS: Blockstore,
pub fn get_proposal<BS: Blockstore>( &self, store: &BS, id: DealID, ) -> Result<DealProposal, ActorError>
pub fn find_proposal<BS>(
&self,
store: &BS,
deal_id: DealID,
) -> Result<Option<DealProposal>, ActorError>where
BS: Blockstore,
pub fn remove_proposal<BS>(
&mut self,
store: &BS,
deal_id: DealID,
) -> Result<Option<DealProposal>, ActorError>where
BS: Blockstore,
pub fn put_deal_proposals<BS>(
&mut self,
store: &BS,
new_deal_proposals: &[(DealID, DealProposal)],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn load_pending_deal_allocation_ids<BS>(
&mut self,
store: BS,
) -> Result<PendingDealAllocationsMap<BS>, ActorError>where
BS: Blockstore,
pub fn save_pending_deal_allocation_ids<BS>(
&mut self,
pending_deal_allocation_ids: &mut PendingDealAllocationsMap<BS>,
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn put_pending_deal_allocation_ids<BS>(
&mut self,
store: &BS,
new_pending_deal_allocation_ids: &[(DealID, AllocationID)],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn get_pending_deal_allocation_ids<BS>(
&mut self,
store: &BS,
deal_id_keys: &[DealID],
) -> Result<Vec<AllocationID>, ActorError>where
BS: Blockstore,
pub fn remove_pending_deal_allocation_id<BS>(
&mut self,
store: &BS,
deal_id: DealID,
) -> Result<Option<AllocationID>, ActorError>where
BS: Blockstore,
pub fn put_deals_by_epoch<BS>(
&mut self,
store: &BS,
new_deals_by_epoch: &[(ChainEpoch, DealID)],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn put_batch_deals_by_epoch<BS>(
&mut self,
store: &BS,
new_deals_by_epoch: &BTreeMap<ChainEpoch, Vec<DealID>>,
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn get_deals_for_epoch<BS>(
&self,
store: &BS,
key: ChainEpoch,
) -> Result<Vec<DealID>, ActorError>where
BS: Blockstore,
pub fn remove_deals_by_epoch<BS>(
&mut self,
store: &BS,
epochs_to_remove: &[ChainEpoch],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn add_balance_to_escrow_table<BS>(
&mut self,
store: &BS,
addr: &Address,
amount: &TokenAmount,
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn withdraw_balance_from_escrow_table<BS>(
&mut self,
store: &BS,
addr: &Address,
amount: &TokenAmount,
) -> Result<TokenAmount, ActorError>where
BS: Blockstore,
pub fn load_pending_deals<'bs, BS>(
&self,
store: &'bs BS,
) -> Result<Set<'bs, BS>, ActorError>where
BS: Blockstore,
pub fn has_pending_deal<BS>(
&self,
store: &BS,
key: &Cid,
) -> Result<bool, ActorError>where
BS: Blockstore,
pub fn put_pending_deals<BS>(
&mut self,
store: &BS,
new_pending_deals: &[Cid],
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn remove_pending_deal<BS>(
&mut self,
store: &BS,
pending_deal_key: Cid,
) -> Result<Option<()>, ActorError>where
BS: Blockstore,
pub fn put_sector_deal_ids( &mut self, store: &impl Blockstore, provider: ActorID, sector_deal_ids: &[(SectorNumber, SectorDealIDs)], ) -> Result<(), ActorError>
pub fn pop_sector_deal_ids( &mut self, store: &impl Blockstore, provider: ActorID, sector_numbers: impl Iterator<Item = SectorNumber>, ) -> Result<Vec<DealID>, ActorError>
pub fn remove_sector_deal_ids( &mut self, store: &impl Blockstore, provider_sector_deal_ids: &BTreeMap<ActorID, BTreeMap<SectorNumber, Vec<DealID>>>, ) -> Result<(), ActorError>
pub fn load_provider_sectors<BS>(
&self,
store: BS,
) -> Result<ProviderSectorsMap<BS>, ActorError>where
BS: Blockstore,
sourcepub fn remove_completed_deal<BS>(
&mut self,
store: &BS,
deal_id: DealID,
) -> Result<(), ActorError>where
BS: Blockstore,
pub fn remove_completed_deal<BS>(
&mut self,
store: &BS,
deal_id: DealID,
) -> Result<(), ActorError>where
BS: Blockstore,
Delete proposal and state simultaneously.
sourcepub fn get_active_deal_or_process_timeout<BS>(
&mut self,
store: &BS,
curr_epoch: ChainEpoch,
deal_id: DealID,
deal_proposal: &DealProposal,
dcid: &Cid,
) -> Result<LoadDealState, ActorError>where
BS: Blockstore,
pub fn get_active_deal_or_process_timeout<BS>(
&mut self,
store: &BS,
curr_epoch: ChainEpoch,
deal_id: DealID,
deal_proposal: &DealProposal,
dcid: &Cid,
) -> Result<LoadDealState, ActorError>where
BS: Blockstore,
Given a DealProposal, checks that the corresponding deal has activated If not, checks that the deal is past its activation epoch and performs cleanup
pub fn process_deal_update<BS>(
&mut self,
store: &BS,
state: &DealState,
deal: &DealProposal,
deal_cid: &Cid,
epoch: ChainEpoch,
) -> Result<(TokenAmount, TokenAmount, bool, bool), ActorError>where
BS: Blockstore,
pub fn process_slashed_deal<BS>(
&mut self,
store: &BS,
proposal: &DealProposal,
state: &DealState,
) -> Result<TokenAmount, ActorError>where
BS: Blockstore,
sourcepub fn process_deal_init_timed_out<BS>(
&mut self,
store: &BS,
deal: &DealProposal,
) -> Result<TokenAmount, ActorError>where
BS: Blockstore,
pub fn process_deal_init_timed_out<BS>(
&mut self,
store: &BS,
deal: &DealProposal,
) -> Result<TokenAmount, ActorError>where
BS: Blockstore,
Deal start deadline elapsed without appearing in a proven sector. Slash a portion of provider’s collateral, and unlock remaining collaterals for both provider and client.
pub fn generate_storage_deal_id(&mut self) -> DealID
pub fn escrow_table<'a, BS: Blockstore>( &self, store: &'a BS, ) -> Result<BalanceTable<&'a BS>, ActorError>
pub fn locked_table<'a, BS: Blockstore>( &self, store: &'a BS, ) -> Result<BalanceTable<&'a BS>, ActorError>
pub fn balance_covered<BS: Blockstore>( &self, store: &BS, addr: Address, amount_to_lock: &TokenAmount, ) -> Result<bool, ActorError>
pub fn lock_client_and_provider_balances<BS>(
&mut self,
store: &BS,
proposal: &DealProposal,
) -> Result<(), ActorError>where
BS: Blockstore,
sourcepub fn verify_deals_for_activation<BS>(
&self,
store: &BS,
addr: &Address,
deal_ids: Vec<DealID>,
curr_epoch: ChainEpoch,
sector_exp: i64,
) -> Result<(DealWeight, DealWeight), ActorError>where
BS: Blockstore,
pub fn verify_deals_for_activation<BS>(
&self,
store: &BS,
addr: &Address,
deal_ids: Vec<DealID>,
curr_epoch: ChainEpoch,
sector_exp: i64,
) -> Result<(DealWeight, DealWeight), ActorError>where
BS: Blockstore,
Verify that a given set of storage deals is valid for a sector currently being PreCommitted
Trait Implementations§
source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.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>
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>
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 moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> References<RawCodec> for T
impl<T> References<RawCodec> for T
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.