Versions in this module Expand all Collapse all v5 v5.0.6 Sep 27, 2021 Changes in this version + var DisbursedAmount = big.Mul(big.NewInt(41e6), big.NewInt(1e18)) + func BlockstoreCopy(from, to cbor.IpldBlockstore, root cid.Cid) (blocks uint64, copySize uint64, err error) + func PopRandom(list []uint64, rnd *rand.Rand) (uint64, []uint64) + func WinCount(minerPower abi.StoragePower, totalPower abi.StoragePower, random float64) uint64 + type Agent interface + Tick func(v SimState) ([]message, error) + type DeadlineStateV4 struct + func (d *DeadlineStateV4) LoadPartition(store adt.Store, partIdx uint64) (SimPartitionState, error) + type DeadlineStateV5 struct + func (d *DeadlineStateV5) LoadPartition(store adt.Store, partIdx uint64) (SimPartitionState, error) + type DealClientAgent struct + DealCount int + func AddDealClientsForAccounts(s SimState, accounts []address.Address, seed int64, config DealClientConfig) []*DealClientAgent + func NewDealClientAgent(account address.Address, seed int64, config DealClientConfig) *DealClientAgent + func (dca *DealClientAgent) Tick(s SimState) ([]message, error) + type DealClientConfig struct + DealRate float64 + MaxMarketBalance abi.TokenAmount + MaxPieceSize uint64 + MaxStoragePrice abi.TokenAmount + MinMarketBalance abi.TokenAmount + MinPieceSize uint64 + MinStoragePrice abi.TokenAmount + type DealProvider interface + Address func() address.Address + AvailableCollateral func() abi.TokenAmount + CreateDeal func(proposal market.ClientDealProposal) + DealRange func(currentEpoch abi.ChainEpoch) (start abi.ChainEpoch, end abi.ChainEpoch) + type MinerAgent struct + Config MinerAgentConfig + IDAddress address.Address + Owner address.Address + RobustAddress address.Address + UpgradedSectors uint64 + Worker address.Address + func NewMinerAgent(owner address.Address, worker address.Address, idAddress address.Address, ...) *MinerAgent + func (ma *MinerAgent) Address() address.Address + func (ma *MinerAgent) AvailableCollateral() abi.TokenAmount + func (ma *MinerAgent) CreateDeal(proposal market.ClientDealProposal) + func (ma *MinerAgent) DealRange(currentEpoch abi.ChainEpoch) (abi.ChainEpoch, abi.ChainEpoch) + func (ma *MinerAgent) Tick(s SimState) ([]message, error) + type MinerAgentConfig struct + FaultRate float64 + MaxMarketBalance abi.TokenAmount + MinMarketBalance abi.TokenAmount + PrecommitRate float64 + ProofType abi.RegisteredSealProof + RecoveryRate float64 + StartingBalance abi.TokenAmount + UpgradeSectors bool + type MinerGenerator struct + func NewMinerGenerator(accounts []address.Address, config MinerAgentConfig, createMinerRate float64, ...) *MinerGenerator + func (mg *MinerGenerator) Tick(s SimState) ([]message, error) + type MinerStateV4 struct + Ctx context.Context + Root cid.Cid + func (m *MinerStateV4) DeadlineInfo(store adt.Store, currEpoch abi.ChainEpoch) (*dline.Info, error) + func (m *MinerStateV4) FeeDebt(store adt.Store) (abi.TokenAmount, error) + func (m *MinerStateV4) FindSector(store adt.Store, sectorNo abi.SectorNumber) (uint64, uint64, error) + func (m *MinerStateV4) HasSectorNo(store adt.Store, sectorNo abi.SectorNumber) (bool, error) + func (m *MinerStateV4) LoadDeadlineState(store adt.Store, dlIdx uint64) (SimDeadlineState, error) + func (m *MinerStateV4) LoadSectorInfo(store adt.Store, sectorNo uint64) (SimSectorInfo, error) + func (m *MinerStateV4) ProvingPeriodStart(store adt.Store) (abi.ChainEpoch, error) + type MinerStateV5 struct + Ctx context.Context + Root cid.Cid + func (m *MinerStateV5) DeadlineInfo(store adt.Store, currEpoch abi.ChainEpoch) (*dline.Info, error) + func (m *MinerStateV5) FeeDebt(store adt.Store) (abi.TokenAmount, error) + func (m *MinerStateV5) FindSector(store adt.Store, sectorNo abi.SectorNumber) (uint64, uint64, error) + func (m *MinerStateV5) HasSectorNo(store adt.Store, sectorNo abi.SectorNumber) (bool, error) + func (m *MinerStateV5) LoadDeadlineState(store adt.Store, dlIdx uint64) (SimDeadlineState, error) + func (m *MinerStateV5) LoadSectorInfo(store adt.Store, sectorNo uint64) (SimSectorInfo, error) + func (m *MinerStateV5) ProvingPeriodStart(store adt.Store) (abi.ChainEpoch, error) + type PartitionStateV4 struct + func (p *PartitionStateV4) Terminated() bitfield.BitField + type PartitionStateV5 struct + func (p *PartitionStateV5) Terminated() bitfield.BitField + type PowerTable struct + type RateIterator struct + func NewRateIterator(rate float64, seed int64) *RateIterator + func (ri *RateIterator) Tick(f func() error) error + func (ri *RateIterator) TickWithRate(rate float64, f func() error) error + type SectorInfoV4 struct + func (s *SectorInfoV4) Expiration() abi.ChainEpoch + type SectorInfoV5 struct + func (s *SectorInfoV5) Expiration() abi.ChainEpoch + type Sim struct + Agents []Agent + Config SimConfig + DealProviders []DealProvider + MessageCount uint64 + WinCount uint64 + func NewSim(ctx context.Context, t testing.TB, ...) *Sim + func NewSimWithVM(ctx context.Context, t testing.TB, v SimVM, vmFactory VMFactoryFunc, ...) *Sim + func (s *Sim) AddAgent(a Agent) + func (s *Sim) AddDealProvider(d DealProvider) + func (s *Sim) ChooseDealProvider() DealProvider + func (s *Sim) CreateMinerParams(worker, owner address.Address, sealProof abi.RegisteredSealProof) (*power.CreateMinerParams, error) + func (s *Sim) GetCallStats() map[vm.MethodKey]*vm.CallStats + func (s *Sim) GetEpoch() abi.ChainEpoch + func (s *Sim) GetState(addr address.Address, out cbor.Unmarshaler) error + func (s *Sim) GetVM() SimVM + func (s *Sim) MinerState(addr address.Address) (SimMinerState, error) + func (s *Sim) NetworkCirculatingSupply() abi.TokenAmount + func (s *Sim) Store() adt.Store + func (s *Sim) SwapVM(v SimVM, vmFactory VMFactoryFunc, ...) + func (s *Sim) Tick() error + type SimConfig struct + AccountCount int + AccountInitialBalance abi.TokenAmount + CheckpointEpochs uint64 + CreateMinerProbability float32 + Seed int64 + type SimDeadlineState interface + LoadPartition func(adt.Store, uint64) (SimPartitionState, error) + type SimMinerState interface + DeadlineInfo func(adt.Store, abi.ChainEpoch) (*dline.Info, error) + FeeDebt func(adt.Store) (abi.TokenAmount, error) + FindSector func(adt.Store, abi.SectorNumber) (uint64, uint64, error) + HasSectorNo func(adt.Store, abi.SectorNumber) (bool, error) + LoadDeadlineState func(adt.Store, uint64) (SimDeadlineState, error) + LoadSectorInfo func(adt.Store, uint64) (SimSectorInfo, error) + ProvingPeriodStart func(adt.Store) (abi.ChainEpoch, error) + type SimPartitionState interface + Terminated func() bitfield.BitField + type SimSectorInfo interface + Expiration func() abi.ChainEpoch + type SimState interface + AddAgent func(a Agent) + AddDealProvider func(d DealProvider) + ChooseDealProvider func() DealProvider + CreateMinerParams func(worker, owner address.Address, sealProof abi.RegisteredSealProof) (*power.CreateMinerParams, error) + GetEpoch func() abi.ChainEpoch + GetState func(addr address.Address, out cbor.Unmarshaler) error + MinerState func(addr address.Address) (SimMinerState, error) + NetworkCirculatingSupply func() abi.TokenAmount + Store func() adt.Store + type SimVM interface + ApplyMessage func(from, to address.Address, value abi.TokenAmount, method abi.MethodNum, ...) (vm.MessageResult, error) + GetActor func(addr address.Address) (*states.Actor, bool, error) + GetActorImpls func() map[cid.Cid]rt.VMActor + GetCallStats func() map[vm2.MethodKey]*vm2.CallStats + GetCirculatingSupply func() abi.TokenAmount + GetEpoch func() abi.ChainEpoch + GetLogs func() []string + GetState func(addr address.Address, out cbor.Unmarshaler) error + GetStatsSource func() vm2.StatsSource + GetTotalActorBalance func() (abi.TokenAmount, error) + SetCirculatingSupply func(supply big.Int) + SetStatsSource func(stats vm2.StatsSource) + StateRoot func() cid.Cid + Store func() adt2.Store + type VMFactoryFunc func(context.Context, vm2.ActorImplLookup, adt.Store, cid.Cid, abi.ChainEpoch) (SimVM, error)