types

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: Apache-2.0, MIT Imports: 42 Imported by: 134

Documentation

Index

Constants

View Source
const (
	StageIdle = SyncStateStage(iota)
	StageHeaders
	StagePersistHeaders
	StageMessages
	StageSyncComplete
	StageSyncErrored
	StageFetchingMessages
)
View Source
const (
	SigTypeUnknown = SigType(math.MaxUint8)

	SigTypeSecp256k1 = SigType(iota)
	SigTypeBLS
)
View Source
const (
	MTUnknown = MsgType("unknown")

	// Signing message CID. MsgMeta.Extra contains raw cbor message bytes
	MTChainMsg = MsgType("message")

	// Signing a blockheader. signing raw cbor block bytes (MsgMeta.Extra is empty)
	MTBlock = MsgType("block")

	// Signing a deal proposal. signing raw cbor proposal bytes (MsgMeta.Extra is empty)
	MTDealProposal = MsgType("dealproposal")
	// extra is nil, 'toSign' is cbor raw bytes of 'DrawRandomParams'
	//  following types follow above rule
	MTDrawRandomParam = MsgType("drawrandomparam")
	MTSignedVoucher   = MsgType("signedvoucher")
	MTStorageAsk      = MsgType("storageask")
	MTAskResponse     = MsgType("askresponse")
	MTNetWorkResponse = MsgType("networkresposne")

	// reference : storagemarket/impl/remotecli.go:330
	// sign storagemarket.ClientDeal.ProposalCid,
	// MsgMeta.Extra is nil, 'toSign' is market.ClientDealProposal
	// storagemarket.ClientDeal.ProposalCid equals cborutil.AsIpld(market.ClientDealProposal).Cid()
	MTClientDeal = MsgType("clientdeal")

	MTProviderDealState = MsgType("providerdealstate")

	MTVerifyAddress = MsgType("verifyaddress")
)
View Source
const DefaultHashFunction = uint64(mh.BLAKE2B_MIN + 31)

The multihash function identifier to use for content addresses.

View Source
const HeadChangeTopic = "headchange"

HeadChangeTopic is the topic used to publish new heads.

View Source
const MessageVersion = internal.MessageVersion

Variables

View Source
var (
	ErrKeyInfoNotFound = fmt.Errorf("key info not found")
	ErrKeyExists       = fmt.Errorf("key already exists")
)
View Source
var AttoFil = internal.AttoFil
View Source
var BigAdd = internal.BigAdd
View Source
var BigCmp = internal.BigCmp
View Source
var BigDiv = internal.BigDiv
View Source
var BigDivFloat = internal.BigDivFloat
View Source
var BigFromBytes = internal.BigFromBytes
View Source
var BigFromString = internal.BigFromString
View Source
var BigMod = internal.BigMod
View Source
var BigMul = internal.BigMul
View Source
var BigSub = internal.BigSub
View Source
var DecodeMessage = internal.DecodeMessage
View Source
var DefaultCidBuilder = cid.V1Builder{Codec: cid.DagCBOR, MhType: DefaultHashFunction}

A builder for all blockchain CIDs. Note that sector commitments use a different scheme.

View Source
var EmptyInt = internal.EmptyInt
View Source
var EmptyTSK = TipSetKey{}
View Source
var EmptyTokenAmount = abi.TokenAmount{}
View Source
var ErrActorNotFound = internal.ErrActorNotFound
View Source
var FemtoFil = internal.FemtoFil
View Source
var FromFil = internal.FromFil
View Source
var MarketBalanceNil = MarketBalance{}
View Source
var MustParseFIL = internal.MustParseFIL
View Source
var NanoFil = internal.NanoFil
View Source
var NewInt = internal.NewInt
View Source
var ParseFIL = internal.ParseFIL
View Source
var PicoFil = internal.PicoFil
View Source
var TotalFilecoinInt = internal.TotalFilecoinInt
View Source
var UndefTipSet = &TipSet{}

UndefTipSet is a singleton representing a nil or undefined tipset.

View Source
var ZeroAddress = internal.ZeroAddress
View Source
var ZeroFIL = internal.ZeroFIL

Functions

func CidArrsContains added in v1.6.0

func CidArrsContains(a []cid.Cid, b cid.Cid) bool

func CidArrsEqual

func CidArrsEqual(a, b []cid.Cid) bool

func DeciStr

func DeciStr(bi BigInt) string

func MessageProvider

func MessageProvider() func(t *testing.T) *Message

func MustParseAddress

func MustParseAddress(addr string) address.Address

func MustParseCid

func MustParseCid(c string) cid.Cid

func NewGasFeeCap

func NewGasFeeCap(price int64) abi.TokenAmount

func NewGasPremium

func NewGasPremium(price int64) abi.TokenAmount

func ReverseFullBlock

func ReverseFullBlock(chain []*FullTipSet)

Reverse reverses the order of the slice `chain`.

func ReverseTipSet

