gateway

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CrossMsgsAMTBitwidth = 3
View Source
const ManifestID = "ipc_gateway"

ManifestID is the id used to index the gateway actor in the builtin-actors bundle.

Variables

This section is empty.

Functions

func CheckpointEpoch

func CheckpointEpoch(epoch, period abi.ChainEpoch) abi.ChainEpoch

func WindowEpoch

func WindowEpoch(epoch, period abi.ChainEpoch) abi.ChainEpoch

Types

type ApplyMsgParams

type ApplyMsgParams struct {
	CrossMsg CrossMsg
}

func (*ApplyMsgParams) MarshalCBOR

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

func (*ApplyMsgParams) UnmarshalCBOR

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

type CheckData

type CheckData struct {
	Source    sdk.SubnetID
	TipSet    []byte
	Epoch     abi.ChainEpoch
	PrevCheck cid.Cid // TCid<TLink<Checkpoint>>
	Children  []ChildCheck
	CrossMsgs []CrossMsgMeta
}

func (*CheckData) MarshalCBOR

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

func (*CheckData) UnmarshalCBOR

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

type Checkpoint

type Checkpoint struct {
	Data CheckData
	Sig  []byte
}

func (*Checkpoint) CrossMsgMeta

func (c *Checkpoint) CrossMsgMeta(from, to *sdk.SubnetID) (*CrossMsgMeta, bool)

func (*Checkpoint) CrossMsgMetaIndex

func (s *Checkpoint) CrossMsgMetaIndex(from, to *sdk.SubnetID) (int, bool)

func (*Checkpoint) MarshalCBOR

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

func (*Checkpoint) UnmarshalCBOR

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

type ChildCheck

type ChildCheck struct {
	Source sdk.SubnetID
	Checks cid.Cid // Vec<TCid<TLink<Checkpoint>>>,
}

func (*ChildCheck) MarshalCBOR

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

func (*ChildCheck) UnmarshalCBOR

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

type ConstructParams

type ConstructParams struct {
	NetworkName      string
	CheckpointPeriod abi.ChainEpoch
}

func (*ConstructParams) MarshalCBOR

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

func (*ConstructParams) UnmarshalCBOR

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

type CrossMsg

type CrossMsg struct {
	Msg     StorableMsg
	Wrapped bool
}

func GetTopDownMsg

func GetTopDownMsg(crossMsgs *adt.Array, nonce uint64) (*CrossMsg, error)

func (*CrossMsg) MarshalCBOR

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

func (*CrossMsg) UnmarshalCBOR

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

type CrossMsgMeta

type CrossMsgMeta struct {
	From    sdk.SubnetID
	To      sdk.SubnetID
	MsgsCID cid.Cid // TCid<TLink<CrossMsgs>>,
	Nonce   uint64
	Value   abi.TokenAmount
}

func (*CrossMsgMeta) MarshalCBOR

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

func (*CrossMsgMeta) UnmarshalCBOR

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

type CrossMsgParams

type CrossMsgParams struct {
	CrossMsg    CrossMsg
	Destination sdk.SubnetID
}

func (*CrossMsgParams) MarshalCBOR

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

func (*CrossMsgParams) UnmarshalCBOR

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

type CrossMsgs

type CrossMsgs struct {
	Msgs  []CrossMsg
	Metas []CrossMsgMeta
}

func (*CrossMsgs) MarshalCBOR

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

func (*CrossMsgs) UnmarshalCBOR

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

type FundParams

type FundParams struct {
	Value abi.TokenAmount
}

func (*FundParams) MarshalCBOR

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

func (*FundParams) UnmarshalCBOR

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

type IPCMsgType

type IPCMsgType int
const (
	IPCMsgTypeUnknown IPCMsgType = iota
	IPCMsgTypeBottomUp
	IPCMsgTypeTopDown
)

type RawBytes

type RawBytes struct {
	Bytes []byte
}

func (*RawBytes) MarshalCBOR

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

func (*RawBytes) UnmarshalCBOR

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

type State

type State struct {
	NetworkName          sdk.SubnetID
	TotalSubnets         uint64
	MinStake             abi.TokenAmount
	Subnets              cid.Cid // TCid<THamt<Cid, Subnet>>
	CheckPeriod          abi.ChainEpoch
	Checkpoints          cid.Cid //TCid<THamt<ChainEpoch, Checkpoint>>
	CheckMsgRegistry     cid.Cid //TCid<THamt<TCid<TLink<CrossMsgs>>, CrossMsgs>>
	Postbox              cid.Cid // TCid<THamt<Cid, Vec<u8>>>;
	Nonce                uint64
	BottomupNonce        uint64
	BottomupMsgMeta      cid.Cid // TCid<TAmt<CrossMsgMeta, CROSSMSG_AMT_BITWIDTH>>
	AppliedBottomupNonce uint64
	AppliedTopdownNonce  uint64
}

func (*State) BottomUpMsgFromNonce

func (st *State) BottomUpMsgFromNonce(s adt.Store, nonce uint64) ([]*CrossMsgMeta, error)

BottomUpMsgFromNonce gets the latest bottomUpMetas from a specific nonce (including the one specified, i.e. [nonce, latest], both limits included).

func (*State) GetBottomUpMsgMeta

func (st *State) GetBottomUpMsgMeta(s adt.Store, cID cid.Cid, nonce uint64) (*CrossMsgMeta, error)

func (*State) GetCheckpoints

func (st *State) GetCheckpoints(s adt.Store, c abi.ChainEpoch) (*Checkpoint, error)

func (*State) GetCrossMsgs

func (st *State) GetCrossMsgs(s adt.Store, cID cid.Cid) (*CrossMsgs, error)

func (*State) GetSubnet

func (st *State) GetSubnet(s adt.Store, id sdk.SubnetID) (*Subnet, error)

func (*State) GetTopDownMsg

func (st *State) GetTopDownMsg(s adt.Store, id sdk.SubnetID, nonce uint64) (*CrossMsg, error)

func (*State) MarshalCBOR

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

func (*State) UnmarshalCBOR

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

type StorableMsg

type StorableMsg struct {
	From   sdk.IPCAddress
	To     sdk.IPCAddress
	Method abi.MethodNum
	Params RawBytes
	Value  abi.TokenAmount
	Nonce  uint64
}

func (*StorableMsg) IPCType

func (sm *StorableMsg) IPCType() IPCMsgType

func (*StorableMsg) MarshalCBOR

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

func (*StorableMsg) UnmarshalCBOR

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

type Subnet

type Subnet struct {
	ID             sdk.SubnetID
	Stake          abi.TokenAmount
	TopDownMsgs    cid.Cid // TCid<TAmt<CrossMsg, CROSSMSG_AMT_BITWIDTH>>,
	Nonce          uint64
	CircSupply     abi.TokenAmount
	Status         sdk.Status
	PrevCheckpoint Checkpoint
}

func (Subnet) GetTopDownMsg

func (sn Subnet) GetTopDownMsg(s adt.Store, nonce uint64) (*CrossMsg, error)

Jump to

Keyboard shortcuts

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