From 313c720ece0b1b79e626ab9d7746e1bb64cf50d4 Mon Sep 17 00:00:00 2001 From: Shoham Chakraborty Date: Thu, 5 Sep 2024 20:52:59 +0800 Subject: [PATCH] rpcdaemon: Split BorEvent gRPC into BorEvents and BorTxnLookup (#11877) - `BorEventResponse` was pulling double duty by being used for block number lookups as well as event lookups. - As a result, we were using `EventsByBlock` instead of `EventLookup` and interpreting the presence of the bor TX hash in `kv.BorTxLookup` by the absence of returned events. - This PR refactors the code so that remote calls to `EventLookup` use `BlockReader.EventLookup`, preventing any discrepancies between the two. - Naming has also been updated to be clearer. Depends on: https://github.com/erigontech/interfaces/pull/231 --- erigon-lib/direct/eth_backend_client.go | 13 +- erigon-lib/go.mod | 2 +- erigon-lib/go.sum | 4 +- .../gointerfaces/remoteproto/ethbackend.pb.go | 503 +++++++++++------- .../remoteproto/ethbackend_grpc.pb.go | 195 +++++-- erigon-lib/gointerfaces/remoteproto/kv.pb.go | 26 +- .../kv/remotedbserver/remotedbserver.go | 8 +- ethdb/privateapi/ethbackend.go | 33 +- .../snapshotsync/freezeblocks/block_reader.go | 13 +- 9 files changed, 524 insertions(+), 273 deletions(-) diff --git a/erigon-lib/direct/eth_backend_client.go b/erigon-lib/direct/eth_backend_client.go index 06b3d7c13a2..66005d47dba 100644 --- a/erigon-lib/direct/eth_backend_client.go +++ b/erigon-lib/direct/eth_backend_client.go @@ -20,10 +20,11 @@ import ( "context" "io" - remote "github.com/erigontech/erigon-lib/gointerfaces/remoteproto" - types "github.com/erigontech/erigon-lib/gointerfaces/typesproto" "google.golang.org/grpc" "google.golang.org/protobuf/types/known/emptypb" + + remote "github.com/erigontech/erigon-lib/gointerfaces/remoteproto" + types "github.com/erigontech/erigon-lib/gointerfaces/typesproto" ) type EthBackendClientDirect struct { @@ -227,6 +228,10 @@ func (s *EthBackendClientDirect) PendingBlock(ctx context.Context, in *emptypb.E return s.server.PendingBlock(ctx, in) } -func (s *EthBackendClientDirect) BorEvent(ctx context.Context, in *remote.BorEventRequest, opts ...grpc.CallOption) (*remote.BorEventReply, error) { - return s.server.BorEvent(ctx, in) +func (s *EthBackendClientDirect) BorTxnLookup(ctx context.Context, in *remote.BorTxnLookupRequest, opts ...grpc.CallOption) (*remote.BorTxnLookupReply, error) { + return s.server.BorTxnLookup(ctx, in) +} + +func (s *EthBackendClientDirect) BorEvents(ctx context.Context, in *remote.BorEventsRequest, opts ...grpc.CallOption) (*remote.BorEventsReply, error) { + return s.server.BorEvents(ctx, in) } diff --git a/erigon-lib/go.mod b/erigon-lib/go.mod index 92f2f7c1275..de2d0409769 100644 --- a/erigon-lib/go.mod +++ b/erigon-lib/go.mod @@ -4,7 +4,7 @@ go 1.21.5 require ( github.com/erigontech/erigon-snapshot v1.3.1-0.20240814160410-2ce37904b978 - github.com/erigontech/interfaces v0.0.0-20240819221809-43fdab2057da + github.com/erigontech/interfaces v0.0.0-20240905113027-2c1accea17aa github.com/erigontech/mdbx-go v0.38.4 github.com/erigontech/secp256k1 v1.1.0 github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 diff --git a/erigon-lib/go.sum b/erigon-lib/go.sum index 7108fcf838b..58ff8bdc0b5 100644 --- a/erigon-lib/go.sum +++ b/erigon-lib/go.sum @@ -148,8 +148,8 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erigontech/erigon-snapshot v1.3.1-0.20240814160410-2ce37904b978 h1:7ECOf7Us3+/706WGZXIX84qQc6zmxQby8fGbFLiqFlU= github.com/erigontech/erigon-snapshot v1.3.1-0.20240814160410-2ce37904b978/go.mod h1:ooHlCl+eEYzebiPu+FP6Q6SpPUeMADn8Jxabv3IKb9M= -github.com/erigontech/interfaces v0.0.0-20240819221809-43fdab2057da h1:ZayX+yo/IRJ1CGVsC8R32tqU2uUEvJr/L6L4RUAa/+s= -github.com/erigontech/interfaces v0.0.0-20240819221809-43fdab2057da/go.mod h1:N7OUkhkcagp9+7yb4ycHsG2VWCOmuJ1ONBecJshxtLE= +github.com/erigontech/interfaces v0.0.0-20240905113027-2c1accea17aa h1:iVT7tKZN3L6Jug928bzyAu7peeslHD1QDbdbmyMyUgo= +github.com/erigontech/interfaces v0.0.0-20240905113027-2c1accea17aa/go.mod h1:N7OUkhkcagp9+7yb4ycHsG2VWCOmuJ1ONBecJshxtLE= github.com/erigontech/mdbx-go v0.38.4 h1:S9T7mTe9KPcFe4dOoOtVdI6gPzht9y7wMnYfUBgrQLo= github.com/erigontech/mdbx-go v0.38.4/go.mod h1:IcOLQDPw3VM/asP6T5JVPPN4FHHgJtY16XfYjzWKVNI= github.com/erigontech/secp256k1 v1.1.0 h1:mO3YJMUSoASE15Ya//SoHiisptUhdXExuMUN1M0X9qY= diff --git a/erigon-lib/gointerfaces/remoteproto/ethbackend.pb.go b/erigon-lib/gointerfaces/remoteproto/ethbackend.pb.go index e7e97004a68..0c823fc6d22 100644 --- a/erigon-lib/gointerfaces/remoteproto/ethbackend.pb.go +++ b/erigon-lib/gointerfaces/remoteproto/ethbackend.pb.go @@ -1656,7 +1656,7 @@ func (x *EngineGetPayloadBodiesByRangeV1Request) GetCount() uint64 { return 0 } -type BorEventRequest struct { +type BorTxnLookupRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1664,8 +1664,8 @@ type BorEventRequest struct { BorTxHash *typesproto.H256 `protobuf:"bytes,1,opt,name=bor_tx_hash,json=borTxHash,proto3" json:"bor_tx_hash,omitempty"` } -func (x *BorEventRequest) Reset() { - *x = BorEventRequest{} +func (x *BorTxnLookupRequest) Reset() { + *x = BorTxnLookupRequest{} if protoimpl.UnsafeEnabled { mi := &file_remote_ethbackend_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1673,13 +1673,13 @@ func (x *BorEventRequest) Reset() { } } -func (x *BorEventRequest) String() string { +func (x *BorTxnLookupRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BorEventRequest) ProtoMessage() {} +func (*BorTxnLookupRequest) ProtoMessage() {} -func (x *BorEventRequest) ProtoReflect() protoreflect.Message { +func (x *BorTxnLookupRequest) ProtoReflect() protoreflect.Message { mi := &file_remote_ethbackend_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1691,30 +1691,29 @@ func (x *BorEventRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BorEventRequest.ProtoReflect.Descriptor instead. -func (*BorEventRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use BorTxnLookupRequest.ProtoReflect.Descriptor instead. +func (*BorTxnLookupRequest) Descriptor() ([]byte, []int) { return file_remote_ethbackend_proto_rawDescGZIP(), []int{32} } -func (x *BorEventRequest) GetBorTxHash() *typesproto.H256 { +func (x *BorTxnLookupRequest) GetBorTxHash() *typesproto.H256 { if x != nil { return x.BorTxHash } return nil } -type BorEventReply struct { +type BorTxnLookupReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Present bool `protobuf:"varint,1,opt,name=present,proto3" json:"present,omitempty"` - BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` - EventRlps [][]byte `protobuf:"bytes,3,rep,name=event_rlps,json=eventRlps,proto3" json:"event_rlps,omitempty"` + Present bool `protobuf:"varint,1,opt,name=present,proto3" json:"present,omitempty"` + BlockNumber uint64 `protobuf:"varint,2,opt,name=block_number,json=blockNumber,proto3" json:"block_number,omitempty"` } -func (x *BorEventReply) Reset() { - *x = BorEventReply{} +func (x *BorTxnLookupReply) Reset() { + *x = BorTxnLookupReply{} if protoimpl.UnsafeEnabled { mi := &file_remote_ethbackend_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1722,13 +1721,13 @@ func (x *BorEventReply) Reset() { } } -func (x *BorEventReply) String() string { +func (x *BorTxnLookupReply) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BorEventReply) ProtoMessage() {} +func (*BorTxnLookupReply) ProtoMessage() {} -func (x *BorEventReply) ProtoReflect() protoreflect.Message { +func (x *BorTxnLookupReply) ProtoReflect() protoreflect.Message { mi := &file_remote_ethbackend_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1740,26 +1739,121 @@ func (x *BorEventReply) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BorEventReply.ProtoReflect.Descriptor instead. -func (*BorEventReply) Descriptor() ([]byte, []int) { +// Deprecated: Use BorTxnLookupReply.ProtoReflect.Descriptor instead. +func (*BorTxnLookupReply) Descriptor() ([]byte, []int) { return file_remote_ethbackend_proto_rawDescGZIP(), []int{33} } -func (x *BorEventReply) GetPresent() bool { +func (x *BorTxnLookupReply) GetPresent() bool { if x != nil { return x.Present } return false } -func (x *BorEventReply) GetBlockNumber() uint64 { +func (x *BorTxnLookupReply) GetBlockNumber() uint64 { if x != nil { return x.BlockNumber } return 0 } -func (x *BorEventReply) GetEventRlps() [][]byte { +type BorEventsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` + BlockHash *typesproto.H256 `protobuf:"bytes,2,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` +} + +func (x *BorEventsRequest) Reset() { + *x = BorEventsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BorEventsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BorEventsRequest) ProtoMessage() {} + +func (x *BorEventsRequest) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[34] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BorEventsRequest.ProtoReflect.Descriptor instead. +func (*BorEventsRequest) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{34} +} + +func (x *BorEventsRequest) GetBlockNum() uint64 { + if x != nil { + return x.BlockNum + } + return 0 +} + +func (x *BorEventsRequest) GetBlockHash() *typesproto.H256 { + if x != nil { + return x.BlockHash + } + return nil +} + +type BorEventsReply struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EventRlps [][]byte `protobuf:"bytes,1,rep,name=event_rlps,json=eventRlps,proto3" json:"event_rlps,omitempty"` +} + +func (x *BorEventsReply) Reset() { + *x = BorEventsReply{} + if protoimpl.UnsafeEnabled { + mi := &file_remote_ethbackend_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BorEventsReply) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BorEventsReply) ProtoMessage() {} + +func (x *BorEventsReply) ProtoReflect() protoreflect.Message { + mi := &file_remote_ethbackend_proto_msgTypes[35] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BorEventsReply.ProtoReflect.Descriptor instead. +func (*BorEventsReply) Descriptor() ([]byte, []int) { + return file_remote_ethbackend_proto_rawDescGZIP(), []int{35} +} + +func (x *BorEventsReply) GetEventRlps() [][]byte { if x != nil { return x.EventRlps } @@ -1904,101 +1998,113 @@ var file_remote_ethbackend_proto_rawDesc = []byte{ 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x3e, 0x0a, 0x0f, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x0b, 0x62, 0x6f, 0x72, 0x5f, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x54, 0x78, 0x48, 0x61, 0x73, 0x68, 0x22, - 0x6b, 0x0a, 0x0d, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6c, 0x70, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x6c, 0x70, 0x73, 0x2a, 0x4a, 0x0a, 0x05, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, - 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x47, - 0x53, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x42, - 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x45, 0x57, 0x5f, 0x53, 0x4e, - 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x03, 0x32, 0xcf, 0x09, 0x0a, 0x0a, 0x45, 0x54, 0x48, - 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x12, 0x3d, 0x0a, 0x09, 0x45, 0x74, 0x68, 0x65, 0x72, - 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, - 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, + 0x42, 0x0a, 0x13, 0x42, 0x6f, 0x72, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x0b, 0x62, 0x6f, 0x72, 0x5f, 0x74, 0x78, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6f, 0x72, 0x54, 0x78, 0x48, + 0x61, 0x73, 0x68, 0x22, 0x50, 0x0a, 0x11, 0x42, 0x6f, 0x72, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, + 0x6b, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x65, 0x73, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x65, 0x73, 0x65, + 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x10, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, + 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x48, 0x32, 0x35, 0x36, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, + 0x73, 0x68, 0x22, 0x2f, 0x0a, 0x0e, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x6c, + 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x6c, 0x70, 0x73, 0x2a, 0x4a, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, + 0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x45, 0x4e, 0x44, + 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x47, 0x53, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x45, + 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x10, 0x02, 0x12, 0x10, 0x0a, + 0x0c, 0x4e, 0x45, 0x57, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x03, 0x32, + 0x9a, 0x0a, 0x0a, 0x0a, 0x45, 0x54, 0x48, 0x42, 0x41, 0x43, 0x4b, 0x45, 0x4e, 0x44, 0x12, 0x3d, + 0x0a, 0x09, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x45, + 0x74, 0x68, 0x65, 0x72, 0x62, 0x61, 0x73, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x40, 0x0a, + 0x0a, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, + 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x46, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x4f, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x12, 0x49, 0x0a, 0x0d, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x4e, 0x65, 0x74, 0x50, - 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, - 0x65, 0x74, 0x50, 0x65, 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x36, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x13, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x4f, 0x0a, 0x0f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x0d, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x09, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, - 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x30, 0x01, 0x12, 0x4a, 0x0a, 0x0d, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, - 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, - 0x4c, 0x6f, 0x67, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, - 0x72, 0x69, 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x31, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x14, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x12, 0x67, 0x0a, 0x17, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, - 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, - 0x26, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, - 0x61, 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, - 0x72, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, - 0x0d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, + 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x56, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x09, 0x53, + 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x30, 0x01, 0x12, 0x4a, 0x0a, 0x0d, + 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4c, 0x6f, 0x67, 0x73, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x4c, 0x6f, 0x67, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x28, 0x01, 0x30, 0x01, 0x12, 0x31, 0x0a, 0x05, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x12, 0x14, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x67, 0x0a, 0x17, 0x43, + 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, 0x72, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x26, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, + 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, 0x72, + 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, - 0x6c, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, - 0x61, 0x73, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, - 0x12, 0x3d, 0x0a, 0x09, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x18, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, - 0x3c, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, - 0x05, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x12, 0x16, 0x2e, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, - 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x41, 0x0a, 0x0c, 0x50, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, 0x6e, - 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3a, - 0x0a, 0x08, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, 0x72, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x16, 0x5a, 0x14, 0x2e, 0x2f, - 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x42, 0x6f, 0x64, 0x79, 0x46, 0x6f, 0x72, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, + 0x6c, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, + 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x61, 0x6e, + 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, + 0x46, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3d, 0x0a, 0x09, 0x54, 0x78, 0x6e, 0x4c, 0x6f, + 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, + 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, + 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3c, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x12, 0x33, 0x0a, 0x05, 0x50, 0x65, 0x65, 0x72, 0x73, 0x12, 0x16, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, + 0x65, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x37, 0x0a, 0x07, 0x41, 0x64, 0x64, + 0x50, 0x65, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, + 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x41, 0x64, 0x64, 0x50, 0x65, 0x65, 0x72, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x12, 0x41, 0x0a, 0x0c, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x46, 0x0a, 0x0c, 0x42, 0x6f, 0x72, 0x54, 0x78, 0x6e, 0x4c, + 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x1b, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, + 0x6f, 0x72, 0x54, 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, 0x72, 0x54, + 0x78, 0x6e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3d, 0x0a, + 0x09, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x42, 0x6f, + 0x72, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x16, 0x5a, 0x14, + 0x2e, 0x2f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2014,7 +2120,7 @@ func file_remote_ethbackend_proto_rawDescGZIP() []byte { } var file_remote_ethbackend_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_remote_ethbackend_proto_msgTypes = make([]protoimpl.MessageInfo, 34) +var file_remote_ethbackend_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_remote_ethbackend_proto_goTypes = []any{ (Event)(0), // 0: remote.Event (*EtherbaseRequest)(nil), // 1: remote.EtherbaseRequest @@ -2049,74 +2155,79 @@ var file_remote_ethbackend_proto_goTypes = []any{ (*PendingBlockReply)(nil), // 30: remote.PendingBlockReply (*EngineGetPayloadBodiesByHashV1Request)(nil), // 31: remote.EngineGetPayloadBodiesByHashV1Request (*EngineGetPayloadBodiesByRangeV1Request)(nil), // 32: remote.EngineGetPayloadBodiesByRangeV1Request - (*BorEventRequest)(nil), // 33: remote.BorEventRequest - (*BorEventReply)(nil), // 34: remote.BorEventReply - (*typesproto.H160)(nil), // 35: types.H160 - (*typesproto.H256)(nil), // 36: types.H256 - (*typesproto.NodeInfoReply)(nil), // 37: types.NodeInfoReply - (*typesproto.PeerInfo)(nil), // 38: types.PeerInfo - (*emptypb.Empty)(nil), // 39: google.protobuf.Empty - (*typesproto.VersionReply)(nil), // 40: types.VersionReply + (*BorTxnLookupRequest)(nil), // 33: remote.BorTxnLookupRequest + (*BorTxnLookupReply)(nil), // 34: remote.BorTxnLookupReply + (*BorEventsRequest)(nil), // 35: remote.BorEventsRequest + (*BorEventsReply)(nil), // 36: remote.BorEventsReply + (*typesproto.H160)(nil), // 37: types.H160 + (*typesproto.H256)(nil), // 38: types.H256 + (*typesproto.NodeInfoReply)(nil), // 39: types.NodeInfoReply + (*typesproto.PeerInfo)(nil), // 40: types.PeerInfo + (*emptypb.Empty)(nil), // 41: google.protobuf.Empty + (*typesproto.VersionReply)(nil), // 42: types.VersionReply } var file_remote_ethbackend_proto_depIdxs = []int32{ - 35, // 0: remote.EtherbaseReply.address:type_name -> types.H160 - 36, // 1: remote.CanonicalHashReply.hash:type_name -> types.H256 - 36, // 2: remote.HeaderNumberRequest.hash:type_name -> types.H256 + 37, // 0: remote.EtherbaseReply.address:type_name -> types.H160 + 38, // 1: remote.CanonicalHashReply.hash:type_name -> types.H256 + 38, // 2: remote.HeaderNumberRequest.hash:type_name -> types.H256 0, // 3: remote.SubscribeRequest.type:type_name -> remote.Event 0, // 4: remote.SubscribeReply.type:type_name -> remote.Event - 35, // 5: remote.LogsFilterRequest.addresses:type_name -> types.H160 - 36, // 6: remote.LogsFilterRequest.topics:type_name -> types.H256 - 35, // 7: remote.SubscribeLogsReply.address:type_name -> types.H160 - 36, // 8: remote.SubscribeLogsReply.block_hash:type_name -> types.H256 - 36, // 9: remote.SubscribeLogsReply.topics:type_name -> types.H256 - 36, // 10: remote.SubscribeLogsReply.transaction_hash:type_name -> types.H256 - 36, // 11: remote.BlockRequest.block_hash:type_name -> types.H256 - 36, // 12: remote.TxnLookupRequest.txn_hash:type_name -> types.H256 - 37, // 13: remote.NodesInfoReply.nodes_info:type_name -> types.NodeInfoReply - 38, // 14: remote.PeersReply.peers:type_name -> types.PeerInfo - 36, // 15: remote.EngineGetPayloadBodiesByHashV1Request.hashes:type_name -> types.H256 - 36, // 16: remote.BorEventRequest.bor_tx_hash:type_name -> types.H256 - 1, // 17: remote.ETHBACKEND.Etherbase:input_type -> remote.EtherbaseRequest - 3, // 18: remote.ETHBACKEND.NetVersion:input_type -> remote.NetVersionRequest - 5, // 19: remote.ETHBACKEND.NetPeerCount:input_type -> remote.NetPeerCountRequest - 39, // 20: remote.ETHBACKEND.Version:input_type -> google.protobuf.Empty - 7, // 21: remote.ETHBACKEND.ProtocolVersion:input_type -> remote.ProtocolVersionRequest - 9, // 22: remote.ETHBACKEND.ClientVersion:input_type -> remote.ClientVersionRequest - 17, // 23: remote.ETHBACKEND.Subscribe:input_type -> remote.SubscribeRequest - 19, // 24: remote.ETHBACKEND.SubscribeLogs:input_type -> remote.LogsFilterRequest - 21, // 25: remote.ETHBACKEND.Block:input_type -> remote.BlockRequest - 15, // 26: remote.ETHBACKEND.CanonicalBodyForStorage:input_type -> remote.CanonicalBodyForStorageRequest - 11, // 27: remote.ETHBACKEND.CanonicalHash:input_type -> remote.CanonicalHashRequest - 13, // 28: remote.ETHBACKEND.HeaderNumber:input_type -> remote.HeaderNumberRequest - 23, // 29: remote.ETHBACKEND.TxnLookup:input_type -> remote.TxnLookupRequest - 25, // 30: remote.ETHBACKEND.NodeInfo:input_type -> remote.NodesInfoRequest - 39, // 31: remote.ETHBACKEND.Peers:input_type -> google.protobuf.Empty - 26, // 32: remote.ETHBACKEND.AddPeer:input_type -> remote.AddPeerRequest - 39, // 33: remote.ETHBACKEND.PendingBlock:input_type -> google.protobuf.Empty - 33, // 34: remote.ETHBACKEND.BorEvent:input_type -> remote.BorEventRequest - 2, // 35: remote.ETHBACKEND.Etherbase:output_type -> remote.EtherbaseReply - 4, // 36: remote.ETHBACKEND.NetVersion:output_type -> remote.NetVersionReply - 6, // 37: remote.ETHBACKEND.NetPeerCount:output_type -> remote.NetPeerCountReply - 40, // 38: remote.ETHBACKEND.Version:output_type -> types.VersionReply - 8, // 39: remote.ETHBACKEND.ProtocolVersion:output_type -> remote.ProtocolVersionReply - 10, // 40: remote.ETHBACKEND.ClientVersion:output_type -> remote.ClientVersionReply - 18, // 41: remote.ETHBACKEND.Subscribe:output_type -> remote.SubscribeReply - 20, // 42: remote.ETHBACKEND.SubscribeLogs:output_type -> remote.SubscribeLogsReply - 22, // 43: remote.ETHBACKEND.Block:output_type -> remote.BlockReply - 16, // 44: remote.ETHBACKEND.CanonicalBodyForStorage:output_type -> remote.CanonicalBodyForStorageReply - 12, // 45: remote.ETHBACKEND.CanonicalHash:output_type -> remote.CanonicalHashReply - 14, // 46: remote.ETHBACKEND.HeaderNumber:output_type -> remote.HeaderNumberReply - 24, // 47: remote.ETHBACKEND.TxnLookup:output_type -> remote.TxnLookupReply - 27, // 48: remote.ETHBACKEND.NodeInfo:output_type -> remote.NodesInfoReply - 28, // 49: remote.ETHBACKEND.Peers:output_type -> remote.PeersReply - 29, // 50: remote.ETHBACKEND.AddPeer:output_type -> remote.AddPeerReply - 30, // 51: remote.ETHBACKEND.PendingBlock:output_type -> remote.PendingBlockReply - 34, // 52: remote.ETHBACKEND.BorEvent:output_type -> remote.BorEventReply - 35, // [35:53] is the sub-list for method output_type - 17, // [17:35] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 37, // 5: remote.LogsFilterRequest.addresses:type_name -> types.H160 + 38, // 6: remote.LogsFilterRequest.topics:type_name -> types.H256 + 37, // 7: remote.SubscribeLogsReply.address:type_name -> types.H160 + 38, // 8: remote.SubscribeLogsReply.block_hash:type_name -> types.H256 + 38, // 9: remote.SubscribeLogsReply.topics:type_name -> types.H256 + 38, // 10: remote.SubscribeLogsReply.transaction_hash:type_name -> types.H256 + 38, // 11: remote.BlockRequest.block_hash:type_name -> types.H256 + 38, // 12: remote.TxnLookupRequest.txn_hash:type_name -> types.H256 + 39, // 13: remote.NodesInfoReply.nodes_info:type_name -> types.NodeInfoReply + 40, // 14: remote.PeersReply.peers:type_name -> types.PeerInfo + 38, // 15: remote.EngineGetPayloadBodiesByHashV1Request.hashes:type_name -> types.H256 + 38, // 16: remote.BorTxnLookupRequest.bor_tx_hash:type_name -> types.H256 + 38, // 17: remote.BorEventsRequest.block_hash:type_name -> types.H256 + 1, // 18: remote.ETHBACKEND.Etherbase:input_type -> remote.EtherbaseRequest + 3, // 19: remote.ETHBACKEND.NetVersion:input_type -> remote.NetVersionRequest + 5, // 20: remote.ETHBACKEND.NetPeerCount:input_type -> remote.NetPeerCountRequest + 41, // 21: remote.ETHBACKEND.Version:input_type -> google.protobuf.Empty + 7, // 22: remote.ETHBACKEND.ProtocolVersion:input_type -> remote.ProtocolVersionRequest + 9, // 23: remote.ETHBACKEND.ClientVersion:input_type -> remote.ClientVersionRequest + 17, // 24: remote.ETHBACKEND.Subscribe:input_type -> remote.SubscribeRequest + 19, // 25: remote.ETHBACKEND.SubscribeLogs:input_type -> remote.LogsFilterRequest + 21, // 26: remote.ETHBACKEND.Block:input_type -> remote.BlockRequest + 15, // 27: remote.ETHBACKEND.CanonicalBodyForStorage:input_type -> remote.CanonicalBodyForStorageRequest + 11, // 28: remote.ETHBACKEND.CanonicalHash:input_type -> remote.CanonicalHashRequest + 13, // 29: remote.ETHBACKEND.HeaderNumber:input_type -> remote.HeaderNumberRequest + 23, // 30: remote.ETHBACKEND.TxnLookup:input_type -> remote.TxnLookupRequest + 25, // 31: remote.ETHBACKEND.NodeInfo:input_type -> remote.NodesInfoRequest + 41, // 32: remote.ETHBACKEND.Peers:input_type -> google.protobuf.Empty + 26, // 33: remote.ETHBACKEND.AddPeer:input_type -> remote.AddPeerRequest + 41, // 34: remote.ETHBACKEND.PendingBlock:input_type -> google.protobuf.Empty + 33, // 35: remote.ETHBACKEND.BorTxnLookup:input_type -> remote.BorTxnLookupRequest + 35, // 36: remote.ETHBACKEND.BorEvents:input_type -> remote.BorEventsRequest + 2, // 37: remote.ETHBACKEND.Etherbase:output_type -> remote.EtherbaseReply + 4, // 38: remote.ETHBACKEND.NetVersion:output_type -> remote.NetVersionReply + 6, // 39: remote.ETHBACKEND.NetPeerCount:output_type -> remote.NetPeerCountReply + 42, // 40: remote.ETHBACKEND.Version:output_type -> types.VersionReply + 8, // 41: remote.ETHBACKEND.ProtocolVersion:output_type -> remote.ProtocolVersionReply + 10, // 42: remote.ETHBACKEND.ClientVersion:output_type -> remote.ClientVersionReply + 18, // 43: remote.ETHBACKEND.Subscribe:output_type -> remote.SubscribeReply + 20, // 44: remote.ETHBACKEND.SubscribeLogs:output_type -> remote.SubscribeLogsReply + 22, // 45: remote.ETHBACKEND.Block:output_type -> remote.BlockReply + 16, // 46: remote.ETHBACKEND.CanonicalBodyForStorage:output_type -> remote.CanonicalBodyForStorageReply + 12, // 47: remote.ETHBACKEND.CanonicalHash:output_type -> remote.CanonicalHashReply + 14, // 48: remote.ETHBACKEND.HeaderNumber:output_type -> remote.HeaderNumberReply + 24, // 49: remote.ETHBACKEND.TxnLookup:output_type -> remote.TxnLookupReply + 27, // 50: remote.ETHBACKEND.NodeInfo:output_type -> remote.NodesInfoReply + 28, // 51: remote.ETHBACKEND.Peers:output_type -> remote.PeersReply + 29, // 52: remote.ETHBACKEND.AddPeer:output_type -> remote.AddPeerReply + 30, // 53: remote.ETHBACKEND.PendingBlock:output_type -> remote.PendingBlockReply + 34, // 54: remote.ETHBACKEND.BorTxnLookup:output_type -> remote.BorTxnLookupReply + 36, // 55: remote.ETHBACKEND.BorEvents:output_type -> remote.BorEventsReply + 37, // [37:56] is the sub-list for method output_type + 18, // [18:37] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name } func init() { file_remote_ethbackend_proto_init() } @@ -2510,7 +2621,7 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[32].Exporter = func(v any, i int) any { - switch v := v.(*BorEventRequest); i { + switch v := v.(*BorTxnLookupRequest); i { case 0: return &v.state case 1: @@ -2522,7 +2633,31 @@ func file_remote_ethbackend_proto_init() { } } file_remote_ethbackend_proto_msgTypes[33].Exporter = func(v any, i int) any { - switch v := v.(*BorEventReply); i { + switch v := v.(*BorTxnLookupReply); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[34].Exporter = func(v any, i int) any { + switch v := v.(*BorEventsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_remote_ethbackend_proto_msgTypes[35].Exporter = func(v any, i int) any { + switch v := v.(*BorEventsReply); i { case 0: return &v.state case 1: @@ -2541,7 +2676,7 @@ func file_remote_ethbackend_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_remote_ethbackend_proto_rawDesc, NumEnums: 1, - NumMessages: 34, + NumMessages: 36, NumExtensions: 0, NumServices: 1, }, diff --git a/erigon-lib/gointerfaces/remoteproto/ethbackend_grpc.pb.go b/erigon-lib/gointerfaces/remoteproto/ethbackend_grpc.pb.go index 3ae184f098d..366e13975f1 100644 --- a/erigon-lib/gointerfaces/remoteproto/ethbackend_grpc.pb.go +++ b/erigon-lib/gointerfaces/remoteproto/ethbackend_grpc.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.5.1 +// - protoc-gen-go-grpc v1.4.0 // - protoc v5.27.1 // source: remote/ethbackend.proto @@ -17,8 +17,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 +// Requires gRPC-Go v1.62.0 or later. +const _ = grpc.SupportPackageIsVersion8 const ( ETHBACKEND_Etherbase_FullMethodName = "/remote.ETHBACKEND/Etherbase" @@ -38,7 +38,8 @@ const ( ETHBACKEND_Peers_FullMethodName = "/remote.ETHBACKEND/Peers" ETHBACKEND_AddPeer_FullMethodName = "/remote.ETHBACKEND/AddPeer" ETHBACKEND_PendingBlock_FullMethodName = "/remote.ETHBACKEND/PendingBlock" - ETHBACKEND_BorEvent_FullMethodName = "/remote.ETHBACKEND/BorEvent" + ETHBACKEND_BorTxnLookup_FullMethodName = "/remote.ETHBACKEND/BorTxnLookup" + ETHBACKEND_BorEvents_FullMethodName = "/remote.ETHBACKEND/BorEvents" ) // ETHBACKENDClient is the client API for ETHBACKEND service. @@ -54,9 +55,9 @@ type ETHBACKENDClient interface { ProtocolVersion(ctx context.Context, in *ProtocolVersionRequest, opts ...grpc.CallOption) (*ProtocolVersionReply, error) // ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux). ClientVersion(ctx context.Context, in *ClientVersionRequest, opts ...grpc.CallOption) (*ClientVersionReply, error) - Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SubscribeReply], error) + Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (ETHBACKEND_SubscribeClient, error) // Only one subscription is needed to serve all the users, LogsFilterRequest allows to dynamically modifying the subscription - SubscribeLogs(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[LogsFilterRequest, SubscribeLogsReply], error) + SubscribeLogs(ctx context.Context, opts ...grpc.CallOption) (ETHBACKEND_SubscribeLogsClient, error) // High-level method - can read block from db, snapshots or apply any other logic // it doesn't provide consistency // Request fields are optional - it's ok to request block only by hash or only by number @@ -77,7 +78,8 @@ type ETHBACKENDClient interface { AddPeer(ctx context.Context, in *AddPeerRequest, opts ...grpc.CallOption) (*AddPeerReply, error) // PendingBlock returns latest built block. PendingBlock(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*PendingBlockReply, error) - BorEvent(ctx context.Context, in *BorEventRequest, opts ...grpc.CallOption) (*BorEventReply, error) + BorTxnLookup(ctx context.Context, in *BorTxnLookupRequest, opts ...grpc.CallOption) (*BorTxnLookupReply, error) + BorEvents(ctx context.Context, in *BorEventsRequest, opts ...grpc.CallOption) (*BorEventsReply, error) } type eTHBACKENDClient struct { @@ -148,13 +150,13 @@ func (c *eTHBACKENDClient) ClientVersion(ctx context.Context, in *ClientVersionR return out, nil } -func (c *eTHBACKENDClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[SubscribeReply], error) { +func (c *eTHBACKENDClient) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc.CallOption) (ETHBACKEND_SubscribeClient, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, ÐBACKEND_ServiceDesc.Streams[0], ETHBACKEND_Subscribe_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[SubscribeRequest, SubscribeReply]{ClientStream: stream} + x := &eTHBACKENDSubscribeClient{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -164,21 +166,54 @@ func (c *eTHBACKENDClient) Subscribe(ctx context.Context, in *SubscribeRequest, return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ETHBACKEND_SubscribeClient = grpc.ServerStreamingClient[SubscribeReply] +type ETHBACKEND_SubscribeClient interface { + Recv() (*SubscribeReply, error) + grpc.ClientStream +} + +type eTHBACKENDSubscribeClient struct { + grpc.ClientStream +} + +func (x *eTHBACKENDSubscribeClient) Recv() (*SubscribeReply, error) { + m := new(SubscribeReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} -func (c *eTHBACKENDClient) SubscribeLogs(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[LogsFilterRequest, SubscribeLogsReply], error) { +func (c *eTHBACKENDClient) SubscribeLogs(ctx context.Context, opts ...grpc.CallOption) (ETHBACKEND_SubscribeLogsClient, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) stream, err := c.cc.NewStream(ctx, ÐBACKEND_ServiceDesc.Streams[1], ETHBACKEND_SubscribeLogs_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &grpc.GenericClientStream[LogsFilterRequest, SubscribeLogsReply]{ClientStream: stream} + x := &eTHBACKENDSubscribeLogsClient{ClientStream: stream} return x, nil } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ETHBACKEND_SubscribeLogsClient = grpc.BidiStreamingClient[LogsFilterRequest, SubscribeLogsReply] +type ETHBACKEND_SubscribeLogsClient interface { + Send(*LogsFilterRequest) error + Recv() (*SubscribeLogsReply, error) + grpc.ClientStream +} + +type eTHBACKENDSubscribeLogsClient struct { + grpc.ClientStream +} + +func (x *eTHBACKENDSubscribeLogsClient) Send(m *LogsFilterRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *eTHBACKENDSubscribeLogsClient) Recv() (*SubscribeLogsReply, error) { + m := new(SubscribeLogsReply) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} func (c *eTHBACKENDClient) Block(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*BlockReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) @@ -270,10 +305,20 @@ func (c *eTHBACKENDClient) PendingBlock(ctx context.Context, in *emptypb.Empty, return out, nil } -func (c *eTHBACKENDClient) BorEvent(ctx context.Context, in *BorEventRequest, opts ...grpc.CallOption) (*BorEventReply, error) { +func (c *eTHBACKENDClient) BorTxnLookup(ctx context.Context, in *BorTxnLookupRequest, opts ...grpc.CallOption) (*BorTxnLookupReply, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BorTxnLookupReply) + err := c.cc.Invoke(ctx, ETHBACKEND_BorTxnLookup_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eTHBACKENDClient) BorEvents(ctx context.Context, in *BorEventsRequest, opts ...grpc.CallOption) (*BorEventsReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(BorEventReply) - err := c.cc.Invoke(ctx, ETHBACKEND_BorEvent_FullMethodName, in, out, cOpts...) + out := new(BorEventsReply) + err := c.cc.Invoke(ctx, ETHBACKEND_BorEvents_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -282,7 +327,7 @@ func (c *eTHBACKENDClient) BorEvent(ctx context.Context, in *BorEventRequest, op // ETHBACKENDServer is the server API for ETHBACKEND service. // All implementations must embed UnimplementedETHBACKENDServer -// for forward compatibility. +// for forward compatibility type ETHBACKENDServer interface { Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) NetVersion(context.Context, *NetVersionRequest) (*NetVersionReply, error) @@ -293,9 +338,9 @@ type ETHBACKENDServer interface { ProtocolVersion(context.Context, *ProtocolVersionRequest) (*ProtocolVersionReply, error) // ClientVersion returns the Ethereum client version string using node name convention (e.g. TurboGeth/v2021.03.2-alpha/Linux). ClientVersion(context.Context, *ClientVersionRequest) (*ClientVersionReply, error) - Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[SubscribeReply]) error + Subscribe(*SubscribeRequest, ETHBACKEND_SubscribeServer) error // Only one subscription is needed to serve all the users, LogsFilterRequest allows to dynamically modifying the subscription - SubscribeLogs(grpc.BidiStreamingServer[LogsFilterRequest, SubscribeLogsReply]) error + SubscribeLogs(ETHBACKEND_SubscribeLogsServer) error // High-level method - can read block from db, snapshots or apply any other logic // it doesn't provide consistency // Request fields are optional - it's ok to request block only by hash or only by number @@ -316,16 +361,14 @@ type ETHBACKENDServer interface { AddPeer(context.Context, *AddPeerRequest) (*AddPeerReply, error) // PendingBlock returns latest built block. PendingBlock(context.Context, *emptypb.Empty) (*PendingBlockReply, error) - BorEvent(context.Context, *BorEventRequest) (*BorEventReply, error) + BorTxnLookup(context.Context, *BorTxnLookupRequest) (*BorTxnLookupReply, error) + BorEvents(context.Context, *BorEventsRequest) (*BorEventsReply, error) mustEmbedUnimplementedETHBACKENDServer() } -// UnimplementedETHBACKENDServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedETHBACKENDServer struct{} +// UnimplementedETHBACKENDServer must be embedded to have forward compatible implementations. +type UnimplementedETHBACKENDServer struct { +} func (UnimplementedETHBACKENDServer) Etherbase(context.Context, *EtherbaseRequest) (*EtherbaseReply, error) { return nil, status.Errorf(codes.Unimplemented, "method Etherbase not implemented") @@ -345,10 +388,10 @@ func (UnimplementedETHBACKENDServer) ProtocolVersion(context.Context, *ProtocolV func (UnimplementedETHBACKENDServer) ClientVersion(context.Context, *ClientVersionRequest) (*ClientVersionReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ClientVersion not implemented") } -func (UnimplementedETHBACKENDServer) Subscribe(*SubscribeRequest, grpc.ServerStreamingServer[SubscribeReply]) error { +func (UnimplementedETHBACKENDServer) Subscribe(*SubscribeRequest, ETHBACKEND_SubscribeServer) error { return status.Errorf(codes.Unimplemented, "method Subscribe not implemented") } -func (UnimplementedETHBACKENDServer) SubscribeLogs(grpc.BidiStreamingServer[LogsFilterRequest, SubscribeLogsReply]) error { +func (UnimplementedETHBACKENDServer) SubscribeLogs(ETHBACKEND_SubscribeLogsServer) error { return status.Errorf(codes.Unimplemented, "method SubscribeLogs not implemented") } func (UnimplementedETHBACKENDServer) Block(context.Context, *BlockRequest) (*BlockReply, error) { @@ -378,11 +421,13 @@ func (UnimplementedETHBACKENDServer) AddPeer(context.Context, *AddPeerRequest) ( func (UnimplementedETHBACKENDServer) PendingBlock(context.Context, *emptypb.Empty) (*PendingBlockReply, error) { return nil, status.Errorf(codes.Unimplemented, "method PendingBlock not implemented") } -func (UnimplementedETHBACKENDServer) BorEvent(context.Context, *BorEventRequest) (*BorEventReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method BorEvent not implemented") +func (UnimplementedETHBACKENDServer) BorTxnLookup(context.Context, *BorTxnLookupRequest) (*BorTxnLookupReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BorTxnLookup not implemented") +} +func (UnimplementedETHBACKENDServer) BorEvents(context.Context, *BorEventsRequest) (*BorEventsReply, error) { + return nil, status.Errorf(codes.Unimplemented, "method BorEvents not implemented") } func (UnimplementedETHBACKENDServer) mustEmbedUnimplementedETHBACKENDServer() {} -func (UnimplementedETHBACKENDServer) testEmbeddedByValue() {} // UnsafeETHBACKENDServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ETHBACKENDServer will @@ -392,13 +437,6 @@ type UnsafeETHBACKENDServer interface { } func RegisterETHBACKENDServer(s grpc.ServiceRegistrar, srv ETHBACKENDServer) { - // If the following call pancis, it indicates UnimplementedETHBACKENDServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } s.RegisterService(ÐBACKEND_ServiceDesc, srv) } @@ -515,18 +553,47 @@ func _ETHBACKEND_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) er if err := stream.RecvMsg(m); err != nil { return err } - return srv.(ETHBACKENDServer).Subscribe(m, &grpc.GenericServerStream[SubscribeRequest, SubscribeReply]{ServerStream: stream}) + return srv.(ETHBACKENDServer).Subscribe(m, &eTHBACKENDSubscribeServer{ServerStream: stream}) +} + +type ETHBACKEND_SubscribeServer interface { + Send(*SubscribeReply) error + grpc.ServerStream +} + +type eTHBACKENDSubscribeServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ETHBACKEND_SubscribeServer = grpc.ServerStreamingServer[SubscribeReply] +func (x *eTHBACKENDSubscribeServer) Send(m *SubscribeReply) error { + return x.ServerStream.SendMsg(m) +} func _ETHBACKEND_SubscribeLogs_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(ETHBACKENDServer).SubscribeLogs(&grpc.GenericServerStream[LogsFilterRequest, SubscribeLogsReply]{ServerStream: stream}) + return srv.(ETHBACKENDServer).SubscribeLogs(&eTHBACKENDSubscribeLogsServer{ServerStream: stream}) +} + +type ETHBACKEND_SubscribeLogsServer interface { + Send(*SubscribeLogsReply) error + Recv() (*LogsFilterRequest, error) + grpc.ServerStream +} + +type eTHBACKENDSubscribeLogsServer struct { + grpc.ServerStream } -// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. -type ETHBACKEND_SubscribeLogsServer = grpc.BidiStreamingServer[LogsFilterRequest, SubscribeLogsReply] +func (x *eTHBACKENDSubscribeLogsServer) Send(m *SubscribeLogsReply) error { + return x.ServerStream.SendMsg(m) +} + +func (x *eTHBACKENDSubscribeLogsServer) Recv() (*LogsFilterRequest, error) { + m := new(LogsFilterRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} func _ETHBACKEND_Block_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(BlockRequest) @@ -690,20 +757,38 @@ func _ETHBACKEND_PendingBlock_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _ETHBACKEND_BorEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BorEventRequest) +func _ETHBACKEND_BorTxnLookup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BorTxnLookupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ETHBACKENDServer).BorTxnLookup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ETHBACKEND_BorTxnLookup_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ETHBACKENDServer).BorTxnLookup(ctx, req.(*BorTxnLookupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _ETHBACKEND_BorEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BorEventsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ETHBACKENDServer).BorEvent(ctx, in) + return srv.(ETHBACKENDServer).BorEvents(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ETHBACKEND_BorEvent_FullMethodName, + FullMethod: ETHBACKEND_BorEvents_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ETHBACKENDServer).BorEvent(ctx, req.(*BorEventRequest)) + return srv.(ETHBACKENDServer).BorEvents(ctx, req.(*BorEventsRequest)) } return interceptor(ctx, in, info, handler) } @@ -776,8 +861,12 @@ var ETHBACKEND_ServiceDesc = grpc.ServiceDesc{ Handler: _ETHBACKEND_PendingBlock_Handler, }, { - MethodName: "BorEvent", - Handler: _ETHBACKEND_BorEvent_Handler, + MethodName: "BorTxnLookup", + Handler: _ETHBACKEND_BorTxnLookup_Handler, + }, + { + MethodName: "BorEvents", + Handler: _ETHBACKEND_BorEvents_Handler, }, }, Streams: []grpc.StreamDesc{ diff --git a/erigon-lib/gointerfaces/remoteproto/kv.pb.go b/erigon-lib/gointerfaces/remoteproto/kv.pb.go index 88615d1eaa3..7b8c31bb353 100644 --- a/erigon-lib/gointerfaces/remoteproto/kv.pb.go +++ b/erigon-lib/gointerfaces/remoteproto/kv.pb.go @@ -1665,7 +1665,7 @@ func (x *Pairs) GetNextPageToken() string { return "" } -type ParisPagination struct { +type PairsPagination struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1674,8 +1674,8 @@ type ParisPagination struct { Limit int64 `protobuf:"zigzag64,2,opt,name=limit,proto3" json:"limit,omitempty"` } -func (x *ParisPagination) Reset() { - *x = ParisPagination{} +func (x *PairsPagination) Reset() { + *x = PairsPagination{} if protoimpl.UnsafeEnabled { mi := &file_remote_kv_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1683,13 +1683,13 @@ func (x *ParisPagination) Reset() { } } -func (x *ParisPagination) String() string { +func (x *PairsPagination) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ParisPagination) ProtoMessage() {} +func (*PairsPagination) ProtoMessage() {} -func (x *ParisPagination) ProtoReflect() protoreflect.Message { +func (x *PairsPagination) ProtoReflect() protoreflect.Message { mi := &file_remote_kv_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1701,19 +1701,19 @@ func (x *ParisPagination) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ParisPagination.ProtoReflect.Descriptor instead. -func (*ParisPagination) Descriptor() ([]byte, []int) { +// Deprecated: Use PairsPagination.ProtoReflect.Descriptor instead. +func (*PairsPagination) Descriptor() ([]byte, []int) { return file_remote_kv_proto_rawDescGZIP(), []int{19} } -func (x *ParisPagination) GetNextKey() []byte { +func (x *PairsPagination) GetNextKey() []byte { if x != nil { return x.NextKey } return nil } -func (x *ParisPagination) GetLimit() int64 { +func (x *PairsPagination) GetLimit() int64 { if x != nil { return x.Limit } @@ -1954,7 +1954,7 @@ var file_remote_kv_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x42, 0x0a, 0x0f, 0x50, 0x61, 0x72, 0x69, 0x73, 0x50, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x42, 0x0a, 0x0f, 0x50, 0x61, 0x69, 0x72, 0x73, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6e, 0x65, 0x78, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, @@ -2064,7 +2064,7 @@ var file_remote_kv_proto_goTypes = []any{ (*HistoryRangeReq)(nil), // 19: remote.HistoryRangeReq (*DomainRangeReq)(nil), // 20: remote.DomainRangeReq (*Pairs)(nil), // 21: remote.Pairs - (*ParisPagination)(nil), // 22: remote.ParisPagination + (*PairsPagination)(nil), // 22: remote.PairsPagination (*IndexPagination)(nil), // 23: remote.IndexPagination (*typesproto.H256)(nil), // 24: types.H256 (*typesproto.H160)(nil), // 25: types.H160 @@ -2343,7 +2343,7 @@ func file_remote_kv_proto_init() { } } file_remote_kv_proto_msgTypes[19].Exporter = func(v any, i int) any { - switch v := v.(*ParisPagination); i { + switch v := v.(*PairsPagination); i { case 0: return &v.state case 1: diff --git a/erigon-lib/kv/remotedbserver/remotedbserver.go b/erigon-lib/kv/remotedbserver/remotedbserver.go index d3f233b5c3b..efdf2da2a02 100644 --- a/erigon-lib/kv/remotedbserver/remotedbserver.go +++ b/erigon-lib/kv/remotedbserver/remotedbserver.go @@ -661,7 +661,7 @@ func (s *KvServer) DomainRange(_ context.Context, req *remote.DomainRangeReq) (* reply := &remote.Pairs{} fromKey, toKey, limit := req.FromKey, req.ToKey, int(req.Limit) if req.PageToken != "" { - var pagination remote.ParisPagination + var pagination remote.PairsPagination if err := unmarshalPagination(req.PageToken, &pagination); err != nil { return nil, err } @@ -697,7 +697,7 @@ func (s *KvServer) DomainRange(_ context.Context, req *remote.DomainRangeReq) (* if err != nil { return err } - reply.NextPageToken, err = marshalPagination(&remote.ParisPagination{NextKey: nextK, Limit: int64(limit)}) + reply.NextPageToken, err = marshalPagination(&remote.PairsPagination{NextKey: nextK, Limit: int64(limit)}) if err != nil { return err } @@ -712,7 +712,7 @@ func (s *KvServer) DomainRange(_ context.Context, req *remote.DomainRangeReq) (* func (s *KvServer) Range(_ context.Context, req *remote.RangeReq) (*remote.Pairs, error) { from, limit := req.FromPrefix, int(req.Limit) if req.PageToken != "" { - var pagination remote.ParisPagination + var pagination remote.PairsPagination if err := unmarshalPagination(req.PageToken, &pagination); err != nil { return nil, err } @@ -751,7 +751,7 @@ func (s *KvServer) Range(_ context.Context, req *remote.RangeReq) (*remote.Pairs if err != nil { return err } - reply.NextPageToken, err = marshalPagination(&remote.ParisPagination{NextKey: nextK, Limit: int64(limit)}) + reply.NextPageToken, err = marshalPagination(&remote.PairsPagination{NextKey: nextK, Limit: int64(limit)}) if err != nil { return err } diff --git a/ethdb/privateapi/ethbackend.go b/ethdb/privateapi/ethbackend.go index 79a81f880a0..8b8a0e5ab67 100644 --- a/ethdb/privateapi/ethbackend.go +++ b/ethdb/privateapi/ethbackend.go @@ -328,18 +328,41 @@ func (s *EthBackendServer) SubscribeLogs(server remote.ETHBACKEND_SubscribeLogsS return errors.New("no logs filter available") } -func (s *EthBackendServer) BorEvent(ctx context.Context, req *remote.BorEventRequest) (*remote.BorEventReply, error) { +func (s *EthBackendServer) BorTxnLookup(ctx context.Context, req *remote.BorTxnLookupRequest) (*remote.BorTxnLookupReply, error) { tx, err := s.db.BeginRo(ctx) if err != nil { return nil, err } defer tx.Rollback() - _, ok, err := s.blockReader.EventLookup(ctx, tx, gointerfaces.ConvertH256ToHash(req.BorTxHash)) + + blockNum, ok, err := s.blockReader.EventLookup(ctx, tx, gointerfaces.ConvertH256ToHash(req.BorTxHash)) if err != nil { return nil, err } - if !ok { - return &remote.BorEventReply{}, nil + return &remote.BorTxnLookupReply{ + BlockNumber: blockNum, + Present: ok, + }, nil +} + +func (s *EthBackendServer) BorEvents(ctx context.Context, req *remote.BorEventsRequest) (*remote.BorEventsReply, error) { + tx, err := s.db.BeginRo(ctx) + if err != nil { + return nil, err } - return &remote.BorEventReply{}, nil + defer tx.Rollback() + + events, err := s.blockReader.EventsByBlock(ctx, tx, gointerfaces.ConvertH256ToHash(req.BlockHash), req.BlockNum) + if err != nil { + return nil, err + } + + eventsRaw := make([][]byte, len(events)) + for i, e := range events { + eventsRaw[i] = e + } + + return &remote.BorEventsReply{ + EventRlps: eventsRaw, + }, nil } diff --git a/turbo/snapshotsync/freezeblocks/block_reader.go b/turbo/snapshotsync/freezeblocks/block_reader.go index 5f3af2d1fb5..d5a61d725d5 100644 --- a/turbo/snapshotsync/freezeblocks/block_reader.go +++ b/turbo/snapshotsync/freezeblocks/block_reader.go @@ -288,26 +288,25 @@ func (r *RemoteBlockReader) LastEventId(ctx context.Context, tx kv.Tx) (uint64, return 0, false, errors.New("not implemented") } -func (r *RemoteBlockReader) EventLookup(ctx context.Context, tx kv.Getter, txnHash common.Hash) (uint64, bool, error) { - reply, err := r.client.BorEvent(ctx, &remote.BorEventRequest{BorTxHash: gointerfaces.ConvertHashToH256(txnHash)}) +func (r *RemoteBlockReader) EventLookup(ctx context.Context, tx kv.Getter, borTxnHash common.Hash) (uint64, bool, error) { + reply, err := r.client.BorTxnLookup(ctx, &remote.BorTxnLookupRequest{BorTxHash: gointerfaces.ConvertHashToH256(borTxnHash)}) if err != nil { return 0, false, err } - if reply == nil || len(reply.EventRlps) == 0 { + if reply == nil { return 0, false, nil } - return reply.BlockNumber, true, nil + return reply.BlockNumber, reply.Present, nil } func (r *RemoteBlockReader) EventsByBlock(ctx context.Context, tx kv.Tx, hash common.Hash, blockHeight uint64) ([]rlp.RawValue, error) { - borTxnHash := bortypes.ComputeBorTxHash(blockHeight, hash) - reply, err := r.client.BorEvent(ctx, &remote.BorEventRequest{BorTxHash: gointerfaces.ConvertHashToH256(borTxnHash)}) + reply, err := r.client.BorEvents(ctx, &remote.BorEventsRequest{BlockHash: gointerfaces.ConvertHashToH256(hash), BlockNum: blockHeight}) if err != nil { return nil, err } result := make([]rlp.RawValue, len(reply.EventRlps)) for i, r := range reply.EventRlps { - result[i] = rlp.RawValue(r) + result[i] = r } return result, nil }