func ReverseTipSet(chain []*TipSet)

Reverse reverses the order of the slice `chain`.

func SizeStr

func SizeStr(bi BigInt) string

func TipsetProvider

func TipsetProvider() func(*testing.T) *TipSet

Types

type ActiveSync

type ActiveSync struct {
	WorkerID uint64
	Base     *TipSet
	Target   *TipSet

	Stage  SyncStateStage
	Height abi.ChainEpoch

	Start   time.Time
	End     time.Time
	Message string
}

type Actor

type Actor = internal.Actor

func NewActor

func NewActor(code cid.Cid, balance abi.TokenAmount, head cid.Cid) *Actor

NewActor constructs a new actor.

type BeaconEntry

type BeaconEntry struct {
	Round uint64
	Data  []byte
}

func (*BeaconEntry) MarshalCBOR

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

func (*BeaconEntry) UnmarshalCBOR

func (t *BeaconEntry) UnmarshalCBOR(r io.Reader) (err error)

type BigInt

type BigInt = internal.BigInt

type BlockHeader

type BlockHeader struct {
	// Miner is the address of the miner actor that mined this newBlock.
	Miner address.Address

	// Ticket is the ticket submitted with this newBlock.
	Ticket *Ticket

	// ElectionProof is the vrf proof giving this newBlock's miner authoring rights
	ElectionProof *ElectionProof

	// BeaconEntries contain the verifiable oracle randomness used to elect
	// this newBlock's author leader
	BeaconEntries []BeaconEntry

	// WinPoStProof are the winning post proofs
	WinPoStProof []proof.PoStProof

	// Parents is the set of parents this newBlock was based on. Typically one,
	// but can be several in the case where there were multiple winning ticket-
	// holders for an epoch.
	Parents []cid.Cid

	// ParentWeight is the aggregate chain weight of the parent set.
	ParentWeight big.Int

	// Height is the chain height of this newBlock.
	Height abi.ChainEpoch

	// ParentStateRoot is the CID of the root of the state tree after application of the messages in the parent tipset
	// to the parent tipset's state root.
	ParentStateRoot cid.Cid

	// ParentMessageReceipts is a list of receipts corresponding to the application of the messages in the parent tipset
	// to the parent tipset's state root (corresponding to this newBlock's ParentStateRoot).
	ParentMessageReceipts cid.Cid

	// Messages is the set of messages included in this newBlock
	Messages cid.Cid

	// The aggregate signature of all BLS signed messages in the newBlock
	BLSAggregate *crypto.Signature

	// The timestamp, in seconds since the Unix epoch, at which this newBlock was created.
	Timestamp uint64

	// The signature of the miner's worker key over the newBlock
	BlockSig *crypto.Signature

	// ForkSignaling is extra data used by miners to communicate
	ForkSignaling uint64

	//identical for all blocks in same tipset: the base fee after executing parent tipset
	ParentBaseFee abi.TokenAmount
	// contains filtered or unexported fields
}

BlockHeader is a newBlock in the blockchain.

func DecodeBlock

func DecodeBlock(b []byte) (*BlockHeader, error)

DecodeBlock decodes raw cbor bytes into a BlockHeader.

func (*BlockHeader) Cid

func (b *BlockHeader) Cid() cid.Cid

Cid returns the content id of this newBlock.

func (*BlockHeader) Equals

func (b *BlockHeader) Equals(other *BlockHeader) bool

Equals returns true if the BlockHeader is equal to other.

func (*BlockHeader) IsValidated

func (b *BlockHeader) IsValidated() bool

IsValidated check whether block signature is valid from memory

func (*BlockHeader) LastTicket

func (b *BlockHeader) LastTicket() *Ticket

LastTicket get ticket in block

func (*BlockHeader) MarshalCBOR

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

func (*BlockHeader) Serialize

func (b *BlockHeader) Serialize() ([]byte, error)

Serialize serialize blockheader to binary

func (*BlockHeader) SerializeWithCid

func (b *BlockHeader) SerializeWithCid() (cid.Cid, []byte, error)

func (*BlockHeader) SetValidated

func (b *BlockHeader) SetValidated()

SetValidated set block signature is valid after checkout blocksig

func (*BlockHeader) SignatureData

func (b *BlockHeader) SignatureData() ([]byte, error)

SignatureData returns the newBlock's bytes with a null signature field for signature creation and verification

func (*BlockHeader) String

func (b *BlockHeader) String() string

func (*BlockHeader) ToNode

func (b *BlockHeader) ToNode() node.Node

ToNode converts the BlockHeader to an IPLD node.

func (*BlockHeader) ToStorageBlock

func (b *BlockHeader) ToStorageBlock() (blocks.Block, error)

ToStorageBlock convert blockheader to data block with cid

func (*BlockHeader) UnmarshalCBOR

func (t *BlockHeader) UnmarshalCBOR(r io.Reader) (err error)

type BlockMessages

