abi

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegisteredSealProof_StackedDrg2KiBV1   = RegisteredSealProof(0)
	RegisteredSealProof_StackedDrg8MiBV1   = RegisteredSealProof(1)
	RegisteredSealProof_StackedDrg512MiBV1 = RegisteredSealProof(2)
	RegisteredSealProof_StackedDrg32GiBV1  = RegisteredSealProof(3)
	RegisteredSealProof_StackedDrg64GiBV1  = RegisteredSealProof(4)
)
View Source
const (
	RegisteredPoStProof_StackedDrgWinning2KiBV1   = RegisteredPoStProof(0)
	RegisteredPoStProof_StackedDrgWinning8MiBV1   = RegisteredPoStProof(1)
	RegisteredPoStProof_StackedDrgWinning512MiBV1 = RegisteredPoStProof(2)
	RegisteredPoStProof_StackedDrgWinning32GiBV1  = RegisteredPoStProof(3)
	RegisteredPoStProof_StackedDrgWinning64GiBV1  = RegisteredPoStProof(4)
	RegisteredPoStProof_StackedDrgWindow2KiBV1    = RegisteredPoStProof(5)
	RegisteredPoStProof_StackedDrgWindow8MiBV1    = RegisteredPoStProof(6)
	RegisteredPoStProof_StackedDrgWindow512MiBV1  = RegisteredPoStProof(7)
	RegisteredPoStProof_StackedDrgWindow32GiBV1   = RegisteredPoStProof(8)
	RegisteredPoStProof_StackedDrgWindow64GiBV1   = RegisteredPoStProof(9)
)
View Source
const MaxSectorNumber = math.MaxInt64

The maximum assignable sector number. Raising this would require modifying our AMT implementation.

Variables

View Source
var (
	// HashFunction is the default hash function for computing CIDs.
	//
	// This is currently Blake2b-256.
	HashFunction = uint64(mh.BLAKE2B_MIN + 31)

	// When producing a CID for an IPLD block less than or equal to CIDInlineLimit
	// bytes in length, the identity hash function will be used instead of
	// HashFunction. This will effectively "inline" the block into the CID, allowing
	// it to be extracted directly from the CID with no disk/network operations.
	//
	// This is currently -1 for "disabled".
	//
	// This is exposed for testing. Do not modify unless you know what you're doing.
	CIDInlineLimit = -1
)
View Source
var CidBuilder cid.Builder = cidBuilder{/* contains filtered or unexported fields */}

CidBuilder is the default CID builder for Filecoin.

- The default codec is CBOR. This can be changed with CidBuilder.WithCodec. - The default hash function is 256bit blake2b.

View Source
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.

View Source
var TotalFilecoin = big.Mul(big.NewIntUnsigned(2_000_000_000), TokenPrecision)

The maximum supply of Filecoin that will ever exist (in token units)

Functions

func BitFieldContainsAll

func BitFieldContainsAll(a, b BitField) (bool, error)

Checks whether bitfield `a` contains all bits set in bitfield `b`.

func BitFieldContainsAny

func BitFieldContainsAny(a, b BitField) (bool, error)

Checks whether bitfield `a` contains any bit that is set in bitfield `b`.

Types

type ActorID

type ActorID uint64

A sequential number assigned to an actor when created by the InitActor. This ID is embedded in ID-type addresses.

func (ActorID) String

func (e ActorID) String() string

type BitField

type BitField = bitfield.BitField

type ChainEpoch

type ChainEpoch int64

Epoch number of the chain state, which acts as a proxy for time within the VM.

func (ChainEpoch) String

func (e ChainEpoch) String() string

type DealID

type DealID uint64

type DealWeight

type DealWeight = big.Int // units: byte-epochs

BigInt types are aliases rather than new types because the latter introduce incredible amounts of noise converting to and from types in order to manipulate values. We give up some type safety for ergonomics.

type InteractiveSealRandomness

type InteractiveSealRandomness Randomness

type Invokee

type Invokee interface {
	Exports() []interface{}
}

type MethodNum

type MethodNum uint64

