Run NodesReference

message

Package message is a generated GoMock package.

import "github.com/luxfi/node/message"

Package message is a generated GoMock package.

Package message is a generated GoMock package.

Functions

GetChainID

func GetChainID(m any) (ids.ID, error)

GetContainerBytes

func GetContainerBytes(msg fmt.Stringer) []byte

GetContainerBytes extracts the container/body bytes from various message types

GetDeadline

func GetDeadline(m any) (time.Duration, bool)

GetEngineType

func GetEngineType(m any) (p2p.EngineType, bool)

GetRequestID

func GetRequestID(m any) (uint32, bool)

ToConsensusOp

func ToConsensusOp(op Op) (byte, bool)

ToConsensusOp maps a wire message Op to the consensus router op the chain router (node/chain_router.go) dispatches on, returning false for ops that are not consensus-routed (the router drops those as "unhandled message op"). The returned values ARE the router constants, so they cannot drift in value; the mapping must also stay a bijection onto the router op space [0, router.NumOps) — proven by message/ops_test.go. A missing case silently drops that op: that is the α-of-K finality wedge, where GossipOp had no case and every vote vanished before reaching blockHandler.Gossip -> engine.HandleIncomingVote.

Unwrap

func Unwrap(m *p2p.Message) (fmt.Stringer, error)

Types

Codec

Codec defines the wire format encoding interface for P2P messages. Implementations are selected via build tags (proto vs zap).

Connected

func (m *Connected) String() string

Creator

func NewCreator(
	metrics metric.Registerer,
	compressionType compression.Type,
	maxMessageTimeout time.Duration,
) (Creator, error)

Disconnected

func (Disconnected) String() string

GetAcceptedFailed

func (m *GetAcceptedFailed) GetChainId() []byte
func (m *GetAcceptedFailed) GetRequestId() uint32
func (m *GetAcceptedFailed) String() string

GetAcceptedFrontierFailed

func (m *GetAcceptedFrontierFailed) GetChainId() []byte
func (m *GetAcceptedFrontierFailed) GetRequestId() uint32
func (m *GetAcceptedFrontierFailed) String() string

GetAcceptedStateSummaryFailed

func (m *GetAcceptedStateSummaryFailed) GetChainId() []byte
func (m *GetAcceptedStateSummaryFailed) GetRequestId() uint32
func (m *GetAcceptedStateSummaryFailed) String() string

GetAncestorsFailed

func (m *GetAncestorsFailed) GetChainId() []byte
func (m *GetAncestorsFailed) GetEngineType() p2p.EngineType
func (m *GetAncestorsFailed) GetRequestId() uint32
func (m *GetAncestorsFailed) String() string

GetFailed

func (m *GetFailed) GetChainId() []byte
func (m *GetFailed) GetRequestId() uint32
func (m *GetFailed) String() string

GetStateSummaryFrontierFailed

func (m *GetStateSummaryFrontierFailed) GetChainId() []byte
func (m *GetStateSummaryFrontierFailed) GetRequestId() uint32
func (m *GetStateSummaryFrontierFailed) String() string

GossipRequest

func (GossipRequest) String() string

InboundMessage

InboundMessage represents a set of fields for an inbound message

func InboundAccepted(
	chainID ids.ID,
	requestID uint32,
	containerIDs []ids.ID,
	nodeID ids.NodeID,
) InboundMessage
func InboundAcceptedFrontier(
	chainID ids.ID,
	requestID uint32,
	containerID ids.ID,
	nodeID ids.NodeID,
) InboundMessage
func InboundAcceptedStateSummary(
	chainID ids.ID,
	requestID uint32,
	summaryIDs []ids.ID,
	nodeID ids.NodeID,
) InboundMessage
func InboundBFTMessage(
	nodeID ids.NodeID,
	msg *p2p.BFT,
) InboundMessage
func InboundChits(
	chainID ids.ID,
	requestID uint32,
	preferredID ids.ID,
	preferredIDAtHeight ids.ID,
	acceptedID ids.ID,
	nodeID ids.NodeID,
) InboundMessage
func InboundError(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
	errorCode int32,
	errorMessage string,
) InboundMessage
func InboundGetAccepted(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	containerIDs []ids.ID,
	nodeID ids.NodeID,
) InboundMessage
func InboundGetAcceptedFrontier(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	nodeID ids.NodeID,
) InboundMessage
func InboundGetAcceptedStateSummary(
	chainID ids.ID,
	requestID uint32,
	heights []uint64,
	deadline time.Duration,
	nodeID ids.NodeID,
) InboundMessage
func InboundGetStateSummaryFrontier(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	nodeID ids.NodeID,
) InboundMessage
func InboundGossip(
	chainID ids.ID,
	msg []byte,
	nodeID ids.NodeID,
) InboundMessage
func InboundPullQuery(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	containerID ids.ID,
	requestedHeight uint64,
	nodeID ids.NodeID,
) InboundMessage
func InboundPushQuery(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	container []byte,
	requestedHeight uint64,
	nodeID ids.NodeID,
) InboundMessage
func InboundRequest(
	chainID ids.ID,
	requestID uint32,
	deadline time.Duration,
	msg []byte,
	nodeID ids.NodeID,
) InboundMessage
func InboundResponse(
	chainID ids.ID,
	requestID uint32,
	msg []byte,
	nodeID ids.NodeID,
) InboundMessage
func InboundStateSummaryFrontier(
	chainID ids.ID,
	requestID uint32,
	summary []byte,
	nodeID ids.NodeID,
) InboundMessage
func InternalConnected(nodeID ids.NodeID, nodeVersion *version.Application) InboundMessage
func InternalDisconnected(nodeID ids.NodeID) InboundMessage
func InternalGetAcceptedFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalGetAcceptedFrontierFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalGetAcceptedStateSummaryFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalGetAncestorsFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
	engineType p2p.EngineType,
) InboundMessage
func InternalGetFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalGetStateSummaryFrontierFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalGossipRequest(
	nodeID ids.NodeID,
) InboundMessage
func InternalQueryFailed(
	nodeID ids.NodeID,
	chainID ids.ID,
	requestID uint32,
) InboundMessage
func InternalVMMessage(
	nodeID ids.NodeID,
	notification uint32,
) InboundMessage