type BlockMessages struct {
	BlsMessages   []*Message
	SecpkMessages []*SignedMessage
	Cids          []cid.Cid
}

BlsMessages[x].cid = Cids[x] SecpkMessages[y].cid = Cids[BlsMessages.length + y]

type BlockMessagesInfo

type BlockMessagesInfo struct {
	BlsMessages   []ChainMsg
	SecpkMessages []ChainMsg

	Block *BlockHeader
}

BlockMessagesInfo contains messages for one newBlock in a tipset.

type BlockMsg

type BlockMsg struct {
	Header        *BlockHeader
	BlsMessages   []cid.Cid
	SecpkMessages []cid.Cid
}

func (*BlockMsg) Cid

func (bm *BlockMsg) Cid() cid.Cid

Cid return block cid

func (*BlockMsg) MarshalCBOR

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

func (*BlockMsg) Serialize

func (bm *BlockMsg) Serialize() ([]byte, error)

Serialize return blockmsg binary

func (*BlockMsg) UnmarshalCBOR

func (t *BlockMsg) UnmarshalCBOR(r io.Reader) (err error)

type BlockTemplate

type BlockTemplate struct {
	Miner            address.Address
	Parents          TipSetKey
	Ticket           *Ticket
	Eproof           *ElectionProof
	BeaconValues     []BeaconEntry
	Messages         []*SignedMessage
	Epoch            abi.ChainEpoch
	Timestamp        uint64
	WinningPoStProof []builtin.PoStProof
}

type ChainInfo

type ChainInfo struct {
	// The originator of the TipSetKey propagation wave.
	Source peer.ID
	// The peer that sent us the TipSetKey message.
	Sender peer.ID
	Head   *TipSet
}

ChainInfo is used to track metadata about a peer and its chain.

func NewChainInfo

func NewChainInfo(source peer.ID, sender peer.ID, head *TipSet) *ChainInfo

NewChainInfo creates a chain info from a peer id a head tipset key and a chain height.

func (*ChainInfo) String

func (i *ChainInfo) String() string

String returns a human-readable string representation of a chain info

type ChainMessage

type ChainMessage struct {
	TS      *TipSet
	Message *Message
	Block   *BlockHeader
	Receipt *MessageReceipt
}

ChainMessage is an on-chain message with its block and receipt.

type ChainMsg

type ChainMsg = internal.ChainMsg

type ChannelAvailableFunds

type ChannelAvailableFunds struct {
	// Channel is the address of the channel
	Channel *address.Address
	// From is the from address of the channel (channel creator)
	From address.Address
	// To is the to address of the channel
	To address.Address
	// ConfirmedAmt is the total amount of funds that have been confirmed on-chain for the channel
	ConfirmedAmt BigInt
	// PendingAmt is the amount of funds that are pending confirmation on-chain
	PendingAmt BigInt
	// NonReservedAmt is part of ConfirmedAmt that is available for use (e.g. when the payment channel was pre-funded)
	NonReservedAmt BigInt
	// PendingAvailableAmt is the amount of funds that are pending confirmation on-chain that will become available once confirmed
	PendingAvailableAmt BigInt
	// PendingWaitSentinel can be used with PaychGetWaitReady to wait for
	// confirmation of pending funds
	PendingWaitSentinel *cid.Cid
	// QueuedAmt is the amount that is queued up behind a pending request
	QueuedAmt BigInt
	// VoucherRedeemedAmt is the amount that is redeemed by vouchers on-chain
	// and in the local datastore
	VoucherReedeemedAmt BigInt
}

type ChannelInfo

type ChannelInfo struct {
	Channel      address.Address
	WaitSentinel cid.Cid
}

type CheckStatus

type CheckStatus struct {
	Code CheckStatusCode
	OK   bool
	Err  string
	Hint map[string]interface{}
}

type CheckStatusCode

type CheckStatusCode int
const (

	// Message Checks
	CheckStatusMessageSerialize CheckStatusCode
	CheckStatusMessageSize
	CheckStatusMessageValidity
	CheckStatusMessageMinGas
	CheckStatusMessageMinBaseFee
	CheckStatusMessageBaseFee
	CheckStatusMessageBaseFeeLowerBound
	CheckStatusMessageBaseFeeUpperBound
	CheckStatusMessageGetStateNonce
	CheckStatusMessageNonce
	CheckStatusMessageGetStateBalance
	CheckStatusMessageBalance
)

func (CheckStatusCode) String

func (i CheckStatusCode) String() string

type CirculatingSupply

type CirculatingSupply struct {
	FilVested           abi.TokenAmount
	FilMined            abi.TokenAmount
	FilBurnt            abi.TokenAmount
	FilLocked           abi.TokenAmount
	FilCirculating      abi.TokenAmount
	FilReserveDisbursed abi.TokenAmount
}

type ConnMgrInfo added in v1.6.1

type ConnMgrInfo struct {
	FirstSeen time.Time
	Value     int
	Tags      map[string]int
	Conns     map[string]time.Time
}