MethodNum is an integer that represents a particular method in an actor's function table. These numbers are used to compress invocation of actor code, and to decouple human language concerns about method names from the ability to uniquely refer to a particular method.

Consider MethodNum numbers to be similar in concerns as for offsets in function tables (in programming languages), and for tags in ProtocolBuffer fields. Tags in ProtocolBuffers recommend assigning a unique tag to a field and never reusing that tag. If a field is no longer used, the field name may change but should still remain defined in the code to ensure the tag number is not reused accidentally. The same should apply to the MethodNum associated with methods in Filecoin VM Actors.

func (MethodNum) String

func (e MethodNum) String() string

type Multiaddrs added in v0.5.5

type Multiaddrs = []byte

Multiaddrs is a byte array representing a Libp2p MultiAddress

type PaddedPieceSize

type PaddedPieceSize uint64

func (PaddedPieceSize) Unpadded

func (s PaddedPieceSize) Unpadded() UnpaddedPieceSize

func (PaddedPieceSize) Validate

func (s PaddedPieceSize) Validate() error

type PeerID added in v0.5.5

type PeerID = []byte

PeerID is a byte array representing a Libp2p PeerID

type PieceInfo

type PieceInfo struct {
	Size     PaddedPieceSize // Size in nodes. For BLS12-381 (capacity 254 bits), must be >= 16. (16 * 8 = 128)
	PieceCID cid.Cid
}

func (*PieceInfo) MarshalCBOR

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

func (*PieceInfo) UnmarshalCBOR

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

type PoStProof

type PoStProof struct {
	PoStProof  RegisteredPoStProof
	ProofBytes []byte
}

func (*PoStProof) MarshalCBOR

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

func (*PoStProof) UnmarshalCBOR

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

type PoStRandomness

type PoStRandomness Randomness

type Randomness

type Randomness []byte

Randomness is a string of random bytes

type RegisteredPoStProof added in v0.6.0

type RegisteredPoStProof RegisteredProof

func (RegisteredPoStProof) RegisteredSealProof added in v0.6.0

func (p RegisteredPoStProof) RegisteredSealProof() (RegisteredSealProof, error)

func (RegisteredPoStProof) SectorSize added in v0.6.0

func (p RegisteredPoStProof) SectorSize() (SectorSize, error)

func (RegisteredPoStProof) WindowPoStPartitionSectors added in v0.6.0

func (p RegisteredPoStProof) WindowPoStPartitionSectors() (uint64, error)

Returns the partition size, in sectors, associated with a proof type. The partition size is the number of sectors proved in a single PoSt proof.

type RegisteredProof

type RegisteredProof = int64

type RegisteredSealProof added in v0.6.0

type RegisteredSealProof RegisteredProof

This ordering, defines mappings to UInt in a way which MUST never change.

func (RegisteredSealProof) RegisteredWindowPoStProof added in v0.6.0

func (p RegisteredSealProof) RegisteredWindowPoStProof() (RegisteredPoStProof, error)

RegisteredWindowPoStProof produces the PoSt-specific RegisteredProof corresponding to the receiving RegisteredProof.

func (RegisteredSealProof) RegisteredWinningPoStProof added in v0.6.0

func (p RegisteredSealProof) RegisteredWinningPoStProof() (RegisteredPoStProof, error)

RegisteredWinningPoStProof produces the PoSt-specific RegisteredProof corresponding to the receiving RegisteredProof.

func (RegisteredSealProof) SectorMaximumLifetime added in v0.7.0

func (p RegisteredSealProof) SectorMaximumLifetime() ChainEpoch

SectorMaximumLifetime is the maximum duration a sector sealed with this proof may exist between activation and expiration

func (RegisteredSealProof) SectorSize added in v0.6.0

func (p RegisteredSealProof) SectorSize() (SectorSize, error)

func (RegisteredSealProof) WindowPoStPartitionSectors added in v0.6.0

func (p RegisteredSealProof) WindowPoStPartitionSectors() (uint64, error)

Returns the partition size, in sectors, associated with a proof type. The partition size is the number of sectors proved in a single PoSt proof.

