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) []byteGetContainerBytes 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() stringCreator
func NewCreator(
metrics metric.Registerer,
compressionType compression.Type,
maxMessageTimeout time.Duration,
) (Creator, error)Disconnected
func (Disconnected) String() stringGetAcceptedFailed
func (m *GetAcceptedFailed) GetChainId() []bytefunc (m *GetAcceptedFailed) GetRequestId() uint32func (m *GetAcceptedFailed) String() stringGetAcceptedFrontierFailed
func (m *GetAcceptedFrontierFailed) GetChainId() []bytefunc (m *GetAcceptedFrontierFailed) GetRequestId() uint32func (m *GetAcceptedFrontierFailed) String() stringGetAcceptedStateSummaryFailed
func (m *GetAcceptedStateSummaryFailed) GetChainId() []bytefunc (m *GetAcceptedStateSummaryFailed) GetRequestId() uint32func (m *GetAcceptedStateSummaryFailed) String() stringGetAncestorsFailed
func (m *GetAncestorsFailed) GetChainId() []bytefunc (m *GetAncestorsFailed) GetEngineType() p2p.EngineTypefunc (m *GetAncestorsFailed) GetRequestId() uint32func (m *GetAncestorsFailed) String() stringGetFailed
func (m *GetFailed) GetChainId() []bytefunc (m *GetFailed) GetRequestId() uint32func (m *GetFailed) String() stringGetStateSummaryFrontierFailed
func (m *GetStateSummaryFrontierFailed) GetChainId() []bytefunc (m *GetStateSummaryFrontierFailed) GetRequestId() uint32func (m *GetStateSummaryFrontierFailed) String() stringGossipRequest
func (GossipRequest) String() stringInboundMessage
InboundMessage represents a set of fields for an inbound message
func InboundAccepted(
chainID ids.ID,
requestID uint32,
containerIDs []ids.ID,
nodeID ids.NodeID,
) InboundMessagefunc InboundAcceptedFrontier(
chainID ids.ID,
requestID uint32,
containerID ids.ID,
nodeID ids.NodeID,
) InboundMessagefunc InboundAcceptedStateSummary(
chainID ids.ID,
requestID uint32,
summaryIDs []ids.ID,
nodeID ids.NodeID,
) InboundMessagefunc InboundBFTMessage(
nodeID ids.NodeID,
msg *p2p.BFT,
) InboundMessagefunc InboundChits(
chainID ids.ID,
requestID uint32,
preferredID ids.ID,
preferredIDAtHeight ids.ID,
acceptedID ids.ID,
nodeID ids.NodeID,
) InboundMessagefunc InboundError(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
errorCode int32,
errorMessage string,
) InboundMessagefunc InboundGetAccepted(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
containerIDs []ids.ID,
nodeID ids.NodeID,
) InboundMessagefunc InboundGetAcceptedFrontier(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
nodeID ids.NodeID,
) InboundMessagefunc InboundGetAcceptedStateSummary(
chainID ids.ID,
requestID uint32,
heights []uint64,
deadline time.Duration,
nodeID ids.NodeID,
) InboundMessagefunc InboundGetStateSummaryFrontier(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
nodeID ids.NodeID,
) InboundMessagefunc InboundGossip(
chainID ids.ID,
msg []byte,
nodeID ids.NodeID,
) InboundMessagefunc InboundPullQuery(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
containerID ids.ID,
requestedHeight uint64,
nodeID ids.NodeID,
) InboundMessagefunc InboundPushQuery(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
container []byte,
requestedHeight uint64,
nodeID ids.NodeID,
) InboundMessagefunc InboundRequest(
chainID ids.ID,
requestID uint32,
deadline time.Duration,
msg []byte,
nodeID ids.NodeID,
) InboundMessagefunc InboundResponse(
chainID ids.ID,
requestID uint32,
msg []byte,
nodeID ids.NodeID,
) InboundMessagefunc InboundStateSummaryFrontier(
chainID ids.ID,
requestID uint32,
summary []byte,
nodeID ids.NodeID,
) InboundMessagefunc InternalConnected(nodeID ids.NodeID, nodeVersion *version.Application) InboundMessagefunc InternalDisconnected(nodeID ids.NodeID) InboundMessagefunc InternalGetAcceptedFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalGetAcceptedFrontierFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalGetAcceptedStateSummaryFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalGetAncestorsFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
engineType p2p.EngineType,
) InboundMessagefunc InternalGetFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalGetStateSummaryFrontierFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalGossipRequest(
nodeID ids.NodeID,
) InboundMessagefunc InternalQueryFailed(
nodeID ids.NodeID,
chainID ids.ID,
requestID uint32,
) InboundMessagefunc InternalVMMessage(
nodeID ids.NodeID,
notification uint32,
) InboundMessageInboundMsgBuilder
MockOutboundMessage
MockOutboundMessage is a mock of OutboundMessage interface.
func NewMockOutboundMessage(ctrl *gomock.Controller) *MockOutboundMessagefunc (m *MockOutboundMessage) BypassThrottling() boolfunc (m *MockOutboundMessage) Bytes() []bytefunc (m *MockOutboundMessage) BytesSavedCompression() intfunc (m *MockOutboundMessage) EXPECT() *MockOutboundMessageMockRecorderfunc (m *MockOutboundMessage) Op() OpMockOutboundMessageMockRecorder
MockOutboundMessageMockRecorder is the mock recorder for MockOutboundMessage.
func (mr *MockOutboundMessageMockRecorder) BypassThrottling() *gomock.Callfunc (mr *MockOutboundMessageMockRecorder) Bytes() *gomock.Callfunc (mr *MockOutboundMessageMockRecorder) BytesSavedCompression() *gomock.Callfunc (mr *MockOutboundMessageMockRecorder) Op() *gomock.CallMockOutboundMsgBuilder
MockOutboundMsgBuilder is a mock of OutboundMsgBuilder interface.
func NewMockOutboundMsgBuilder(ctrl *gomock.Controller) *MockOutboundMsgBuilderfunc (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() *MockOutboundMsgBuilderMockRecorderfunc (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.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) AcceptedFrontier(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) AcceptedStateSummary(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Ancestors(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Chits(arg0, arg1, arg2, arg3, arg4 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Error(arg0, arg1, arg2, arg3 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedStateSummary(arg0, arg1, arg2, arg3 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetAncestors(arg0, arg1, arg2, arg3, arg4 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetPeerList(arg0, arg1 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) GetStateSummaryFrontier(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Gossip(arg0, arg1 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Handshake(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) PeerList(arg0, arg1 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Ping(arg0, arg1 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Pong() *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Request(arg0, arg1, arg2, arg3 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) Response(arg0, arg1, arg2 any) *gomock.Callfunc (mr *MockOutboundMsgBuilderMockRecorder) StateSummaryFrontier(arg0, arg1, arg2 any) *gomock.CallOp
Op is an opcode
func ToOp(m *p2p.Message) (Op, error)func (op Op) String() stringOutboundMessage
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() []bytefunc (m *QueryFailed) GetRequestId() uint32func (m *QueryFailed) String() stringVMMessage
func (m *VMMessage) String() string