type Deadline

type Deadline struct {
	PostSubmissions      bitfield.BitField
	DisputableProofCount uint64
}

type DealCollateralBounds

type DealCollateralBounds struct {
	Min abi.TokenAmount
	Max abi.TokenAmount
}

type ElectionProof

type ElectionProof struct {
	WinCount int64

	// A proof output by running a VRF on the VRFProof of the parent ticket
	VRFProof VRFPi
}

func (*ElectionProof) ComputeWinCount

func (ep *ElectionProof) ComputeWinCount(power abi.StoragePower, totalPower abi.StoragePower) 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 EstimateMessage

type EstimateMessage struct {
	Msg  *Message
	Spec *MessageSendSpec
}

type EstimateResult

type EstimateResult struct {
	Msg *Message
	Err string
}

type ExecutionTrace

type ExecutionTrace struct {
	Msg        *Message
	MsgRct     *MessageReceipt
	Error      string
	Duration   time.Duration
	GasCharges []*GasTrace

	Subcalls []ExecutionTrace
}

type ExpTipSet

type ExpTipSet struct {
	Cids   []cid.Cid
	Blocks []*BlockHeader
	Height abi.ChainEpoch
}

func (*ExpTipSet) MarshalCBOR

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

func (*ExpTipSet) UnmarshalCBOR

func (t *ExpTipSet) UnmarshalCBOR(r io.Reader) (err error)

type ExtendedPeerInfo added in v1.6.1

type ExtendedPeerInfo struct {
	ID          peer.ID
	Agent       string
	Addrs       []string
	Protocols   []string
	ConnMgrMeta *ConnMgrInfo
}

type FIL

type FIL = internal.FIL

type ForkUpgradeParams added in v1.6.0

type ForkUpgradeParams struct {
	UpgradeSmokeHeight       abi.ChainEpoch
	UpgradeBreezeHeight      abi.ChainEpoch
	UpgradeIgnitionHeight    abi.ChainEpoch
	UpgradeLiftoffHeight     abi.ChainEpoch
	UpgradeAssemblyHeight    abi.ChainEpoch
	UpgradeRefuelHeight      abi.ChainEpoch
	UpgradeTapeHeight        abi.ChainEpoch
	UpgradeKumquatHeight     abi.ChainEpoch
	BreezeGasTampingDuration abi.ChainEpoch
	UpgradeCalicoHeight      abi.ChainEpoch
	UpgradePersianHeight     abi.ChainEpoch
	UpgradeOrangeHeight      abi.ChainEpoch
	UpgradeClausHeight       abi.ChainEpoch
	UpgradeTrustHeight       abi.ChainEpoch
	UpgradeNorwegianHeight   abi.ChainEpoch
	UpgradeTurboHeight       abi.ChainEpoch
	UpgradeHyperdriveHeight  abi.ChainEpoch
	UpgradeChocolateHeight   abi.ChainEpoch
	UpgradeOhSnapHeight      abi.ChainEpoch
	UpgradeSkyrHeight        abi.ChainEpoch
}

type FullBlock

type FullBlock struct {
	Header       *BlockHeader
	BLSMessages  []*Message
	SECPMessages []*SignedMessage
}

FullBlock carries a newBlock header and the message and receipt collections referenced from the header.

func (*FullBlock) Cid

func (fb *FullBlock) Cid() cid.Cid

Cid returns the FullBlock's header's Cid

type FullTipSet

type FullTipSet struct {
	Blocks []*FullBlock
	// contains filtered or unexported fields
}

FullTipSet is an expanded version of the TipSet that contains all the blocks and messages

func NewFullTipSet

func NewFullTipSet(blks []*FullBlock) *FullTipSet

func (*FullTipSet) Cids

func (fts *FullTipSet) Cids() []cid.Cid

func (*FullTipSet) TipSet

func (fts *FullTipSet) TipSet() *TipSet

TipSet returns a narrower view of this FullTipSet elliding the newBlock messages.

type GasTrace

type GasTrace struct {
	Name string

	Location          []Loc `json:"loc"`
	TotalGas          int64 `json:"tg"`
	ComputeGas        int64 `json:"cg"`
	StorageGas        int64 `json:"sg"`
	TotalVirtualGas   int64 `json:"vtg"`
	VirtualComputeGas int64 `json:"vcg"`
	VirtualStorageGas int64 `json:"vsg"`

	TimeTaken time.Duration `json:"tt"`
	Extra     interface{}   `json:"ex,omitempty"`

	Callers []uintptr `json:"-"`
}

func (*GasTrace) MarshalJSON

func (gt *GasTrace) MarshalJSON() ([]byte, error)

type HeadChange

type HeadChange struct {
	Type HeadChangeType
	Val  *TipSet
}

type HeadChangeType

type HeadChangeType string
const (
	HCRevert  HeadChangeType = "revert"
	HCApply   HeadChangeType = "apply"
	HCCurrent HeadChangeType = "current"
)

