Documentation
¶
Overview ¶
Copied from github.com/filecoin-project/lotus/chain/types/actor.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/bigint.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/blockheader.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/blockmsg.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Package types contains Filecoin chain primitive types: BlockHeader, TipSet, Message, SignedMessage, BeaconEntry, ElectionProof, BigInt, FIL, and the associated CBOR codecs.
The files in this package are copied verbatim from github.com/filecoin-project/lotus/chain/types at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253 unless a header note indicates otherwise. See LICENSE in the repository root.
Lantern maintains its own copy so the module can avoid importing the Lotus module (and its transitive filecoin-ffi dependency). Code here must remain pure Go; any change that introduces CGo or depends on filecoin-ffi is a regression.
Copied from github.com/filecoin-project/lotus/chain/types/electionproof.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/event.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/execresult.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/fil.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/finality.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/fullblock.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/index.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/keystore.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/logs.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/message.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/message_receipt.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/message_receipt_cbor.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/mpool.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/percent.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/signedmessage.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/state.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/tipset.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Copied from github.com/filecoin-project/lotus/chain/types/tipset_key.go at commit a0ecb8687f1c60d5e66040b6de364dbc9cc4d253. See LICENSE.
Index ¶
- Constants
- Variables
- func BigCmp(a, b BigInt) int
- func BigDivFloat(num, den BigInt) float64
- func CidArrsContains(a []cid.Cid, b cid.Cid) bool
- func CidArrsEqual(a, b []cid.Cid) bool
- func CidArrsSubset(a, b []cid.Cid) bool
- func DeciStr(bi BigInt) string
- func SizeStr(bi BigInt) string
- type Actor
- type ActorTrace
- type ActorV4
- type ActorV5
- type BeaconEntry
- type BigInt
- type BlockHeader
- func (blk *BlockHeader) Cid() cid.Cid
- func (blk *BlockHeader) IsValidated() bool
- func (blk *BlockHeader) LastTicket() *Ticket
- func (t *BlockHeader) MarshalCBOR(w io.Writer) error
- func (blk *BlockHeader) Serialize() ([]byte, error)
- func (blk *BlockHeader) SetValidated()
- func (blk *BlockHeader) SigningBytes() ([]byte, error)
- func (blk *BlockHeader) ToStorageBlock() (block.Block, error)
- func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error)
- type BlockMsg
- type ChainMsg
- type ElectionProof
- type Event
- type EventEntry
- type ExecutionTrace
- type ExpTipSet
- type FIL
- type FilterID
- type FinalityStatus
- type FullBlock
- type GasTrace
- type IndexValidation
- type KeyInfo
- type KeyStore
- type KeyType
- type LogCids
- type Message
- func (m *Message) Caller() address.Address
- func (m *Message) ChainLength() int
- func (m *Message) Cid() cid.Cid
- func (m *Message) EffectiveGasPremium(baseFee abi.TokenAmount) abi.TokenAmount
- func (m *Message) EqualCall(o *Message) bool
- func (m *Message) Equals(o *Message) bool
- func (t *Message) MarshalCBOR(w io.Writer) error
- func (m *Message) MarshalJSON() ([]byte, error)
- func (m *Message) Receiver() address.Address
- func (m *Message) RequiredFunds() BigInt
- func (m *Message) Serialize() ([]byte, error)
- func (m *Message) ToStorageBlock() (block.Block, error)
- func (t *Message) UnmarshalCBOR(r io.Reader) (err error)
- func (m *Message) VMMessage() *Message
- func (m *Message) ValidForBlockInclusion(minGas int64, version network.Version) error
- func (m *Message) ValueReceived() abi.TokenAmount
- type MessageReceipt
- type MessageReceiptVersion
- type MessageTrace
- type MpoolConfig
- type MsgMeta
- type Op
- type Percent
- type RawMessage
- type RawSignedMessage
- type ReturnTrace
- type SignedMessage
- func (sm *SignedMessage) ChainLength() int
- func (sm *SignedMessage) Cid() cid.Cid
- func (t *SignedMessage) MarshalCBOR(w io.Writer) error
- func (sm *SignedMessage) MarshalJSON() ([]byte, error)
- func (sm *SignedMessage) Serialize() ([]byte, error)
- func (sm *SignedMessage) Size() int
- func (sm *SignedMessage) ToStorageBlock() (block.Block, error)
- func (t *SignedMessage) UnmarshalCBOR(r io.Reader) (err error)
- func (sm *SignedMessage) VMMessage() *Message
- type StateInfo0
- type StateRoot
- type StateTreeVersion
- type Ticket
- type TipSet
- func (ts *TipSet) Blocks() []*BlockHeader
- func (ts *TipSet) Cids() []cid.Cid
- func (ts *TipSet) Contains(oc cid.Cid) bool
- func (ts *TipSet) Equals(ots *TipSet) bool
- func (ts *TipSet) Height() abi.ChainEpoch
- func (ts *TipSet) IsChildOf(parent *TipSet) bool
- func (ts *TipSet) Key() TipSetKey
- func (ts *TipSet) MarshalCBOR(w io.Writer) error
- func (ts *TipSet) MarshalJSON() ([]byte, error)
- func (ts *TipSet) MinTicket() *Ticket
- func (ts *TipSet) MinTicketBlock() *BlockHeader
- func (ts *TipSet) MinTimestamp() uint64
- func (ts *TipSet) ParentMessageReceipts() cid.Cid
- func (ts *TipSet) ParentState() cid.Cid
- func (ts *TipSet) ParentWeight() BigInt
- func (ts *TipSet) Parents() TipSetKey
- func (ts *TipSet) String() string
- func (ts *TipSet) UnmarshalCBOR(r io.Reader) error
- func (ts *TipSet) UnmarshalJSON(b []byte) error
- type TipSetKey
- func (k TipSetKey) Bytes() []byte
- func (k TipSetKey) Cid() (cid.Cid, error)
- func (k TipSetKey) Cids() []cid.Cid
- func (k TipSetKey) IsEmpty() bool
- func (k TipSetKey) MarshalCBOR(writer io.Writer) error
- func (k TipSetKey) MarshalJSON() ([]byte, error)
- func (k TipSetKey) String() string
- func (k TipSetKey) ToStorageBlock() (block.Block, error)
- func (k *TipSetKey) UnmarshalCBOR(reader io.Reader) error
- func (k *TipSetKey) UnmarshalJSON(b []byte) error
- type TraceIpld
Constants ¶
const ( EventFlagIndexedKey = 0b00000001 EventFlagIndexedValue = 0b00000010 )
EventEntry flags defined in fvm_shared
const BigIntMaxSerializedLen = 128 // is this big enough? or too big?
const EventAMTBitwidth = 5
const MessageVersion = 0
const TestGasLimit = 100e6
Variables ¶
var ( ErrKeyInfoNotFound = fmt.Errorf("key info not found") ErrKeyExists = fmt.Errorf("key already exists") )
var AttoFil = NewInt(1)
var EmptyInt = BigInt{}
var EmptyTSK = TipSetKey{}
var ErrActorNotFound = errors.New("actor not found")
var FemtoFil = BigMul(AttoFil, NewInt(1000))
var MaxWinCount = 3 * int64(build.BlocksPerEpoch)
var NanoFil = BigMul(PicoFil, NewInt(1000))
var PicoFil = BigMul(FemtoFil, NewInt(1000))
var TotalFilecoinInt = FromFil(build.FilBase)
Functions ¶
func BigDivFloat ¶
func CidArrsEqual ¶
func CidArrsSubset ¶
Types ¶
type ActorTrace ¶
func (*ActorTrace) MarshalCBOR ¶
func (t *ActorTrace) MarshalCBOR(w io.Writer) error
func (*ActorTrace) UnmarshalCBOR ¶
func (t *ActorTrace) UnmarshalCBOR(r io.Reader) (err error)
type ActorV4 ¶
type ActorV4 struct {
// Identifies the type of actor (string coded as a CID), see `chain/actors/actors.go`.
Code cid.Cid
Head cid.Cid
Nonce uint64
Balance BigInt
}
ActorV4 is Actor State for state tree version up to 4
type ActorV5 ¶
type ActorV5 struct {
// Identifies the type of actor (string coded as a CID), see `chain/actors/actors.go`.
Code cid.Cid
Head cid.Cid
Nonce uint64
Balance BigInt
// The f4 address of the actor, if any.
DelegatedAddress *address.Address
}
ActorV5 is Actor State for state tree version 5
type BeaconEntry ¶
func NewBeaconEntry ¶
func NewBeaconEntry(round uint64, data []byte) BeaconEntry
func (*BeaconEntry) MarshalCBOR ¶
func (t *BeaconEntry) MarshalCBOR(w io.Writer) error
func (*BeaconEntry) UnmarshalCBOR ¶
func (t *BeaconEntry) UnmarshalCBOR(r io.Reader) (err error)
type BlockHeader ¶
type BlockHeader struct {
Miner address.Address // 0 unique per block/miner
Ticket *Ticket // 1 unique per block/miner: should be a valid VRF
ElectionProof *ElectionProof // 2 unique per block/miner: should be a valid VRF
BeaconEntries []BeaconEntry // 3 identical for all blocks in same tipset
WinPoStProof []proof.PoStProof // 4 unique per block/miner
Parents []cid.Cid // 5 identical for all blocks in same tipset
ParentWeight BigInt // 6 identical for all blocks in same tipset
Height abi.ChainEpoch // 7 identical for all blocks in same tipset
ParentStateRoot cid.Cid // 8 identical for all blocks in same tipset
ParentMessageReceipts cid.Cid // 9 identical for all blocks in same tipset
Messages cid.Cid // 10 unique per block
BLSAggregate *crypto.Signature // 11 unique per block: aggrregate of BLS messages from above
Timestamp uint64 // 12 identical for all blocks in same tipset / hard-tied to the value of Height above
BlockSig *crypto.Signature // 13 unique per block/miner: miner signature
ForkSignaling uint64 // 14 currently unused/undefined
ParentBaseFee abi.TokenAmount // 15 identical for all blocks in same tipset: the base fee after executing parent tipset
// contains filtered or unexported fields
}
func DecodeBlock ¶
func DecodeBlock(b []byte) (*BlockHeader, error)
func (*BlockHeader) Cid ¶
func (blk *BlockHeader) Cid() cid.Cid
func (*BlockHeader) IsValidated ¶
func (blk *BlockHeader) IsValidated() bool
func (*BlockHeader) LastTicket ¶
func (blk *BlockHeader) LastTicket() *Ticket
func (*BlockHeader) MarshalCBOR ¶
func (t *BlockHeader) MarshalCBOR(w io.Writer) error
func (*BlockHeader) Serialize ¶
func (blk *BlockHeader) Serialize() ([]byte, error)
func (*BlockHeader) SetValidated ¶
func (blk *BlockHeader) SetValidated()
func (*BlockHeader) SigningBytes ¶
func (blk *BlockHeader) SigningBytes() ([]byte, error)
func (*BlockHeader) ToStorageBlock ¶
func (blk *BlockHeader) ToStorageBlock() (block.Block, error)
func (*BlockHeader) UnmarshalCBOR ¶
func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error)
type BlockMsg ¶
type BlockMsg struct {
Header *BlockHeader
BlsMessages []cid.Cid
SecpkMessages []cid.Cid
}
func DecodeBlockMsg ¶
type ElectionProof ¶
func (*ElectionProof) ComputeWinCount ¶
func (ep *ElectionProof) ComputeWinCount(power BigInt, totalPower BigInt) int64
ComputeWinCount uses VRFProof to compute number of wins The algorithm is based on Algorand's Sortition with Binomial distribution replaced by Poisson distribution.
func (*ElectionProof) MarshalCBOR ¶
func (t *ElectionProof) MarshalCBOR(w io.Writer) error
func (*ElectionProof) UnmarshalCBOR ¶
func (t *ElectionProof) UnmarshalCBOR(r io.Reader) (err error)
type Event ¶
type Event struct {
// The ID of the actor that emitted this event.
Emitter abi.ActorID
// Key values making up this event.
Entries []EventEntry
}
type EventEntry ¶
type EventEntry struct {
// A bitmap conveying metadata or hints about this entry.
Flags uint8
// The key of this event entry
Key string
// The event value's codec
Codec uint64
// The event value. It is encoded using the codec specified above
Value []byte
}
func (*EventEntry) MarshalCBOR ¶
func (t *EventEntry) MarshalCBOR(w io.Writer) error
func (*EventEntry) UnmarshalCBOR ¶
func (t *EventEntry) UnmarshalCBOR(r io.Reader) (err error)
type ExecutionTrace ¶
type ExecutionTrace struct {
Msg MessageTrace
MsgRct ReturnTrace
InvokedActor *ActorTrace `json:",omitempty"`
GasCharges []*GasTrace `cborgen:"maxlen=1000000000"`
Subcalls []ExecutionTrace `cborgen:"maxlen=1000000000"`
Logs []string `cborgen:"maxlen=1000000000" json:",omitempty"`
IpldOps []TraceIpld `cborgen:"maxlen=1000000000" json:",omitempty"`
}
func (*ExecutionTrace) MarshalCBOR ¶
func (t *ExecutionTrace) MarshalCBOR(w io.Writer) error
func (ExecutionTrace) SumGas ¶
func (et ExecutionTrace) SumGas() GasTrace
func (*ExecutionTrace) UnmarshalCBOR ¶
func (t *ExecutionTrace) UnmarshalCBOR(r io.Reader) (err error)
type ExpTipSet ¶
type ExpTipSet struct {
Cids []cid.Cid
Blocks []*BlockHeader
Height abi.ChainEpoch
}
type FIL ¶
type FIL BigInt
func MustParseFIL ¶
func (FIL) JSONSchema ¶
func (f FIL) JSONSchema() *jsonschema.Schema
func (FIL) MarshalText ¶
func (FIL) UnmarshalText ¶
type FinalityStatus ¶
type FinalityStatus struct {
// ECFinalityThresholdDepth is the shallowest epoch depth at which the
// probability of a chain reorganization drops below 2^-30 (~one in a
// billion). A value of -1 indicates the threshold was not met within the
// search range, which suggests degraded chain health.
ECFinalityThresholdDepth int `json:"ecFinalityThresholdDepth"`
// ECFinalizedTipSet is the most recent tipset where the reorg probability
// is below 2^-30, based on observed block production. Nil if the
// threshold is not met.
ECFinalizedTipSet *TipSet `json:"ecFinalizedTipSet"`
// F3FinalizedTipSet is the tipset finalized by F3 (Fast Finality), if F3
// is running and has issued a certificate. Nil if F3 is not available.
F3FinalizedTipSet *TipSet `json:"f3FinalizedTipSet"`
// FinalizedTipSet is the overall finalized tipset used by the node,
// taking the most recent of F3 and EC calculator results.
FinalizedTipSet *TipSet `json:"finalizedTipSet"`
// Head is the current chain head used for the computation.
Head *TipSet `json:"head"`
}
FinalityStatus describes how the node is currently determining finality, combining probabilistic EC finality (based on observed chain health) with F3 fast finality when available.
type FullBlock ¶
type FullBlock struct {
Header *BlockHeader
BlsMessages []*Message
SecpkMessages []*SignedMessage
}
type GasTrace ¶
type GasTrace struct {
Name string
TotalGas int64 `json:"tg"`
ComputeGas int64 `json:"cg"`
StorageGas int64 `json:"sg"`
TimeTaken time.Duration `json:"tt"`
}
func (*GasTrace) MarshalJSON ¶
type IndexValidation ¶
type IndexValidation struct {
// TipSetKey is the key of the canonical tipset for this epoch.
TipSetKey TipSetKey
// Height is the epoch height at which the validation is performed.
Height abi.ChainEpoch
// IndexedMessagesCount is the number of indexed messages for the canonical tipset at this epoch.
IndexedMessagesCount uint64
// IndexedEventsCount is the number of indexed events for the canonical tipset at this epoch.
IndexedEventsCount uint64
// IndexedEventEntriesCount is the number of indexed event entries for the canonical tipset at this epoch.
IndexedEventEntriesCount uint64
// Backfilled denotes whether missing data was successfully backfilled into the index during validation.
Backfilled bool
// IsNullRound indicates if the epoch corresponds to a null round and therefore does not have any indexed messages or events.
IsNullRound bool
}
IndexValidation contains detailed information about the validation status of a specific chain epoch.
type KeyStore ¶
type KeyStore interface {
// List lists all the keys stored in the KeyStore
List() ([]string, error)
// Get gets a key out of keystore and returns KeyInfo corresponding to named key
Get(string) (KeyInfo, error)
// Put saves a key info under given name
Put(string, KeyInfo) error
// Delete removes a key from keystore
Delete(string) error
}
KeyStore is used for storing secret keys
type LogCids ¶
func (LogCids) MarshalLogArray ¶
func (cids LogCids) MarshalLogArray(ae zapcore.ArrayEncoder) error
type Message ¶
type Message struct {
Version uint64
To address.Address
From address.Address
Nonce uint64
Value abi.TokenAmount
GasLimit int64
GasFeeCap abi.TokenAmount
GasPremium abi.TokenAmount
Method abi.MethodNum
Params []byte
}
func DecodeMessage ¶
func (*Message) ChainLength ¶
func (*Message) EffectiveGasPremium ¶
func (m *Message) EffectiveGasPremium(baseFee abi.TokenAmount) abi.TokenAmount
EffectiveGasPremium returns the effective gas premium claimable by the miner given the supplied base fee.
Filecoin clamps the gas premium at GasFeeCap - BaseFee, if lower than the specified premium. Returns 0 if GasFeeCap is less than BaseFee.
func (*Message) MarshalJSON ¶
func (*Message) RequiredFunds ¶
func (*Message) ValidForBlockInclusion ¶
func (*Message) ValueReceived ¶
func (m *Message) ValueReceived() abi.TokenAmount
type MessageReceipt ¶
type MessageReceipt struct {
ExitCode exitcode.ExitCode
Return []byte
GasUsed int64
EventsRoot *cid.Cid // Root of Event AMT with bitwidth = EventAMTBitwidth
// contains filtered or unexported fields
}
func NewMessageReceiptV0 ¶
func NewMessageReceiptV0(exitcode exitcode.ExitCode, ret []byte, gasUsed int64) MessageReceipt
NewMessageReceiptV0 creates a new pre FIP-0049 receipt with no capability to convey events.
func NewMessageReceiptV1 ¶
func NewMessageReceiptV1(exitcode exitcode.ExitCode, ret []byte, gasUsed int64, eventsRoot *cid.Cid) MessageReceipt
NewMessageReceiptV1 creates a new pre FIP-0049 receipt with the ability to convey events.
func (*MessageReceipt) Equals ¶
func (mr *MessageReceipt) Equals(o *MessageReceipt) bool
func (*MessageReceipt) MarshalCBOR ¶
func (mr *MessageReceipt) MarshalCBOR(w io.Writer) error
func (*MessageReceipt) UnmarshalCBOR ¶
func (mr *MessageReceipt) UnmarshalCBOR(r io.Reader) (err error)
func (*MessageReceipt) Version ¶
func (mr *MessageReceipt) Version() MessageReceiptVersion
type MessageReceiptVersion ¶
type MessageReceiptVersion byte
const ( // MessageReceiptV0 refers to pre FIP-0049 receipts. MessageReceiptV0 MessageReceiptVersion = 0 // MessageReceiptV1 refers to post FIP-0049 receipts. MessageReceiptV1 MessageReceiptVersion = 1 )
type MessageTrace ¶
type MessageTrace struct {
From address.Address
To address.Address
Value abi.TokenAmount
Method abi.MethodNum
Params []byte
ParamsCodec uint64
GasLimit uint64
ReadOnly bool
}
func (*MessageTrace) MarshalCBOR ¶
func (t *MessageTrace) MarshalCBOR(w io.Writer) error
func (*MessageTrace) UnmarshalCBOR ¶
func (t *MessageTrace) UnmarshalCBOR(r io.Reader) (err error)
type MpoolConfig ¶
type MpoolConfig struct {
PriorityAddrs []address.Address
SizeLimitHigh int
SizeLimitLow int
ReplaceByFeeRatio Percent
PruneCooldown time.Duration
GasLimitOverestimation float64
}
func (*MpoolConfig) Clone ¶
func (mc *MpoolConfig) Clone() *MpoolConfig
type Percent ¶
type Percent int64
Percent stores a signed percentage as an int64. When converted to a string (or json), it's stored as a decimal with two places (e.g., 100% -> 1.00).
func (Percent) MarshalJSON ¶
func (*Percent) UnmarshalJSON ¶
type RawMessage ¶
type RawMessage Message
type RawSignedMessage ¶
type RawSignedMessage SignedMessage
type ReturnTrace ¶
func (*ReturnTrace) MarshalCBOR ¶
func (t *ReturnTrace) MarshalCBOR(w io.Writer) error
func (*ReturnTrace) UnmarshalCBOR ¶
func (t *ReturnTrace) UnmarshalCBOR(r io.Reader) (err error)
type SignedMessage ¶
func DecodeSignedMessage ¶
func DecodeSignedMessage(data []byte) (*SignedMessage, error)
func (*SignedMessage) ChainLength ¶
func (sm *SignedMessage) ChainLength() int
func (*SignedMessage) Cid ¶
func (sm *SignedMessage) Cid() cid.Cid
func (*SignedMessage) MarshalCBOR ¶
func (t *SignedMessage) MarshalCBOR(w io.Writer) error
func (*SignedMessage) MarshalJSON ¶
func (sm *SignedMessage) MarshalJSON() ([]byte, error)
func (*SignedMessage) Serialize ¶
func (sm *SignedMessage) Serialize() ([]byte, error)
func (*SignedMessage) Size ¶
func (sm *SignedMessage) Size() int
func (*SignedMessage) ToStorageBlock ¶
func (sm *SignedMessage) ToStorageBlock() (block.Block, error)
func (*SignedMessage) UnmarshalCBOR ¶
func (t *SignedMessage) UnmarshalCBOR(r io.Reader) (err error)
func (*SignedMessage) VMMessage ¶
func (sm *SignedMessage) VMMessage() *Message
type StateInfo0 ¶
type StateInfo0 struct{} // TODO: version this.
func (*StateInfo0) MarshalCBOR ¶
func (t *StateInfo0) MarshalCBOR(w io.Writer) error
func (*StateInfo0) UnmarshalCBOR ¶
func (t *StateInfo0) UnmarshalCBOR(r io.Reader) (err error)
type StateRoot ¶
type StateRoot struct {
// State tree version.
Version StateTreeVersion
// Actors tree. The structure depends on the state root version.
Actors cid.Cid
// Info. The structure depends on the state root version.
Info cid.Cid
}
type StateTreeVersion ¶
type StateTreeVersion uint64
StateTreeVersion is the version of the state tree itself, independent of the network version or the actors version.
const ( // StateTreeVersion0 corresponds to actors < v2. StateTreeVersion0 StateTreeVersion = iota // StateTreeVersion1 corresponds to actors v2 StateTreeVersion1 // StateTreeVersion2 corresponds to actors v3. StateTreeVersion2 // StateTreeVersion3 corresponds to actors v4. StateTreeVersion3 // StateTreeVersion4 corresponds to actors v5 and above. StateTreeVersion4 // StateTreeVersion5 corresponds to actors v10 and above. StateTreeVersion5 )
type TipSet ¶
type TipSet struct {
// contains filtered or unexported fields
}
func NewStubTipSet ¶
func NewStubTipSet(cids []cid.Cid, height abi.ChainEpoch) *TipSet
NewStubTipSet constructs a TipSet from a (cids, height) tuple without requiring the full BlockHeader contents. It exists for the narrow case where Lantern needs to return a TipSet whose .Cids and .Height shape is the only thing the caller inspects (e.g. ChainGetGenesis, where we have the canonical genesis CID but not the genesis block bytes).
This is NOT a substitute for NewTipSet for normal chain operations: the returned TipSet has an empty Blocks() slice and its Parents, MinTicket, MinTimestamp etc. accessors panic / return zero. Callers must only inspect Cids() / Key() / Height() on the result.
Phase 8 addition.
func NewTipSet ¶
func NewTipSet(blks []*BlockHeader) (*TipSet, error)
NewTipSet checks:
- A tipset is composed of at least one block. (Because of our variable number of blocks per tipset, determined by randomness, we do not impose an upper limit.)
- All blocks have the same height.
- All blocks have the same parents (same number of them and matching CIDs).
func (*TipSet) Blocks ¶
func (ts *TipSet) Blocks() []*BlockHeader
func (*TipSet) Height ¶
func (ts *TipSet) Height() abi.ChainEpoch
func (*TipSet) MarshalJSON ¶
func (*TipSet) MinTicketBlock ¶
func (ts *TipSet) MinTicketBlock() *BlockHeader
func (*TipSet) MinTimestamp ¶
func (*TipSet) ParentMessageReceipts ¶
func (*TipSet) ParentState ¶
func (*TipSet) ParentWeight ¶
func (*TipSet) UnmarshalJSON ¶
type TipSetKey ¶
type TipSetKey struct {
// contains filtered or unexported fields
}
A TipSetKey is an immutable collection of CIDs forming a unique key for a tipset. The CIDs are assumed to be distinct and in canonical order. Two keys with the same CIDs in a different order are not considered equal. TipSetKey is a lightweight value type, and may be compared for equality with ==.
func NewTipSetKey ¶
NewTipSetKey builds a new key from a slice of CIDs. The CIDs are assumed to be ordered correctly.
func TipSetKeyFromBytes ¶
TipSetKeyFromBytes wraps an encoded key, validating correct decoding.