gateway

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0, MIT Imports: 17 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 AmountParams added in v0.1.6

type AmountParams struct {
	Value abi.TokenAmount
}

func (*AmountParams) MarshalCBOR added in v0.1.6

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

func (*AmountParams) UnmarshalCBOR added in v0.1.6

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

type BatchCrossMsgs added in v0.1.5

type BatchCrossMsgs struct {
	CrossMsgs []CrossMsg
	Fee       abi.TokenAmount
}

func (*BatchCrossMsgs) MarshalCBOR added in v0.1.5

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

func (*BatchCrossMsgs) UnmarshalCBOR added in v0.1.5

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

type BottomUpCheckpoint added in v0.1.5

type BottomUpCheckpoint struct {
	Data CheckData
	Sig  []byte
}

func NewBottomUpCheckpoint added in v0.1.5

func NewBottomUpCheckpoint(subnet sdk.SubnetID, epoch abi.ChainEpoch) *BottomUpCheckpoint

func (*BottomUpCheckpoint) Cid added in v0.1.5

func (c *BottomUpCheckpoint) Cid() (cid.Cid, error)

func (*BottomUpCheckpoint) MarshalCBOR added in v0.1.5

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

func (*BottomUpCheckpoint) UnmarshalCBOR added in v0.1.5

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

type CheckData

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

func (*CheckData) MarshalCBOR

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

func (*CheckData) UnmarshalCBOR

func (t *CheckData) 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 (*CrossMsg) MarshalCBOR

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

func (*CrossMsg) UnmarshalCBOR

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

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 {
	Subnet sdk.SubnetID
	To     address.Address
}

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 InitGenesisEpochParams added in v0.1.5

type InitGenesisEpochParams struct {
	GenesisEpoch abi.ChainEpoch
}

func (*InitGenesisEpochParams) MarshalCBOR added in v0.1.5

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

func (*InitGenesisEpochParams) UnmarshalCBOR added in v0.1.5

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

type ReleaseParams added in v0.1.6

type ReleaseParams struct {
	To address.Address
}

func (*ReleaseParams) MarshalCBOR added in v0.1.6

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

func (*ReleaseParams) UnmarshalCBOR added in v0.1.6

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

type State

type State struct {
	NetworkName             sdk.SubnetID
	TotalSubnets            uint64
	MinStake                abi.TokenAmount
	Subnets                 cid.Cid // TCid<THamt<SubnetID, Subnet>>
	BottomUpCheckPeriod     abi.ChainEpoch
	TopDownCheckPeriod      abi.ChainEpoch
	BottomUpCheckpoints     cid.Cid // TCid<THamt<ChainEpoch, Checkpoint>>
	Postbox                 cid.Cid // TCid<THamt<Cid, Vec<u8>>>
	BottomupNonce           uint64
	AppliedTopdownNonce     uint64
	TopDownCheckpointVoting voting.Voting
	Validators              validator.OnChainValidators
	Initialized             bool
}

func (*State) GetCheckpoints

func (st *State) GetCheckpoints(s adt.Store, e abi.ChainEpoch) (*BottomUpCheckpoint, bool, error)

func (*State) GetSubnet

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

func (*State) GetTopDownMsg

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

func (*State) GetWindowCheckpoint added in v0.1.2

func (st *State) GetWindowCheckpoint(s adt.Store, epoch abi.ChainEpoch) (*BottomUpCheckpoint, error)

GetWindowCheckpoint gets the template for a specific epoch. If no template is persisted yet, an empty template is provided. Here we get the checkpoint template for an epoch that is already finished and ready to be populated

NOTE: This function doesn't check if a template from the future is being requested.

func (*State) ListSubnets added in v0.1.3

func (st *State) ListSubnets(s adt.Store) ([]Subnet, error)

ListSubnets lists subnets registered in the gateway

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 []byte
	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       *BottomUpCheckpoint
	AppliedBottomupNonce uint64
	GenesisEpoch         abi.ChainEpoch
}

func (*Subnet) GetTopDownMsg

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

func (*Subnet) MarshalCBOR added in v0.1.2

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

func (*Subnet) TopDownMsgsFromNonce added in v0.1.4

func (sn *Subnet) TopDownMsgsFromNonce(s adt.Store, nonce uint64) ([]*CrossMsg, error)

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

func (*Subnet) UnmarshalCBOR added in v0.1.2

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

type TopDownCheckpoint added in v0.1.5

type TopDownCheckpoint struct {
	Epoch       abi.ChainEpoch
	TopDownMsgs []CrossMsgs
}

func (*TopDownCheckpoint) MarshalCBOR added in v0.1.5

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

func (*TopDownCheckpoint) UnmarshalCBOR added in v0.1.5

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

Jump to

Keyboard shortcuts

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