type InvocResult

type InvocResult struct {
	MsgCid         cid.Cid
	Msg            *Message
	MsgRct         *MessageReceipt
	GasCost        MsgGasCost
	ExecutionTrace ExecutionTrace
	Error          string
	Duration       time.Duration
}

type KeyInfo

type KeyInfo struct {
	Type       KeyType
	PrivateKey []byte
}

KeyInfo is used for storing keys in KeyStore

type KeyType

type KeyType string

KeyType defines a type of a key

const (
	KTUnknown         KeyType = "unknown"
	KTBLS             KeyType = "bls"
	KTSecp256k1       KeyType = "secp256k1"
	KTSecp256k1Ledger KeyType = "secp256k1-ledger"
)

func SignType2Key

func SignType2Key(kt SigType) KeyType

func (*KeyType) UnmarshalJSON

func (kt *KeyType) UnmarshalJSON(bb []byte) error

type Loc

type Loc struct {
	File     string
	Line     int
	Function string
}

func (Loc) Important

func (l Loc) Important() bool

func (Loc) String

func (l Loc) String() string

type MarketBalance

type MarketBalance struct {
	Escrow big.Int
	Locked big.Int
}

type MarketDeal

type MarketDeal struct {
	Proposal market.DealProposal
	State    market.DealState
}

type Message

type Message = internal.Message

type MessageCID

type MessageCID struct {
	Cid     cid.Cid
	Message *Message
}

type MessageCheckStatus

type MessageCheckStatus struct {
	Cid cid.Cid
	CheckStatus
}

type MessagePrototype

type MessagePrototype struct {
	Message    Message
	ValidNonce bool
}

type MessageReceipt

type MessageReceipt struct {
	ExitCode exitcode.ExitCode
	Return   []byte
	GasUsed  int64
}

MessageReceipt is what is returned by executing a message on the vm.

func (*MessageReceipt) MarshalCBOR

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

func (*MessageReceipt) String

func (r *MessageReceipt) String() string

func (*MessageReceipt) UnmarshalCBOR

func (t *MessageReceipt) UnmarshalCBOR(r io.Reader) (err error)

type MessageRoot

type MessageRoot struct {
	BlsRoot   cid.Cid
	SecpkRoot cid.Cid
}

func (*MessageRoot) Cid

func (mr *MessageRoot) Cid() cid.Cid

func (*MessageRoot) MarshalCBOR

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

func (*MessageRoot) Serialize

func (mr *MessageRoot) Serialize() ([]byte, error)

func (*MessageRoot) SerializeWithCid

func (mr *MessageRoot) SerializeWithCid() (cid.Cid, []byte, error)

func (*MessageRoot) ToStorageBlock

func (mr *MessageRoot) ToStorageBlock() (blocks.Block, error)

func (*MessageRoot) UnmarshalCBOR

func (t *MessageRoot) UnmarshalCBOR(r io.Reader) (err error)

type MessageSendSpec

type MessageSendSpec struct {
	MaxFee            abi.TokenAmount
	GasOverEstimation float64
	GasOverPremium    float64
}

type MinerInfo added in v1.6.0

type MinerInfo struct {
	Owner                      address.Address   // Must be an ID-address.
	Worker                     address.Address   // Must be an ID-address.
	NewWorker                  address.Address   // Must be an ID-address.
	ControlAddresses           []address.Address // Must be an ID-addresses.
	WorkerChangeEpoch          abi.ChainEpoch
	PeerId                     *peer.ID // nolint
	Multiaddrs                 []abi.Multiaddrs
	WindowPoStProofType        abi.RegisteredPoStProof
	SectorSize                 abi.SectorSize
	WindowPoStPartitionSectors uint64
	ConsensusFaultElapsed      abi.ChainEpoch
}

type MinerPower

type MinerPower struct {
	MinerPower  power.Claim
	TotalPower  power.Claim
	HasMinPower bool
}

type MinerSectors

type MinerSectors struct {
	// Live sectors that should be proven.
	Live uint64
	// Sectors actively contributing to power.
	Active uint64
	// Sectors with failed proofs.
	Faulty uint64
}

type MiningBaseInfo

type MiningBaseInfo struct {
	MinerPower        abi.StoragePower
	NetworkPower      abi.StoragePower
	Sectors           []builtin.ExtendedSectorInfo
	WorkerKey         address.Address
	SectorSize        abi.SectorSize
	PrevBeaconEntry   BeaconEntry
	BeaconEntries     []BeaconEntry
	EligibleForMining bool
}

type MpoolChange

type MpoolChange int
const (
	MpoolAdd MpoolChange = iota
	MpoolRemove
)

type MpoolConfig

type MpoolConfig struct {
	PriorityAddrs          []address.Address
	SizeLimitHigh          int
	SizeLimitLow           int
	ReplaceByFeeRatio      float64
	PruneCooldown          time.Duration
	GasLimitOverestimation float64
}

type MpoolUpdate

type MpoolUpdate struct {
	Type    MpoolChange
	Message *SignedMessage
}

type MsgGasCost

type MsgGasCost struct {
	Message            cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
	GasUsed            abi.TokenAmount
	BaseFeeBurn        abi.TokenAmount
	OverEstimationBurn abi.TokenAmount
	MinerPenalty       abi.TokenAmount
	MinerTip           abi.TokenAmount
	Refund             abi.TokenAmount
	TotalCost          abi.TokenAmount
}

type MsgLookup

type MsgLookup struct {
	Message   cid.Cid // Can be different than requested, in case it was replaced, but only gas values changed
	Receipt   MessageReceipt
	ReturnDec interface{}
	TipSet    TipSetKey
	Height    abi.ChainEpoch
}

type MsgMeta

type MsgMeta struct {
	Type MsgType

	// Additional data related to what is signed. Should be verifiable with the
	// signed bytes (e.g. CID(Extra).Bytes() == toSign)
	Extra []byte
}

type MsgType

type MsgType string

type NatInfo added in v1.6.1

type NatInfo struct {
	Reachability network.Reachability
	PublicAddr   string
}

type NetworkName

type NetworkName string
const (
	NetworkNameMain        NetworkName = "mainnet"
	NetworkNameCalibration NetworkName = "calibrationnet"
	NetworkNameButterfly   NetworkName = "butterflynet"
	NetworkNameInterop     NetworkName = "interopnet"
	NetworkNameIntegration NetworkName = "integrationnet"
)

type NetworkParams added in v1.6.0

type NetworkParams struct {
	NetworkName             NetworkName
	BlockDelaySecs          uint64
	ConsensusMinerMinPower  abi.StoragePower
	SupportedProofTypes     []abi.RegisteredSealProof
	PreCommitChallengeDelay abi.ChainEpoch
	ForkUpgradeParams       ForkUpgradeParams
}

type NetworkType added in v1.6.0

type NetworkType int
const (
	NetworkDefault   NetworkType = 0
	NetworkMainnet   NetworkType = 0x1
	Network2k        NetworkType = 0x2
	NetworkDebug     NetworkType = 0x3
	NetworkCalibnet  NetworkType = 0x4
	NetworkNerpa     NetworkType = 0x5
	NetworkInterop   NetworkType = 0x6
	NetworkForce     NetworkType = 0x7
	NetworkButterfly NetworkType = 0x8

	Integrationnet NetworkType = 0x30
)

type ObjStat

type ObjStat struct {
	Size  uint64
	Links uint64
}

type PCHDir

type PCHDir int
const (
	PCHUndef PCHDir = iota
	PCHInbound
	PCHOutbound
)

type PaddedByteIndex

type PaddedByteIndex uint64

type Partition

type Partition struct {
	AllSectors        bitfield.BitField
	FaultySectors     bitfield.BitField
	RecoveringSectors bitfield.BitField
	LiveSectors       bitfield.BitField
	ActiveSectors     bitfield.BitField
}

type PaychGetOpts added in v1.6.0

type PaychGetOpts struct {
	OffChain bool
}

type PaymentInfo

type PaymentInfo struct {
	Channel      address.Address
	WaitSentinel cid.Cid
	Vouchers     []*paych.SignedVoucher
}

func (*PaymentInfo) MarshalCBOR

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

func (*PaymentInfo) UnmarshalCBOR

func (t *PaymentInfo) UnmarshalCBOR(r io.Reader) (err error)

type ProtocolParams

type ProtocolParams struct {
	Network          string
	BlockTime        time.Duration
	SupportedSectors []SectorInfo
}

type RawHost added in v1.6.1

type RawHost host.Host

type RawMessage

type RawMessage = internal.RawMessage

type RawSignedMessage

type RawSignedMessage SignedMessage

type SectorInfo

type SectorInfo struct {
	Size         abi.SectorSize
	MaxPieceSize abi.UnpaddedPieceSize
}

SectorInfo provides information about a sector construction

type SigType

type SigType = crypto.SigType

func KeyType2Sign

func KeyType2Sign(kt KeyType) SigType

type SignedMessage

type SignedMessage struct {
	Message   Message
	Signature crypto.Signature
}

SignedMessage contains a message and its signature

func (*SignedMessage) ChainLength

func (smsg *SignedMessage) ChainLength() int

nolint

func (*SignedMessage) Cid