InboundMsgBuilder

MockOutboundMessage

MockOutboundMessage is a mock of OutboundMessage interface.

func NewMockOutboundMessage(ctrl *gomock.Controller) *MockOutboundMessage
func (m *MockOutboundMessage) BypassThrottling() bool
func (m *MockOutboundMessage) Bytes() []byte
func (m *MockOutboundMessage) BytesSavedCompression() int
func (m *MockOutboundMessage) EXPECT() *MockOutboundMessageMockRecorder
func (m *MockOutboundMessage) Op() Op

MockOutboundMessageMockRecorder

MockOutboundMessageMockRecorder is the mock recorder for MockOutboundMessage.

func (mr *MockOutboundMessageMockRecorder) BypassThrottling() *gomock.Call
func (mr *MockOutboundMessageMockRecorder) Bytes() *gomock.Call
func (mr *MockOutboundMessageMockRecorder) BytesSavedCompression() *gomock.Call
func (mr *MockOutboundMessageMockRecorder) Op() *gomock.Call

MockOutboundMsgBuilder

MockOutboundMsgBuilder is a mock of OutboundMsgBuilder interface.

func NewMockOutboundMsgBuilder(ctrl *gomock.Controller) *MockOutboundMsgBuilder
func (m *MockOutboundMsgBuilder) Accepted(arg0 ids.ID, arg1 uint32, arg2 []ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) AcceptedFrontier(arg0 ids.ID, arg1 uint32, arg2 ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) AcceptedStateSummary(arg0 ids.ID, arg1 uint32, arg2 []ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Ancestors(arg0 ids.ID, arg1 uint32, arg2 [][]byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Chits(arg0 ids.ID, arg1 uint32, arg2, arg3, arg4 ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) EXPECT() *MockOutboundMsgBuilderMockRecorder
func (m *MockOutboundMsgBuilder) Error(arg0 ids.ID, arg1 uint32, arg2 int32, arg3 string) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Get(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetAccepted(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []ids.ID) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetAcceptedFrontier(arg0 ids.ID, arg1 uint32, arg2 time.Duration) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetAcceptedStateSummary(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []uint64) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetAncestors(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID, arg4 p2p.EngineType) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetPeerList(arg0, arg1 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) GetStateSummaryFrontier(arg0 ids.ID, arg1 uint32, arg2 time.Duration) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Gossip(arg0 ids.ID, arg1 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Handshake(arg0 uint32, arg1 uint64, arg2 netip.AddrPort, arg3 string, arg4, arg5, arg6 uint32, arg7 uint64, arg8, arg9 []byte, arg10 []ids.ID, arg11, arg12 []uint32, arg13, arg14 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) PeerList(arg0 []*endpoints.ClaimedIPPort, arg1 bool) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Ping(arg0 uint32) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Pong() (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) PullQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID, arg4 uint64) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) PushQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []byte, arg4 uint64) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Put(arg0 ids.ID, arg1 uint32, arg2 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Request(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) Response(arg0 ids.ID, arg1 uint32, arg2 []byte) (OutboundMessage, error)
func (m *MockOutboundMsgBuilder) StateSummaryFrontier(arg0 ids.ID, arg1 uint32, arg2 []byte) (OutboundMessage, error)

MockOutboundMsgBuilderMockRecorder

MockOutboundMsgBuilderMockRecorder is the mock recorder for MockOutboundMsgBuilder.

func (mr *MockOutboundMsgBuilderMockRecorder) Accepted(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedFrontier(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) AcceptedStateSummary(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Ancestors(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Chits(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Error(arg0, arg1, arg2, arg3 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedStateSummary(arg0, arg1, arg2, arg3 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetAncestors(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetPeerList(arg0, arg1 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) GetStateSummaryFrontier(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Gossip(arg0, arg1 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) PeerList(arg0, arg1 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Ping(arg0, arg1 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Pong() *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Request(arg0, arg1, arg2, arg3 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) Response(arg0, arg1, arg2 any) *gomock.Call
func (mr *MockOutboundMsgBuilderMockRecorder) StateSummaryFrontier(arg0, arg1, arg2 any) *gomock.Call

Op

Op is an opcode

func ToOp(m *p2p.Message) (Op, error)
func (op Op) String() string

OutboundMessage

OutboundMessage represents a set of fields for an outbound message that can be serialized into a byte stream

OutboundMsgBuilder

OutboundMsgBuilder builds outbound messages. Outbound messages are returned with a reference count of 1. Once the reference count hits 0, the message bytes should no longer be accessed.

P2PMessage

P2PMessage is the top-level message container used by the codec. It wraps the inner message type for encoding/decoding.

func (m *P2PMessage) Inner() interface{}
func (m *P2PMessage) SetInner(v interface{})

QueryFailed

func (m *QueryFailed) GetChainId() []byte
func (m *QueryFailed) GetRequestId() uint32
func (m *QueryFailed) String() string

VMMessage

func (m *VMMessage) String() string