builtin

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2020 License: Apache-2.0, MIT Imports: 11 Imported by: 120

Documentation

Index

Constants

View Source
const (
	MethodSend        = abi.MethodNum(0)
	MethodConstructor = abi.MethodNum(1)

	// TODO fin: remove this once canonical method numbers are finalized
	MethodPlaceholder = abi.MethodNum(1 << 30)
)
View Source
const EpochDurationSeconds = 25

The duration of a chain epoch. This 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

View Source
const FirstNonSingletonActorId = 100
View Source
const SecondsInDay = 86400
View Source
const SecondsInHour = 3600
View Source
const SecondsInYear = 31556925

Variables

View Source
var (
	SystemActorCodeID           cid.Cid
	InitActorCodeID             cid.Cid
	CronActorCodeID             cid.Cid
	AccountActorCodeID          cid.Cid
	StoragePowerActorCodeID     cid.Cid
	StorageMinerActorCodeID     cid.Cid
	StorageMarketActorCodeID    cid.Cid
	PaymentChannelActorCodeID   cid.Cid
	MultisigActorCodeID         cid.Cid
	RewardActorCodeID           cid.Cid
	VerifiedRegistryActorCodeID cid.Cid
	CallerTypesSignable         []cid.Cid
)

The built-in actor code IDs

View Source
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)
	// Distinguished AccountActor that is the destination of all burnt funds.
	BurntFundsActorAddr = mustMakeAddress(99)
)

Addresses for singleton system actors.

View Source
var ExpectedLeadersPerEpoch = int64(5)

The expected number of block producers in each epoch.

View Source
var MethodsAccount = struct {
	Constructor   abi.MethodNum
	PubkeyAddress abi.MethodNum
}{MethodConstructor, 2}
View Source
var MethodsCron = struct {
	Constructor abi.MethodNum
	EpochTick   abi.MethodNum
}{MethodConstructor, 2}
View Source
var MethodsInit = struct {
	Constructor abi.MethodNum
	Exec        abi.MethodNum
}{MethodConstructor, 2}
View Source
var MethodsMarket = struct {
	Constructor                    abi.MethodNum
	AddBalance                     abi.MethodNum
	WithdrawBalance                abi.MethodNum
	PublishStorageDeals            abi.MethodNum
	VerifyDealsOnSectorProveCommit abi.MethodNum
	OnMinerSectorsTerminate        abi.MethodNum
	ComputeDataCommitment          abi.MethodNum
	CronTick                       abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8}
View Source
var MethodsMiner = struct {
	Constructor            abi.MethodNum
	ControlAddresses       abi.MethodNum
	ChangeWorkerAddress    abi.MethodNum
	ChangePeerID           abi.MethodNum
	SubmitWindowedPoSt     abi.MethodNum
	PreCommitSector        abi.MethodNum
	ProveCommitSector      abi.MethodNum
	ExtendSectorExpiration abi.MethodNum
	TerminateSectors       abi.MethodNum
	DeclareFaults          abi.MethodNum
	DeclareFaultsRecovered abi.MethodNum
	OnDeferredCronEvent    abi.MethodNum
	CheckSectorProven      abi.MethodNum
	AddLockedFund          abi.MethodNum
	ReportConsensusFault   abi.MethodNum
	WithdrawBalance        abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}
View Source
var MethodsMultisig = struct {
	Constructor                 abi.MethodNum
	Propose                     abi.MethodNum
	Approve                     abi.MethodNum
	Cancel                      abi.MethodNum
	AddSigner                   abi.MethodNum
	RemoveSigner                abi.MethodNum
	SwapSigner                  abi.MethodNum
	ChangeNumApprovalsThreshold abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8}
View Source
var MethodsPaych = struct {
	Constructor        abi.MethodNum
	UpdateChannelState abi.MethodNum
	Settle             abi.MethodNum
	Collect            abi.MethodNum
}{MethodConstructor, 2, 3, 4}
View Source
var MethodsPower = struct {
	Constructor              abi.MethodNum
	CreateMiner              abi.MethodNum
	DeleteMiner              abi.MethodNum
	OnSectorProveCommit      abi.MethodNum
	OnSectorTerminate        abi.MethodNum
	OnFaultBegin             abi.MethodNum
	OnFaultEnd               abi.MethodNum
	OnSectorModifyWeightDesc abi.MethodNum
	EnrollCronEvent          abi.MethodNum
	OnEpochTickEnd           abi.MethodNum
	UpdatePledgeTotal        abi.MethodNum
	OnConsensusFault         abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
View Source
var MethodsReward = struct {
	Constructor        abi.MethodNum
	AwardBlockReward   abi.MethodNum
	LastPerEpochReward abi.MethodNum
	UpdateNetworkKPI   abi.MethodNum
}{MethodConstructor, 2, 3, 4}
View Source
var MethodsVerifiedRegistry = struct {
	Constructor       abi.MethodNum
	AddVerifier       abi.MethodNum
	RemoveVerifier    abi.MethodNum
	AddVerifiedClient abi.MethodNum
	UseBytes          abi.MethodNum
	RestoreBytes      abi.MethodNum
}{MethodConstructor, 2, 3, 4, 5, 6}

Functions

func ActorNameByCode

func ActorNameByCode(code cid.Cid) string

ActorNameByCode returns the (string) name of the actor given a cid code.

func IsBuiltinActor

func IsBuiltinActor(code cid.Cid) bool

IsBuiltinActor returns true if the code belongs to an actor defined in this repo.

func IsPrincipal

func IsPrincipal(code cid.Cid) bool

Tests whether a code CID represents an actor that can be an external principal: i.e. an account or multisig. We could do something more sophisticated here: https://github.com/filecoin-project/specs-actors/issues/178

func IsSingletonActor

func IsSingletonActor(code cid.Cid) bool

IsSingletonActor returns true if the code belongs to a singleton actor.

func RequestMinerControlAddrs

func RequestMinerControlAddrs(rt runtime.Runtime, minerAddr addr.Address) (ownerAddr addr.Address, workerAddr addr.Address)

func RequireNoErr

func RequireNoErr(rt runtime.Runtime, err error, code exitcode.ExitCode, msg string, args ...interface{})

Aborts with a formatted message if err is not nil. The provided message will be suffixed by ": %s" and the provided args suffixed by the err.

func RequireSuccess

func RequireSuccess(rt runtime.Runtime, e exitcode.ExitCode, msg string, args ...interface{})

Propagates a failed send by aborting the current method with the same exit code.

Types

type MinerAddrs

type MinerAddrs struct {
	Owner  addr.Address
	Worker addr.Address
}

This type duplicates the Miner.ControlAddresses return type, to work around a circular dependency between actors.

func (*MinerAddrs) MarshalCBOR

func (t *MinerAddrs) MarshalCBOR(w io.Writer) error

func (*MinerAddrs) UnmarshalCBOR

func (t *MinerAddrs) UnmarshalCBOR(r io.Reader) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL