Documentation ¶
Index ¶
- Constants
- Variables
- func ConsensusMinerMinPower(p stabi.RegisteredPoStProof) (stabi.StoragePower, error)
- func GenerateFRCMethodNum(name string) (abi.MethodNum, error)
- func MakeEmptyState() (cid.Cid, error)
- func MustGenerateFRCMethodNum(name string) abi.MethodNum
- func PoStProofWindowPoStPartitionSectors(p stabi.RegisteredPoStProof) (uint64, error)
- func QuantizeUp(e abi.ChainEpoch, unit abi.ChainEpoch, offsetSeed abi.ChainEpoch) abi.ChainEpoch
- func SealProofSectorMaximumLifetime(p stabi.RegisteredSealProof) (stabi.ChainEpoch, error)
- type ActorTree
- func (t *ActorTree) Flush() (cid.Cid, error)
- func (t *ActorTree) ForEachKey(fn func(addr address.Address) error) error
- func (t *ActorTree) ForEachV4(fn func(addr address.Address, actor *ActorV4) error) error
- func (t *ActorTree) ForEachV5(fn func(addr address.Address, actor *ActorV5) error) error
- func (t *ActorTree) GetActorV4(addr address.Address) (*ActorV4, bool, error)
- func (t *ActorTree) GetActorV5(addr address.Address) (*ActorV5, bool, error)
- func (t *ActorTree) SetActorV4(addr address.Address, actor *ActorV4) error
- func (t *ActorTree) SetActorV5(addr address.Address, actor *ActorV5) error
- type ActorV4
- type ActorV5
- type BigFrac
- type MessageAccumulator
- func (ma *MessageAccumulator) Add(msg string)
- func (ma *MessageAccumulator) AddAll(other *MessageAccumulator)
- func (ma *MessageAccumulator) Addf(format string, args ...interface{})
- func (ma *MessageAccumulator) IsEmpty() bool
- func (ma *MessageAccumulator) Messages() []string
- func (ma *MessageAccumulator) Require(predicate bool, msg string, args ...interface{})
- func (ma *MessageAccumulator) RequireNoError(err error, msg string, args ...interface{})
- func (ma *MessageAccumulator) WithPrefix(format string, args ...interface{}) *MessageAccumulator
- type MethodMeta
- type PoStProofPolicy
- type QuantSpec
- type SealProofPolicy
Constants ¶
const ( MethodSend = abi.MethodNum(0) MethodConstructor = abi.MethodNum(1) )
const DefaultHamtBitwidth = 5
Default log2 of branching factor for HAMTs. This value has been empirically chosen, but the optimal value for maps with different mutation profiles may differ.
const DefaultTokenActorBitwidth = 3
const EndOfLifeClaimDropPeriod = 30 * EpochsInDay
const EpochDurationSeconds = 30
PARAM_SPEC The duration of a chain epoch. Motivation: It guarantees that a block is propagated and WinningPoSt can be successfully done in time all supported miners. Usage: It is used for deriving epoch-denominated periods that are more naturally expressed in clock time. TODO: In lieu of a real configuration mechanism for this value, we'd like to make it a var so that implementations can override it at runtime. Doing so requires changing all the static references to it in this repo to go through late-binding function calls, or they'll see the "wrong" value. https://github.com/filecoin-project/specs-actors/issues/353 If EpochDurationSeconds is changed, update `BaselineExponent`, `lambda`, and // `expLamSubOne` in ./reward/reward_logic.go You can re-calculate these constants by changing the epoch duration in ./reward/reward_calc.py and running it.
const EpochsIn540Days = stabi.ChainEpoch(540 * EpochsInDay)
For V1 Stacked DRG sectors, the max is 540 days since Network Version 11
according to https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0014.md
const EpochsInDay = 24 * EpochsInHour
const EpochsInFiveYears = stabi.ChainEpoch(5 * EpochsInYear)
For V1_1 Stacked DRG sectors, the max is 5 years
const EpochsInHour = SecondsInHour / EpochDurationSeconds
const EpochsInYear = 365 * EpochsInDay
const FirstNonSingletonActorId = 100
const MinVerifiedDealSize = 1 << 20
const SecondsInDay = 24 * SecondsInHour
const SecondsInHour = 60 * 60
const SectorQualityPrecision = 20
Precision used for making QA power calculations
Variables ¶
var ( // Distinguished AccountActor that is the source of system implicit messages. SystemActorAddr = mustMakeAddress(0) InitActorAddr = mustMakeAddress(1) RewardActorAddr = mustMakeAddress(2) CronActorAddr = mustMakeAddress(3) StoragePowerActorAddr = mustMakeAddress(4) StorageMarketActorAddr = mustMakeAddress(5) VerifiedRegistryActorAddr = mustMakeAddress(6) DatacapActorAddr = mustMakeAddress(7) // Distinguished AccountActor that is the destination of all burnt funds. BurntFundsActorAddr = mustMakeAddress(99) // EthereumAddressManagerActorID is the actor ID of the Ethereum Address Manager singleton. EthereumAddressManagerActorID = uint64(10) EthereumAddressManagerActorAddr = mustMakeAddress(EthereumAddressManagerActorID) )
Addresses for singleton system actors.
var DealWeightMultiplier = big.NewInt(10)
Quality multiplier for unverified deals in a sector
var ExpectedLeadersPerEpoch = int64(5)
PARAM_SPEC Expected number of block quality in an epoch (e.g. 1 block with block quality 5, or 5 blocks with quality 1) Motivation: It ensures that there is enough on-chain throughput Usage: It is used to calculate the block reward.
var MethodSectorContentChanged = MustGenerateFRCMethodNum("SectorContentChanged")
ext::miner::SECTOR_CONTENT_CHANGED
var MethodsAccount = struct { Constructor abi.MethodNum PubkeyAddress abi.MethodNum AuthenticateMessage abi.MethodNum }{ MethodConstructor, 2, MustGenerateFRCMethodNum("AuthenticateMessage"), }
var MethodsCron = struct { Constructor abi.MethodNum EpochTick abi.MethodNum }{ MethodConstructor, 2, }
var MethodsDatacap = struct { Constructor abi.MethodNum MintExported abi.MethodNum DestroyExported abi.MethodNum NameExported abi.MethodNum SymbolExported abi.MethodNum TotalSupplyExported abi.MethodNum BalanceExported abi.MethodNum TransferExported abi.MethodNum TransferFromExported abi.MethodNum IncreaseAllowanceExported abi.MethodNum DecreaseAllowanceExported abi.MethodNum RevokeAllowanceExported abi.MethodNum BurnExported abi.MethodNum BurnFromExported abi.MethodNum AllowanceExported abi.MethodNum GranularityExported abi.MethodNum }{ MethodConstructor, MustGenerateFRCMethodNum("Mint"), MustGenerateFRCMethodNum("Destroy"), MustGenerateFRCMethodNum("Name"), MustGenerateFRCMethodNum("Symbol"), MustGenerateFRCMethodNum("TotalSupply"), MustGenerateFRCMethodNum("Balance"), MustGenerateFRCMethodNum("Transfer"), MustGenerateFRCMethodNum("TransferFrom"), MustGenerateFRCMethodNum("IncreaseAllowance"), MustGenerateFRCMethodNum("DecreaseAllowance"), MustGenerateFRCMethodNum("RevokeAllowance"), MustGenerateFRCMethodNum("Burn"), MustGenerateFRCMethodNum("BurnFrom"), MustGenerateFRCMethodNum("Allowance"), MustGenerateFRCMethodNum("Granularity"), }
var MethodsEAM = struct { Constructor abi.MethodNum Create abi.MethodNum Create2 abi.MethodNum CreateExternal abi.MethodNum }{ MethodConstructor, 2, 3, 4, }
var MethodsEVM = struct { Constructor abi.MethodNum Resurrect abi.MethodNum GetBytecode abi.MethodNum GetBytecodeHash abi.MethodNum GetStorageAt abi.MethodNum InvokeContractDelegate abi.MethodNum InvokeContract abi.MethodNum }{ MethodConstructor, 2, 3, 4, 5, 6, MustGenerateFRCMethodNum("InvokeEVM"), }
var MethodsEthAccount = struct { Constructor abi.MethodNum }{ MethodConstructor, }
var MethodsInit = struct { Constructor abi.MethodNum Exec abi.MethodNum Exec4 abi.MethodNum }{ MethodConstructor, 2, 3, }
var MethodsMarket = struct { Constructor abi.MethodNum AddBalance abi.MethodNum AddBalanceExported abi.MethodNum WithdrawBalance abi.MethodNum WithdrawBalanceExported abi.MethodNum PublishStorageDeals abi.MethodNum PublishStorageDealsExported abi.MethodNum VerifyDealsForActivation abi.MethodNum ActivateDeals abi.MethodNum OnMinerSectorsTerminate abi.MethodNum Deprecated1 abi.MethodNum CronTick abi.MethodNum GetBalanceExported abi.MethodNum GetDealDataCommitmentExported abi.MethodNum GetDealClientExported abi.MethodNum GetDealProviderExported abi.MethodNum GetDealLabelExported abi.MethodNum GetDealTermExported abi.MethodNum GetDealTotalPriceExported abi.MethodNum GetDealClientCollateralExported abi.MethodNum GetDealProviderCollateralExported abi.MethodNum GetDealVerifiedExported abi.MethodNum GetDealActivationExported abi.MethodNum GetDealSectorExported abi.MethodNum SectorContentChangedExported abi.MethodNum SettleDealPaymentsExported abi.MethodNum }{ MethodConstructor, 2, MustGenerateFRCMethodNum("AddBalance"), 3, MustGenerateFRCMethodNum("WithdrawBalance"), 4, MustGenerateFRCMethodNum("PublishStorageDeals"), 5, 6, 7, 8, 9, MustGenerateFRCMethodNum("GetBalance"), MustGenerateFRCMethodNum("GetDealDataCommitment"), MustGenerateFRCMethodNum("GetDealClient"), MustGenerateFRCMethodNum("GetDealProvider"), MustGenerateFRCMethodNum("GetDealLabel"), MustGenerateFRCMethodNum("GetDealTerm"), MustGenerateFRCMethodNum("GetDealTotalPrice"), MustGenerateFRCMethodNum("GetDealClientCollateral"), MustGenerateFRCMethodNum("GetDealProviderCollateral"), MustGenerateFRCMethodNum("GetDealVerified"), MustGenerateFRCMethodNum("GetDealActivation"), MustGenerateFRCMethodNum("GetDealSector"), MethodSectorContentChanged, MustGenerateFRCMethodNum("SettleDealPayments"), }
var MethodsMiner = struct { Constructor abi.MethodNum ControlAddresses abi.MethodNum ChangeWorkerAddress abi.MethodNum ChangeWorkerAddressExported abi.MethodNum ChangePeerID abi.MethodNum ChangePeerIDExported abi.MethodNum SubmitWindowedPoSt abi.MethodNum PreCommitSector abi.MethodNum // deprecated av13 ProveCommitSector abi.MethodNum ExtendSectorExpiration abi.MethodNum TerminateSectors abi.MethodNum DeclareFaults abi.MethodNum DeclareFaultsRecovered abi.MethodNum OnDeferredCronEvent abi.MethodNum CheckSectorProven abi.MethodNum ApplyRewards abi.MethodNum ReportConsensusFault abi.MethodNum WithdrawBalance abi.MethodNum WithdrawBalanceExported abi.MethodNum InternalSectorSetupForPreseal abi.MethodNum ChangeMultiaddrs abi.MethodNum ChangeMultiaddrsExported abi.MethodNum CompactPartitions abi.MethodNum CompactSectorNumbers abi.MethodNum ConfirmChangeWorkerAddress abi.MethodNum ConfirmChangeWorkerAddressExported abi.MethodNum RepayDebt abi.MethodNum RepayDebtExported abi.MethodNum ChangeOwnerAddress abi.MethodNum ChangeOwnerAddressExported abi.MethodNum DisputeWindowedPoSt abi.MethodNum PreCommitSectorBatch abi.MethodNum // deprecated av13 ProveCommitAggregate abi.MethodNum ProveReplicaUpdates abi.MethodNum PreCommitSectorBatch2 abi.MethodNum ProveReplicaUpdates2 abi.MethodNum // deprecated av13 ChangeBeneficiary abi.MethodNum ChangeBeneficiaryExported abi.MethodNum GetBeneficiary abi.MethodNum ExtendSectorExpiration2 abi.MethodNum GetOwnerExported abi.MethodNum IsControllingAddressExported abi.MethodNum GetSectorSizeExported abi.MethodNum GetAvailableBalanceExported abi.MethodNum GetVestingFundsExported abi.MethodNum GetPeerIDExported abi.MethodNum GetMultiaddrsExported abi.MethodNum // MovePartitionsExported abi.MethodNum ProveCommitSectors3 abi.MethodNum ProveReplicaUpdates3 abi.MethodNum ProveCommitSectorsNI abi.MethodNum }{ MethodConstructor, 2, 3, MustGenerateFRCMethodNum("ChangeWorkerAddress"), 4, MustGenerateFRCMethodNum("ChangePeerID"), 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, MustGenerateFRCMethodNum("WithdrawBalance"), 17, 18, MustGenerateFRCMethodNum("ChangeMultiaddrs"), 19, 20, 21, MustGenerateFRCMethodNum("ConfirmChangeWorkerAddress"), 22, MustGenerateFRCMethodNum("RepayDebt"), 23, MustGenerateFRCMethodNum("ChangeOwnerAddress"), 24, 25, 26, 27, 28, 29, 30, MustGenerateFRCMethodNum("ChangeBeneficiary"), 31, 32, MustGenerateFRCMethodNum("GetOwner"), MustGenerateFRCMethodNum("IsControllingAddress"), MustGenerateFRCMethodNum("GetSectorSize"), MustGenerateFRCMethodNum("GetAvailableBalance"), MustGenerateFRCMethodNum("GetVestingFunds"), MustGenerateFRCMethodNum("GetPeerID"), MustGenerateFRCMethodNum("GetMultiaddrs"), 34, 35, 36, }
var MethodsMultisig = struct { Constructor abi.MethodNum Propose abi.MethodNum ProposeExported abi.MethodNum Approve abi.MethodNum ApproveExported abi.MethodNum Cancel abi.MethodNum CancelExported abi.MethodNum AddSigner abi.MethodNum AddSignerExported abi.MethodNum RemoveSigner abi.MethodNum RemoveSignerExported abi.MethodNum SwapSigner abi.MethodNum SwapSignerExported abi.MethodNum ChangeNumApprovalsThreshold abi.MethodNum ChangeNumApprovalsThresholdExported abi.MethodNum LockBalance abi.MethodNum LockBalanceExported abi.MethodNum UniversalReceiverHook abi.MethodNum }{ MethodConstructor, 2, MustGenerateFRCMethodNum("Propose"), 3, MustGenerateFRCMethodNum("Approve"), 4, MustGenerateFRCMethodNum("Cancel"), 5, MustGenerateFRCMethodNum("AddSigner"), 6, MustGenerateFRCMethodNum("RemoveSigner"), 7, MustGenerateFRCMethodNum("SwapSigner"), 8, MustGenerateFRCMethodNum("ChangeNumApprovalsThreshold"), 9, MustGenerateFRCMethodNum("LockBalance"), MustGenerateFRCMethodNum("Receive"), }
var MethodsPaych = struct { Constructor abi.MethodNum UpdateChannelState abi.MethodNum Settle abi.MethodNum Collect abi.MethodNum }{ MethodConstructor, 2, 3, 4, }
var MethodsPlaceholder = struct { Constructor abi.MethodNum }{ MethodConstructor, }
var MethodsPower = struct { Constructor abi.MethodNum CreateMiner abi.MethodNum CreateMinerExported abi.MethodNum UpdateClaimedPower abi.MethodNum EnrollCronEvent abi.MethodNum CronTick abi.MethodNum UpdatePledgeTotal abi.MethodNum Deprecated1 abi.MethodNum SubmitPoRepForBulkVerify abi.MethodNum CurrentTotalPower abi.MethodNum CurrentTotalPowerNetworkRawPowerExported abi.MethodNum CurrentTotalPowerMinerRawPowerExported abi.MethodNum CurrentTotalPowerMinerCountExported abi.MethodNum CurrentTotalPowerMinerConsensusCountExported abi.MethodNum }{ MethodConstructor, 2, MustGenerateFRCMethodNum("CreateMiner"), 3, 4, 5, 6, 7, 8, 9, MustGenerateFRCMethodNum("NetworkRawPower"), MustGenerateFRCMethodNum("MinerRawPower"), MustGenerateFRCMethodNum("MinerCount"), MustGenerateFRCMethodNum("MinerConsensusCount"), }
var MethodsReward = struct { Constructor abi.MethodNum AwardBlockReward abi.MethodNum ThisEpochReward abi.MethodNum UpdateNetworkKPI abi.MethodNum }{ MethodConstructor, 2, 3, 4, }
var MethodsVerifiedRegistry = struct { Constructor abi.MethodNum AddVerifier abi.MethodNum RemoveVerifier abi.MethodNum AddVerifiedClient abi.MethodNum AddVerifiedClientExported abi.MethodNum Deprecated1 abi.MethodNum Deprecated2 abi.MethodNum RemoveVerifiedClientDataCap abi.MethodNum RemoveExpiredAllocations abi.MethodNum RemoveExpiredAllocationsExported abi.MethodNum ClaimAllocations abi.MethodNum GetClaims abi.MethodNum GetClaimsExported abi.MethodNum ExtendClaimTerms abi.MethodNum ExtendClaimTermsExported abi.MethodNum RemoveExpiredClaims abi.MethodNum RemoveExpiredClaimsExported abi.MethodNum UniversalReceiverHook abi.MethodNum }{ MethodConstructor, 2, 3, 4, MustGenerateFRCMethodNum("AddVerifiedClient"), 5, 6, 7, 8, MustGenerateFRCMethodNum("RemoveExpiredAllocations"), 9, 10, MustGenerateFRCMethodNum("GetClaims"), 11, MustGenerateFRCMethodNum("ExtendClaimTerms"), 12, MustGenerateFRCMethodNum("RemoveExpiredClaims"), MustGenerateFRCMethodNum("Receive"), }
var NoQuantization = NewQuantSpec(1, 0)
var OneNanoFIL = big.NewInt(1_000_000_000)
1 NanoFIL
var PoStProofPolicies = map[stabi.RegisteredPoStProof]*PoStProofPolicy{ stabi.RegisteredPoStProof_StackedDrgWindow2KiBV1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow2KiBV1_1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow8MiBV1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow8MiBV1_1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow512MiBV1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow512MiBV1_1: { WindowPoStPartitionSectors: 2, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow32GiBV1: { WindowPoStPartitionSectors: 2349, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow32GiBV1_1: { WindowPoStPartitionSectors: 2349, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow64GiBV1: { WindowPoStPartitionSectors: 2300, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow64GiBV1_1: { WindowPoStPartitionSectors: 2300, ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, }
Partition sizes must match those used by the proofs library. See https://github.com/filecoin-project/rust-fil-proofs/blob/master/filecoin-proofs/src/constants.rs#L85
var QualityBaseMultiplier = big.NewInt(10)
Quality multiplier for committed capacity (no deals) in a sector
var SealProofPoliciesV11 = map[stabi.RegisteredSealProof]*SealProofPolicy{ stabi.RegisteredSealProof_StackedDrg2KiBV1: { SectorMaxLifetime: EpochsIn540Days, }, stabi.RegisteredSealProof_StackedDrg8MiBV1: { SectorMaxLifetime: EpochsIn540Days, }, stabi.RegisteredSealProof_StackedDrg512MiBV1: { SectorMaxLifetime: EpochsIn540Days, }, stabi.RegisteredSealProof_StackedDrg32GiBV1: { SectorMaxLifetime: EpochsIn540Days, }, stabi.RegisteredSealProof_StackedDrg64GiBV1: { SectorMaxLifetime: EpochsIn540Days, }, stabi.RegisteredSealProof_StackedDrg2KiBV1_1: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg8MiBV1_1: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg512MiBV1_1: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg32GiBV1_1: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg64GiBV1_1: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg2KiBV1_1_Feat_SyntheticPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg8MiBV1_1_Feat_SyntheticPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg512MiBV1_1_Feat_SyntheticPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg32GiBV1_1_Feat_SyntheticPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg64GiBV1_1_Feat_SyntheticPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg2KiBV1_2_Feat_NiPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg8MiBV1_2_Feat_NiPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg512MiBV1_2_Feat_NiPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg32GiBV1_2_Feat_NiPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, stabi.RegisteredSealProof_StackedDrg64GiBV1_2_Feat_NiPoRep: { SectorMaxLifetime: EpochsInFiveYears, }, }
540-day maximum life time setting for V1 since network version 11
var TokenPrecision = big.NewIntUnsigned(1_000_000_000_000_000_000)
Number of token units in an abstract "FIL" token. The network works purely in the indivisible token amounts. This constant converts to a fixed decimal with more human-friendly scale.
var TotalFilecoin = big.Mul(big.NewIntUnsigned(2_000_000_000), TokenPrecision)
The maximum supply of Filecoin that will ever exist (in token units)
var VerifiedDealWeightMultiplier = big.NewInt(100)
Quality multiplier for verified deals in a sector
Functions ¶
func ConsensusMinerMinPower ¶
func ConsensusMinerMinPower(p stabi.RegisteredPoStProof) (stabi.StoragePower, error)
The minimum power of an individual miner to meet the threshold for leader election (in bytes). Motivation: - Limits sybil generation - Improves consensus fault detection - Guarantees a minimum fee for consensus faults - Ensures that a specific soundness for the power table Note: We may be able to reduce this in the future, addressing consensus faults with more complicated penalties, sybil generation with crypto-economic mechanism, and PoSt soundness by increasing the challenges for small miners.
func GenerateFRCMethodNum ¶ added in v0.10.0
Generates a standard FRC-42 compliant method number Reference: https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0042.md
func MakeEmptyState ¶ added in v0.10.0
func MakeEmptyState() (cid.Cid, error)
func MustGenerateFRCMethodNum ¶ added in v0.10.0
func PoStProofWindowPoStPartitionSectors ¶
func PoStProofWindowPoStPartitionSectors(p stabi.RegisteredPoStProof) (uint64, error)
Returns the partition size, in sectors, associated with a Window PoSt proof type. The partition size is the number of sectors proved in a single PoSt proof.
func QuantizeUp ¶ added in v0.9.3
func QuantizeUp(e abi.ChainEpoch, unit abi.ChainEpoch, offsetSeed abi.ChainEpoch) abi.ChainEpoch
Rounds e to the nearest exact multiple of the quantization unit offset by offsetSeed % unit, rounding up. This function is equivalent to `unit * ceil(e - (offsetSeed % unit) / unit) + (offsetSeed % unit)` with the variables/operations are over real numbers instead of ints. Precondition: unit >= 0 else behaviour is undefined
func SealProofSectorMaximumLifetime ¶
func SealProofSectorMaximumLifetime(p stabi.RegisteredSealProof) (stabi.ChainEpoch, error)
SectorMaximumLifetime is the maximum duration a sector sealed with this proof may exist between activation and expiration
Types ¶
type ActorTree ¶ added in v0.9.3
A specialization of a map of ID-addresses to actor heads.
func (*ActorTree) Flush ¶ added in v0.9.3
Writes the tree root node to the store, and returns its CID.
func (*ActorTree) ForEachKey ¶ added in v0.9.3
Traverses all keys in the tree, without decoding the actor states.
func (*ActorTree) GetActorV4 ¶ added in v0.10.0
Loads the state associated with an address.
func (*ActorTree) GetActorV5 ¶ added in v0.10.0
func (*ActorTree) SetActorV4 ¶ added in v0.10.0
Sets the state associated with an address, overwriting if it already present.
func (*ActorTree) SetActorV5 ¶ added in v0.10.0
type ActorV4 ¶ added in v0.10.0
type ActorV4 struct { Code cid.Cid // CID representing the code associated with the actor Head cid.Cid // CID of the head state object for the actor CallSeqNum uint64 // CallSeqNum for the next message to be received by the actor (non-zero for accounts only) Balance big.Int // Token balance of the actor }
Value type of the top level of the state tree. Represents the on-chain state of a single actor. This is the actor state for state tree version up to 4
type ActorV5 ¶ added in v0.10.0
type ActorV5 struct { Code cid.Cid // CID representing the code associated with the actor Head cid.Cid // CID of the head state object for the actor CallSeqNum uint64 // CallSeqNum for the next message to be received by the actor (non-zero for accounts only) Balance big.Int // Token balance of the actor DelegatedAddress *address.Address // Delegated (f4) actor address }
As above, but this is the actor state for state tree version 5 and above.
type MessageAccumulator ¶ added in v0.9.3
type MessageAccumulator struct {
// contains filtered or unexported fields
}
Accumulates a sequence of messages (e.g. validation failures).
func (*MessageAccumulator) Add ¶ added in v0.9.3
func (ma *MessageAccumulator) Add(msg string)
Adds messages to the accumulator.
func (*MessageAccumulator) AddAll ¶ added in v0.9.3
func (ma *MessageAccumulator) AddAll(other *MessageAccumulator)
Adds messages from another accumulator to this one.
func (*MessageAccumulator) Addf ¶ added in v0.9.3
func (ma *MessageAccumulator) Addf(format string, args ...interface{})
Adds a message to the accumulator
func (*MessageAccumulator) IsEmpty ¶ added in v0.9.3
func (ma *MessageAccumulator) IsEmpty() bool
func (*MessageAccumulator) Messages ¶ added in v0.9.3
func (ma *MessageAccumulator) Messages() []string
func (*MessageAccumulator) Require ¶ added in v0.9.3
func (ma *MessageAccumulator) Require(predicate bool, msg string, args ...interface{})
Adds a message if predicate is false.
func (*MessageAccumulator) RequireNoError ¶ added in v0.9.3
func (ma *MessageAccumulator) RequireNoError(err error, msg string, args ...interface{})
func (*MessageAccumulator) WithPrefix ¶ added in v0.9.3
func (ma *MessageAccumulator) WithPrefix(format string, args ...interface{}) *MessageAccumulator
Returns a new accumulator backed by the same collection, that will prefix each new message with a formatted string.
type MethodMeta ¶ added in v0.9.2
type MethodMeta struct { Name string Method interface{} }
func NewMethodMeta ¶ added in v0.14.0
func NewMethodMeta(name string, method interface{}) MethodMeta
type PoStProofPolicy ¶
type PoStProofPolicy struct { WindowPoStPartitionSectors uint64 ConsensusMinerMinPower stabi.StoragePower }
Policy values associated with a PoSt proof type.
type QuantSpec ¶
type QuantSpec struct {
// contains filtered or unexported fields
}
A spec for quantization.
func NewQuantSpec ¶
func NewQuantSpec(unit, offset abi.ChainEpoch) QuantSpec
func (QuantSpec) QuantizeUp ¶ added in v0.9.3
func (q QuantSpec) QuantizeUp(e abi.ChainEpoch) abi.ChainEpoch
type SealProofPolicy ¶
type SealProofPolicy struct {
SectorMaxLifetime stabi.ChainEpoch
}
Policy values associated with a seal proof type.