Documentation ¶
Index ¶
- func NewBitField() *bitfield.BitField
- type AccountView
- type ChainSectorInfo
- type CirculatingSupply
- type DealCollateralBounds
- type FakeMinerState
- type FakeSectorInfo
- type FakeStateView
- func (v *FakeStateView) GetMinerWorkerRaw(ctx context.Context, maddr address.Address) (address.Address, error)
- func (v *FakeStateView) GetSectorsForWinningPoSt(ctx context.Context, nv network.Version, pv ffiwrapper.Verifier, st cid.Cid, ...) ([]builtin.SectorInfo, error)
- func (v *FakeStateView) InitNetworkName(_ context.Context) (string, error)
- func (v *FakeStateView) MinerClaimedPower(ctx context.Context, miner address.Address) (abi.StoragePower, abi.StoragePower, error)
- func (v *FakeStateView) MinerExists(_ context.Context, _ address.Address) (bool, error)
- func (v *FakeStateView) MinerInfo(ctx context.Context, maddr address.Address, nv network.Version) (*miner.MinerInfo, error)
- func (v *FakeStateView) MinerPledgeCollateral(_ context.Context, maddr address.Address) (locked abi.TokenAmount, total abi.TokenAmount, err error)
- func (v *FakeStateView) MinerProvingPeriod(ctx context.Context, maddr address.Address) (start abi.ChainEpoch, end abi.ChainEpoch, failureCount int, err error)
- func (v *FakeStateView) MinerSectorCount(ctx context.Context, maddr address.Address) (uint64, error)
- func (v *FakeStateView) MinerSectorInfo(_ context.Context, maddr address.Address, sectorNum abi.SectorNumber) (*miner.SectorOnChainInfo, error)
- func (v *FakeStateView) PowerNetworkTotal(_ context.Context) (*NetworkPower, error)
- func (v *FakeStateView) ResolveToKeyAddr(ctx context.Context, addr address.Address) (address.Address, error)
- type FaultStateView
- type HeadSignView
- type MarketDeal
- type NetworkPower
- type PowerStateView
- type PowerTableView
- func (v PowerTableView) MinerClaimedPower(ctx context.Context, mAddr address.Address) (abi.StoragePower, error)
- func (v PowerTableView) NetworkTotalPower(ctx context.Context) (abi.StoragePower, error)
- func (v PowerTableView) SignerAddress(ctx context.Context, addr address.Address) (address.Address, error)
- func (v PowerTableView) WorkerAddr(ctx context.Context, mAddr address.Address, nv network.Version) (address.Address, error)
- type SignatureValidator
- func (v *SignatureValidator) ValidateBLSMessageAggregate(ctx context.Context, msgs []*types.UnsignedMessage, sig *crypto.Signature) error
- func (v *SignatureValidator) ValidateMessageSignature(ctx context.Context, msg *types.SignedMessage) error
- func (v *SignatureValidator) ValidateSignature(ctx context.Context, data []byte, signer address.Address, sig crypto.Signature) error
- type Signer
- type View
- func (v *View) GetFilLocked(ctx context.Context, st vmstate.Tree) (abi.TokenAmount, error)
- func (v *View) GetMinerWorkerRaw(ctx context.Context, maddr addr.Address) (addr.Address, error)
- func (v *View) GetPartsProving(ctx context.Context, maddr addr.Address) ([]bitfield.BitField, error)
- func (v *View) GetPowerRaw(ctx context.Context, maddr addr.Address) (power.Claim, power.Claim, bool, error)
- func (v *View) GetSectorsForWinningPoSt(ctx context.Context, nv network.Version, pv ffiwrapper.Verifier, st cid.Cid, ...) ([]builtin.SectorInfo, error)
- func (v *View) InitNetworkName(ctx context.Context) (string, error)
- func (v *View) InitResolveAddress(ctx context.Context, a addr.Address) (addr.Address, error)
- func (v *View) LoadActor(ctx context.Context, address addr.Address) (*types.Actor, error)
- func (v *View) LoadMarketState(ctx context.Context) (market.State, error)
- func (v *View) LoadMinerState(ctx context.Context, maddr addr.Address) (miner.State, error)
- func (v *View) LoadPaychState(ctx context.Context, actr *types.Actor) (paychActor.State, error)
- func (v *View) LookupID(ctx context.Context, address addr.Address) (addr.Address, error)
- func (v *View) MarketComputeDataCommitment(ctx context.Context, registeredProof abi.RegisteredSealProof, ...) (cid.Cid, error)
- func (v *View) MarketDealProposal(ctx context.Context, dealID abi.DealID) (market.DealProposal, error)
- func (v *View) MarketDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, ...) (DealCollateralBounds, error)
- func (v *View) MarketDealState(ctx context.Context, dealID abi.DealID) (*market.DealState, bool, error)
- func (v *View) MarketDealStatesForEach(ctx context.Context, f func(id abi.DealID, state *market.DealState) error) error
- func (v *View) MarketEscrowBalance(ctx context.Context, addr addr.Address) (found bool, amount abi.TokenAmount, err error)
- func (v *View) MinerClaimedPower(ctx context.Context, miner addr.Address) (raw, qa abi.StoragePower, err error)
- func (v *View) MinerDeadlineInfo(ctx context.Context, maddr addr.Address, epoch abi.ChainEpoch) (index uint64, open, close, challenge abi.ChainEpoch, _ error)
- func (v *View) MinerExists(ctx context.Context, maddr addr.Address) (bool, error)
- func (v *View) MinerGetPrecommittedSector(ctx context.Context, maddr addr.Address, sectorNum abi.SectorNumber) (*miner.SectorPreCommitOnChainInfo, bool, error)
- func (v *View) MinerInfo(ctx context.Context, maddr addr.Address, nv network.Version) (*miner.MinerInfo, error)
- func (v *View) MinerNominalPowerMeetsConsensusMinimum(ctx context.Context, addr addr.Address) (bool, error)
- func (v *View) MinerSectorInfo(ctx context.Context, maddr addr.Address, sectorNum abi.SectorNumber) (*miner.SectorOnChainInfo, error)
- func (v *View) PaychActorParties(ctx context.Context, paychAddr addr.Address) (from, to addr.Address, err error)
- func (v *View) PowerNetworkTotal(ctx context.Context) (*NetworkPower, error)
- func (v *View) PreCommitInfo(ctx context.Context, maddr addr.Address, sid abi.SectorNumber) (*miner.SectorPreCommitOnChainInfo, error)
- func (v *View) ResolveToKeyAddr(ctx context.Context, address addr.Address) (addr.Address, error)
- func (v *View) StateListMiners(ctx context.Context, tsk types.TipSetKey) ([]addr.Address, error)
- func (v *View) StateMarketDeals(ctx context.Context, tsk types.TipSetKey) (map[string]MarketDeal, error)
- func (v *View) StateMarketStorageDeal(ctx context.Context, dealID abi.DealID) (*MarketDeal, error)
- func (v *View) StateMinerActiveSectors(ctx context.Context, maddr addr.Address, tsk types.TipSetKey) ([]*miner.SectorOnChainInfo, error)
- func (v *View) StateMinerAvailableBalance(ctx context.Context, maddr addr.Address, ts *types.TipSet) (big.Int, error)
- func (v *View) StateMinerDeadlineForIdx(ctx context.Context, addr addr.Address, dlIdx uint64, key types.TipSetKey) (miner.Deadline, error)
- func (v *View) StateMinerPower(ctx context.Context, maddr addr.Address, tsk types.TipSetKey) (power.Claim, power.Claim, bool, error)
- func (v *View) StateMinerProvingDeadline(ctx context.Context, addr addr.Address, ts *types.TipSet) (*dline.Info, error)
- func (v *View) StateMinerSectors(ctx context.Context, addr addr.Address, filter *bitfield.BitField, ...) ([]*ChainSectorInfo, error)
- func (v *View) StateSectorExpiration(ctx context.Context, maddr addr.Address, sectorNumber abi.SectorNumber, ...) (*miner.SectorExpiration, error)
- func (v *View) StateSectorPartition(ctx context.Context, maddr addr.Address, sectorNumber abi.SectorNumber) (*miner.SectorLocation, error)
- func (v *View) StateVerifiedClientStatus(ctx context.Context, addr addr.Address) (abi.StoragePower, error)
- type Viewer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBitField ¶
func NewBitField() *bitfield.BitField
Types ¶
type AccountView ¶ added in v0.9.1
type ChainSectorInfo ¶
type ChainSectorInfo struct { Info miner.SectorOnChainInfo ID abi.SectorNumber }
type CirculatingSupply ¶
type CirculatingSupply struct { FilVested abi.TokenAmount FilMined abi.TokenAmount FilBurnt abi.TokenAmount FilLocked abi.TokenAmount FilCirculating abi.TokenAmount }
type DealCollateralBounds ¶
type DealCollateralBounds struct { Min abi.TokenAmount Max abi.TokenAmount }
type FakeMinerState ¶
type FakeMinerState struct { Owner address.Address Worker address.Address PeerID peer.ID ProvingPeriodStart abi.ChainEpoch ProvingPeriodEnd abi.ChainEpoch PoStFailures int Sectors []miner.SectorOnChainInfo Deadlines []*bitfield.BitField ClaimedRawPower abi.StoragePower ClaimedQAPower abi.StoragePower PledgeRequirement abi.TokenAmount PledgeBalance abi.TokenAmount }
FakeMinerState is fake state for a single miner.
type FakeSectorInfo ¶
type FakeSectorInfo struct { ID abi.SectorNumber SealedCID cid.Cid }
FakeSectorInfo fakes a subset of sector onchain info
type FakeStateView ¶
type FakeStateView struct { NetworkName string Power *NetworkPower Miners map[address.Address]*FakeMinerState }
FakeStateView is a fake state view.
func NewFakeStateView ¶
func NewFakeStateView(rawBytePower, qaPower abi.StoragePower, minerCount, minPowerMinerCount int64) *FakeStateView
NewFakeStateView creates a new fake state view.
func (*FakeStateView) GetMinerWorkerRaw ¶ added in v0.9.1
func (v *FakeStateView) GetMinerWorkerRaw(ctx context.Context, maddr address.Address) (address.Address, error)
func (*FakeStateView) GetSectorsForWinningPoSt ¶
func (v *FakeStateView) GetSectorsForWinningPoSt(ctx context.Context, nv network.Version, pv ffiwrapper.Verifier, st cid.Cid, maddr address.Address, rand abi.PoStRandomness) ([]builtin.SectorInfo, error)
func (*FakeStateView) InitNetworkName ¶
func (v *FakeStateView) InitNetworkName(_ context.Context) (string, error)
func (*FakeStateView) MinerClaimedPower ¶
func (v *FakeStateView) MinerClaimedPower(ctx context.Context, miner address.Address) (abi.StoragePower, abi.StoragePower, error)
func (*FakeStateView) MinerExists ¶
func (v *FakeStateView) MinerExists(_ context.Context, _ address.Address) (bool, error)
func (*FakeStateView) MinerPledgeCollateral ¶
func (v *FakeStateView) MinerPledgeCollateral(_ context.Context, maddr address.Address) (locked abi.TokenAmount, total abi.TokenAmount, err error)
func (*FakeStateView) MinerProvingPeriod ¶
func (v *FakeStateView) MinerProvingPeriod(ctx context.Context, maddr address.Address) (start abi.ChainEpoch, end abi.ChainEpoch, failureCount int, err error)
func (*FakeStateView) MinerSectorCount ¶
func (v *FakeStateView) MinerSectorCount(ctx context.Context, maddr address.Address) (uint64, error)
MinerSectorCount reports the number of sectors a miner has pledged
func (*FakeStateView) MinerSectorInfo ¶
func (v *FakeStateView) MinerSectorInfo(_ context.Context, maddr address.Address, sectorNum abi.SectorNumber) (*miner.SectorOnChainInfo, error)
func (*FakeStateView) PowerNetworkTotal ¶
func (v *FakeStateView) PowerNetworkTotal(_ context.Context) (*NetworkPower, error)
func (*FakeStateView) ResolveToKeyAddr ¶ added in v0.9.1
func (v *FakeStateView) ResolveToKeyAddr(ctx context.Context, addr address.Address) (address.Address, error)
type FaultStateView ¶
type FaultStateView interface {
MinerExists(ctx context.Context, maddr address.Address) (bool, error)
}
FaultStateView is a view of chain state for adjustment of miner power claims based on changes since the power state's lookback (primarily, the miner ceasing to be registered).
type HeadSignView ¶ added in v0.9.1
type HeadSignView struct {
// contains filtered or unexported fields
}
func NewHeadSignView ¶ added in v0.9.1
func NewHeadSignView(tipSignerView tipSignerView) *HeadSignView
func (*HeadSignView) ResolveToKeyAddr ¶ added in v0.9.1
func (headSignView *HeadSignView) ResolveToKeyAddr(ctx context.Context, addr address.Address) (address.Address, error)
type MarketDeal ¶
type MarketDeal struct { Proposal market.DealProposal State market.DealState }
type NetworkPower ¶
type NetworkPower struct { RawBytePower abi.StoragePower QualityAdjustedPower abi.StoragePower MinerCount int64 MinPowerMinerCount int64 }
type PowerStateView ¶
type PowerStateView interface { ResolveToKeyAddr(ctx context.Context, maddr address.Address) (address.Address, error) GetMinerWorkerRaw(ctx context.Context, maddr address.Address) (address.Address, error) MinerInfo(ctx context.Context, maddr address.Address, nv network.Version) (*miner.MinerInfo, error) MinerSectorInfo(ctx context.Context, maddr address.Address, sectorNum abi.SectorNumber) (*miner.SectorOnChainInfo, error) PowerNetworkTotal(ctx context.Context) (*NetworkPower, error) MinerClaimedPower(ctx context.Context, miner address.Address) (raw, qa abi.StoragePower, err error) GetSectorsForWinningPoSt(ctx context.Context, nv network.Version, pv ffiwrapper.Verifier, st cid.Cid, maddr address.Address, rand abi.PoStRandomness) ([]builtin.SectorInfo, error) }
PowerStateView is a view of chain state for election computations, typically at some lookback from the immediate parent state. This type isn't doing much that the state view doesn't already do, consider removing it.
type PowerTableView ¶
type PowerTableView struct {
// contains filtered or unexported fields
}
An interface to the network power table for elections. Elections use the quality-adjusted power, rather than raw byte power.
func NewPowerTableView ¶
func NewPowerTableView(state PowerStateView, faultState FaultStateView) PowerTableView
func (PowerTableView) MinerClaimedPower ¶
func (v PowerTableView) MinerClaimedPower(ctx context.Context, mAddr address.Address) (abi.StoragePower, error)
Returns a miner's claimed quality-adjusted power.
func (PowerTableView) NetworkTotalPower ¶
func (v PowerTableView) NetworkTotalPower(ctx context.Context) (abi.StoragePower, error)
Returns the network's total quality-adjusted power.
func (PowerTableView) SignerAddress ¶
func (v PowerTableView) SignerAddress(ctx context.Context, addr address.Address) (address.Address, error)
SignerAddress returns the public key address associated with the given address.
func (PowerTableView) WorkerAddr ¶
func (v PowerTableView) WorkerAddr(ctx context.Context, mAddr address.Address, nv network.Version) (address.Address, error)
WorkerAddr returns the worker address for a miner actor.
type SignatureValidator ¶
type SignatureValidator struct {
// contains filtered or unexported fields
}
SignatureValidator resolves account actor addresses to their pubkey-style address for signature validation.
func NewSignatureValidator ¶
func NewSignatureValidator(signerView AccountView) *SignatureValidator
func (*SignatureValidator) ValidateBLSMessageAggregate ¶
func (v *SignatureValidator) ValidateBLSMessageAggregate(ctx context.Context, msgs []*types.UnsignedMessage, sig *crypto.Signature) error
func (*SignatureValidator) ValidateMessageSignature ¶
func (v *SignatureValidator) ValidateMessageSignature(ctx context.Context, msg *types.SignedMessage) error
func (*SignatureValidator) ValidateSignature ¶
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer looks up non-signing addresses before signing
func NewSigner ¶
func NewSigner(signerView AccountView, wallet *wallet.Wallet) *Signer
NewSigner creates a new signer
func (*Signer) HasAddress ¶
HasAddress returns whether this signer can sign with the given address
type View ¶
type View struct {
// contains filtered or unexported fields
}
View is a read-only interface to a snapshot of application-level actor state. This object interprets the actor state, abstracting the concrete on-chain structures so as to hide the complications of protocol versions. Exported methods on this type avoid exposing concrete state structures (which may be subject to versioning) where possible.
func (*View) GetFilLocked ¶
func (*View) GetMinerWorkerRaw ¶ added in v0.9.1
ResolveToKeyAddr returns the public key type of address (`BLS`/`SECP256K1`) of an account actor identified by `addr`.
func (*View) GetPartsProving ¶
func (*View) GetPowerRaw ¶
func (*View) GetSectorsForWinningPoSt ¶
func (v *View) GetSectorsForWinningPoSt(ctx context.Context, nv network.Version, pv ffiwrapper.Verifier, st cid.Cid, maddr addr.Address, rand abi.PoStRandomness) ([]builtin.SectorInfo, error)
func (*View) InitNetworkName ¶
InitNetworkName Returns the network name from the init actor state.
func (*View) InitResolveAddress ¶
InitResolveAddress Returns ID address if public key address is given.
func (*View) LoadMarketState ¶
func (*View) LoadMinerState ¶
func (*View) LoadPaychState ¶ added in v0.9.1
func (*View) MarketComputeDataCommitment ¶
func (v *View) MarketComputeDataCommitment(ctx context.Context, registeredProof abi.RegisteredSealProof, dealIDs []abi.DealID) (cid.Cid, error)
MarketComputeDataCommitment takes deal ids and uses associated commPs to compute commD for a sector that contains the deals
func (*View) MarketDealProposal ¶
func (v *View) MarketDealProposal(ctx context.Context, dealID abi.DealID) (market.DealProposal, error)
NOTE: exposes on-chain structures directly for storage FSM interface.
func (*View) MarketDealProviderCollateralBounds ¶
func (v *View) MarketDealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, verified bool, height abi.ChainEpoch) (DealCollateralBounds, error)
StateDealProviderCollateralBounds returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters.
func (*View) MarketDealState ¶
func (v *View) MarketDealState(ctx context.Context, dealID abi.DealID) (*market.DealState, bool, error)
NOTE: exposes on-chain structures directly for storage FSM and market module interfaces.
func (*View) MarketDealStatesForEach ¶
func (v *View) MarketDealStatesForEach(ctx context.Context, f func(id abi.DealID, state *market.DealState) error) error
NOTE: exposes on-chain structures directly for market interface. The callback receives a pointer to a transient object; take a copy or drop the reference outside the callback.
func (*View) MarketEscrowBalance ¶
func (v *View) MarketEscrowBalance(ctx context.Context, addr addr.Address) (found bool, amount abi.TokenAmount, err error)
MarketEscrowBalance looks up a token amount in the escrow table for the given address
func (*View) MinerClaimedPower ¶
func (v *View) MinerClaimedPower(ctx context.Context, miner addr.Address) (raw, qa abi.StoragePower, err error)
Returns the power of a miner's committed sectors.
func (*View) MinerDeadlineInfo ¶
func (v *View) MinerDeadlineInfo(ctx context.Context, maddr addr.Address, epoch abi.ChainEpoch) (index uint64, open, close, challenge abi.ChainEpoch, _ error)
MinerDeadlineInfo returns information relevant to the current proving deadline
func (*View) MinerExists ¶
MinerExists Returns true iff the miner exists.
func (*View) MinerGetPrecommittedSector ¶
func (v *View) MinerGetPrecommittedSector(ctx context.Context, maddr addr.Address, sectorNum abi.SectorNumber) (*miner.SectorPreCommitOnChainInfo, bool, error)
MinerGetPrecommittedSector Looks up info for a miners precommitted sector. NOTE: exposes on-chain structures directly for storage FSM API.
func (*View) MinerNominalPowerMeetsConsensusMinimum ¶
func (*View) MinerSectorInfo ¶
func (v *View) MinerSectorInfo(ctx context.Context, maddr addr.Address, sectorNum abi.SectorNumber) (*miner.SectorOnChainInfo, error)
Loads sector info from miner state.
func (*View) PaychActorParties ¶
func (v *View) PaychActorParties(ctx context.Context, paychAddr addr.Address) (from, to addr.Address, err error)
PaychActorParties returns the From and To addresses for the given payment channel
func (*View) PowerNetworkTotal ¶
func (v *View) PowerNetworkTotal(ctx context.Context) (*NetworkPower, error)
Returns the storage power actor's values for network total power.
func (*View) PreCommitInfo ¶
func (v *View) PreCommitInfo(ctx context.Context, maddr addr.Address, sid abi.SectorNumber) (*miner.SectorPreCommitOnChainInfo, error)
func (*View) ResolveToKeyAddr ¶
func (*View) StateListMiners ¶
func (*View) StateMarketDeals ¶
func (*View) StateMarketStorageDeal ¶
func (*View) StateMinerActiveSectors ¶
func (*View) StateMinerAvailableBalance ¶
func (*View) StateMinerDeadlineForIdx ¶
func (*View) StateMinerPower ¶
func (*View) StateMinerProvingDeadline ¶
func (*View) StateMinerSectors ¶
func (*View) StateSectorExpiration ¶
func (*View) StateSectorPartition ¶
func (v *View) StateSectorPartition(ctx context.Context, maddr addr.Address, sectorNumber abi.SectorNumber) (*miner.SectorLocation, error)