Documentation ¶
Index ¶
- Constants
- type Actor
- func (a Actor) AddBalance(rt Runtime, providerOrClientAddress *addr.Address) *adt.EmptyValue
- func (a Actor) ComputeDataCommitment(rt Runtime, params *ComputeDataCommitmentParams) *cbg.CborCid
- func (a Actor) Constructor(rt Runtime, _ *adt.EmptyValue) *adt.EmptyValue
- func (a Actor) CronTick(rt Runtime, params *adt.EmptyValue) *adt.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) OnMinerSectorsTerminate(rt Runtime, params *OnMinerSectorsTerminateParams) *adt.EmptyValue
- func (a Actor) PublishStorageDeals(rt Runtime, params *PublishStorageDealsParams) *PublishStorageDealsReturn
- func (a Actor) VerifyDealsOnSectorProveCommit(rt Runtime, params *VerifyDealsOnSectorProveCommitParams) *VerifyDealsOnSectorProveCommitReturn
- func (a Actor) WithdrawBalance(rt Runtime, params *WithdrawBalanceParams) *adt.EmptyValue
- type ClientDealProposal
- type ComputeDataCommitmentParams
- type DealArray
- type DealMetaArray
- type DealProposal
- func (p *DealProposal) ClientBalanceRequirement() abi.TokenAmount
- func (p *DealProposal) Duration() abi.ChainEpoch
- func (t *DealProposal) MarshalCBOR(w io.Writer) error
- func (p *DealProposal) ProviderBalanceRequirement() abi.TokenAmount
- func (p *DealProposal) TotalStorageFee() abi.TokenAmount
- func (t *DealProposal) UnmarshalCBOR(r io.Reader) error
- type DealState
- type OnMinerSectorsTerminateParams
- type PublishStorageDealsParams
- type PublishStorageDealsReturn
- type Runtime
- type SetMultimap
- func (mm *SetMultimap) ForEach(epoch abi.ChainEpoch, fn func(id abi.DealID) error) error
- func (mm *SetMultimap) Put(epoch abi.ChainEpoch, v abi.DealID) error
- func (mm *SetMultimap) PutMany(epoch abi.ChainEpoch, vs []abi.DealID) error
- func (mm *SetMultimap) RemoveAll(key abi.ChainEpoch) error
- func (mm *SetMultimap) Root() (cid.Cid, error)
- type State
- func (st *State) AddEscrowBalance(s adt.Store, a addr.Address, amount abi.TokenAmount) error
- func (st *State) AddLockedBalance(s adt.Store, a addr.Address, amount abi.TokenAmount) error
- func (st *State) GetEscrowBalance(rt Runtime, a addr.Address) abi.TokenAmount
- func (st *State) GetLockedBalance(rt Runtime, a addr.Address) abi.TokenAmount
- func (t *State) MarshalCBOR(w io.Writer) error
- func (st *State) MutateBalanceTable(s adt.Store, c *cid.Cid, f func(t *adt.BalanceTable) error) error
- func (t *State) UnmarshalCBOR(r io.Reader) error
- type VerifyDealsOnSectorProveCommitParams
- type VerifyDealsOnSectorProveCommitReturn
- type WithdrawBalanceParams
Constants ¶
const DealUpdatesInterval = 100
DealUpdatesInterval is the number of blocks between payouts for deals
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct{}
func (Actor) AddBalance ¶
Deposits the received value into the balance held in escrow.
func (Actor) ComputeDataCommitment ¶
func (a Actor) ComputeDataCommitment(rt Runtime, params *ComputeDataCommitmentParams) *cbg.CborCid
func (Actor) Constructor ¶
func (a Actor) Constructor(rt Runtime, _ *adt.EmptyValue) *adt.EmptyValue
func (Actor) CronTick ¶ added in v0.5.1
func (a Actor) CronTick(rt Runtime, params *adt.EmptyValue) *adt.EmptyValue
func (Actor) OnMinerSectorsTerminate ¶
func (a Actor) OnMinerSectorsTerminate(rt Runtime, params *OnMinerSectorsTerminateParams) *adt.EmptyValue
Terminate a set of deals in response to their containing sector being terminated. Slash provider collateral, refund client collateral, and refund partial unpaid escrow amount to client.
func (Actor) PublishStorageDeals ¶
func (a Actor) PublishStorageDeals(rt Runtime, params *PublishStorageDealsParams) *PublishStorageDealsReturn
Publish a new set of storage deals (not yet included in a sector).
func (Actor) VerifyDealsOnSectorProveCommit ¶
func (a Actor) VerifyDealsOnSectorProveCommit(rt Runtime, params *VerifyDealsOnSectorProveCommitParams) *VerifyDealsOnSectorProveCommitReturn
Verify that a given set of storage deals is valid for a sector currently being ProveCommitted, update the market's internal state accordingly, and return DealWeight of the set of storage deals given. Note: in the case of a capacity-commitment sector (one with zero deals), this function should succeed vacuously. The weight is defined as the sum, over all deals in the set, of the product of its size with its duration. This quantity may be an input into the functions specifying block reward, sector power, collateral, and/or other parameters.
func (Actor) WithdrawBalance ¶
func (a Actor) WithdrawBalance(rt Runtime, params *WithdrawBalanceParams) *adt.EmptyValue
Attempt to withdraw the specified amount from the balance held in escrow. If less than the specified amount is available, yields the entire available balance.
type ClientDealProposal ¶
type ClientDealProposal struct { Proposal DealProposal ClientSignature acrypto.Signature }
ClientDealProposal is a DealProposal signed by a client
func (*ClientDealProposal) MarshalCBOR ¶
func (t *ClientDealProposal) MarshalCBOR(w io.Writer) error
func (*ClientDealProposal) UnmarshalCBOR ¶
func (t *ClientDealProposal) UnmarshalCBOR(r io.Reader) error
type ComputeDataCommitmentParams ¶
type ComputeDataCommitmentParams struct { DealIDs []abi.DealID SectorType abi.RegisteredProof }
func (*ComputeDataCommitmentParams) MarshalCBOR ¶
func (t *ComputeDataCommitmentParams) MarshalCBOR(w io.Writer) error
func (*ComputeDataCommitmentParams) UnmarshalCBOR ¶
func (t *ComputeDataCommitmentParams) UnmarshalCBOR(r io.Reader) error
type DealArray ¶
type DealArray struct {
*Array
}
A specialization of a array to deals. It is an error to query for a key that doesn't exist.
func AsDealProposalArray ¶
Interprets a store as balance table with root `r`.
func (*DealArray) Get ¶
func (t *DealArray) Get(id abi.DealID) (*DealProposal, error)
Gets the deal for a key. The entry must have been previously initialized.
type DealMetaArray ¶
type DealMetaArray struct {
*Array
}
A specialization of a array to deals. It is an error to query for a key that doesn't exist.
func AsDealStateArray ¶
func AsDealStateArray(s Store, r cid.Cid) (*DealMetaArray, error)
Interprets a store as balance table with root `r`.
func (*DealMetaArray) Delete ¶
func (t *DealMetaArray) Delete(key uint64) error
func (*DealMetaArray) Get ¶
Gets the deal for a key. The entry must have been previously initialized.
func (*DealMetaArray) Root ¶
func (t *DealMetaArray) Root() (cid.Cid, error)
Returns the root cid of underlying AMT.
type DealProposal ¶
type DealProposal struct { PieceCID cid.Cid // CommP PieceSize abi.PaddedPieceSize VerifiedDeal bool Client addr.Address Provider addr.Address // Nominal start epoch. Deal payment is linear between StartEpoch and EndEpoch, // with total amount StoragePricePerEpoch * (EndEpoch - StartEpoch). // Storage deal must appear in a sealed (proven) sector no later than StartEpoch, // otherwise it is invalid. StartEpoch abi.ChainEpoch EndEpoch abi.ChainEpoch StoragePricePerEpoch abi.TokenAmount ProviderCollateral abi.TokenAmount ClientCollateral abi.TokenAmount }
Note: Deal Collateral is only released and returned to clients and miners when the storage deal stops counting towards power. In the current iteration, it will be released when the sector containing the storage deals expires, even though some storage deals can expire earlier than the sector does. Collaterals are denominated in PerEpoch to incur a cost for self dealing or minimal deals that last for a long time. Note: ClientCollateralPerEpoch may not be needed and removed pending future confirmation. There will be a Minimum value for both client and provider deal collateral.
func (*DealProposal) ClientBalanceRequirement ¶
func (p *DealProposal) ClientBalanceRequirement() abi.TokenAmount
func (*DealProposal) Duration ¶
func (p *DealProposal) Duration() abi.ChainEpoch
func (*DealProposal) MarshalCBOR ¶
func (t *DealProposal) MarshalCBOR(w io.Writer) error
func (*DealProposal) ProviderBalanceRequirement ¶
func (p *DealProposal) ProviderBalanceRequirement() abi.TokenAmount
func (*DealProposal) TotalStorageFee ¶
func (p *DealProposal) TotalStorageFee() abi.TokenAmount
func (*DealProposal) UnmarshalCBOR ¶
func (t *DealProposal) UnmarshalCBOR(r io.Reader) error
type DealState ¶
type DealState struct { SectorStartEpoch abi.ChainEpoch // -1 if not yet included in proven sector LastUpdatedEpoch abi.ChainEpoch // -1 if deal state never updated SlashEpoch abi.ChainEpoch // -1 if deal never slashed }
type OnMinerSectorsTerminateParams ¶
func (*OnMinerSectorsTerminateParams) MarshalCBOR ¶
func (t *OnMinerSectorsTerminateParams) MarshalCBOR(w io.Writer) error
func (*OnMinerSectorsTerminateParams) UnmarshalCBOR ¶
func (t *OnMinerSectorsTerminateParams) UnmarshalCBOR(r io.Reader) error
type PublishStorageDealsParams ¶
type PublishStorageDealsParams struct {
Deals []ClientDealProposal
}
func (*PublishStorageDealsParams) MarshalCBOR ¶
func (t *PublishStorageDealsParams) MarshalCBOR(w io.Writer) error
func (*PublishStorageDealsParams) UnmarshalCBOR ¶
func (t *PublishStorageDealsParams) UnmarshalCBOR(r io.Reader) error
type PublishStorageDealsReturn ¶
func (*PublishStorageDealsReturn) MarshalCBOR ¶
func (t *PublishStorageDealsReturn) MarshalCBOR(w io.Writer) error
func (*PublishStorageDealsReturn) UnmarshalCBOR ¶
func (t *PublishStorageDealsReturn) UnmarshalCBOR(r io.Reader) error
type SetMultimap ¶
type SetMultimap struct {
// contains filtered or unexported fields
}
func AsSetMultimap ¶
Interprets a store as a HAMT-based map of HAMT-based sets with root `r`.
func MakeEmptySetMultimap ¶
func MakeEmptySetMultimap(s adt.Store) *SetMultimap
Creates a new map backed by an empty HAMT and flushes it to the store.
func (*SetMultimap) ForEach ¶
func (mm *SetMultimap) ForEach(epoch abi.ChainEpoch, fn func(id abi.DealID) error) error
Iterates all entries for a key, iteration halts if the function returns an error.
func (*SetMultimap) Put ¶
func (mm *SetMultimap) Put(epoch abi.ChainEpoch, v abi.DealID) error
func (*SetMultimap) PutMany ¶ added in v0.5.1
func (mm *SetMultimap) PutMany(epoch abi.ChainEpoch, vs []abi.DealID) error
func (*SetMultimap) RemoveAll ¶
func (mm *SetMultimap) RemoveAll(key abi.ChainEpoch) error
Removes all values for a key.
type State ¶
type State struct { Proposals cid.Cid // AMT[DealID]DealProposal States cid.Cid // AMT[DealID]DealState // Total amount held in escrow, indexed by actor address (including both locked and unlocked amounts). EscrowTable cid.Cid // BalanceTable // 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. LockedTable cid.Cid // BalanceTable NextID abi.DealID // Metadata cached for efficient iteration over deals. DealOpsByEpoch cid.Cid // SetMultimap, HAMT[epoch]Set LastCron abi.ChainEpoch }
func ConstructState ¶
func ConstructState(emptyArrayCid, emptyMapCid, emptyMSetCid cid.Cid) *State
func (*State) AddEscrowBalance ¶
func (*State) AddLockedBalance ¶
func (*State) GetEscrowBalance ¶
func (*State) GetLockedBalance ¶
func (*State) MutateBalanceTable ¶
type VerifyDealsOnSectorProveCommitParams ¶
type VerifyDealsOnSectorProveCommitParams struct { DealIDs []abi.DealID SectorExpiry abi.ChainEpoch }
func (*VerifyDealsOnSectorProveCommitParams) MarshalCBOR ¶
func (t *VerifyDealsOnSectorProveCommitParams) MarshalCBOR(w io.Writer) error
func (*VerifyDealsOnSectorProveCommitParams) UnmarshalCBOR ¶
func (t *VerifyDealsOnSectorProveCommitParams) UnmarshalCBOR(r io.Reader) error
type VerifyDealsOnSectorProveCommitReturn ¶
type VerifyDealsOnSectorProveCommitReturn struct { DealWeight abi.DealWeight VerifiedDealWeight abi.DealWeight }
func (*VerifyDealsOnSectorProveCommitReturn) MarshalCBOR ¶
func (t *VerifyDealsOnSectorProveCommitReturn) MarshalCBOR(w io.Writer) error
func (*VerifyDealsOnSectorProveCommitReturn) UnmarshalCBOR ¶
func (t *VerifyDealsOnSectorProveCommitReturn) UnmarshalCBOR(r io.Reader) error
type WithdrawBalanceParams ¶
type WithdrawBalanceParams struct { ProviderOrClientAddress addr.Address Amount abi.TokenAmount }
func (*WithdrawBalanceParams) MarshalCBOR ¶
func (t *WithdrawBalanceParams) MarshalCBOR(w io.Writer) error
func (*WithdrawBalanceParams) UnmarshalCBOR ¶
func (t *WithdrawBalanceParams) UnmarshalCBOR(r io.Reader) error