README ¶
Actors
This package contains shims for abstracting over different actor versions.
Design
Shims in this package follow a few common design principles.
Structure Agnostic
Shims interfaces defined in this package should (ideally) not change even if the structure of the underlying data changes. For example:
- All shims store an internal "store" object. That way, state can be moved into a separate object without needing to add a store to the function signature.
- All functions must return an error, even if unused for now.
Minimal
These interfaces should be expanded only as necessary to reduce maintenance burden.
Queries, not field assessors.
When possible, functions should query the state instead of simply acting as field assessors. These queries are more likely to remain stable across specs-actor upgrades than specific state fields.
Note: there is a trade-off here. Avoid implementing complicated query logic inside these shims, as it will need to be replicated in every shim.
Documentation ¶
Index ¶
- Constants
- Variables
- func ActorNameByCode(c cid.Cid) string
- func IsAccountActor(c cid.Cid) bool
- func IsBuiltinActor(c cid.Cid) bool
- func IsMultisigActor(c cid.Cid) bool
- func IsPaymentChannelActor(c cid.Cid) bool
- func IsStorageMinerActor(c cid.Cid) bool
- func Load(store adt.Store, act *types.Actor) (cbor.Marshaler, error)
- func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, ...) abi.StoragePower
- func RegisterActorState(code cid.Cid, loader ActorStateLoader)
- type ActorStateLoader
- type FilterEstimate
- func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate
- func FromV2FilterEstimate(v2 smoothing2.FilterEstimate) FilterEstimate
- func FromV3FilterEstimate(v3 smoothing3.FilterEstimate) FilterEstimate
- func FromV4FilterEstimate(v4 smoothing4.FilterEstimate) FilterEstimate
- func FromV5FilterEstimate(v5 smoothing5.FilterEstimate) FilterEstimate
- type PoStProof
- type SectorInfo
Constants ¶
const ( EpochDurationSeconds = builtin5.EpochDurationSeconds EpochsInDay = builtin5.EpochsInDay SecondsInDay = builtin5.SecondsInDay )
const ( MethodSend = builtin5.MethodSend MethodConstructor = builtin5.MethodConstructor )
Variables ¶
var ActorStateLoaders = make(map[cid.Cid]ActorStateLoader)
var BurntFundsActorAddr = builtin5.BurntFundsActorAddr
var CronActorAddr = builtin5.CronActorAddr
var (
ExpectedLeadersPerEpoch = builtin5.ExpectedLeadersPerEpoch
)
var ReserveAddress = makeAddress("t090")
var RootVerifierAddress = makeAddress("t080")
var SaftAddress = makeAddress("t0122")
var SystemActorAddr = builtin5.SystemActorAddr
Functions ¶
func ActorNameByCode ¶ added in v0.9.0
func ActorNameByCode(c cid.Cid) string
func IsAccountActor ¶ added in v0.9.0
func IsAccountActor(c cid.Cid) bool
func IsBuiltinActor ¶ added in v0.9.0
func IsBuiltinActor(c cid.Cid) bool
func IsMultisigActor ¶ added in v0.9.0
func IsMultisigActor(c cid.Cid) bool
func IsPaymentChannelActor ¶ added in v0.9.0
func IsPaymentChannelActor(c cid.Cid) bool
func IsStorageMinerActor ¶ added in v0.9.0
func IsStorageMinerActor(c cid.Cid) bool
func QAPowerForWeight ¶
func QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, dealWeight, verifiedWeight abi.DealWeight) abi.StoragePower
func RegisterActorState ¶ added in v0.9.0
func RegisterActorState(code cid.Cid, loader ActorStateLoader)
Types ¶
type ActorStateLoader ¶ added in v0.9.0
type FilterEstimate ¶
type FilterEstimate = smoothing0.FilterEstimate
func FromV0FilterEstimate ¶
func FromV0FilterEstimate(v0 smoothing0.FilterEstimate) FilterEstimate
func FromV2FilterEstimate ¶ added in v0.9.0
func FromV2FilterEstimate(v2 smoothing2.FilterEstimate) FilterEstimate
func FromV3FilterEstimate ¶ added in v1.4.2
func FromV3FilterEstimate(v3 smoothing3.FilterEstimate) FilterEstimate
func FromV4FilterEstimate ¶ added in v1.8.0
func FromV4FilterEstimate(v4 smoothing4.FilterEstimate) FilterEstimate
func FromV5FilterEstimate ¶ added in v1.10.0
func FromV5FilterEstimate(v5 smoothing5.FilterEstimate) FilterEstimate
type SectorInfo ¶
type SectorInfo = proof5.SectorInfo
These are all just type aliases across actor versions. In the future, that might change and we might need to do something fancier.