func (smsg *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 (smsg *SignedMessage) Serialize() ([]byte, error)

Serialize return message binary

func (*SignedMessage) SerializeWithCid

func (smsg *SignedMessage) SerializeWithCid() (cid.Cid, []byte, error)

Serialize return message binary

func (*SignedMessage) String

func (smsg *SignedMessage) String() string

String return message json string

func (*SignedMessage) ToStorageBlock

func (smsg *SignedMessage) ToStorageBlock() (blocks.Block, error)

func (*SignedMessage) UnmarshalCBOR

func (t *SignedMessage) UnmarshalCBOR(r io.Reader) (err error)

func (*SignedMessage) VMMessage

func (smsg *SignedMessage) VMMessage() *Message

type SignedVoucher

type SignedVoucher = paych.SignedVoucher

type Signer

type Signer interface {
	SignBytes(ctx context.Context, data []byte, addr address.Address) (*crypto.Signature, error)
	HasAddress(ctx context.Context, addr address.Address) (bool, error)
}

Signer signs data with a private key obtained internally from a provided address.

type Status

type Status struct {
	ControlAddr address.Address
	Direction   PCHDir
}

type SyncState

type SyncState struct {
	ActiveSyncs []ActiveSync

	VMApplied uint64
}

type SyncStateStage

type SyncStateStage int

just compatible code lotus

func (SyncStateStage) String

func (v SyncStateStage) String() string

type Target

type Target struct {
	State   SyncStateStage
	Base    *TipSet
	Current *TipSet
	Start   time.Time
	End     time.Time
	Err     error
	ChainInfo
}

sync

type TargetTracker

type TargetTracker struct {
	History []*Target
	Buckets []*Target
}

type Ticket

type Ticket struct {
	// A proof output by running a VRF on the VRFProof of the parent ticket
	VRFProof VRFPi
}

A Ticket is a marker of a tick of the blockchain's clock. It is the source of randomness for proofs of storage and leader election. It is generated by the miner of a newBlock using a VRF.

func (*Ticket) Compare

func (t *Ticket) Compare(o *Ticket) int

func (*Ticket) Less

func (t *Ticket) Less(o *Ticket) bool

func (*Ticket) MarshalCBOR

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

func (*Ticket) Quality

func (t *Ticket) Quality() float64

func (Ticket) String

func (t Ticket) String() string

String returns the string representation of the VRFProof of the ticket

func (*Ticket) UnmarshalCBOR

func (t *Ticket) UnmarshalCBOR(r io.Reader) (err error)

type TipSet

type TipSet struct {
	// contains filtered or unexported fields
}

TipSet is a non-empty, immutable set of blocks at the same height with the same parent set. Blocks in a tipset are canonically ordered by ticket. Blocks may be iterated either via ToSlice() (which involves a shallow copy) or efficiently by index with At(). TipSet is a lightweight value type; passing by pointer is usually unnecessary.

Canonical tipset newBlock ordering does not match the order of CIDs in a TipSetKey used as a tipset "key".

func NewTipSet

func NewTipSet(bhs []*BlockHeader) (*TipSet, error)

func (*TipSet) At

func (ts *TipSet) At(i int) *BlockHeader

At returns the i'th newBlock in the tipset. An index outside the half-open range [0, Len()) will panic.

func (*TipSet) Blocks

func (ts *TipSet) Blocks() []*BlockHeader

func (*TipSet) Cids

func (ts *TipSet) Cids() []cid.Cid

func (*TipSet) Defined

func (ts *TipSet) Defined() bool

Defined checks whether the tipset is defined. Invoking any other methods on an undefined tipset will result in undefined behaviour (c.f. cid.Undef)

func (*TipSet) Equals

func (ts *TipSet) Equals(ots *TipSet) bool

func (*TipSet) Height

func (ts *TipSet) Height() abi.ChainEpoch

Height returns the height of a tipset.

func (*TipSet) IsChildOf

func (ts *TipSet) IsChildOf(parent *TipSet) bool

func (*TipSet) Key

func (ts *TipSet) Key() TipSetKey

Key returns a key for the tipset.

func (*TipSet) Len

func (ts *TipSet) Len() int

Len returns the number of blocks in the tipset.

func (*TipSet) MarshalCBOR

func (ts *TipSet) MarshalCBOR(w io.Writer) error

func (*TipSet) MarshalJSON

func (ts *TipSet) MarshalJSON() ([]byte, error)

func (*TipSet) MinTicket

func (ts *TipSet) MinTicket() *Ticket

MinTicket returns the smallest ticket of all blocks in the tipset.

func (*TipSet) MinTicketBlock

func (ts *TipSet) MinTicketBlock() *BlockHeader

func (*TipSet) MinTimestamp

func (ts *TipSet) MinTimestamp() uint64

func (*TipSet) ParentState

func (ts *TipSet) ParentState() cid.Cid

Parents returns the CIDs of the parents of the blocks in the tipset.

func (*TipSet) ParentWeight

func (ts *TipSet) ParentWeight() big.Int

ParentWeight returns the tipset's ParentWeight in fixed point form.

func (*TipSet) Parents

func (ts *TipSet) Parents() TipSetKey

Parents returns the CIDs of the parents of the blocks in the tipset.

func (TipSet) String

func (ts TipSet) String() string

String returns a formatted string of the CIDs in the TipSet. "{ <cid1> <cid2> <cid3> }" Note: existing callers use this as a unique key for the tipset. We should change them to use the TipSetKey explicitly

func (*TipSet) ToSlice

func (ts *TipSet) ToSlice() []*BlockHeader

ToSlice returns an ordered slice of pointers to the tipset's blocks.

func (*TipSet) UnmarshalCBOR

func (ts *TipSet) UnmarshalCBOR(r io.Reader) error

func (*TipSet) UnmarshalJSON

func (ts *TipSet) UnmarshalJSON(b []byte) error

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

func NewTipSetKey(cids ...cid.Cid) TipSetKey

NewTipSetKey builds a new key from a slice of CIDs. The CIDs are assumed to be ordered correctly.

func TipSetKeyFromBytes

func TipSetKeyFromBytes(encoded []byte) (TipSetKey, error)

TipSetKeyFromBytes wraps an encoded key, validating correct decoding.

func (TipSetKey) Bytes

func (tsk TipSetKey) Bytes() []byte

Bytes returns a binary representation of the key.

func (TipSetKey) Cids

func (tsk TipSetKey) Cids() []cid.Cid

Cids returns a slice of the CIDs comprising this key.

func (TipSetKey) ContainsAll

func (tsk TipSetKey) ContainsAll(other TipSetKey) bool

ContainsAll checks if another set is a subset of this one. We can assume that the relative order of members of one key is maintained in the other since we assume that all ids are sorted by corresponding newBlock ticket value.

func (TipSetKey) Equals

func (tsk TipSetKey) Equals(other TipSetKey) bool

Equals checks whether the set contains exactly the same CIDs as another.

func (TipSetKey) Has

func (tsk TipSetKey) Has(id cid.Cid) bool

Has checks whether the set contains `id`.

func (TipSetKey) IsEmpty

func (tsk TipSetKey) IsEmpty() bool

func (TipSetKey) MarshalCBOR

func (tsk TipSetKey) MarshalCBOR(w io.Writer) error

func (TipSetKey) MarshalJSON

func (tsk TipSetKey) MarshalJSON() ([]byte, error)

func (TipSetKey) String

func (tsk TipSetKey) String() string

String returns a human-readable representation of the key.

func (*TipSetKey) UnmarshalCBOR

func (tsk *TipSetKey) UnmarshalCBOR(r io.Reader) error

func (*TipSetKey) UnmarshalJSON

func (tsk *TipSetKey) UnmarshalJSON(b []byte) error

type UUID

type UUID uuid.UUID

func NewUUID

func NewUUID() UUID

func ParseUUID

func ParseUUID(uid string) (UUID, error)

func (UUID) IsEmpty

func (uid UUID) IsEmpty() bool

Value implement sql.Scanner

func (UUID) MarshalBinary added in v1.6.0

func (uid UUID) MarshalBinary() ([]byte, error)

func (UUID) MarshalJSON

func (uid UUID) MarshalJSON() ([]byte, error)

func (*UUID) Scan

func (uid *UUID) Scan(value interface{}) error

Scan assigns a value from a database driver. An error should be returned if the value cannot be stored without loss of information.

Reference types such as []byte are only valid until the next call to Scan and should not be retained. Their underlying memory is owned by the driver. If retention is necessary, copy their values before the next call to Scan.

func (UUID) String

func (uid UUID) String() string

Value implement sql.Scanner

func (*UUID) UnmarshalBinary added in v1.6.0

func (uid *UUID) UnmarshalBinary(b []byte) error

func (*UUID) UnmarshalJSON

func (uid *UUID) UnmarshalJSON(b []byte) error

func (UUID) Value

func (uid UUID) Value() (driver.Value, error)

Value implement sql.Scanner

type UnpaddedByteIndex

type UnpaddedByteIndex uint64

func (UnpaddedByteIndex) Padded

func (UnpaddedByteIndex) Valid

func (i UnpaddedByteIndex) Valid() error

type VRFPi

type VRFPi []byte

VRFPi is the proof output from running a VRF.

func (VRFPi) Digest

func (p VRFPi) Digest() [32]byte

Digest returns the digest (hash) of a proof, for use generating challenges etc.

type Version

type Version struct {
	Version string

	// APIVersion is a binary encoded semver version of the remote implementing
	// this api
	//
	APIVersion api.Version
}

Version provides various build-time information

type VoucherCreateResult

type VoucherCreateResult struct {
	// Voucher that was created, or nil if there was an error or if there
	// were insufficient funds in the channel
	Voucher *paych.SignedVoucher
	// Shortfall is the additional amount that would be needed in the channel
	// in order to be able to create the voucher
	Shortfall BigInt
}

VoucherCreateResult is the response to calling PaychVoucherCreate

type VoucherSpec

type VoucherSpec struct {
	Amount      BigInt
	TimeLockMin abi.ChainEpoch
	TimeLockMax abi.ChainEpoch
	MinSettle   abi.ChainEpoch

	Extra *paych.ModVerifyParams
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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