From e89b02369e68ef93b1a0e672875cfa1d3326d4b5 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Sat, 16 Nov 2024 15:09:35 +0100 Subject: [PATCH 1/2] Up-dep BLS (#12743) Fixed a mem leak in validator --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 62eae751f53..f7e4248dc96 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ replace github.com/erigontech/erigon-lib => ./erigon-lib require ( gfx.cafe/util/go/generic v0.0.0-20230721185457-c559e86c829c github.com/99designs/gqlgen v0.17.48 - github.com/Giulio2002/bls v0.0.0-20241109090632-4d3266c3b924 + github.com/Giulio2002/bls v0.0.0-20241116091023-2ddcc8954ec0 github.com/Masterminds/sprig/v3 v3.2.3 github.com/RoaringBitmap/roaring v1.9.4 github.com/alecthomas/kong v0.8.1 diff --git a/go.sum b/go.sum index 8c93a3ee39a..8fe7b35f979 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,8 @@ github.com/AskAlexSharov/bloomfilter/v2 v2.0.8 h1:eRExAhnCcGHKC4/s8bpbYHJTQfOtn/ github.com/AskAlexSharov/bloomfilter/v2 v2.0.8/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/Giulio2002/bls v0.0.0-20241109090632-4d3266c3b924 h1:F0mqC1pjpzpVtBfC3DK7a4uThmCk/9HwbHZs7pfSSlY= -github.com/Giulio2002/bls v0.0.0-20241109090632-4d3266c3b924/go.mod h1:k6OaCwpn4WGfzPgoXuEiWaV1BKXW+GjSkIz1mCA4jFU= +github.com/Giulio2002/bls v0.0.0-20241116091023-2ddcc8954ec0 h1:6DVEDL29nd7f2GoHZIA9rjpW90gYeNE3x5aUadOgTB4= +github.com/Giulio2002/bls v0.0.0-20241116091023-2ddcc8954ec0/go.mod h1:k6OaCwpn4WGfzPgoXuEiWaV1BKXW+GjSkIz1mCA4jFU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= From 6ba3d740e5f3e2d7713f41ed15b9c8b63c491de4 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Sun, 17 Nov 2024 14:36:50 +0700 Subject: [PATCH 2/2] grpc: domain methods rename (#12740) Rename: - `DomainRange` to `RangeAsOf` - `DomainGetAsOf` to `GetAsOf` - `DomainGet` to `GetLatest` all this methods do accept typed `kv.Domain` as a parameter merge after https://github.com/erigontech/erigon/pull/12621 --- .../mock_services/synced_data_mock.go | 25 +- erigon-lib/go.mod | 2 +- erigon-lib/go.sum | 4 +- erigon-lib/gointerfaces/remoteproto/kv.pb.go | 292 +++++++++--------- .../remoteproto/kv_client_mock.go | 112 +++---- .../gointerfaces/remoteproto/kv_grpc.pb.go | 63 ++-- erigon-lib/kv/remotedb/kv_remote.go | 6 +- .../kv/remotedbserver/remotedbserver.go | 6 +- polygon/bor/spanner_mock.go | 8 +- polygon/heimdall/entity_store_mock.go | 236 +++++++------- polygon/sync/p2p_service_mock.go | 1 + 11 files changed, 379 insertions(+), 376 deletions(-) diff --git a/cl/beacon/synced_data/mock_services/synced_data_mock.go b/cl/beacon/synced_data/mock_services/synced_data_mock.go index c89b8a7826e..5a37152a15b 100644 --- a/cl/beacon/synced_data/mock_services/synced_data_mock.go +++ b/cl/beacon/synced_data/mock_services/synced_data_mock.go @@ -22,6 +22,7 @@ import ( type MockSyncedData struct { ctrl *gomock.Controller recorder *MockSyncedDataMockRecorder + isgomock struct{} } // MockSyncedDataMockRecorder is the mock recorder for MockSyncedData. @@ -42,17 +43,17 @@ func (m *MockSyncedData) EXPECT() *MockSyncedDataMockRecorder { } // CommitteeCount mocks base method. -func (m *MockSyncedData) CommitteeCount(arg0 uint64) uint64 { +func (m *MockSyncedData) CommitteeCount(epoch uint64) uint64 { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CommitteeCount", arg0) + ret := m.ctrl.Call(m, "CommitteeCount", epoch) ret0, _ := ret[0].(uint64) return ret0 } // CommitteeCount indicates an expected call of CommitteeCount. -func (mr *MockSyncedDataMockRecorder) CommitteeCount(arg0 any) *MockSyncedDataCommitteeCountCall { +func (mr *MockSyncedDataMockRecorder) CommitteeCount(epoch any) *MockSyncedDataCommitteeCountCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitteeCount", reflect.TypeOf((*MockSyncedData)(nil).CommitteeCount), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitteeCount", reflect.TypeOf((*MockSyncedData)(nil).CommitteeCount), epoch) return &MockSyncedDataCommitteeCountCall{Call: call} } @@ -156,17 +157,17 @@ func (c *MockSyncedDataHeadSlotCall) DoAndReturn(f func() uint64) *MockSyncedDat } // OnHeadState mocks base method. -func (m *MockSyncedData) OnHeadState(arg0 *state.CachingBeaconState) error { +func (m *MockSyncedData) OnHeadState(newState *state.CachingBeaconState) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "OnHeadState", arg0) + ret := m.ctrl.Call(m, "OnHeadState", newState) ret0, _ := ret[0].(error) return ret0 } // OnHeadState indicates an expected call of OnHeadState. -func (mr *MockSyncedDataMockRecorder) OnHeadState(arg0 any) *MockSyncedDataOnHeadStateCall { +func (mr *MockSyncedDataMockRecorder) OnHeadState(newState any) *MockSyncedDataOnHeadStateCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnHeadState", reflect.TypeOf((*MockSyncedData)(nil).OnHeadState), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnHeadState", reflect.TypeOf((*MockSyncedData)(nil).OnHeadState), newState) return &MockSyncedDataOnHeadStateCall{Call: call} } @@ -268,17 +269,17 @@ func (c *MockSyncedDataUnsetHeadStateCall) DoAndReturn(f func()) *MockSyncedData } // ViewHeadState mocks base method. -func (m *MockSyncedData) ViewHeadState(arg0 synced_data.ViewHeadStateFn) error { +func (m *MockSyncedData) ViewHeadState(fn synced_data.ViewHeadStateFn) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ViewHeadState", arg0) + ret := m.ctrl.Call(m, "ViewHeadState", fn) ret0, _ := ret[0].(error) return ret0 } // ViewHeadState indicates an expected call of ViewHeadState. -func (mr *MockSyncedDataMockRecorder) ViewHeadState(arg0 any) *MockSyncedDataViewHeadStateCall { +func (mr *MockSyncedDataMockRecorder) ViewHeadState(fn any) *MockSyncedDataViewHeadStateCall { mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ViewHeadState", reflect.TypeOf((*MockSyncedData)(nil).ViewHeadState), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ViewHeadState", reflect.TypeOf((*MockSyncedData)(nil).ViewHeadState), fn) return &MockSyncedDataViewHeadStateCall{Call: call} } diff --git a/erigon-lib/go.mod b/erigon-lib/go.mod index ab87b1e514c..67fc1fd20fd 100644 --- a/erigon-lib/go.mod +++ b/erigon-lib/go.mod @@ -4,7 +4,7 @@ go 1.22.0 require ( github.com/erigontech/erigon-snapshot v1.3.1-0.20241023024258-f64407a77e8e - github.com/erigontech/interfaces v0.0.0-20241026045526-56f59523ec08 + github.com/erigontech/interfaces v0.0.0-20241116035842-5d396f10468e 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 1b777e16b96..c3205b9cd42 100644 --- a/erigon-lib/go.sum +++ b/erigon-lib/go.sum @@ -150,8 +150,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.20241023024258-f64407a77e8e h1:ZpIO6HeopuZPYDLldL6zR0qyRezj80kQrDOGEF779ts= github.com/erigontech/erigon-snapshot v1.3.1-0.20241023024258-f64407a77e8e/go.mod h1:ooHlCl+eEYzebiPu+FP6Q6SpPUeMADn8Jxabv3IKb9M= -github.com/erigontech/interfaces v0.0.0-20241026045526-56f59523ec08 h1:kjkEK5+jMxU9UkcBiFp1ZsRDyaAN8AXnoaITmso3FYQ= -github.com/erigontech/interfaces v0.0.0-20241026045526-56f59523ec08/go.mod h1:N7OUkhkcagp9+7yb4ycHsG2VWCOmuJ1ONBecJshxtLE= +github.com/erigontech/interfaces v0.0.0-20241116035842-5d396f10468e h1:KD/yuduvNJDKkdmEaaiDYb9RQstnkJn5ZcSZHjH/C/w= +github.com/erigontech/interfaces v0.0.0-20241116035842-5d396f10468e/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/kv.pb.go b/erigon-lib/gointerfaces/remoteproto/kv.pb.go index 2593e64de84..0af2893c155 100644 --- a/erigon-lib/gointerfaces/remoteproto/kv.pb.go +++ b/erigon-lib/gointerfaces/remoteproto/kv.pb.go @@ -939,7 +939,7 @@ func (x *RangeReq) GetPageToken() string { } // Temporal methods -type DomainGetReq struct { +type GetLatestReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -953,8 +953,8 @@ type DomainGetReq struct { Latest bool `protobuf:"varint,6,opt,name=latest,proto3" json:"latest,omitempty"` // if true, then `ts` ignored and return latest state (without history lookup) } -func (x *DomainGetReq) Reset() { - *x = DomainGetReq{} +func (x *GetLatestReq) Reset() { + *x = GetLatestReq{} if protoimpl.UnsafeEnabled { mi := &file_remote_kv_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -962,13 +962,13 @@ func (x *DomainGetReq) Reset() { } } -func (x *DomainGetReq) String() string { +func (x *GetLatestReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DomainGetReq) ProtoMessage() {} +func (*GetLatestReq) ProtoMessage() {} -func (x *DomainGetReq) ProtoReflect() protoreflect.Message { +func (x *GetLatestReq) ProtoReflect() protoreflect.Message { mi := &file_remote_kv_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -980,54 +980,54 @@ func (x *DomainGetReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DomainGetReq.ProtoReflect.Descriptor instead. -func (*DomainGetReq) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLatestReq.ProtoReflect.Descriptor instead. +func (*GetLatestReq) Descriptor() ([]byte, []int) { return file_remote_kv_proto_rawDescGZIP(), []int{10} } -func (x *DomainGetReq) GetTxId() uint64 { +func (x *GetLatestReq) GetTxId() uint64 { if x != nil { return x.TxId } return 0 } -func (x *DomainGetReq) GetTable() string { +func (x *GetLatestReq) GetTable() string { if x != nil { return x.Table } return "" } -func (x *DomainGetReq) GetK() []byte { +func (x *GetLatestReq) GetK() []byte { if x != nil { return x.K } return nil } -func (x *DomainGetReq) GetTs() uint64 { +func (x *GetLatestReq) GetTs() uint64 { if x != nil { return x.Ts } return 0 } -func (x *DomainGetReq) GetK2() []byte { +func (x *GetLatestReq) GetK2() []byte { if x != nil { return x.K2 } return nil } -func (x *DomainGetReq) GetLatest() bool { +func (x *GetLatestReq) GetLatest() bool { if x != nil { return x.Latest } return false } -type DomainGetReply struct { +type GetLatestReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1036,8 +1036,8 @@ type DomainGetReply struct { Ok bool `protobuf:"varint,2,opt,name=ok,proto3" json:"ok,omitempty"` } -func (x *DomainGetReply) Reset() { - *x = DomainGetReply{} +func (x *GetLatestReply) Reset() { + *x = GetLatestReply{} if protoimpl.UnsafeEnabled { mi := &file_remote_kv_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1045,13 +1045,13 @@ func (x *DomainGetReply) Reset() { } } -func (x *DomainGetReply) String() string { +func (x *GetLatestReply) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DomainGetReply) ProtoMessage() {} +func (*GetLatestReply) ProtoMessage() {} -func (x *DomainGetReply) ProtoReflect() protoreflect.Message { +func (x *GetLatestReply) ProtoReflect() protoreflect.Message { mi := &file_remote_kv_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1063,19 +1063,19 @@ func (x *DomainGetReply) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DomainGetReply.ProtoReflect.Descriptor instead. -func (*DomainGetReply) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLatestReply.ProtoReflect.Descriptor instead. +func (*GetLatestReply) Descriptor() ([]byte, []int) { return file_remote_kv_proto_rawDescGZIP(), []int{11} } -func (x *DomainGetReply) GetV() []byte { +func (x *GetLatestReply) GetV() []byte { if x != nil { return x.V } return nil } -func (x *DomainGetReply) GetOk() bool { +func (x *GetLatestReply) GetOk() bool { if x != nil { return x.Ok } @@ -1481,7 +1481,7 @@ func (x *HistoryRangeReq) GetPageToken() string { return "" } -type DomainRangeReq struct { +type RangeAsOfReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -1500,8 +1500,8 @@ type DomainRangeReq struct { PageToken string `protobuf:"bytes,10,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` } -func (x *DomainRangeReq) Reset() { - *x = DomainRangeReq{} +func (x *RangeAsOfReq) Reset() { + *x = RangeAsOfReq{} if protoimpl.UnsafeEnabled { mi := &file_remote_kv_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1509,13 +1509,13 @@ func (x *DomainRangeReq) Reset() { } } -func (x *DomainRangeReq) String() string { +func (x *RangeAsOfReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DomainRangeReq) ProtoMessage() {} +func (*RangeAsOfReq) ProtoMessage() {} -func (x *DomainRangeReq) ProtoReflect() protoreflect.Message { +func (x *RangeAsOfReq) ProtoReflect() protoreflect.Message { mi := &file_remote_kv_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -1527,75 +1527,75 @@ func (x *DomainRangeReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DomainRangeReq.ProtoReflect.Descriptor instead. -func (*DomainRangeReq) Descriptor() ([]byte, []int) { +// Deprecated: Use RangeAsOfReq.ProtoReflect.Descriptor instead. +func (*RangeAsOfReq) Descriptor() ([]byte, []int) { return file_remote_kv_proto_rawDescGZIP(), []int{17} } -func (x *DomainRangeReq) GetTxId() uint64 { +func (x *RangeAsOfReq) GetTxId() uint64 { if x != nil { return x.TxId } return 0 } -func (x *DomainRangeReq) GetTable() string { +func (x *RangeAsOfReq) GetTable() string { if x != nil { return x.Table } return "" } -func (x *DomainRangeReq) GetFromKey() []byte { +func (x *RangeAsOfReq) GetFromKey() []byte { if x != nil { return x.FromKey } return nil } -func (x *DomainRangeReq) GetToKey() []byte { +func (x *RangeAsOfReq) GetToKey() []byte { if x != nil { return x.ToKey } return nil } -func (x *DomainRangeReq) GetTs() uint64 { +func (x *RangeAsOfReq) GetTs() uint64 { if x != nil { return x.Ts } return 0 } -func (x *DomainRangeReq) GetLatest() bool { +func (x *RangeAsOfReq) GetLatest() bool { if x != nil { return x.Latest } return false } -func (x *DomainRangeReq) GetOrderAscend() bool { +func (x *RangeAsOfReq) GetOrderAscend() bool { if x != nil { return x.OrderAscend } return false } -func (x *DomainRangeReq) GetLimit() int64 { +func (x *RangeAsOfReq) GetLimit() int64 { if x != nil { return x.Limit } return 0 } -func (x *DomainRangeReq) GetPageSize() int32 { +func (x *RangeAsOfReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *DomainRangeReq) GetPageToken() string { +func (x *RangeAsOfReq) GetPageToken() string { if x != nil { return x.PageToken } @@ -1877,7 +1877,7 @@ var file_remote_kv_proto_rawDesc = []byte{ 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0x7f, 0x0a, 0x0c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x65, 0x74, + 0x6b, 0x65, 0x6e, 0x22, 0x7f, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x78, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0c, @@ -1885,7 +1885,7 @@ var file_remote_kv_proto_rawDesc = []byte{ 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x74, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x6b, 0x32, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x02, 0x6b, 0x32, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x65, + 0x74, 0x65, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x76, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x01, 0x76, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x6f, 0x6b, 0x22, 0x59, 0x0a, 0x0e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, @@ -1931,100 +1931,100 @@ var file_remote_kv_proto_rawDesc = []byte{ 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8a, 0x02, 0x0a, - 0x0e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, - 0x13, 0x0a, 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, - 0x74, 0x78, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x72, - 0x6f, 0x6d, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x66, 0x72, - 0x6f, 0x6d, 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x73, - 0x63, 0x65, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6f, 0x72, 0x64, 0x65, - 0x72, 0x41, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x05, 0x50, 0x61, 0x69, - 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, - 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 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, 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, - 0x01, 0x28, 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x0f, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x12, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x6d, 0x65, - 0x53, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2a, 0xfb, 0x01, 0x0a, 0x02, - 0x4f, 0x70, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0d, 0x0a, - 0x09, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x53, 0x45, 0x45, 0x4b, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x45, 0x45, 0x4b, 0x5f, 0x42, - 0x4f, 0x54, 0x48, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x55, 0x52, 0x52, 0x45, 0x4e, 0x54, - 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, - 0x4c, 0x41, 0x53, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x45, - 0x58, 0x54, 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x44, 0x55, 0x50, - 0x10, 0x09, 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x55, - 0x50, 0x10, 0x0b, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x52, 0x45, 0x56, 0x10, 0x0c, 0x12, 0x0c, 0x0a, - 0x08, 0x50, 0x52, 0x45, 0x56, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x50, - 0x52, 0x45, 0x56, 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x0e, 0x12, 0x0e, 0x0a, 0x0a, - 0x53, 0x45, 0x45, 0x4b, 0x5f, 0x45, 0x58, 0x41, 0x43, 0x54, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, - 0x53, 0x45, 0x45, 0x4b, 0x5f, 0x42, 0x4f, 0x54, 0x48, 0x5f, 0x45, 0x58, 0x41, 0x43, 0x54, 0x10, - 0x10, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x1e, 0x12, 0x09, 0x0a, 0x05, 0x43, - 0x4c, 0x4f, 0x53, 0x45, 0x10, 0x1f, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x50, 0x45, 0x4e, 0x5f, 0x44, - 0x55, 0x50, 0x5f, 0x53, 0x4f, 0x52, 0x54, 0x10, 0x20, 0x2a, 0x48, 0x0a, 0x06, 0x41, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x00, - 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x50, 0x53, 0x45, 0x52, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x43, 0x4f, 0x44, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x50, 0x53, 0x45, 0x52, 0x54, - 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, - 0x45, 0x10, 0x04, 0x2a, 0x24, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x0b, 0x0a, 0x07, 0x46, 0x4f, 0x52, 0x57, 0x41, 0x52, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, - 0x06, 0x55, 0x4e, 0x57, 0x49, 0x4e, 0x44, 0x10, 0x01, 0x32, 0xbd, 0x04, 0x0a, 0x02, 0x4b, 0x56, - 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, 0x26, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x0e, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x1a, 0x0c, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x28, 0x01, 0x30, 0x01, - 0x12, 0x46, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x12, 0x1a, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x42, 0x61, 0x74, 0x63, 0x68, 0x30, 0x01, 0x12, 0x3d, 0x0a, 0x09, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x10, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, + 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x88, 0x02, 0x0a, + 0x0c, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x73, 0x4f, 0x66, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, + 0x05, 0x74, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x74, 0x78, + 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x72, 0x6f, 0x6d, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x66, 0x72, 0x6f, 0x6d, + 0x4b, 0x65, 0x79, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x73, 0x63, 0x65, + 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x41, + 0x73, 0x63, 0x65, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5b, 0x0a, 0x05, 0x50, 0x61, 0x69, 0x72, 0x73, + 0x12, 0x12, 0x0a, 0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x04, + 0x6b, 0x65, 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 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, 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, 0x01, 0x28, + 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0x4f, 0x0a, 0x0f, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x6e, + 0x65, 0x78, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x12, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x53, 0x74, + 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x12, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x2a, 0xfb, 0x01, 0x0a, 0x02, 0x4f, 0x70, + 0x12, 0x09, 0x0a, 0x05, 0x46, 0x49, 0x52, 0x53, 0x54, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x46, + 0x49, 0x52, 0x53, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x53, 0x45, + 0x45, 0x4b, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x45, 0x45, 0x4b, 0x5f, 0x42, 0x4f, 0x54, + 0x48, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x55, 0x52, 0x52, 0x45, 0x4e, 0x54, 0x10, 0x04, + 0x12, 0x08, 0x0a, 0x04, 0x4c, 0x41, 0x53, 0x54, 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x4c, 0x41, + 0x53, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x45, 0x58, 0x54, + 0x10, 0x08, 0x12, 0x0c, 0x0a, 0x08, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x09, + 0x12, 0x0f, 0x0a, 0x0b, 0x4e, 0x45, 0x58, 0x54, 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x55, 0x50, 0x10, + 0x0b, 0x12, 0x08, 0x0a, 0x04, 0x50, 0x52, 0x45, 0x56, 0x10, 0x0c, 0x12, 0x0c, 0x0a, 0x08, 0x50, + 0x52, 0x45, 0x56, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x0d, 0x12, 0x0f, 0x0a, 0x0b, 0x50, 0x52, 0x45, + 0x56, 0x5f, 0x4e, 0x4f, 0x5f, 0x44, 0x55, 0x50, 0x10, 0x0e, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x45, + 0x45, 0x4b, 0x5f, 0x45, 0x58, 0x41, 0x43, 0x54, 0x10, 0x0f, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, + 0x45, 0x4b, 0x5f, 0x42, 0x4f, 0x54, 0x48, 0x5f, 0x45, 0x58, 0x41, 0x43, 0x54, 0x10, 0x10, 0x12, + 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, 0x1e, 0x12, 0x09, 0x0a, 0x05, 0x43, 0x4c, 0x4f, + 0x53, 0x45, 0x10, 0x1f, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x50, 0x45, 0x4e, 0x5f, 0x44, 0x55, 0x50, + 0x5f, 0x53, 0x4f, 0x52, 0x54, 0x10, 0x20, 0x2a, 0x48, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x54, 0x4f, 0x52, 0x41, 0x47, 0x45, 0x10, 0x00, 0x12, 0x0a, + 0x0a, 0x06, 0x55, 0x50, 0x53, 0x45, 0x52, 0x54, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, + 0x44, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x55, 0x50, 0x53, 0x45, 0x52, 0x54, 0x5f, 0x43, + 0x4f, 0x44, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x10, + 0x04, 0x2a, 0x24, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, + 0x0a, 0x07, 0x46, 0x4f, 0x52, 0x57, 0x41, 0x52, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, + 0x4e, 0x57, 0x49, 0x4e, 0x44, 0x10, 0x01, 0x32, 0xb9, 0x04, 0x0a, 0x02, 0x4b, 0x56, 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, 0x26, 0x0a, 0x02, 0x54, 0x78, 0x12, 0x0e, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x43, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x1a, 0x0c, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x28, 0x01, 0x30, 0x01, 0x12, 0x46, + 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x1a, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x42, + 0x61, 0x74, 0x63, 0x68, 0x30, 0x01, 0x12, 0x3d, 0x0a, 0x09, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, + 0x6f, 0x74, 0x73, 0x12, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x6e, 0x61, + 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x73, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x28, 0x0a, 0x05, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x10, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x73, 0x12, + 0x39, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x14, 0x2e, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x4c, + 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x0b, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, 0x52, 0x65, + 0x71, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3c, 0x0a, 0x0a, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, + 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x0c, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x69, 0x72, - 0x73, 0x12, 0x39, 0x0a, 0x09, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x65, 0x74, 0x12, 0x14, - 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x44, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3f, 0x0a, 0x0b, - 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, 0x12, 0x16, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, - 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x65, 0x6b, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3c, 0x0a, - 0x0a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x15, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x36, 0x0a, 0x0c, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x17, 0x2e, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, - 0x69, 0x72, 0x73, 0x12, 0x34, 0x0a, 0x0b, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x12, 0x16, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, 0x69, 0x72, 0x73, 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, + 0x73, 0x12, 0x30, 0x0a, 0x09, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x73, 0x4f, 0x66, 0x12, 0x14, + 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x73, 0x4f, + 0x66, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2e, 0x50, 0x61, + 0x69, 0x72, 0x73, 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 ( @@ -2055,14 +2055,14 @@ var file_remote_kv_proto_goTypes = []any{ (*SnapshotsRequest)(nil), // 10: remote.SnapshotsRequest (*SnapshotsReply)(nil), // 11: remote.SnapshotsReply (*RangeReq)(nil), // 12: remote.RangeReq - (*DomainGetReq)(nil), // 13: remote.DomainGetReq - (*DomainGetReply)(nil), // 14: remote.DomainGetReply + (*GetLatestReq)(nil), // 13: remote.GetLatestReq + (*GetLatestReply)(nil), // 14: remote.GetLatestReply (*HistorySeekReq)(nil), // 15: remote.HistorySeekReq (*HistorySeekReply)(nil), // 16: remote.HistorySeekReply (*IndexRangeReq)(nil), // 17: remote.IndexRangeReq (*IndexRangeReply)(nil), // 18: remote.IndexRangeReply (*HistoryRangeReq)(nil), // 19: remote.HistoryRangeReq - (*DomainRangeReq)(nil), // 20: remote.DomainRangeReq + (*RangeAsOfReq)(nil), // 20: remote.RangeAsOfReq (*Pairs)(nil), // 21: remote.Pairs (*PairsPagination)(nil), // 22: remote.PairsPagination (*IndexPagination)(nil), // 23: remote.IndexPagination @@ -2086,17 +2086,17 @@ var file_remote_kv_proto_depIdxs = []int32{ 9, // 11: remote.KV.StateChanges:input_type -> remote.StateChangeRequest 10, // 12: remote.KV.Snapshots:input_type -> remote.SnapshotsRequest 12, // 13: remote.KV.Range:input_type -> remote.RangeReq - 13, // 14: remote.KV.GetLatest:input_type -> remote.DomainGetReq + 13, // 14: remote.KV.GetLatest:input_type -> remote.GetLatestReq 15, // 15: remote.KV.HistorySeek:input_type -> remote.HistorySeekReq 17, // 16: remote.KV.IndexRange:input_type -> remote.IndexRangeReq 19, // 17: remote.KV.HistoryRange:input_type -> remote.HistoryRangeReq - 20, // 18: remote.KV.RangeAsOf:input_type -> remote.DomainRangeReq + 20, // 18: remote.KV.RangeAsOf:input_type -> remote.RangeAsOfReq 27, // 19: remote.KV.Version:output_type -> types.VersionReply 4, // 20: remote.KV.Tx:output_type -> remote.Pair 7, // 21: remote.KV.StateChanges:output_type -> remote.StateChangeBatch 11, // 22: remote.KV.Snapshots:output_type -> remote.SnapshotsReply 21, // 23: remote.KV.Range:output_type -> remote.Pairs - 14, // 24: remote.KV.GetLatest:output_type -> remote.DomainGetReply + 14, // 24: remote.KV.GetLatest:output_type -> remote.GetLatestReply 16, // 25: remote.KV.HistorySeek:output_type -> remote.HistorySeekReply 18, // 26: remote.KV.IndexRange:output_type -> remote.IndexRangeReply 21, // 27: remote.KV.HistoryRange:output_type -> remote.Pairs @@ -2235,7 +2235,7 @@ func file_remote_kv_proto_init() { } } file_remote_kv_proto_msgTypes[10].Exporter = func(v any, i int) any { - switch v := v.(*DomainGetReq); i { + switch v := v.(*GetLatestReq); i { case 0: return &v.state case 1: @@ -2247,7 +2247,7 @@ func file_remote_kv_proto_init() { } } file_remote_kv_proto_msgTypes[11].Exporter = func(v any, i int) any { - switch v := v.(*DomainGetReply); i { + switch v := v.(*GetLatestReply); i { case 0: return &v.state case 1: @@ -2319,7 +2319,7 @@ func file_remote_kv_proto_init() { } } file_remote_kv_proto_msgTypes[17].Exporter = func(v any, i int) any { - switch v := v.(*DomainRangeReq); i { + switch v := v.(*RangeAsOfReq); i { case 0: return &v.state case 1: diff --git a/erigon-lib/gointerfaces/remoteproto/kv_client_mock.go b/erigon-lib/gointerfaces/remoteproto/kv_client_mock.go index e66760b88ee..ae80abfd688 100644 --- a/erigon-lib/gointerfaces/remoteproto/kv_client_mock.go +++ b/erigon-lib/gointerfaces/remoteproto/kv_client_mock.go @@ -43,90 +43,46 @@ func (m *MockKVClient) EXPECT() *MockKVClientMockRecorder { return m.recorder } -// DomainGet mocks base method. -func (m *MockKVClient) DomainGet(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) { +// GetLatest mocks base method. +func (m *MockKVClient) GetLatest(ctx context.Context, in *GetLatestReq, opts ...grpc.CallOption) (*GetLatestReply, error) { m.ctrl.T.Helper() varargs := []any{ctx, in} for _, a := range opts { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "GetLatest", varargs...) - ret0, _ := ret[0].(*DomainGetReply) + ret0, _ := ret[0].(*GetLatestReply) ret1, _ := ret[1].(error) return ret0, ret1 } -// DomainGet indicates an expected call of DomainGet. -func (mr *MockKVClientMockRecorder) DomainGet(ctx, in any, opts ...any) *MockKVClientDomainGetCall { +// GetLatest indicates an expected call of GetLatest. +func (mr *MockKVClientMockRecorder) GetLatest(ctx, in any, opts ...any) *MockKVClientGetLatestCall { mr.mock.ctrl.T.Helper() varargs := append([]any{ctx, in}, opts...) - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatest", reflect.TypeOf((*MockKVClient)(nil).DomainGet), varargs...) - return &MockKVClientDomainGetCall{Call: call} + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLatest", reflect.TypeOf((*MockKVClient)(nil).GetLatest), varargs...) + return &MockKVClientGetLatestCall{Call: call} } -// MockKVClientDomainGetCall wrap *gomock.Call -type MockKVClientDomainGetCall struct { +// MockKVClientGetLatestCall wrap *gomock.Call +type MockKVClientGetLatestCall struct { *gomock.Call } // Return rewrite *gomock.Call.Return -func (c *MockKVClientDomainGetCall) Return(arg0 *DomainGetReply, arg1 error) *MockKVClientDomainGetCall { +func (c *MockKVClientGetLatestCall) Return(arg0 *GetLatestReply, arg1 error) *MockKVClientGetLatestCall { c.Call = c.Call.Return(arg0, arg1) return c } // Do rewrite *gomock.Call.Do -func (c *MockKVClientDomainGetCall) Do(f func(context.Context, *DomainGetReq, ...grpc.CallOption) (*DomainGetReply, error)) *MockKVClientDomainGetCall { +func (c *MockKVClientGetLatestCall) Do(f func(context.Context, *GetLatestReq, ...grpc.CallOption) (*GetLatestReply, error)) *MockKVClientGetLatestCall { c.Call = c.Call.Do(f) return c } // DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockKVClientDomainGetCall) DoAndReturn(f func(context.Context, *DomainGetReq, ...grpc.CallOption) (*DomainGetReply, error)) *MockKVClientDomainGetCall { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// DomainRange mocks base method. -func (m *MockKVClient) DomainRange(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) { - m.ctrl.T.Helper() - varargs := []any{ctx, in} - for _, a := range opts { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "RangeAsOf", varargs...) - ret0, _ := ret[0].(*Pairs) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DomainRange indicates an expected call of DomainRange. -func (mr *MockKVClientMockRecorder) DomainRange(ctx, in any, opts ...any) *MockKVClientDomainRangeCall { - mr.mock.ctrl.T.Helper() - varargs := append([]any{ctx, in}, opts...) - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeAsOf", reflect.TypeOf((*MockKVClient)(nil).DomainRange), varargs...) - return &MockKVClientDomainRangeCall{Call: call} -} - -// MockKVClientDomainRangeCall wrap *gomock.Call -type MockKVClientDomainRangeCall struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *MockKVClientDomainRangeCall) Return(arg0 *Pairs, arg1 error) *MockKVClientDomainRangeCall { - c.Call = c.Call.Return(arg0, arg1) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *MockKVClientDomainRangeCall) Do(f func(context.Context, *DomainRangeReq, ...grpc.CallOption) (*Pairs, error)) *MockKVClientDomainRangeCall { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockKVClientDomainRangeCall) DoAndReturn(f func(context.Context, *DomainRangeReq, ...grpc.CallOption) (*Pairs, error)) *MockKVClientDomainRangeCall { +func (c *MockKVClientGetLatestCall) DoAndReturn(f func(context.Context, *GetLatestReq, ...grpc.CallOption) (*GetLatestReply, error)) *MockKVClientGetLatestCall { c.Call = c.Call.DoAndReturn(f) return c } @@ -307,6 +263,50 @@ func (c *MockKVClientRangeCall) DoAndReturn(f func(context.Context, *RangeReq, . return c } +// RangeAsOf mocks base method. +func (m *MockKVClient) RangeAsOf(ctx context.Context, in *RangeAsOfReq, opts ...grpc.CallOption) (*Pairs, error) { + m.ctrl.T.Helper() + varargs := []any{ctx, in} + for _, a := range opts { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RangeAsOf", varargs...) + ret0, _ := ret[0].(*Pairs) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RangeAsOf indicates an expected call of RangeAsOf. +func (mr *MockKVClientMockRecorder) RangeAsOf(ctx, in any, opts ...any) *MockKVClientRangeAsOfCall { + mr.mock.ctrl.T.Helper() + varargs := append([]any{ctx, in}, opts...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RangeAsOf", reflect.TypeOf((*MockKVClient)(nil).RangeAsOf), varargs...) + return &MockKVClientRangeAsOfCall{Call: call} +} + +// MockKVClientRangeAsOfCall wrap *gomock.Call +type MockKVClientRangeAsOfCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockKVClientRangeAsOfCall) Return(arg0 *Pairs, arg1 error) *MockKVClientRangeAsOfCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockKVClientRangeAsOfCall) Do(f func(context.Context, *RangeAsOfReq, ...grpc.CallOption) (*Pairs, error)) *MockKVClientRangeAsOfCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockKVClientRangeAsOfCall) DoAndReturn(f func(context.Context, *RangeAsOfReq, ...grpc.CallOption) (*Pairs, error)) *MockKVClientRangeAsOfCall { + c.Call = c.Call.DoAndReturn(f) + return c +} + // Snapshots mocks base method. func (m *MockKVClient) Snapshots(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error) { m.ctrl.T.Helper() diff --git a/erigon-lib/gointerfaces/remoteproto/kv_grpc.pb.go b/erigon-lib/gointerfaces/remoteproto/kv_grpc.pb.go index b1972d9a156..f64ddddf7e7 100644 --- a/erigon-lib/gointerfaces/remoteproto/kv_grpc.pb.go +++ b/erigon-lib/gointerfaces/remoteproto/kv_grpc.pb.go @@ -7,12 +7,13 @@ package remoteproto import ( - context "context" - typesproto "github.com/erigontech/erigon-lib/gointerfaces/typesproto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - emptypb "google.golang.org/protobuf/types/known/emptypb" + "context" + + "github.com/erigontech/erigon-lib/gointerfaces/typesproto" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/types/known/emptypb" ) // This is a compile-time assertion to ensure that this generated file @@ -26,11 +27,11 @@ const ( KV_StateChanges_FullMethodName = "/remote.KV/StateChanges" KV_Snapshots_FullMethodName = "/remote.KV/Snapshots" KV_Range_FullMethodName = "/remote.KV/Range" - KV_DomainGet_FullMethodName = "/remote.KV/GetLatest" + KV_GetLatest_FullMethodName = "/remote.KV/GetLatest" KV_HistorySeek_FullMethodName = "/remote.KV/HistorySeek" KV_IndexRange_FullMethodName = "/remote.KV/IndexRange" KV_HistoryRange_FullMethodName = "/remote.KV/HistoryRange" - KV_DomainRange_FullMethodName = "/remote.KV/RangeAsOf" + KV_RangeAsOf_FullMethodName = "/remote.KV/RangeAsOf" ) // KVClient is the client API for KV service. @@ -56,11 +57,11 @@ type KVClient interface { // If orderAscend=false server expecting `from`<`to`. Example: Range("B", "A") Range(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error) // Temporal methods - DomainGet(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) + GetLatest(ctx context.Context, in *GetLatestReq, opts ...grpc.CallOption) (*GetLatestReply, error) HistorySeek(ctx context.Context, in *HistorySeekReq, opts ...grpc.CallOption) (*HistorySeekReply, error) IndexRange(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error) HistoryRange(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error) - DomainRange(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) + RangeAsOf(ctx context.Context, in *RangeAsOfReq, opts ...grpc.CallOption) (*Pairs, error) } type kVClient struct { @@ -166,10 +167,10 @@ func (c *kVClient) Range(ctx context.Context, in *RangeReq, opts ...grpc.CallOpt return out, nil } -func (c *kVClient) DomainGet(ctx context.Context, in *DomainGetReq, opts ...grpc.CallOption) (*DomainGetReply, error) { +func (c *kVClient) GetLatest(ctx context.Context, in *GetLatestReq, opts ...grpc.CallOption) (*GetLatestReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DomainGetReply) - err := c.cc.Invoke(ctx, KV_DomainGet_FullMethodName, in, out, cOpts...) + out := new(GetLatestReply) + err := c.cc.Invoke(ctx, KV_GetLatest_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -206,10 +207,10 @@ func (c *kVClient) HistoryRange(ctx context.Context, in *HistoryRangeReq, opts . return out, nil } -func (c *kVClient) DomainRange(ctx context.Context, in *DomainRangeReq, opts ...grpc.CallOption) (*Pairs, error) { +func (c *kVClient) RangeAsOf(ctx context.Context, in *RangeAsOfReq, opts ...grpc.CallOption) (*Pairs, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(Pairs) - err := c.cc.Invoke(ctx, KV_DomainRange_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, KV_RangeAsOf_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -239,11 +240,11 @@ type KVServer interface { // If orderAscend=false server expecting `from`<`to`. Example: Range("B", "A") Range(context.Context, *RangeReq) (*Pairs, error) // Temporal methods - DomainGet(context.Context, *DomainGetReq) (*DomainGetReply, error) + GetLatest(context.Context, *GetLatestReq) (*GetLatestReply, error) HistorySeek(context.Context, *HistorySeekReq) (*HistorySeekReply, error) IndexRange(context.Context, *IndexRangeReq) (*IndexRangeReply, error) HistoryRange(context.Context, *HistoryRangeReq) (*Pairs, error) - DomainRange(context.Context, *DomainRangeReq) (*Pairs, error) + RangeAsOf(context.Context, *RangeAsOfReq) (*Pairs, error) mustEmbedUnimplementedKVServer() } @@ -266,7 +267,7 @@ func (UnimplementedKVServer) Snapshots(context.Context, *SnapshotsRequest) (*Sna func (UnimplementedKVServer) Range(context.Context, *RangeReq) (*Pairs, error) { return nil, status.Errorf(codes.Unimplemented, "method Range not implemented") } -func (UnimplementedKVServer) DomainGet(context.Context, *DomainGetReq) (*DomainGetReply, error) { +func (UnimplementedKVServer) GetLatest(context.Context, *GetLatestReq) (*GetLatestReply, error) { return nil, status.Errorf(codes.Unimplemented, "method GetLatest not implemented") } func (UnimplementedKVServer) HistorySeek(context.Context, *HistorySeekReq) (*HistorySeekReply, error) { @@ -278,7 +279,7 @@ func (UnimplementedKVServer) IndexRange(context.Context, *IndexRangeReq) (*Index func (UnimplementedKVServer) HistoryRange(context.Context, *HistoryRangeReq) (*Pairs, error) { return nil, status.Errorf(codes.Unimplemented, "method HistoryRange not implemented") } -func (UnimplementedKVServer) DomainRange(context.Context, *DomainRangeReq) (*Pairs, error) { +func (UnimplementedKVServer) RangeAsOf(context.Context, *RangeAsOfReq) (*Pairs, error) { return nil, status.Errorf(codes.Unimplemented, "method RangeAsOf not implemented") } func (UnimplementedKVServer) mustEmbedUnimplementedKVServer() {} @@ -395,20 +396,20 @@ func _KV_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } -func _KV_DomainGet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DomainGetReq) +func _KV_GetLatest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetLatestReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(KVServer).DomainGet(ctx, in) + return srv.(KVServer).GetLatest(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: KV_DomainGet_FullMethodName, + FullMethod: KV_GetLatest_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).DomainGet(ctx, req.(*DomainGetReq)) + return srv.(KVServer).GetLatest(ctx, req.(*GetLatestReq)) } return interceptor(ctx, in, info, handler) } @@ -467,20 +468,20 @@ func _KV_HistoryRange_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } -func _KV_DomainRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DomainRangeReq) +func _KV_RangeAsOf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RangeAsOfReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(KVServer).DomainRange(ctx, in) + return srv.(KVServer).RangeAsOf(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: KV_DomainRange_FullMethodName, + FullMethod: KV_RangeAsOf_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(KVServer).DomainRange(ctx, req.(*DomainRangeReq)) + return srv.(KVServer).RangeAsOf(ctx, req.(*RangeAsOfReq)) } return interceptor(ctx, in, info, handler) } @@ -506,7 +507,7 @@ var KV_ServiceDesc = grpc.ServiceDesc{ }, { MethodName: "GetLatest", - Handler: _KV_DomainGet_Handler, + Handler: _KV_GetLatest_Handler, }, { MethodName: "HistorySeek", @@ -522,7 +523,7 @@ var KV_ServiceDesc = grpc.ServiceDesc{ }, { MethodName: "RangeAsOf", - Handler: _KV_DomainRange_Handler, + Handler: _KV_RangeAsOf_Handler, }, }, Streams: []grpc.StreamDesc{ diff --git a/erigon-lib/kv/remotedb/kv_remote.go b/erigon-lib/kv/remotedb/kv_remote.go index 1b1639974f1..5b235207650 100644 --- a/erigon-lib/kv/remotedb/kv_remote.go +++ b/erigon-lib/kv/remotedb/kv_remote.go @@ -626,7 +626,7 @@ func (c *remoteCursorDupSort) LastDup() ([]byte, error) { return c.las // Temporal Methods func (tx *tx) GetAsOf(name kv.Domain, k, k2 []byte, ts uint64) (v []byte, ok bool, err error) { - reply, err := tx.db.remoteKV.DomainGet(tx.ctx, &remote.DomainGetReq{TxId: tx.id, Table: name.String(), K: k, K2: k2, Ts: ts}) + reply, err := tx.db.remoteKV.GetLatest(tx.ctx, &remote.GetLatestReq{TxId: tx.id, Table: name.String(), K: k, K2: k2, Ts: ts}) if err != nil { return nil, false, err } @@ -634,7 +634,7 @@ func (tx *tx) GetAsOf(name kv.Domain, k, k2 []byte, ts uint64) (v []byte, ok boo } func (tx *tx) GetLatest(name kv.Domain, k, k2 []byte) (v []byte, step uint64, err error) { - reply, err := tx.db.remoteKV.DomainGet(tx.ctx, &remote.DomainGetReq{TxId: tx.id, Table: name.String(), K: k, K2: k2, Latest: true}) + reply, err := tx.db.remoteKV.GetLatest(tx.ctx, &remote.GetLatestReq{TxId: tx.id, Table: name.String(), K: k, K2: k2, Latest: true}) if err != nil { return nil, 0, err } @@ -643,7 +643,7 @@ func (tx *tx) GetLatest(name kv.Domain, k, k2 []byte) (v []byte, step uint64, er func (tx *tx) RangeAsOf(name kv.Domain, fromKey, toKey []byte, ts uint64, asc order.By, limit int) (it stream.KV, err error) { return stream.PaginateKV(func(pageToken string) (keys, vals [][]byte, nextPageToken string, err error) { - reply, err := tx.db.remoteKV.DomainRange(tx.ctx, &remote.DomainRangeReq{TxId: tx.id, Table: name.String(), FromKey: fromKey, ToKey: toKey, Ts: ts, OrderAscend: bool(asc), Limit: int64(limit), PageToken: pageToken}) + reply, err := tx.db.remoteKV.RangeAsOf(tx.ctx, &remote.RangeAsOfReq{TxId: tx.id, Table: name.String(), FromKey: fromKey, ToKey: toKey, Ts: ts, OrderAscend: bool(asc), Limit: int64(limit), PageToken: pageToken}) if err != nil { return nil, nil, "", err } diff --git a/erigon-lib/kv/remotedbserver/remotedbserver.go b/erigon-lib/kv/remotedbserver/remotedbserver.go index b4c0d981e4d..3f7ea148b36 100644 --- a/erigon-lib/kv/remotedbserver/remotedbserver.go +++ b/erigon-lib/kv/remotedbserver/remotedbserver.go @@ -526,12 +526,12 @@ func (s *StateChangePubSub) remove(id uint) { // Temporal methods // -func (s *KvServer) DomainGet(_ context.Context, req *remote.DomainGetReq) (reply *remote.DomainGetReply, err error) { +func (s *KvServer) DomainGet(_ context.Context, req *remote.GetLatestReq) (reply *remote.GetLatestReply, err error) { domainName, err := kv.String2Domain(req.Table) if err != nil { return nil, err } - reply = &remote.DomainGetReply{} + reply = &remote.GetLatestReply{} if err := s.with(req.TxId, func(tx kv.Tx) error { ttx, ok := tx.(kv.TemporalTx) if !ok { @@ -659,7 +659,7 @@ func (s *KvServer) HistoryRange(_ context.Context, req *remote.HistoryRangeReq) return reply, nil } -func (s *KvServer) DomainRange(_ context.Context, req *remote.DomainRangeReq) (*remote.Pairs, error) { +func (s *KvServer) DomainRange(_ context.Context, req *remote.RangeAsOfReq) (*remote.Pairs, error) { domainName, err := kv.String2Domain(req.Table) if err != nil { return nil, err diff --git a/polygon/bor/spanner_mock.go b/polygon/bor/spanner_mock.go index 0bb851f1619..000df402ea0 100644 --- a/polygon/bor/spanner_mock.go +++ b/polygon/bor/spanner_mock.go @@ -81,9 +81,9 @@ func (c *MockSpannerCommitSpanCall) DoAndReturn(f func(heimdall.Span, consensus. } // GetCurrentProducers mocks base method. -func (m *MockSpanner) GetCurrentProducers(arg0 uint64, arg1 ChainHeaderReader) ([]*valset.Validator, error) { +func (m *MockSpanner) GetCurrentProducers(spanId uint64, chain ChainHeaderReader) ([]*valset.Validator, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCurrentProducers", arg0, arg1) + ret := m.ctrl.Call(m, "GetCurrentProducers", spanId, chain) ret0, _ := ret[0].([]*valset.Validator) ret1, _ := ret[1].(error) return ret0, ret1 @@ -159,9 +159,9 @@ func (c *MockSpannerGetCurrentSpanCall) DoAndReturn(f func(consensus.SystemCall) } // GetCurrentValidators mocks base method. -func (m *MockSpanner) GetCurrentValidators(arg0 uint64, arg1 ChainHeaderReader) ([]*valset.Validator, error) { +func (m *MockSpanner) GetCurrentValidators(spanId uint64, chain ChainHeaderReader) ([]*valset.Validator, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCurrentValidators", arg0, arg1) + ret := m.ctrl.Call(m, "GetCurrentValidators", spanId, chain) ret0, _ := ret[0].([]*valset.Validator) ret1, _ := ret[1].(error) return ret0, ret1 diff --git a/polygon/heimdall/entity_store_mock.go b/polygon/heimdall/entity_store_mock.go index 4ef01910dbd..4c42dd1d181 100644 --- a/polygon/heimdall/entity_store_mock.go +++ b/polygon/heimdall/entity_store_mock.go @@ -77,6 +77,84 @@ func (c *MockEntityStoreCloseCall[TEntity]) DoAndReturn(f func()) *MockEntitySto return c } +// DeleteFromBlockNum mocks base method. +func (m *MockEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, unwindPoint uint64) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteFromBlockNum", ctx, unwindPoint) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteFromBlockNum indicates an expected call of DeleteFromBlockNum. +func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteFromBlockNum(ctx, unwindPoint any) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFromBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).DeleteFromBlockNum), ctx, unwindPoint) + return &MockEntityStoreDeleteFromBlockNumCall[TEntity]{Call: call} +} + +// MockEntityStoreDeleteFromBlockNumCall wrap *gomock.Call +type MockEntityStoreDeleteFromBlockNumCall[TEntity Entity] struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { + c.Call = c.Call.DoAndReturn(f) + return c +} + +// DeleteToBlockNum mocks base method. +func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, unwindPoint uint64, limit int) (int, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteToBlockNum", ctx, unwindPoint, limit) + ret0, _ := ret[0].(int) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteToBlockNum indicates an expected call of DeleteToBlockNum. +func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx, unwindPoint, limit any) *MockEntityStoreDeleteToBlockNumCall[TEntity] { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteToBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).DeleteToBlockNum), ctx, unwindPoint, limit) + return &MockEntityStoreDeleteToBlockNumCall[TEntity]{Call: call} +} + +// MockEntityStoreDeleteToBlockNumCall wrap *gomock.Call +type MockEntityStoreDeleteToBlockNumCall[TEntity Entity] struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteToBlockNumCall[TEntity] { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Do(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity] { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity] { + c.Call = c.Call.DoAndReturn(f) + return c +} + // Entity mocks base method. func (m *MockEntityStore[TEntity]) Entity(ctx context.Context, id uint64) (TEntity, bool, error) { m.ctrl.T.Helper() @@ -117,6 +195,46 @@ func (c *MockEntityStoreEntityCall[TEntity]) DoAndReturn(f func(context.Context, return c } +// EntityIdFromBlockNum mocks base method. +func (m *MockEntityStore[TEntity]) EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EntityIdFromBlockNum", ctx, blockNum) + ret0, _ := ret[0].(uint64) + ret1, _ := ret[1].(bool) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// EntityIdFromBlockNum indicates an expected call of EntityIdFromBlockNum. +func (mr *MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum(ctx, blockNum any) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { + mr.mock.ctrl.T.Helper() + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EntityIdFromBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).EntityIdFromBlockNum), ctx, blockNum) + return &MockEntityStoreEntityIdFromBlockNumCall[TEntity]{Call: call} +} + +// MockEntityStoreEntityIdFromBlockNumCall wrap *gomock.Call +type MockEntityStoreEntityIdFromBlockNumCall[TEntity Entity] struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { + c.Call = c.Call.DoAndReturn(f) + return c +} + // LastEntity mocks base method. func (m *MockEntityStore[TEntity]) LastEntity(ctx context.Context) (TEntity, bool, error) { m.ctrl.T.Helper() @@ -387,121 +505,3 @@ func (c *MockEntityStoreSnapTypeCall[TEntity]) DoAndReturn(f func() snaptype.Typ c.Call = c.Call.DoAndReturn(f) return c } - -// EntityIdFromBlockNum mocks base method. -func (m *MockEntityStore[TEntity]) EntityIdFromBlockNum(ctx context.Context, blockNum uint64) (uint64, bool, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EntityIdFromBlockNum", ctx, blockNum) - ret0, _ := ret[0].(uint64) - ret1, _ := ret[1].(bool) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 -} - -// EntityIdFromBlockNum indicates an expected call of EntityIdFromBlockNum. -func (mr *MockEntityStoreMockRecorder[TEntity]) EntityIdFromBlockNum(ctx any, blockNum any) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EntityIdFromBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).EntityIdFromBlockNum), ctx, blockNum) - return &MockEntityStoreEntityIdFromBlockNumCall[TEntity]{Call: call} -} - -// MockEntityStoreEntityIdFromBlockNumCall wrap *gomock.Call -type MockEntityStoreEntityIdFromBlockNumCall[TEntity Entity] struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Return(arg0 uint64, arg1 bool, arg2 error) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { - c.Call = c.Call.Return(arg0, arg1, arg2) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEntityStoreEntityIdFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (uint64, bool, error)) *MockEntityStoreEntityIdFromBlockNumCall[TEntity] { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// EntityIdFromBlockNum mocks base method. -func (m *MockEntityStore[TEntity]) DeleteToBlockNum(ctx context.Context, blockNum uint64, limit int) (int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteToBlockNum", ctx, blockNum, limit) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DeleteToBlockNum indicates an expected call of DeleteToBlockNum. -func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteToBlockNum(ctx any, blockNum any, limit any) *MockEntityStoreDeleteToBlockNumCall[TEntity] { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteToBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).DeleteToBlockNum), ctx, blockNum, limit) - return &MockEntityStoreDeleteToBlockNumCall[TEntity]{Call: call} -} - -// MockEntityStoreDeleteToBlockNumCall wrap *gomock.Call -type MockEntityStoreDeleteToBlockNumCall[TEntity Entity] struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteToBlockNumCall[TEntity] { - c.Call = c.Call.Return(arg0, arg1) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) Do(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity] { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEntityStoreDeleteToBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64, int) (int, error)) *MockEntityStoreDeleteToBlockNumCall[TEntity] { - c.Call = c.Call.DoAndReturn(f) - return c -} - -// EntityIdFromBlockNum mocks base method. -func (m *MockEntityStore[TEntity]) DeleteFromBlockNum(ctx context.Context, blockNum uint64) (int, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DeleteFromBlockNum", ctx, blockNum) - ret0, _ := ret[0].(int) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DeleteFromBlockNum indicates an expected call of DeleteFromBlockNum. -func (mr *MockEntityStoreMockRecorder[TEntity]) DeleteFromBlockNum(ctx any, blockNum any) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { - mr.mock.ctrl.T.Helper() - call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteFromBlockNum", reflect.TypeOf((*MockEntityStore[TEntity])(nil).DeleteFromBlockNum), ctx, blockNum) - return &MockEntityStoreDeleteFromBlockNumCall[TEntity]{Call: call} -} - -// MockEntityStoreDeleteToBlockNumCall wrap *gomock.Call -type MockEntityStoreDeleteFromBlockNumCall[TEntity Entity] struct { - *gomock.Call -} - -// Return rewrite *gomock.Call.Return -func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Return(arg0 int, arg1 error) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { - c.Call = c.Call.Return(arg0, arg1) - return c -} - -// Do rewrite *gomock.Call.Do -func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) Do(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { - c.Call = c.Call.Do(f) - return c -} - -// DoAndReturn rewrite *gomock.Call.DoAndReturn -func (c *MockEntityStoreDeleteFromBlockNumCall[TEntity]) DoAndReturn(f func(context.Context, uint64) (int, error)) *MockEntityStoreDeleteFromBlockNumCall[TEntity] { - c.Call = c.Call.DoAndReturn(f) - return c -} diff --git a/polygon/sync/p2p_service_mock.go b/polygon/sync/p2p_service_mock.go index c146a16ed24..b9560633e8c 100644 --- a/polygon/sync/p2p_service_mock.go +++ b/polygon/sync/p2p_service_mock.go @@ -24,6 +24,7 @@ import ( type Mockp2pService struct { ctrl *gomock.Controller recorder *Mockp2pServiceMockRecorder + isgomock struct{} } // Mockp2pServiceMockRecorder is the mock recorder for Mockp2pService.