eth2

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecondPerSlot                = 12
	SlotPerEpoch                 = 32
	EpochsPerSyncCommitteePeriod = 256
	SlotPerSyncCommitteePeriod   = SlotPerEpoch * EpochsPerSyncCommitteePeriod
	SlotPerHistoricalRoot        = 8192

	ForkEpochCapellaSepolia = 56832
	ForkEpochCapellaMainnet = 194048
)
View Source
const TYPE = "eth2-v2.0"

Variables

This section is empty.

Functions

func EpochToSyncCommitteePeriod

func EpochToSyncCommitteePeriod(e phase0.Epoch) uint64

func HistoricalSummariesStartSlot

func HistoricalSummariesStartSlot(bn BeaconNetwork, s phase0.Slot) phase0.Slot

func IsCheckPoint

func IsCheckPoint(s phase0.Slot) bool

func IsSyncCommitteeEdge

func IsSyncCommitteeEdge(s phase0.Slot) bool

func NewReceiver

func NewReceiver(srcCfg link.ChainConfig, dstAddr types.BtpAddress, baseDir string, l log.Logger) (link.Receiver, error)

func NewSender

func NewSender(srcAddr types.BtpAddress, dstCfg link.ChainConfig, baseDir string, l log.Logger) (types.Sender, error)

func ParseChainConfig added in v0.5.0

func ParseChainConfig(raw json.RawMessage) (link.ChainConfig, error)

func RegisterEth2 added in v0.5.0

func RegisterEth2()

func SlotToBlockRootsIndex

func SlotToBlockRootsIndex(s phase0.Slot) uint64

func SlotToEpoch

func SlotToEpoch(s phase0.Slot) phase0.Epoch

SlotToEpoch returns the epoch number of the input slot.

func SlotToHistoricalSummariesIndex

func SlotToHistoricalSummariesIndex(bn BeaconNetwork, s phase0.Slot) uint64

func SlotToSyncCommitteePeriod

func SlotToSyncCommitteePeriod(s phase0.Slot) uint64

Types

type BMVExtra

type BMVExtra struct {
	LastMsgSeq  int64
	LastMsgSlot int64
}

func (*BMVExtra) Format added in v0.2.1

func (b *BMVExtra) Format(f fmt.State, c rune)

func (*BMVExtra) RLPDecodeSelf added in v0.2.1

func (b *BMVExtra) RLPDecodeSelf(d codec.Decoder) error

func (*BMVExtra) RLPEncodeSelf added in v0.2.1

func (b *BMVExtra) RLPEncodeSelf(e codec.Encoder) error

type BTPRelayMessage

type BTPRelayMessage struct {
	Messages []*TypePrefixedMessage
}

type BeaconNetwork added in v0.7.3

type BeaconNetwork int
const (
	Mainnet BeaconNetwork = iota + 1
	Sepolia
)

func (BeaconNetwork) String added in v0.7.3

func (b BeaconNetwork) String() string

type BlockProof

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

func (*BlockProof) Len

func (c *BlockProof) Len() int64

func (*BlockProof) Payload

func (c *BlockProof) Payload() []byte

func (*BlockProof) ProofHeight

func (c *BlockProof) ProofHeight() int64

func (*BlockProof) Type

func (c *BlockProof) Type() link.MessageItemType

func (*BlockProof) UpdateBMCLinkStatus

func (c *BlockProof) UpdateBMCLinkStatus(status *types.BMCLinkStatus) error

type BlockUpdate

type BlockUpdate struct {
	BlockProof
	// contains filtered or unexported fields
}

func NewBlockUpdate

func NewBlockUpdate(srcHeight int64, data *blockUpdateData) *BlockUpdate

func (*BlockUpdate) Len

func (c *BlockUpdate) Len() int64

func (*BlockUpdate) Payload

func (c *BlockUpdate) Payload() []byte

func (*BlockUpdate) SrcHeight

func (c *BlockUpdate) SrcHeight() int64

func (*BlockUpdate) TargetHeight

func (c *BlockUpdate) TargetHeight() int64

func (*BlockUpdate) Type

func (c *BlockUpdate) Type() link.MessageItemType

func (*BlockUpdate) UpdateBMCLinkStatus

func (c *BlockUpdate) UpdateBMCLinkStatus(bls *types.BMCLinkStatus) error

type MessageProof

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

func NewMessageProof

func NewMessageProof(bls *types.BMCLinkStatus, ls int64, data *messageProofData) *MessageProof

func (*MessageProof) LastSeqNum

func (m *MessageProof) LastSeqNum() int64

func (*MessageProof) Len

func (c *MessageProof) Len() int64

func (*MessageProof) Payload

func (c *MessageProof) Payload() []byte

func (*MessageProof) StartSeqNum

func (m *MessageProof) StartSeqNum() int64

func (*MessageProof) Type

func (c *MessageProof) Type() link.MessageItemType

func (*MessageProof) UpdateBMCLinkStatus

func (m *MessageProof) UpdateBMCLinkStatus(bls *types.BMCLinkStatus) error

type TypePrefixedMessage

type TypePrefixedMessage struct {
	Type    link.MessageItemType
	Payload []byte
}

func NewTypePrefixedMessage

func NewTypePrefixedMessage(rmi link.RelayMessageItem) (*TypePrefixedMessage, error)

Directories

Path Synopsis
Code generated by fastssz.
Code generated by fastssz.

Jump to

Keyboard shortcuts

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