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 QAPowerForWeight(size abi.SectorSize, duration abi.ChainEpoch, ...) abi.StoragePower
- type ExtendedSectorInfo
- type FilterEstimate
- type PoStProof
- type RegistryEntry
- type SectorInfo
Constants ¶
const ( EpochDurationSeconds = builtin.EpochDurationSeconds EpochsInDay = builtin.EpochsInDay SecondsInDay = builtin.SecondsInDay )
const ( MethodSend = builtin.MethodSend MethodConstructor = builtin.MethodConstructor )
Variables ¶
var BurntFundsActorAddr = builtin.BurntFundsActorAddr
var CronActorAddr = builtin.CronActorAddr
var (
ExpectedLeadersPerEpoch = builtin.ExpectedLeadersPerEpoch
)
var ReserveAddress = makeAddress("t090")
var RootVerifierAddress = makeAddress("t080")
var SaftAddress = makeAddress("t0122")
var SystemActorAddr = builtin.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
Types ¶
type ExtendedSectorInfo ¶ added in v1.14.0
type ExtendedSectorInfo = proof.ExtendedSectorInfo
type FilterEstimate ¶
type FilterEstimate = smoothingtypes.FilterEstimate
type RegistryEntry ¶ added in v1.17.2
type RegistryEntry struct {
// contains filtered or unexported fields
}
func MakeRegistry ¶ added in v1.17.2
func MakeRegistry(av actorstypes.Version) []RegistryEntry
func MakeRegistryLegacy ¶ added in v1.18.0
func MakeRegistryLegacy(actors []rtt.VMActor) []RegistryEntry
func (RegistryEntry) Code ¶ added in v1.17.2
func (r RegistryEntry) Code() cid.Cid
func (RegistryEntry) Exports ¶ added in v1.17.2
func (r RegistryEntry) Exports() map[uint64]builtin.MethodMeta
func (RegistryEntry) State ¶ added in v1.17.2
func (r RegistryEntry) State() cbor.Er
type SectorInfo ¶
type SectorInfo = proof.SectorInfo
These are all just type aliases across actor versions. In the future, that might change and we might need to do something fancier.