type SealRandomness

type SealRandomness Randomness

type SealVerifyInfo

type SealVerifyInfo struct {
	SealProof RegisteredSealProof
	SectorID
	DealIDs               []DealID
	Randomness            SealRandomness
	InteractiveRandomness InteractiveSealRandomness
	Proof                 []byte

	// Safe because we get those from the miner actor
	SealedCID   cid.Cid `checked:"true"` // CommR
	UnsealedCID cid.Cid `checked:"true"` // CommD
}

Information needed to verify a seal proof.

func (*SealVerifyInfo) MarshalCBOR

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

func (*SealVerifyInfo) UnmarshalCBOR

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

type SectorID

type SectorID struct {
	Miner  ActorID
	Number SectorNumber
}

func (*SectorID) MarshalCBOR

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

func (*SectorID) UnmarshalCBOR

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

type SectorInfo

type SectorInfo struct {
	SealProof    RegisteredSealProof // RegisteredProof used when sealing - needs to be mapped to PoSt registered proof when used to verify a PoSt
	SectorNumber SectorNumber
	SealedCID    cid.Cid // CommR
}

Information about a sector necessary for PoSt verification.

func (*SectorInfo) MarshalCBOR

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

func (*SectorInfo) UnmarshalCBOR

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

type SectorNumber

type SectorNumber uint64

SectorNumber is a numeric identifier for a sector. It is usually relative to a miner.

func (SectorNumber) String

func (s SectorNumber) String() string

type SectorQuality

type SectorQuality = big.Int

type SectorSize

type SectorSize uint64

SectorSize indicates one of a set of possible sizes in the network. Ideally, SectorSize would be an enum

type SectorSize enum {
  1KiB = 1024
  1MiB = 1048576
  1GiB = 1073741824
  1TiB = 1099511627776
  1PiB = 1125899906842624
  1EiB = 1152921504606846976
  max  = 18446744073709551615
}

func (SectorSize) ShortString

func (s SectorSize) ShortString() string

Abbreviates the size as a human-scale number. This approximates (truncates) the size unless it is a power of 1024.

func (SectorSize) String

func (s SectorSize) String() string

Formats the size as a decimal string.

type StoragePower

type StoragePower = big.Int

The unit of storage power (measured in bytes)

func NewStoragePower

func NewStoragePower(n int64) StoragePower

type TokenAmount

type TokenAmount = big.Int

TokenAmount is an amount of Filecoin tokens. This type is used within the VM in message execution, to account movement of tokens, payment of VM gas, and more.

BigInt types are aliases rather than new types because the latter introduce incredible amounts of noise converting to and from types in order to manipulate values. We give up some type safety for ergonomics.

func NewTokenAmount

func NewTokenAmount(t int64) TokenAmount

type UnpaddedPieceSize

type UnpaddedPieceSize uint64

UnpaddedPieceSize is the size of a piece, in bytes

func (UnpaddedPieceSize) Padded

func (UnpaddedPieceSize) Validate

func (s UnpaddedPieceSize) Validate() error

type WindowPoStVerifyInfo

type WindowPoStVerifyInfo struct {
	Randomness        PoStRandomness
	Proofs            []PoStProof
	ChallengedSectors []SectorInfo
	Prover            ActorID // used to derive 32-byte prover ID
}

Information needed to verify a Window PoSt submitted directly to a miner actor.

func (*WindowPoStVerifyInfo) MarshalCBOR

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

func (*WindowPoStVerifyInfo) UnmarshalCBOR

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

type WinningPoStVerifyInfo

type WinningPoStVerifyInfo struct {
	Randomness        PoStRandomness
	Proofs            []PoStProof
	ChallengedSectors []SectorInfo
	Prover            ActorID // used to derive 32-byte prover ID
}

Information needed to verify a Winning PoSt attached to a block header. Note: this is not used within the state machine, but by the consensus/election mechanisms.

func (*WinningPoStVerifyInfo) MarshalCBOR

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

func (*WinningPoStVerifyInfo) UnmarshalCBOR

func (t *WinningPoStVerifyInfo) 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