diff --git a/message/fields.go b/message/fields.go index 94dcf2a23061..453315f4323a 100644 --- a/message/fields.go +++ b/message/fields.go @@ -51,13 +51,7 @@ var ( _ requestIDGetter = (*p2p.AppRequest)(nil) _ requestIDGetter = (*p2p.AppResponse)(nil) - _ engineTypeGetter = (*p2p.GetAcceptedFrontier)(nil) - _ engineTypeGetter = (*p2p.GetAccepted)(nil) _ engineTypeGetter = (*p2p.GetAncestors)(nil) - _ engineTypeGetter = (*p2p.Get)(nil) - _ engineTypeGetter = (*p2p.Put)(nil) - _ engineTypeGetter = (*p2p.PushQuery)(nil) - _ engineTypeGetter = (*p2p.PullQuery)(nil) _ deadlineGetter = (*p2p.GetStateSummaryFrontier)(nil) _ deadlineGetter = (*p2p.GetAcceptedStateSummary)(nil) diff --git a/message/inbound_msg_builder.go b/message/inbound_msg_builder.go index b32dbc5d480d..b7b6048d89c8 100644 --- a/message/inbound_msg_builder.go +++ b/message/inbound_msg_builder.go @@ -117,16 +117,14 @@ func InboundGetAcceptedFrontier( requestID uint32, deadline time.Duration, nodeID ids.NodeID, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, op: GetAcceptedFrontierOp, message: &p2p.GetAcceptedFrontier{ - ChainId: chainID[:], - RequestId: requestID, - Deadline: uint64(deadline), - EngineType: engineType, + ChainId: chainID[:], + RequestId: requestID, + Deadline: uint64(deadline), }, expiration: time.Now().Add(deadline), } @@ -156,7 +154,6 @@ func InboundGetAccepted( deadline time.Duration, containerIDs []ids.ID, nodeID ids.NodeID, - engineType p2p.EngineType, ) InboundMessage { containerIDBytes := make([][]byte, len(containerIDs)) encodeIDs(containerIDs, containerIDBytes) @@ -168,7 +165,6 @@ func InboundGetAccepted( RequestId: requestID, Deadline: uint64(deadline), ContainerIds: containerIDBytes, - EngineType: engineType, }, expiration: time.Now().Add(deadline), } @@ -201,7 +197,6 @@ func InboundPushQuery( container []byte, requestedHeight uint64, nodeID ids.NodeID, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, @@ -212,7 +207,6 @@ func InboundPushQuery( Deadline: uint64(deadline), Container: container, RequestedHeight: requestedHeight, - EngineType: engineType, }, expiration: time.Now().Add(deadline), } @@ -225,7 +219,6 @@ func InboundPullQuery( containerID ids.ID, requestedHeight uint64, nodeID ids.NodeID, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, @@ -236,7 +229,6 @@ func InboundPullQuery( Deadline: uint64(deadline), ContainerId: containerID[:], RequestedHeight: requestedHeight, - EngineType: engineType, }, expiration: time.Now().Add(deadline), } diff --git a/message/inbound_msg_builder_test.go b/message/inbound_msg_builder_test.go index 37f713a387bf..09269d1e2ad0 100644 --- a/message/inbound_msg_builder_test.go +++ b/message/inbound_msg_builder_test.go @@ -45,7 +45,6 @@ func TestInboundMsgBuilder(t *testing.T) { acceptedContainerID = ids.GenerateTestID() summaryIDs = []ids.ID{ids.GenerateTestID(), ids.GenerateTestID()} heights = []uint64{1000, 2000} - engineType = p2p.EngineType_ENGINE_TYPE_SNOWMAN ) t.Run( @@ -162,7 +161,6 @@ func TestInboundMsgBuilder(t *testing.T) { requestID, deadline, nodeID, - engineType, ) end := time.Now() @@ -174,7 +172,6 @@ func TestInboundMsgBuilder(t *testing.T) { innerMsg := msg.Message().(*p2p.GetAcceptedFrontier) require.Equal(chainID[:], innerMsg.ChainId) require.Equal(requestID, innerMsg.RequestId) - require.Equal(engineType, innerMsg.EngineType) }, ) @@ -213,7 +210,6 @@ func TestInboundMsgBuilder(t *testing.T) { deadline, containerIDs, nodeID, - engineType, ) end := time.Now() @@ -225,7 +221,6 @@ func TestInboundMsgBuilder(t *testing.T) { innerMsg := msg.Message().(*p2p.GetAccepted) require.Equal(chainID[:], innerMsg.ChainId) require.Equal(requestID, innerMsg.RequestId) - require.Equal(engineType, innerMsg.EngineType) }, ) @@ -270,7 +265,6 @@ func TestInboundMsgBuilder(t *testing.T) { container, requestedHeight, nodeID, - engineType, ) end := time.Now() @@ -284,7 +278,6 @@ func TestInboundMsgBuilder(t *testing.T) { require.Equal(requestID, innerMsg.RequestId) require.Equal(container, innerMsg.Container) require.Equal(requestedHeight, innerMsg.RequestedHeight) - require.Equal(engineType, innerMsg.EngineType) }, ) @@ -301,7 +294,6 @@ func TestInboundMsgBuilder(t *testing.T) { containerIDs[0], requestedHeight, nodeID, - engineType, ) end := time.Now() @@ -315,7 +307,6 @@ func TestInboundMsgBuilder(t *testing.T) { require.Equal(requestID, innerMsg.RequestId) require.Equal(containerIDs[0][:], innerMsg.ContainerId) require.Equal(requestedHeight, innerMsg.RequestedHeight) - require.Equal(engineType, innerMsg.EngineType) }, ) diff --git a/message/internal_msg_builder.go b/message/internal_msg_builder.go index 38a95cb78a8c..141dabaae414 100644 --- a/message/internal_msg_builder.go +++ b/message/internal_msg_builder.go @@ -27,30 +27,26 @@ var ( _ chainIDGetter = (*GetAcceptedStateSummaryFailed)(nil) _ requestIDGetter = (*GetAcceptedStateSummaryFailed)(nil) - _ fmt.Stringer = (*GetAcceptedFrontierFailed)(nil) - _ chainIDGetter = (*GetAcceptedFrontierFailed)(nil) - _ requestIDGetter = (*GetAcceptedFrontierFailed)(nil) - _ engineTypeGetter = (*GetAcceptedFrontierFailed)(nil) + _ fmt.Stringer = (*GetAcceptedFrontierFailed)(nil) + _ chainIDGetter = (*GetAcceptedFrontierFailed)(nil) + _ requestIDGetter = (*GetAcceptedFrontierFailed)(nil) - _ fmt.Stringer = (*GetAcceptedFailed)(nil) - _ chainIDGetter = (*GetAcceptedFailed)(nil) - _ requestIDGetter = (*GetAcceptedFailed)(nil) - _ engineTypeGetter = (*GetAcceptedFailed)(nil) + _ fmt.Stringer = (*GetAcceptedFailed)(nil) + _ chainIDGetter = (*GetAcceptedFailed)(nil) + _ requestIDGetter = (*GetAcceptedFailed)(nil) _ fmt.Stringer = (*GetAncestorsFailed)(nil) _ chainIDGetter = (*GetAncestorsFailed)(nil) _ requestIDGetter = (*GetAncestorsFailed)(nil) _ engineTypeGetter = (*GetAncestorsFailed)(nil) - _ fmt.Stringer = (*GetFailed)(nil) - _ chainIDGetter = (*GetFailed)(nil) - _ requestIDGetter = (*GetFailed)(nil) - _ engineTypeGetter = (*GetFailed)(nil) + _ fmt.Stringer = (*GetFailed)(nil) + _ chainIDGetter = (*GetFailed)(nil) + _ requestIDGetter = (*GetFailed)(nil) - _ fmt.Stringer = (*QueryFailed)(nil) - _ chainIDGetter = (*QueryFailed)(nil) - _ requestIDGetter = (*QueryFailed)(nil) - _ engineTypeGetter = (*QueryFailed)(nil) + _ fmt.Stringer = (*QueryFailed)(nil) + _ chainIDGetter = (*QueryFailed)(nil) + _ requestIDGetter = (*QueryFailed)(nil) _ fmt.Stringer = (*CrossChainAppRequest)(nil) _ sourceChainIDGetter = (*CrossChainAppRequest)(nil) @@ -147,15 +143,14 @@ func InternalGetAcceptedStateSummaryFailed( } type GetAcceptedFrontierFailed struct { - ChainID ids.ID `json:"chain_id,omitempty"` - RequestID uint32 `json:"request_id,omitempty"` - EngineType p2p.EngineType `json:"engine_type,omitempty"` + ChainID ids.ID `json:"chain_id,omitempty"` + RequestID uint32 `json:"request_id,omitempty"` } func (m *GetAcceptedFrontierFailed) String() string { return fmt.Sprintf( - "ChainID: %s RequestID: %d EngineType: %s", - m.ChainID, m.RequestID, m.EngineType, + "ChainID: %s RequestID: %d", + m.ChainID, m.RequestID, ) } @@ -167,38 +162,31 @@ func (m *GetAcceptedFrontierFailed) GetRequestId() uint32 { return m.RequestID } -func (m *GetAcceptedFrontierFailed) GetEngineType() p2p.EngineType { - return m.EngineType -} - func InternalGetAcceptedFrontierFailed( nodeID ids.NodeID, chainID ids.ID, requestID uint32, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, op: GetAcceptedFrontierFailedOp, message: &GetAcceptedFrontierFailed{ - ChainID: chainID, - RequestID: requestID, - EngineType: engineType, + ChainID: chainID, + RequestID: requestID, }, expiration: mockable.MaxTime, } } type GetAcceptedFailed struct { - ChainID ids.ID `json:"chain_id,omitempty"` - RequestID uint32 `json:"request_id,omitempty"` - EngineType p2p.EngineType `json:"engine_type,omitempty"` + ChainID ids.ID `json:"chain_id,omitempty"` + RequestID uint32 `json:"request_id,omitempty"` } func (m *GetAcceptedFailed) String() string { return fmt.Sprintf( - "ChainID: %s RequestID: %d EngineType: %s", - m.ChainID, m.RequestID, m.EngineType, + "ChainID: %s RequestID: %d", + m.ChainID, m.RequestID, ) } @@ -210,23 +198,17 @@ func (m *GetAcceptedFailed) GetRequestId() uint32 { return m.RequestID } -func (m *GetAcceptedFailed) GetEngineType() p2p.EngineType { - return m.EngineType -} - func InternalGetAcceptedFailed( nodeID ids.NodeID, chainID ids.ID, requestID uint32, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, op: GetAcceptedFailedOp, message: &GetAcceptedFailed{ - ChainID: chainID, - RequestID: requestID, - EngineType: engineType, + ChainID: chainID, + RequestID: requestID, }, expiration: mockable.MaxTime, } @@ -276,15 +258,14 @@ func InternalGetAncestorsFailed( } type GetFailed struct { - ChainID ids.ID `json:"chain_id,omitempty"` - RequestID uint32 `json:"request_id,omitempty"` - EngineType p2p.EngineType `json:"engine_type,omitempty"` + ChainID ids.ID `json:"chain_id,omitempty"` + RequestID uint32 `json:"request_id,omitempty"` } func (m *GetFailed) String() string { return fmt.Sprintf( - "ChainID: %s RequestID: %d EngineType: %s", - m.ChainID, m.RequestID, m.EngineType, + "ChainID: %s RequestID: %d", + m.ChainID, m.RequestID, ) } @@ -296,38 +277,31 @@ func (m *GetFailed) GetRequestId() uint32 { return m.RequestID } -func (m *GetFailed) GetEngineType() p2p.EngineType { - return m.EngineType -} - func InternalGetFailed( nodeID ids.NodeID, chainID ids.ID, requestID uint32, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, op: GetFailedOp, message: &GetFailed{ - ChainID: chainID, - RequestID: requestID, - EngineType: engineType, + ChainID: chainID, + RequestID: requestID, }, expiration: mockable.MaxTime, } } type QueryFailed struct { - ChainID ids.ID `json:"chain_id,omitempty"` - RequestID uint32 `json:"request_id,omitempty"` - EngineType p2p.EngineType `json:"engine_type,omitempty"` + ChainID ids.ID `json:"chain_id,omitempty"` + RequestID uint32 `json:"request_id,omitempty"` } func (m *QueryFailed) String() string { return fmt.Sprintf( - "ChainID: %s RequestID: %d EngineType: %s", - m.ChainID, m.RequestID, m.EngineType, + "ChainID: %s RequestID: %d", + m.ChainID, m.RequestID, ) } @@ -339,23 +313,17 @@ func (m *QueryFailed) GetRequestId() uint32 { return m.RequestID } -func (m *QueryFailed) GetEngineType() p2p.EngineType { - return m.EngineType -} - func InternalQueryFailed( nodeID ids.NodeID, chainID ids.ID, requestID uint32, - engineType p2p.EngineType, ) InboundMessage { return &inboundMessage{ nodeID: nodeID, op: QueryFailedOp, message: &QueryFailed{ - ChainID: chainID, - RequestID: requestID, - EngineType: engineType, + ChainID: chainID, + RequestID: requestID, }, expiration: mockable.MaxTime, } diff --git a/message/messages_test.go b/message/messages_test.go index ea2a41e160f7..d469d636e934 100644 --- a/message/messages_test.go +++ b/message/messages_test.go @@ -338,10 +338,9 @@ func TestMessage(t *testing.T) { msg: &p2p.Message{ Message: &p2p.Message_GetAcceptedFrontier{ GetAcceptedFrontier: &p2p.GetAcceptedFrontier{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, + ChainId: testID[:], + RequestId: 1, + Deadline: 1, }, }, }, @@ -375,7 +374,6 @@ func TestMessage(t *testing.T) { RequestId: 1, Deadline: 1, ContainerIds: [][]byte{testID[:], testID[:]}, - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, }, }, }, @@ -459,7 +457,6 @@ func TestMessage(t *testing.T) { RequestId: 1, Deadline: 1, ContainerId: testID[:], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, }, }, }, @@ -473,10 +470,9 @@ func TestMessage(t *testing.T) { msg: &p2p.Message{ Message: &p2p.Message_Put{ Put: &p2p.Put{ - ChainId: testID[:], - RequestId: 1, - Container: []byte{0}, - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, + ChainId: testID[:], + RequestId: 1, + Container: []byte{0}, }, }, }, @@ -490,10 +486,9 @@ func TestMessage(t *testing.T) { msg: &p2p.Message{ Message: &p2p.Message_Put{ Put: &p2p.Put{ - ChainId: testID[:], - RequestId: 1, - Container: compressibleContainers[0], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, + ChainId: testID[:], + RequestId: 1, + Container: compressibleContainers[0], }, }, }, @@ -507,11 +502,10 @@ func TestMessage(t *testing.T) { msg: &p2p.Message{ Message: &p2p.Message_PushQuery{ PushQuery: &p2p.PushQuery{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - Container: []byte{0}, - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, + ChainId: testID[:], + RequestId: 1, + Deadline: 1, + Container: []byte{0}, }, }, }, @@ -525,11 +519,10 @@ func TestMessage(t *testing.T) { msg: &p2p.Message{ Message: &p2p.Message_PushQuery{ PushQuery: &p2p.PushQuery{ - ChainId: testID[:], - RequestId: 1, - Deadline: 1, - Container: compressibleContainers[0], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, + ChainId: testID[:], + RequestId: 1, + Deadline: 1, + Container: compressibleContainers[0], }, }, }, @@ -547,7 +540,6 @@ func TestMessage(t *testing.T) { RequestId: 1, Deadline: 1, ContainerId: testID[:], - EngineType: p2p.EngineType_ENGINE_TYPE_AVALANCHE, }, }, }, diff --git a/message/mock_outbound_message_builder.go b/message/mock_outbound_message_builder.go index 1e7a52265a62..3d8dbba6594c 100644 --- a/message/mock_outbound_message_builder.go +++ b/message/mock_outbound_message_builder.go @@ -178,48 +178,48 @@ func (mr *MockOutboundMsgBuilderMockRecorder) Chits(arg0, arg1, arg2, arg3, arg4 } // Get mocks base method. -func (m *MockOutboundMsgBuilder) Get(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID, arg4 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) Get(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // Get indicates an expected call of Get. -func (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Get(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Get), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Get), arg0, arg1, arg2, arg3) } // GetAccepted mocks base method. -func (m *MockOutboundMsgBuilder) GetAccepted(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []ids.ID, arg4 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) GetAccepted(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []ids.ID) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAccepted", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "GetAccepted", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // GetAccepted indicates an expected call of GetAccepted. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAccepted(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccepted", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAccepted), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccepted", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAccepted), arg0, arg1, arg2, arg3) } // GetAcceptedFrontier mocks base method. -func (m *MockOutboundMsgBuilder) GetAcceptedFrontier(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) GetAcceptedFrontier(arg0 ids.ID, arg1 uint32, arg2 time.Duration) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAcceptedFrontier", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "GetAcceptedFrontier", arg0, arg1, arg2) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // GetAcceptedFrontier indicates an expected call of GetAcceptedFrontier. -func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) GetAcceptedFrontier(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAcceptedFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAcceptedFrontier), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAcceptedFrontier", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).GetAcceptedFrontier), arg0, arg1, arg2) } // GetAcceptedStateSummary mocks base method. @@ -343,48 +343,48 @@ func (mr *MockOutboundMsgBuilderMockRecorder) Pong(arg0, arg1 any) *gomock.Call } // PullQuery mocks base method. -func (m *MockOutboundMsgBuilder) PullQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID, arg4 uint64, arg5 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) PullQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 ids.ID, arg4 uint64) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PullQuery", arg0, arg1, arg2, arg3, arg4, arg5) + ret := m.ctrl.Call(m, "PullQuery", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // PullQuery indicates an expected call of PullQuery. -func (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) PullQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PullQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PullQuery), arg0, arg1, arg2, arg3, arg4, arg5) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PullQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PullQuery), arg0, arg1, arg2, arg3, arg4) } // PushQuery mocks base method. -func (m *MockOutboundMsgBuilder) PushQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []byte, arg4 uint64, arg5 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) PushQuery(arg0 ids.ID, arg1 uint32, arg2 time.Duration, arg3 []byte, arg4 uint64) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "PushQuery", arg0, arg1, arg2, arg3, arg4, arg5) + ret := m.ctrl.Call(m, "PushQuery", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // PushQuery indicates an expected call of PushQuery. -func (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) PushQuery(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PushQuery), arg0, arg1, arg2, arg3, arg4, arg5) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PushQuery", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).PushQuery), arg0, arg1, arg2, arg3, arg4) } // Put mocks base method. -func (m *MockOutboundMsgBuilder) Put(arg0 ids.ID, arg1 uint32, arg2 []byte, arg3 p2p.EngineType) (OutboundMessage, error) { +func (m *MockOutboundMsgBuilder) Put(arg0 ids.ID, arg1 uint32, arg2 []byte) (OutboundMessage, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Put", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "Put", arg0, arg1, arg2) ret0, _ := ret[0].(OutboundMessage) ret1, _ := ret[1].(error) return ret0, ret1 } // Put indicates an expected call of Put. -func (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockOutboundMsgBuilderMockRecorder) Put(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Put), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Put", reflect.TypeOf((*MockOutboundMsgBuilder)(nil).Put), arg0, arg1, arg2) } // StateSummaryFrontier mocks base method. diff --git a/message/outbound_msg_builder.go b/message/outbound_msg_builder.go index 3e5925c65ecc..8e5261f14775 100644 --- a/message/outbound_msg_builder.go +++ b/message/outbound_msg_builder.go @@ -85,7 +85,6 @@ type OutboundMsgBuilder interface { chainID ids.ID, requestID uint32, deadline time.Duration, - engineType p2p.EngineType, ) (OutboundMessage, error) AcceptedFrontier( @@ -99,7 +98,6 @@ type OutboundMsgBuilder interface { requestID uint32, deadline time.Duration, containerIDs []ids.ID, - engineType p2p.EngineType, ) (OutboundMessage, error) Accepted( @@ -127,14 +125,12 @@ type OutboundMsgBuilder interface { requestID uint32, deadline time.Duration, containerID ids.ID, - engineType p2p.EngineType, ) (OutboundMessage, error) Put( chainID ids.ID, requestID uint32, container []byte, - engineType p2p.EngineType, ) (OutboundMessage, error) PushQuery( @@ -143,7 +139,6 @@ type OutboundMsgBuilder interface { deadline time.Duration, container []byte, requestedHeight uint64, - engineType p2p.EngineType, ) (OutboundMessage, error) PullQuery( @@ -152,7 +147,6 @@ type OutboundMsgBuilder interface { deadline time.Duration, containerID ids.ID, requestedHeight uint64, - engineType p2p.EngineType, ) (OutboundMessage, error) Chits( @@ -424,16 +418,14 @@ func (b *outMsgBuilder) GetAcceptedFrontier( chainID ids.ID, requestID uint32, deadline time.Duration, - engineType p2p.EngineType, ) (OutboundMessage, error) { return b.builder.createOutbound( &p2p.Message{ Message: &p2p.Message_GetAcceptedFrontier{ GetAcceptedFrontier: &p2p.GetAcceptedFrontier{ - ChainId: chainID[:], - RequestId: requestID, - Deadline: uint64(deadline), - EngineType: engineType, + ChainId: chainID[:], + RequestId: requestID, + Deadline: uint64(deadline), }, }, }, @@ -467,7 +459,6 @@ func (b *outMsgBuilder) GetAccepted( requestID uint32, deadline time.Duration, containerIDs []ids.ID, - engineType p2p.EngineType, ) (OutboundMessage, error) { containerIDBytes := make([][]byte, len(containerIDs)) encodeIDs(containerIDs, containerIDBytes) @@ -479,7 +470,6 @@ func (b *outMsgBuilder) GetAccepted( RequestId: requestID, Deadline: uint64(deadline), ContainerIds: containerIDBytes, - EngineType: engineType, }, }, }, @@ -559,7 +549,6 @@ func (b *outMsgBuilder) Get( requestID uint32, deadline time.Duration, containerID ids.ID, - engineType p2p.EngineType, ) (OutboundMessage, error) { return b.builder.createOutbound( &p2p.Message{ @@ -569,7 +558,6 @@ func (b *outMsgBuilder) Get( RequestId: requestID, Deadline: uint64(deadline), ContainerId: containerID[:], - EngineType: engineType, }, }, }, @@ -582,16 +570,14 @@ func (b *outMsgBuilder) Put( chainID ids.ID, requestID uint32, container []byte, - engineType p2p.EngineType, ) (OutboundMessage, error) { return b.builder.createOutbound( &p2p.Message{ Message: &p2p.Message_Put{ Put: &p2p.Put{ - ChainId: chainID[:], - RequestId: requestID, - Container: container, - EngineType: engineType, + ChainId: chainID[:], + RequestId: requestID, + Container: container, }, }, }, @@ -606,7 +592,6 @@ func (b *outMsgBuilder) PushQuery( deadline time.Duration, container []byte, requestedHeight uint64, - engineType p2p.EngineType, ) (OutboundMessage, error) { return b.builder.createOutbound( &p2p.Message{ @@ -617,7 +602,6 @@ func (b *outMsgBuilder) PushQuery( Deadline: uint64(deadline), Container: container, RequestedHeight: requestedHeight, - EngineType: engineType, }, }, }, @@ -632,7 +616,6 @@ func (b *outMsgBuilder) PullQuery( deadline time.Duration, containerID ids.ID, requestedHeight uint64, - engineType p2p.EngineType, ) (OutboundMessage, error) { return b.builder.createOutbound( &p2p.Message{ @@ -643,7 +626,6 @@ func (b *outMsgBuilder) PullQuery( Deadline: uint64(deadline), ContainerId: containerID[:], RequestedHeight: requestedHeight, - EngineType: engineType, }, }, }, diff --git a/network/network_test.go b/network/network_test.go index fb70f2966b2e..4540ad198a5a 100644 --- a/network/network_test.go +++ b/network/network_test.go @@ -20,7 +20,6 @@ import ( "github.com/ava-labs/avalanchego/network/dialer" "github.com/ava-labs/avalanchego/network/peer" "github.com/ava-labs/avalanchego/network/throttling" - "github.com/ava-labs/avalanchego/proto/pb/p2p" "github.com/ava-labs/avalanchego/snow/engine/common" "github.com/ava-labs/avalanchego/snow/networking/router" "github.com/ava-labs/avalanchego/snow/networking/tracker" @@ -324,7 +323,7 @@ func TestSend(t *testing.T) { net0 := networks[0] mc := newMessageCreator(t) - outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty, p2p.EngineType_ENGINE_TYPE_SNOWMAN) + outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty) require.NoError(err) toSend := set.Of(nodeIDs[1]) @@ -369,7 +368,7 @@ func TestSendWithFilter(t *testing.T) { net0 := networks[0] mc := newMessageCreator(t) - outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty, p2p.EngineType_ENGINE_TYPE_SNOWMAN) + outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty) require.NoError(err) toSend := set.Of(nodeIDs...) diff --git a/network/peer/peer_test.go b/network/peer/peer_test.go index 45d2fc60a234..f57bd9531f90 100644 --- a/network/peer/peer_test.go +++ b/network/peer/peer_test.go @@ -256,7 +256,7 @@ func TestSend(t *testing.T) { peer0, peer1 := makeReadyTestPeers(t, set.Set[ids.ID]{}) mc := newMessageCreator(t) - outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty, p2p.EngineType_ENGINE_TYPE_SNOWMAN) + outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty) require.NoError(err) require.True(peer0.Send(context.Background(), outboundGetMsg)) @@ -749,7 +749,7 @@ func TestShouldDisconnect(t *testing.T) { func sendAndFlush(t *testing.T, sender *testPeer, receiver *testPeer) { t.Helper() mc := newMessageCreator(t) - outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty, p2p.EngineType_ENGINE_TYPE_SNOWMAN) + outboundGetMsg, err := mc.Get(ids.Empty, 1, time.Second, ids.Empty) require.NoError(t, err) require.True(t, sender.Send(context.Background(), outboundGetMsg)) inboundGetMsg := <-receiver.inboundMsgChan diff --git a/proto/p2p/p2p.proto b/proto/p2p/p2p.proto index 0cbfec212a7d..aa60c6db34de 100644 --- a/proto/p2p/p2p.proto +++ b/proto/p2p/p2p.proto @@ -231,14 +231,13 @@ enum EngineType { // // Peers should respond to GetAcceptedFrontier with AcceptedFrontier. message GetAcceptedFrontier { + reserved 4; // Chain being requested from bytes chain_id = 1; // Unique identifier for this request uint32 request_id = 2; // Timeout (ns) for this request uint64 deadline = 3; - // Consensus type the remote peer should use to handle this message - EngineType engine_type = 4; } // AcceptedFrontier contains the remote peer's last accepted frontier. @@ -258,6 +257,7 @@ message AcceptedFrontier { // // Peers should respond to GetAccepted with an Accepted message. message GetAccepted { + reserved 5; // Chain being requested from bytes chain_id = 1; // Unique identifier for this message @@ -266,8 +266,6 @@ message GetAccepted { uint64 deadline = 3; // The sender's accepted frontier repeated bytes container_ids = 4; - // Consensus type to handle this message - EngineType engine_type = 5; } // Accepted is sent in response to GetAccepted. The sending peer responds with @@ -316,6 +314,7 @@ message Ancestors { // // Remote peers should respond with a Put message if they have the container. message Get { + reserved 5; // Chain being requested from bytes chain_id = 1; // Unique identifier for this request @@ -324,8 +323,6 @@ message Get { uint64 deadline = 3; // Container being requested bytes container_id = 4; - // Consensus type to handle this message - EngineType engine_type = 5; } // Put is sent in response to Get with the requested block. @@ -336,14 +333,13 @@ message Put { uint32 request_id = 2; // Requested container bytes container = 3; - // Consensus type to handle this message - EngineType engine_type = 4; } // PushQuery requests the preferences of a remote peer given a container. // // Remote peers should respond to a PushQuery with a Chits message message PushQuery { + reserved 5; // Chain being requested from bytes chain_id = 1; // Unique identifier for this request @@ -352,8 +348,6 @@ message PushQuery { uint64 deadline = 3; // Container being gossiped bytes container = 4; - // Consensus type to handle this message - EngineType engine_type = 5; // Requesting peer's last accepted height uint64 requested_height = 6; } @@ -362,6 +356,7 @@ message PushQuery { // // Remote peers should respond to a PullQuery with a Chits message message PullQuery { + reserved 5; // Chain being requested from bytes chain_id = 1; // Unique identifier for this request @@ -370,8 +365,6 @@ message PullQuery { uint64 deadline = 3; // Container id being gossiped bytes container_id = 4; - // Consensus type to handle this message - EngineType engine_type = 5; // Requesting peer's last accepted height uint64 requested_height = 6; } diff --git a/proto/pb/p2p/p2p.pb.go b/proto/pb/p2p/p2p.pb.go index 70da9351128e..e3b1f5d86888 100644 --- a/proto/pb/p2p/p2p.pb.go +++ b/proto/pb/p2p/p2p.pb.go @@ -1445,8 +1445,6 @@ type GetAcceptedFrontier struct { RequestId uint32 `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Timeout (ns) for this request Deadline uint64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` - // Consensus type the remote peer should use to handle this message - EngineType EngineType `protobuf:"varint,4,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` } func (x *GetAcceptedFrontier) Reset() { @@ -1502,13 +1500,6 @@ func (x *GetAcceptedFrontier) GetDeadline() uint64 { return 0 } -func (x *GetAcceptedFrontier) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - // AcceptedFrontier contains the remote peer's last accepted frontier. // // AcceptedFrontier is sent in response to GetAcceptedFrontier. @@ -1595,8 +1586,6 @@ type GetAccepted struct { Deadline uint64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` // The sender's accepted frontier ContainerIds [][]byte `protobuf:"bytes,4,rep,name=container_ids,json=containerIds,proto3" json:"container_ids,omitempty"` - // Consensus type to handle this message - EngineType EngineType `protobuf:"varint,5,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` } func (x *GetAccepted) Reset() { @@ -1659,13 +1648,6 @@ func (x *GetAccepted) GetContainerIds() [][]byte { return nil } -func (x *GetAccepted) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - // Accepted is sent in response to GetAccepted. The sending peer responds with // a subset of container ids from the GetAccepted request that the sending peer // has accepted. @@ -1909,8 +1891,6 @@ type Get struct { Deadline uint64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` // Container being requested ContainerId []byte `protobuf:"bytes,4,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Consensus type to handle this message - EngineType EngineType `protobuf:"varint,5,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` } func (x *Get) Reset() { @@ -1973,13 +1953,6 @@ func (x *Get) GetContainerId() []byte { return nil } -func (x *Get) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - // Put is sent in response to Get with the requested block. type Put struct { state protoimpl.MessageState @@ -1992,8 +1965,6 @@ type Put struct { RequestId uint32 `protobuf:"varint,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // Requested container Container []byte `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"` - // Consensus type to handle this message - EngineType EngineType `protobuf:"varint,4,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` } func (x *Put) Reset() { @@ -2049,13 +2020,6 @@ func (x *Put) GetContainer() []byte { return nil } -func (x *Put) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - // PushQuery requests the preferences of a remote peer given a container. // // Remote peers should respond to a PushQuery with a Chits message @@ -2072,8 +2036,6 @@ type PushQuery struct { Deadline uint64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` // Container being gossiped Container []byte `protobuf:"bytes,4,opt,name=container,proto3" json:"container,omitempty"` - // Consensus type to handle this message - EngineType EngineType `protobuf:"varint,5,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` // Requesting peer's last accepted height RequestedHeight uint64 `protobuf:"varint,6,opt,name=requested_height,json=requestedHeight,proto3" json:"requested_height,omitempty"` } @@ -2138,13 +2100,6 @@ func (x *PushQuery) GetContainer() []byte { return nil } -func (x *PushQuery) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - func (x *PushQuery) GetRequestedHeight() uint64 { if x != nil { return x.RequestedHeight @@ -2168,8 +2123,6 @@ type PullQuery struct { Deadline uint64 `protobuf:"varint,3,opt,name=deadline,proto3" json:"deadline,omitempty"` // Container id being gossiped ContainerId []byte `protobuf:"bytes,4,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - // Consensus type to handle this message - EngineType EngineType `protobuf:"varint,5,opt,name=engine_type,json=engineType,proto3,enum=p2p.EngineType" json:"engine_type,omitempty"` // Requesting peer's last accepted height RequestedHeight uint64 `protobuf:"varint,6,opt,name=requested_height,json=requestedHeight,proto3" json:"requested_height,omitempty"` } @@ -2234,13 +2187,6 @@ func (x *PullQuery) GetContainerId() []byte { return nil } -func (x *PullQuery) GetEngineType() EngineType { - if x != nil { - return x.EngineType - } - return EngineType_ENGINE_TYPE_UNSPECIFIED -} - func (x *PullQuery) GetRequestedHeight() uint64 { if x != nil { return x.RequestedHeight @@ -2808,44 +2754,82 @@ var file_p2p_p2p_proto_rawDesc = []byte{ 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x0a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x49, 0x64, 0x73, 0x22, 0x9d, 0x01, 0x0a, - 0x13, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, - 0x74, 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, - 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, - 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, - 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x6f, 0x0a, 0x10, - 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x69, 0x65, 0x72, + 0x52, 0x0a, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x49, 0x64, 0x73, 0x22, 0x71, 0x0a, 0x13, + 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, + 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, + 0x6f, 0x0a, 0x10, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x46, 0x72, 0x6f, 0x6e, 0x74, + 0x69, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, + 0x22, 0x8e, 0x01, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x22, 0xba, 0x01, - 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, + 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, + 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x4a, 0x04, 0x08, 0x05, 0x10, + 0x06, 0x22, 0x69, 0x0a, 0x08, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xb9, 0x01, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, - 0x69, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, - 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, - 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, - 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x69, 0x0a, 0x08, 0x41, 0x63, - 0x63, 0x65, 0x70, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, - 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, - 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x41, 0x6e, 0x63, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, + 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, + 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, + 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x65, 0x0a, 0x09, 0x41, 0x6e, 0x63, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, + 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, + 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, + 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, + 0x84, 0x01, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, + 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, + 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, + 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x5d, 0x0a, 0x03, 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, + 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0xb0, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, + 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, + 0x68, 0x74, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xb5, 0x01, 0x0a, 0x09, 0x50, 0x75, 0x6c, + 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, @@ -2853,64 +2837,9 @@ var file_p2p_p2p_proto_rawDesc = []byte{ 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x65, 0x0a, 0x09, 0x41, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x19, - 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x0a, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x73, 0x22, 0xb0, 0x01, 0x0a, 0x03, 0x47, 0x65, 0x74, - 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, - 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, - 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, - 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, - 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x03, - 0x50, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, - 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, - 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x30, 0x0a, 0x0b, 0x65, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0xdc, 0x01, - 0x0a, 0x09, 0x50, 0x75, 0x73, 0x68, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, - 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0xe1, 0x01, 0x0a, - 0x09, 0x50, 0x75, 0x6c, 0x6c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x64, 0x65, 0x61, 0x64, 0x6c, 0x69, 0x6e, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x30, 0x0a, 0x0b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0f, 0x2e, 0x70, 0x32, 0x70, 0x2e, 0x45, - 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, 0x65, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, + 0x29, 0x0a, 0x10, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, + 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0f, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x65, 0x64, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0xba, 0x01, 0x0a, 0x05, 0x43, 0x68, 0x69, 0x74, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, @@ -3039,18 +2968,12 @@ var file_p2p_p2p_proto_depIdxs = []int32{ 7, // 27: p2p.Handshake.known_peers:type_name -> p2p.BloomFilter 7, // 28: p2p.GetPeerList.known_peers:type_name -> p2p.BloomFilter 8, // 29: p2p.PeerList.claimed_ip_ports:type_name -> p2p.ClaimedIpPort - 0, // 30: p2p.GetAcceptedFrontier.engine_type:type_name -> p2p.EngineType - 0, // 31: p2p.GetAccepted.engine_type:type_name -> p2p.EngineType - 0, // 32: p2p.GetAncestors.engine_type:type_name -> p2p.EngineType - 0, // 33: p2p.Get.engine_type:type_name -> p2p.EngineType - 0, // 34: p2p.Put.engine_type:type_name -> p2p.EngineType - 0, // 35: p2p.PushQuery.engine_type:type_name -> p2p.EngineType - 0, // 36: p2p.PullQuery.engine_type:type_name -> p2p.EngineType - 37, // [37:37] is the sub-list for method output_type - 37, // [37:37] is the sub-list for method input_type - 37, // [37:37] is the sub-list for extension type_name - 37, // [37:37] is the sub-list for extension extendee - 0, // [0:37] is the sub-list for field type_name + 0, // 30: p2p.GetAncestors.engine_type:type_name -> p2p.EngineType + 31, // [31:31] is the sub-list for method output_type + 31, // [31:31] is the sub-list for method input_type + 31, // [31:31] is the sub-list for extension type_name + 31, // [31:31] is the sub-list for extension extendee + 0, // [0:31] is the sub-list for field type_name } func init() { file_p2p_p2p_proto_init() } diff --git a/snow/engine/avalanche/getter/getter.go b/snow/engine/avalanche/getter/getter.go index a8e35fddfd64..796cade92fac 100644 --- a/snow/engine/avalanche/getter/getter.go +++ b/snow/engine/avalanche/getter/getter.go @@ -82,27 +82,23 @@ func (gh *getter) GetAcceptedStateSummary(_ context.Context, nodeID ids.NodeID, return nil } -// TODO: Remove support for GetAcceptedFrontier messages after v1.11.x is -// activated. -func (gh *getter) GetAcceptedFrontier(ctx context.Context, validatorID ids.NodeID, requestID uint32) error { - acceptedFrontier := gh.storage.Edge(ctx) - // Since all the DAGs are linearized, we only need to return the stop - // vertex. - if len(acceptedFrontier) > 0 { - gh.sender.SendAcceptedFrontier(ctx, validatorID, requestID, acceptedFrontier[0]) - } +func (gh *getter) GetAcceptedFrontier(_ context.Context, nodeID ids.NodeID, requestID uint32) error { + gh.log.Debug("dropping request", + zap.String("reason", "unhandled by this gear"), + zap.Stringer("messageOp", message.GetAcceptedFrontierOp), + zap.Stringer("nodeID", nodeID), + zap.Uint32("requestID", requestID), + ) return nil } -// TODO: Remove support for GetAccepted messages after v1.11.x is activated. -func (gh *getter) GetAccepted(ctx context.Context, nodeID ids.NodeID, requestID uint32, containerIDs set.Set[ids.ID]) error { - acceptedVtxIDs := make([]ids.ID, 0, containerIDs.Len()) - for vtxID := range containerIDs { - if vtx, err := gh.storage.GetVtx(ctx, vtxID); err == nil && vtx.Status() == choices.Accepted { - acceptedVtxIDs = append(acceptedVtxIDs, vtxID) - } - } - gh.sender.SendAccepted(ctx, nodeID, requestID, acceptedVtxIDs) +func (gh *getter) GetAccepted(_ context.Context, nodeID ids.NodeID, requestID uint32, _ set.Set[ids.ID]) error { + gh.log.Debug("dropping request", + zap.String("reason", "unhandled by this gear"), + zap.Stringer("messageOp", message.GetAcceptedOp), + zap.Stringer("nodeID", nodeID), + zap.Uint32("requestID", requestID), + ) return nil } @@ -158,10 +154,12 @@ func (gh *getter) GetAncestors(ctx context.Context, nodeID ids.NodeID, requestID return nil } -func (gh *getter) Get(ctx context.Context, nodeID ids.NodeID, requestID uint32, vtxID ids.ID) error { - // If this engine has access to the requested vertex, provide it - if vtx, err := gh.storage.GetVtx(ctx, vtxID); err == nil { - gh.sender.SendPut(ctx, nodeID, requestID, vtx.Bytes()) - } +func (gh *getter) Get(_ context.Context, nodeID ids.NodeID, requestID uint32, _ ids.ID) error { + gh.log.Debug("dropping request", + zap.String("reason", "unhandled by this gear"), + zap.Stringer("messageOp", message.GetOp), + zap.Stringer("nodeID", nodeID), + zap.Uint32("requestID", requestID), + ) return nil } diff --git a/snow/engine/avalanche/getter/getter_test.go b/snow/engine/avalanche/getter/getter_test.go deleted file mode 100644 index c052d0bc3a83..000000000000 --- a/snow/engine/avalanche/getter/getter_test.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (C) 2019-2024, Ava Labs, Inc. All rights reserved. -// See the file LICENSE for licensing terms. - -package getter - -import ( - "context" - "errors" - "testing" - "time" - - "github.com/prometheus/client_golang/prometheus" - "github.com/stretchr/testify/require" - - "github.com/ava-labs/avalanchego/ids" - "github.com/ava-labs/avalanchego/snow/choices" - "github.com/ava-labs/avalanchego/snow/consensus/avalanche" - "github.com/ava-labs/avalanchego/snow/engine/avalanche/vertex" - "github.com/ava-labs/avalanchego/snow/engine/common" - "github.com/ava-labs/avalanchego/utils/logging" - "github.com/ava-labs/avalanchego/utils/set" -) - -var errUnknownVertex = errors.New("unknown vertex") - -func newTest(t *testing.T) (common.AllGetsServer, *vertex.TestManager, *common.SenderTest) { - manager := vertex.NewTestManager(t) - manager.Default(true) - - sender := &common.SenderTest{ - T: t, - } - sender.Default(true) - - bs, err := New( - manager, - sender, - logging.NoLog{}, - time.Second, - 2000, - prometheus.NewRegistry(), - ) - require.NoError(t, err) - - return bs, manager, sender -} - -func TestAcceptedFrontier(t *testing.T) { - require := require.New(t) - bs, manager, sender := newTest(t) - - vtxID := ids.GenerateTestID() - manager.EdgeF = func(context.Context) []ids.ID { - return []ids.ID{ - vtxID, - } - } - - var accepted ids.ID - sender.SendAcceptedFrontierF = func(_ context.Context, _ ids.NodeID, _ uint32, containerID ids.ID) { - accepted = containerID - } - require.NoError(bs.GetAcceptedFrontier(context.Background(), ids.EmptyNodeID, 0)) - require.Equal(vtxID, accepted) -} - -func TestFilterAccepted(t *testing.T) { - require := require.New(t) - bs, manager, sender := newTest(t) - - vtxID0 := ids.GenerateTestID() - vtxID1 := ids.GenerateTestID() - vtxID2 := ids.GenerateTestID() - - vtx0 := &avalanche.TestVertex{TestDecidable: choices.TestDecidable{ - IDV: vtxID0, - StatusV: choices.Accepted, - }} - vtx1 := &avalanche.TestVertex{TestDecidable: choices.TestDecidable{ - IDV: vtxID1, - StatusV: choices.Accepted, - }} - - manager.GetVtxF = func(_ context.Context, vtxID ids.ID) (avalanche.Vertex, error) { - switch vtxID { - case vtxID0: - return vtx0, nil - case vtxID1: - return vtx1, nil - case vtxID2: - return nil, errUnknownVertex - } - require.FailNow(errUnknownVertex.Error()) - return nil, errUnknownVertex - } - - var accepted []ids.ID - sender.SendAcceptedF = func(_ context.Context, _ ids.NodeID, _ uint32, frontier []ids.ID) { - accepted = frontier - } - - vtxIDs := set.Of(vtxID0, vtxID1, vtxID2) - require.NoError(bs.GetAccepted(context.Background(), ids.EmptyNodeID, 0, vtxIDs)) - - require.Contains(accepted, vtxID0) - require.Contains(accepted, vtxID1) - require.NotContains(accepted, vtxID2) -} diff --git a/snow/networking/handler/handler_test.go b/snow/networking/handler/handler_test.go index dbf378c0d366..71809bd953f6 100644 --- a/snow/networking/handler/handler_test.go +++ b/snow/networking/handler/handler_test.go @@ -101,8 +101,8 @@ func TestHandlerDropsTimedOutMessages(t *testing.T) { reqID := uint32(1) chainID := ids.ID{} msg := Message{ - InboundMessage: message.InboundGetAcceptedFrontier(chainID, reqID, 0*time.Second, nodeID, p2p.EngineType_ENGINE_TYPE_SNOWMAN), - EngineType: p2p.EngineType_ENGINE_TYPE_SNOWMAN, + InboundMessage: message.InboundGetAcceptedFrontier(chainID, reqID, 0*time.Second, nodeID), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } handler.Push(context.Background(), msg) @@ -111,8 +111,8 @@ func TestHandlerDropsTimedOutMessages(t *testing.T) { reqID++ msg = Message{ - InboundMessage: message.InboundGetAccepted(chainID, reqID, 1*time.Second, nil, nodeID, p2p.EngineType_ENGINE_TYPE_SNOWMAN), - EngineType: p2p.EngineType_ENGINE_TYPE_SNOWMAN, + InboundMessage: message.InboundGetAccepted(chainID, reqID, 1*time.Second, nil, nodeID), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } handler.Push(context.Background(), msg) @@ -210,7 +210,7 @@ func TestHandlerClosesOnError(t *testing.T) { reqID := uint32(1) deadline := time.Nanosecond msg := Message{ - InboundMessage: message.InboundGetAcceptedFrontier(ids.ID{}, reqID, deadline, nodeID, 0), + InboundMessage: message.InboundGetAcceptedFrontier(ids.ID{}, reqID, deadline, nodeID), EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } handler.Push(context.Background(), msg) @@ -288,8 +288,8 @@ func TestHandlerDropsGossipDuringBootstrapping(t *testing.T) { chainID := ids.Empty reqID := uint32(1) inInboundMessage := Message{ - InboundMessage: message.InternalGetFailed(nodeID, chainID, reqID, p2p.EngineType_ENGINE_TYPE_SNOWMAN), - EngineType: p2p.EngineType_ENGINE_TYPE_SNOWMAN, + InboundMessage: message.InternalGetFailed(nodeID, chainID, reqID), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } handler.Push(context.Background(), inInboundMessage) diff --git a/snow/networking/handler/message_queue_test.go b/snow/networking/handler/message_queue_test.go index 69fbaf531d32..72da75f2d857 100644 --- a/snow/networking/handler/message_queue_test.go +++ b/snow/networking/handler/message_queue_test.go @@ -19,8 +19,6 @@ import ( "github.com/ava-labs/avalanchego/snow/validators" ) -const engineType = p2p.EngineType_ENGINE_TYPE_SNOWMAN - func TestQueue(t *testing.T) { ctrl := gomock.NewController(t) require := require.New(t) @@ -45,9 +43,8 @@ func TestQueue(t *testing.T) { ids.GenerateTestID(), 0, vdr1ID, - engineType, ), - EngineType: engineType, + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } // Push then pop should work regardless of usage when there are no other @@ -105,9 +102,8 @@ func TestQueue(t *testing.T) { ids.GenerateTestID(), 0, vdr2ID, - engineType, ), - EngineType: engineType, + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } // Push msg2 from vdr2ID @@ -132,12 +128,12 @@ func TestQueue(t *testing.T) { // Non-validators should be able to put messages onto [u] nonVdrNodeID1, nonVdrNodeID2 := ids.GenerateTestNodeID(), ids.GenerateTestNodeID() msg3 := Message{ - InboundMessage: message.InboundPullQuery(ids.Empty, 0, 0, ids.Empty, 0, nonVdrNodeID1, engineType), - EngineType: engineType, + InboundMessage: message.InboundPullQuery(ids.Empty, 0, 0, ids.Empty, 0, nonVdrNodeID1), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } msg4 := Message{ - InboundMessage: message.InboundPushQuery(ids.Empty, 0, 0, nil, 0, nonVdrNodeID2, engineType), - EngineType: engineType, + InboundMessage: message.InboundPushQuery(ids.Empty, 0, 0, nil, 0, nonVdrNodeID2), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } u.Push(context.Background(), msg3) u.Push(context.Background(), msg4) diff --git a/snow/networking/router/chain_router_test.go b/snow/networking/router/chain_router_test.go index e9617d7ae687..43ccfa09dbf3 100644 --- a/snow/networking/router/chain_router_test.go +++ b/snow/networking/router/chain_router_test.go @@ -304,8 +304,8 @@ func TestShutdownTimesOut(t *testing.T) { go func() { chainID := ids.ID{} msg := handler.Message{ - InboundMessage: message.InboundPullQuery(chainID, 1, time.Hour, ids.GenerateTestID(), 0, nodeID, engineType), - EngineType: engineType, + InboundMessage: message.InboundPullQuery(chainID, 1, time.Hour, ids.GenerateTestID(), 0, nodeID), + EngineType: p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, } h.Push(context.Background(), msg) @@ -541,7 +541,6 @@ func TestRouterTimeout(t *testing.T) { nodeID, ctx.ChainID, requestID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ), p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) @@ -561,7 +560,6 @@ func TestRouterTimeout(t *testing.T) { nodeID, ctx.ChainID, requestID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ), p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) @@ -601,7 +599,6 @@ func TestRouterTimeout(t *testing.T) { nodeID, ctx.ChainID, requestID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ), p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) @@ -621,7 +618,6 @@ func TestRouterTimeout(t *testing.T) { nodeID, ctx.ChainID, requestID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ), p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) @@ -799,8 +795,6 @@ func TestRouterHonorsRequestedEngine(t *testing.T) { } { - engineType := p2p.EngineType(100) - requestID++ msg := message.InboundPushQuery( ctx.ChainID, @@ -809,11 +803,10 @@ func TestRouterHonorsRequestedEngine(t *testing.T) { nil, 0, nodeID, - engineType, ) h.EXPECT().Push(gomock.Any(), gomock.Any()).Do(func(_ context.Context, msg handler.Message) { - require.Equal(engineType, msg.EngineType) + require.Equal(p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, msg.EngineType) }) chainRouter.HandleInbound(context.Background(), msg) } @@ -846,19 +839,19 @@ func TestRouterClearTimeouts(t *testing.T) { name: "AcceptedFrontierOp", responseOp: message.AcceptedFrontierOp, responseMsg: message.InboundAcceptedFrontier(ids.Empty, requestID, ids.GenerateTestID(), ids.EmptyNodeID), - timeoutMsg: message.InternalGetAcceptedFrontierFailed(ids.EmptyNodeID, ids.Empty, requestID, engineType), + timeoutMsg: message.InternalGetAcceptedFrontierFailed(ids.EmptyNodeID, ids.Empty, requestID), }, { name: "Accepted", responseOp: message.AcceptedOp, responseMsg: message.InboundAccepted(ids.Empty, requestID, []ids.ID{ids.GenerateTestID()}, ids.EmptyNodeID), - timeoutMsg: message.InternalGetAcceptedFailed(ids.EmptyNodeID, ids.Empty, requestID, engineType), + timeoutMsg: message.InternalGetAcceptedFailed(ids.EmptyNodeID, ids.Empty, requestID), }, { name: "Chits", responseOp: message.ChitsOp, responseMsg: message.InboundChits(ids.Empty, requestID, ids.GenerateTestID(), ids.GenerateTestID(), ids.GenerateTestID(), ids.EmptyNodeID), - timeoutMsg: message.InternalQueryFailed(ids.EmptyNodeID, ids.Empty, requestID, engineType), + timeoutMsg: message.InternalQueryFailed(ids.EmptyNodeID, ids.Empty, requestID), }, { name: "AppResponse", @@ -1037,7 +1030,6 @@ func TestValidatorOnlyMessageDrops(t *testing.T) { dummyContainerID, 0, nID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) chainRouter.HandleInbound(context.Background(), inMsg) @@ -1053,7 +1045,6 @@ func TestValidatorOnlyMessageDrops(t *testing.T) { dummyContainerID, 0, vID, - p2p.EngineType_ENGINE_TYPE_SNOWMAN, ) wg.Add(1) chainRouter.HandleInbound(context.Background(), inMsg) @@ -1305,7 +1296,6 @@ func TestValidatorOnlyAllowedNodeMessageDrops(t *testing.T) { dummyContainerID, 0, nID, - engineType, ) chainRouter.HandleInbound(context.Background(), inMsg) @@ -1321,7 +1311,6 @@ func TestValidatorOnlyAllowedNodeMessageDrops(t *testing.T) { dummyContainerID, 0, allowedID, - engineType, ) wg.Add(1) chainRouter.HandleInbound(context.Background(), inMsg) @@ -1339,7 +1328,6 @@ func TestValidatorOnlyAllowedNodeMessageDrops(t *testing.T) { dummyContainerID, 0, vID, - engineType, ) wg.Add(1) chainRouter.HandleInbound(context.Background(), inMsg) diff --git a/snow/networking/sender/sender.go b/snow/networking/sender/sender.go index b7fa9bd395d3..6bbf22a4ccfb 100644 --- a/snow/networking/sender/sender.go +++ b/snow/networking/sender/sender.go @@ -390,7 +390,6 @@ func (s *sender) SendGetAcceptedFrontier(ctx context.Context, nodeIDs set.Set[id nodeID, s.ctx.ChainID, requestID, - s.engineType, ) s.router.RegisterRequest( ctx, @@ -400,7 +399,7 @@ func (s *sender) SendGetAcceptedFrontier(ctx context.Context, nodeIDs set.Set[id requestID, message.AcceptedFrontierOp, inMsg, - s.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) } @@ -413,7 +412,6 @@ func (s *sender) SendGetAcceptedFrontier(ctx context.Context, nodeIDs set.Set[id requestID, deadline, s.ctx.NodeID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -423,7 +421,6 @@ func (s *sender) SendGetAcceptedFrontier(ctx context.Context, nodeIDs set.Set[id s.ctx.ChainID, requestID, deadline, - s.engineType, ) // Send the message over the network. @@ -529,7 +526,6 @@ func (s *sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID nodeID, s.ctx.ChainID, requestID, - s.engineType, ) s.router.RegisterRequest( ctx, @@ -539,7 +535,7 @@ func (s *sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID requestID, message.AcceptedOp, inMsg, - s.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) } @@ -553,7 +549,6 @@ func (s *sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID deadline, containerIDs, s.ctx.NodeID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -564,7 +559,6 @@ func (s *sender) SendGetAccepted(ctx context.Context, nodeIDs set.Set[ids.NodeID requestID, deadline, containerIDs, - s.engineType, ) // Send the message over the network. @@ -778,7 +772,6 @@ func (s *sender) SendGet(ctx context.Context, nodeID ids.NodeID, requestID uint3 nodeID, s.ctx.ChainID, requestID, - s.engineType, ) s.router.RegisterRequest( ctx, @@ -788,7 +781,7 @@ func (s *sender) SendGet(ctx context.Context, nodeID ids.NodeID, requestID uint3 requestID, message.PutOp, inMsg, - s.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) // Sending a Get to myself always fails. @@ -815,7 +808,6 @@ func (s *sender) SendGet(ctx context.Context, nodeID ids.NodeID, requestID uint3 requestID, deadline, containerID, - s.engineType, ) // Send the message over the network. @@ -857,7 +849,7 @@ func (s *sender) SendGet(ctx context.Context, nodeID ids.NodeID, requestID uint3 func (s *sender) SendPut(_ context.Context, nodeID ids.NodeID, requestID uint32, container []byte) { // Create the outbound message. - outMsg, err := s.msgCreator.Put(s.ctx.ChainID, requestID, container, s.engineType) + outMsg, err := s.msgCreator.Put(s.ctx.ChainID, requestID, container) if err != nil { s.ctx.Log.Error("failed to build message", zap.Stringer("messageOp", message.PutOp), @@ -918,7 +910,6 @@ func (s *sender) SendPushQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) s.router.RegisterRequest( ctx, @@ -928,7 +919,7 @@ func (s *sender) SendPushQuery( requestID, message.ChitsOp, inMsg, - s.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) } @@ -947,7 +938,6 @@ func (s *sender) SendPushQuery( container, requestedHeight, s.ctx.NodeID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -967,7 +957,6 @@ func (s *sender) SendPushQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -980,7 +969,6 @@ func (s *sender) SendPushQuery( deadline, container, requestedHeight, - s.engineType, ) // Send the message over the network. @@ -1033,7 +1021,6 @@ func (s *sender) SendPushQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -1059,7 +1046,6 @@ func (s *sender) SendPullQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) s.router.RegisterRequest( ctx, @@ -1069,7 +1055,7 @@ func (s *sender) SendPullQuery( requestID, message.ChitsOp, inMsg, - s.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) } @@ -1088,7 +1074,6 @@ func (s *sender) SendPullQuery( containerID, requestedHeight, s.ctx.NodeID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -1107,7 +1092,6 @@ func (s *sender) SendPullQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } @@ -1120,7 +1104,6 @@ func (s *sender) SendPullQuery( deadline, containerID, requestedHeight, - s.engineType, ) // Send the message over the network. @@ -1163,7 +1146,6 @@ func (s *sender) SendPullQuery( nodeID, s.ctx.ChainID, requestID, - s.engineType, ) go s.router.HandleInbound(ctx, inMsg) } diff --git a/snow/networking/sender/sender_test.go b/snow/networking/sender/sender_test.go index d48d347176df..f1ef03e4c5c2 100644 --- a/snow/networking/sender/sender_test.go +++ b/snow/networking/sender/sender_test.go @@ -605,7 +605,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { requestID = uint32(1337) heights = []uint64{1, 2, 3} containerIDs = []ids.ID{ids.GenerateTestID(), ids.GenerateTestID()} - engineType = p2p.EngineType_ENGINE_TYPE_SNOWMAN ) snowCtx := snowtest.Context(t, snowtest.PChainID) ctx := snowtest.ConsensusContext(snowCtx) @@ -618,7 +617,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { setMsgCreatorExpect func(msgCreator *message.MockOutboundMsgBuilder) setExternalSenderExpect func(externalSender *MockExternalSender) sendF func(require *require.Assertions, sender common.Sender, nodeIDs set.Set[ids.NodeID]) - engineType p2p.EngineType } tests := []test{ @@ -713,7 +711,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { nodeID, ctx.ChainID, requestID, - engineType, ) }, assertMsgToMyself: func(require *require.Assertions, msg message.InboundMessage) { @@ -722,7 +719,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { require.Equal(ctx.ChainID[:], innerMsg.ChainId) require.Equal(requestID, innerMsg.RequestId) require.Equal(uint64(deadline), innerMsg.Deadline) - require.Equal(engineType, innerMsg.EngineType) }, expectedResponseOp: message.AcceptedFrontierOp, setMsgCreatorExpect: func(msgCreator *message.MockOutboundMsgBuilder) { @@ -730,7 +726,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { ctx.ChainID, requestID, deadline, - engineType, ).Return(nil, nil) }, setExternalSenderExpect: func(externalSender *MockExternalSender) { @@ -747,7 +742,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { sendF: func(_ *require.Assertions, sender common.Sender, nodeIDs set.Set[ids.NodeID]) { sender.SendGetAcceptedFrontier(context.Background(), nodeIDs, requestID) }, - engineType: engineType, }, { name: "GetAccepted", @@ -756,7 +750,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { nodeID, ctx.ChainID, requestID, - engineType, ) }, assertMsgToMyself: func(require *require.Assertions, msg message.InboundMessage) { @@ -765,7 +758,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { require.Equal(ctx.ChainID[:], innerMsg.ChainId) require.Equal(requestID, innerMsg.RequestId) require.Equal(uint64(deadline), innerMsg.Deadline) - require.Equal(engineType, innerMsg.EngineType) }, expectedResponseOp: message.AcceptedOp, setMsgCreatorExpect: func(msgCreator *message.MockOutboundMsgBuilder) { @@ -774,7 +766,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { requestID, deadline, containerIDs, - engineType, ).Return(nil, nil) }, setExternalSenderExpect: func(externalSender *MockExternalSender) { @@ -791,7 +782,6 @@ func TestSender_Bootstrap_Requests(t *testing.T) { sendF: func(_ *require.Assertions, sender common.Sender, nodeIDs set.Set[ids.NodeID]) { sender.SendGetAccepted(context.Background(), nodeIDs, requestID, containerIDs) }, - engineType: engineType, }, } @@ -820,7 +810,7 @@ func TestSender_Bootstrap_Requests(t *testing.T) { externalSender, router, timeoutManager, - engineType, + p2p.EngineType_ENGINE_TYPE_SNOWMAN, subnets.New(ctx.NodeID, subnets.Config{}), ) require.NoError(err) @@ -839,7 +829,7 @@ func TestSender_Bootstrap_Requests(t *testing.T) { requestID, // Request ID tt.expectedResponseOp, // Operation expectedFailedMsg, // Failure Message - tt.engineType, + p2p.EngineType_ENGINE_TYPE_UNSPECIFIED, ) } @@ -877,7 +867,6 @@ func TestSender_Bootstrap_Responses(t *testing.T) { requestID = uint32(1337) summaryIDs = []ids.ID{ids.GenerateTestID(), ids.GenerateTestID()} summary = []byte{1, 2, 3} - engineType = p2p.EngineType_ENGINE_TYPE_AVALANCHE ) snowCtx := snowtest.Context(t, snowtest.PChainID) ctx := snowtest.ConsensusContext(snowCtx) @@ -1040,7 +1029,7 @@ func TestSender_Bootstrap_Responses(t *testing.T) { externalSender, router, timeoutManager, - engineType, + p2p.EngineType_ENGINE_TYPE_SNOWMAN, subnets.New(ctx.NodeID, subnets.Config{}), ) require.NoError(err) @@ -1095,6 +1084,7 @@ func TestSender_Single_Request(t *testing.T) { setMsgCreatorExpect func(msgCreator *message.MockOutboundMsgBuilder) setExternalSenderExpect func(externalSender *MockExternalSender, sentTo set.Set[ids.NodeID]) sendF func(require *require.Assertions, sender common.Sender, nodeID ids.NodeID) + expectedEngineType p2p.EngineType } tests := []test{ @@ -1138,6 +1128,7 @@ func TestSender_Single_Request(t *testing.T) { sendF: func(_ *require.Assertions, sender common.Sender, nodeID ids.NodeID) { sender.SendGetAncestors(context.Background(), nodeID, requestID, containerID) }, + expectedEngineType: engineType, }, { name: "Get", @@ -1146,7 +1137,6 @@ func TestSender_Single_Request(t *testing.T) { nodeID, ctx.ChainID, requestID, - engineType, ) }, assertMsgToMyself: func(require *require.Assertions, msg message.InboundMessage) { @@ -1154,7 +1144,6 @@ func TestSender_Single_Request(t *testing.T) { innerMsg := msg.Message().(*message.GetFailed) require.Equal(ctx.ChainID, innerMsg.ChainID) require.Equal(requestID, innerMsg.RequestID) - require.Equal(engineType, innerMsg.EngineType) }, expectedResponseOp: message.PutOp, setMsgCreatorExpect: func(msgCreator *message.MockOutboundMsgBuilder) { @@ -1163,7 +1152,6 @@ func TestSender_Single_Request(t *testing.T) { requestID, deadline, containerID, - engineType, ).Return(nil, nil) }, setExternalSenderExpect: func(externalSender *MockExternalSender, sentTo set.Set[ids.NodeID]) { @@ -1224,7 +1212,7 @@ func TestSender_Single_Request(t *testing.T) { requestID, // Request ID tt.expectedResponseOp, // Operation expectedFailedMsg, // Failure Message - engineType, // Engine Type + tt.expectedEngineType, // Engine Type ) // Note that HandleInbound is called in a separate goroutine @@ -1260,7 +1248,7 @@ func TestSender_Single_Request(t *testing.T) { requestID, // Request ID tt.expectedResponseOp, // Operation expectedFailedMsg, // Failure Message - engineType, // Engine Type + tt.expectedEngineType, // Engine Type ) // Note that HandleInbound is called in a separate goroutine @@ -1296,7 +1284,7 @@ func TestSender_Single_Request(t *testing.T) { requestID, // Request ID tt.expectedResponseOp, // Operation expectedFailedMsg, // Failure Message - engineType, // Engine Type + tt.expectedEngineType, // Engine Type ) // Note that HandleInbound is called in a separate goroutine