From cf868188ef9c7d5822310a7dc131ef8522827f65 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Sat, 17 Sep 2022 13:59:54 +0400 Subject: [PATCH] [#418] netmap: Support `NetmapService.NetmapSnapshot` RPC Signed-off-by: Leonard Lyubich --- accounting/grpc/service.pb.go | Bin 18905 -> 18905 bytes accounting/grpc/service_grpc.pb.go | Bin 4234 -> 4234 bytes accounting/grpc/types.pb.go | Bin 5981 -> 5981 bytes acl/grpc/types.pb.go | Bin 38693 -> 38693 bytes audit/grpc/types.pb.go | Bin 12336 -> 12336 bytes container/grpc/service.pb.go | Bin 112710 -> 112710 bytes container/grpc/service_grpc.pb.go | Bin 17335 -> 17499 bytes container/grpc/types.pb.go | Bin 13332 -> 13332 bytes lock/grpc/types.pb.go | Bin 5645 -> 5645 bytes netmap/convert.go | 178 +++++++++++++++++++++++++++++ netmap/grpc/service.go | 35 ++++++ netmap/grpc/service.pb.go | Bin 32300 -> 45928 bytes netmap/grpc/service_grpc.pb.go | Bin 6837 -> 8859 bytes netmap/grpc/types.go | 10 ++ netmap/grpc/types.pb.go | Bin 43240 -> 45526 bytes netmap/marshal.go | 71 ++++++++++++ netmap/message_test.go | 5 + netmap/test/generate.go | 54 +++++++++ netmap/types.go | 95 +++++++++++++++ object/grpc/service.pb.go | Bin 131124 -> 131124 bytes object/grpc/service_grpc.pb.go | Bin 31238 -> 31238 bytes object/grpc/types.pb.go | Bin 40463 -> 40934 bytes refs/grpc/types.pb.go | Bin 29032 -> 29032 bytes reputation/grpc/service.pb.go | Bin 35818 -> 35818 bytes reputation/grpc/service_grpc.pb.go | Bin 6971 -> 6971 bytes reputation/grpc/types.pb.go | Bin 17494 -> 17494 bytes rpc/netmap.go | 17 +++ session/grpc/service.pb.go | Bin 18185 -> 18185 bytes session/grpc/service_grpc.pb.go | Bin 4026 -> 4026 bytes session/grpc/types.pb.go | Bin 53262 -> 53262 bytes signature/sign.go | 4 + status/grpc/types.pb.go | Bin 21428 -> 21677 bytes storagegroup/grpc/types.pb.go | Bin 8800 -> 8800 bytes subnet/grpc/types.pb.go | Bin 6137 -> 6137 bytes tombstone/grpc/types.pb.go | Bin 7149 -> 7149 bytes util/proto/test/test.pb.go | Bin 13851 -> 13851 bytes 36 files changed, 469 insertions(+) diff --git a/accounting/grpc/service.pb.go b/accounting/grpc/service.pb.go index bbaefffe4d44ae1deb3b9fe05566469fb598909d..7c745aca7424a9306679fa6532726036a64155b0 100644 GIT binary patch delta 42 scmcaPnepai#t9*^7J3F;`uYl-1x5KK`N;}UP-d)WWT{6W2z-YFyky8Kw8~Fq2 delta 12 TcmeBD>{6W2z-YR$ky8Kw8}tL{ diff --git a/accounting/grpc/types.pb.go b/accounting/grpc/types.pb.go index 76287084d7a50f6e8347d4e0efeb935f91f452e4..883a04111d5b170385a13b3652078f3065e96d79 100644 GIT binary patch delta 40 qcmcbscUNyhh^&R40hhkM0%t){eo20^0u+=P>lqp9nQbh5BL)EV6$_XE delta 40 qcmcbscUNyhh^)DuA(y_s0%t){eo20^0u+=P>lqp9nQkn6BL)EV4hxq6 diff --git a/acl/grpc/types.pb.go b/acl/grpc/types.pb.go index 9bfca6a4376c7f6f51c4456b6f8e3e7e751e0a51..9d5934aed5c82cc02099e5faa92134920014629c 100644 GIT binary patch delta 49 zcmZ3wj%n#SrU@ak7J3F;`uYl-1x5KK`N;}UP-d)WWT-OVKz0X~qrV diff --git a/audit/grpc/types.pb.go b/audit/grpc/types.pb.go index 29ef6ea324b6c55766f09ea2eb1558994636c6e5..bd1d59b65eb60cfeedf3155edd8eb03537ec970a 100644 GIT binary patch delta 40 qcmdmxupwbWh^&R40hhkM0%t){eo20^0u+=P>lqp9nQbiGuMYtA_6v>x delta 40 qcmdmxupwbWh^)DuA(y_s0%t){eo20^0u+=P>lqp9nQkoHuMYtA?+c9p diff --git a/container/grpc/service.pb.go b/container/grpc/service.pb.go index 78f8825dcd8e655bd3a3ca1a8676a0888c4ae0c1..1e83d89a807c3b32a97e123e92402f6a2f76a109 100644 GIT binary patch delta 45 vcmX^1f$i7_wh1A!7J3F;`uYl-1x5KK`N;}UP-d)WWTSh%&2@#=N}R|gJz delta 45 vcmX^1f$i7_wh1A!=6Z%)`uYl-1x5KK`N;}UP-d)WWTBdGT-pyBe`NTGxs;DUd0Cq75HUIzs diff --git a/container/grpc/types.pb.go b/container/grpc/types.pb.go index d8dd62f93fbe9dade91f4ad6ef42ba29e8ade8f3..29901f2b4b8a444b7af4c9b16f315277a3bfd4d4 100644 GIT binary patch delta 40 qcmbP|F(qR{h^&R40hhkM0%t){eo20^0u+=P>lqp9nQbgwYzzSJnhQ<< delta 40 qcmbP|F(qR{h^)DuA(y_s0%t){eo20^0u+=P>lqp9nQkmxYzzSJlM77% diff --git a/lock/grpc/types.pb.go b/lock/grpc/types.pb.go index d118ca8c03bbdcd18044042f3277d9f7122f5602..d54ad2fa452abdb1eb9c28ef4a1a78b6121e2d82 100644 GIT binary patch delta 40 qcmeCx>D8GKB5R>%z@@LRz*$g~Uy`4!00m{ndPatNW*ZCVhynoHdD8GKB5ST^$fd8Zz*$g~Uy`4!00m{ndPatNrW*_AhynoHbqb;Y diff --git a/netmap/convert.go b/netmap/convert.go index 14c3792..d2121b1 100644 --- a/netmap/convert.go +++ b/netmap/convert.go @@ -754,3 +754,181 @@ func (l *NetworkInfoResponse) FromGRPCMessage(m grpc.Message) error { return l.ResponseHeaders.FromMessage(v) } + +func (x *NetMap) ToGRPCMessage() grpc.Message { + var m *netmap.Netmap + + if x != nil { + m = new(netmap.Netmap) + + m.SetEpoch(x.epoch) + + if x.nodes != nil { + nodes := make([]*netmap.NodeInfo, len(x.nodes)) + + for i := range x.nodes { + nodes[i] = x.nodes[i].ToGRPCMessage().(*netmap.NodeInfo) + } + + m.SetNodes(nodes) + } + } + + return m +} + +func (x *NetMap) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.Netmap) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + nodes := v.GetNodes() + if nodes == nil { + x.nodes = nil + } else { + x.nodes = make([]NodeInfo, len(nodes)) + + for i := range nodes { + err = x.nodes[i].FromGRPCMessage(nodes[i]) + if err != nil { + return err + } + } + } + + x.epoch = v.GetEpoch() + + return nil +} + +func (x *SnapshotRequestBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotRequest_Body + + if x != nil { + m = new(netmap.NetmapSnapshotRequest_Body) + } + + return m +} + +func (x *SnapshotRequestBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotRequest_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + return nil +} + +func (x *SnapshotRequest) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotRequest + + if x != nil { + m = new(netmap.NetmapSnapshotRequest) + + m.SetBody(x.body.ToGRPCMessage().(*netmap.NetmapSnapshotRequest_Body)) + x.RequestHeaders.ToMessage(m) + } + + return m +} + +func (x *SnapshotRequest) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotRequest) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + x.body = nil + } else { + if x.body == nil { + x.body = new(SnapshotRequestBody) + } + + err = x.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return x.RequestHeaders.FromMessage(v) +} + +func (x *SnapshotResponseBody) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotResponse_Body + + if x != nil { + m = new(netmap.NetmapSnapshotResponse_Body) + + m.SetNetmap(x.netMap.ToGRPCMessage().(*netmap.Netmap)) + } + + return m +} + +func (x *SnapshotResponseBody) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotResponse_Body) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + netMap := v.GetNetmap() + if netMap == nil { + x.netMap = nil + } else { + if x.netMap == nil { + x.netMap = new(NetMap) + } + + err = x.netMap.FromGRPCMessage(netMap) + } + + return err +} + +func (x *SnapshotResponse) ToGRPCMessage() grpc.Message { + var m *netmap.NetmapSnapshotResponse + + if x != nil { + m = new(netmap.NetmapSnapshotResponse) + + m.SetBody(x.body.ToGRPCMessage().(*netmap.NetmapSnapshotResponse_Body)) + x.ResponseHeaders.ToMessage(m) + } + + return m +} + +func (x *SnapshotResponse) FromGRPCMessage(m grpc.Message) error { + v, ok := m.(*netmap.NetmapSnapshotResponse) + if !ok { + return message.NewUnexpectedMessageType(m, v) + } + + var err error + + body := v.GetBody() + if body == nil { + x.body = nil + } else { + if x.body == nil { + x.body = new(SnapshotResponseBody) + } + + err = x.body.FromGRPCMessage(body) + if err != nil { + return err + } + } + + return x.ResponseHeaders.FromMessage(v) +} diff --git a/netmap/grpc/service.go b/netmap/grpc/service.go index 0061631..c97f8be 100644 --- a/netmap/grpc/service.go +++ b/netmap/grpc/service.go @@ -79,3 +79,38 @@ func (x *NetworkInfoResponse) SetMetaHeader(v *session.ResponseMetaHeader) { func (x *NetworkInfoResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { x.VerifyHeader = v } + +// SetBody sets body of the request. +func (x *NetmapSnapshotRequest) SetBody(v *NetmapSnapshotRequest_Body) { + x.Body = v +} + +// SetMetaHeader sets meta header of the request. +func (x *NetmapSnapshotRequest) SetMetaHeader(v *session.RequestMetaHeader) { + x.MetaHeader = v +} + +// SetVerifyHeader sets verification header of the request. +func (x *NetmapSnapshotRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { + x.VerifyHeader = v +} + +// SetNetmap sets current Netmap. +func (x *NetmapSnapshotResponse_Body) SetNetmap(v *Netmap) { + x.Netmap = v +} + +// SetBody sets body of the response. +func (x *NetmapSnapshotResponse) SetBody(v *NetmapSnapshotResponse_Body) { + x.Body = v +} + +// SetMetaHeader sets meta header of the response. +func (x *NetmapSnapshotResponse) SetMetaHeader(v *session.ResponseMetaHeader) { + x.MetaHeader = v +} + +// SetVerifyHeader sets verification header of the response. +func (x *NetmapSnapshotResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { + x.VerifyHeader = v +} diff --git a/netmap/grpc/service.pb.go b/netmap/grpc/service.pb.go index c20094069b09caa927070d07cda422ba8fc3da80..f0629293eff9a47d2b8ed316fc8e98e66fec16ac 100644 GIT binary patch delta 3906 zcmb7HdrVvB6_-u$3$P))Vr<8kXK-U1-|HtP1@agH0>OkROL!TBFHhqKHVoD#3sR?O zTbs4~G*y|_wW+55Gn6Q@v`y2hw3?PbnA9oS_Q$4GYE)(Gv@}g7t(vAP-S^#VgRdd2 z;yLVJR-AT@wR>(Q42_%(+ z&*#wjs-K^^XJUDRCEXr`B=Q%v(}KH5w?3q$y#*)&`7Enw92qq|7oi)>g;KP=yaVQiU9xqj21nckM?3UG~)7@$Kpj2~P1e0)Wv{rRGg zYAq5^Wpxu!*>@2bs&`4u-l*qI?yn*c#)bou9Y-4aCF|E3R&&?svc|v4@E?{>2M#G@ z7pipNvKQb)pcbcDK6DYR;#i%^H-mEUj3+rr35SUv$@N zmymGRTOsnr?&52-wN+yJe9QbXcb2cG&H$0GARPe0BoI^HnFR>=nF5kAYK`UTANWt2 zYdDTLU7en!PX{YJL-fhI5gMz4`5QXCHMGy_c2c2-7oLKd*Fpb#MY&IqPYV(k9(9^= zbwHshs`C2(Q1>ew1#OwZN^B5gyNvAu^`zj_yhyrMb2-K4Sy5F`9 zl1BA>9m=s$f1!&d2sip$D7Z2%O!0GKjyzEyL^R*&R^zj_hC(7Ik{c6EZQEfeBVQAR zdUOkDJ#M;xVYCURv#og0Q3hF80R5dUxZK6zM&}Tsqgt(iTtGmXMeWHUIoWl6zzuUi z1H(CnF7FLiAQ)&x&9VK(bc0g}z=d&rqzjjh>8QEQhlM|uN`gtdL z@2>Ob@!d!>PV+^Qi5ueeco;Dt9^d!;b`;^>X{YmbH?A{$?)Ytv&P6O%dZESWqLF%0 zX1w6Pd>dY$(c&lb8Vt;pp=3sl?&@mTXH-gt0A`(jyf$Bn+jDySa@vN&vn9mVNbGEK zH&q#MaG?SVWa;t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^r*#-_jmM4_4jFAL;UVW=t!8TLsF=5PpGrVM+eZ96Y*6{|<$OJs zgj`glG{KkC-gbq&3@Le5itdHH@SNe0b|MaeCJxpME@U@xY7%O=z|>?cI)zBp(+YAj zMC=K2w<{`<_2Q#waYrKVw7Ztl7Uz@6n$X*xhSeP+>O;(-qQkq8hy*{X&(+7KmuQD} zR*h!{XB!g8QY5-ikuB8Wq*i1uVl~^z+--h}>~zz}>+)ixk<}mUQs#BcC&b}D6!;%a z#?T*5mWwRWX=QV=t8TyOMW5pIQHk2vW^F85bcrPhJTqtOyR9IRb?d04-7f29Dp9!- zfug!@FZMJWG=6&EYLhY7Eg8vpf4nlXSU=`Ytw2eSm4(RTip@`S5=^ZtaKBrRiJtYS zuF=b%d)#WZv<}yLSEBTmPAa?NO)N+rqPZ@yIh2HO*W AzyJUM diff --git a/netmap/marshal.go b/netmap/marshal.go index b7f6e08..fcbf920 100644 --- a/netmap/marshal.go +++ b/netmap/marshal.go @@ -481,3 +481,74 @@ func (i *NetworkInfoResponseBody) StableSize() (size int) { func (i *NetworkInfoResponseBody) Unmarshal(data []byte) error { return message.Unmarshal(i, data, new(netmap.NetworkInfoResponse_Body)) } + +const ( + _ = iota + fNumNetMapEpoch + fNumNetMapNodes +) + +func (x *NetMap) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + offset := protoutil.UInt64Marshal(fNumNetMapEpoch, buf, x.epoch) + + for i := range x.nodes { + offset += protoutil.NestedStructureMarshal(fNumNetMapNodes, buf[offset:], &x.nodes[i]) + } + + return buf +} + +func (x *NetMap) StableSize() (size int) { + if x != nil { + size = protoutil.UInt64Size(fNumNetMapEpoch, x.epoch) + + for i := range x.nodes { + size += protoutil.NestedStructureSize(fNumNetMapNodes, &x.nodes[i]) + } + } + + return +} + +func (x *SnapshotRequestBody) StableMarshal([]byte) []byte { + return nil +} + +func (x *SnapshotRequestBody) StableSize() int { + return 0 +} + +const ( + _ = iota + fNumSnapshotResponseBodyNetMap +) + +func (x *SnapshotResponseBody) StableMarshal(buf []byte) []byte { + if x == nil { + return []byte{} + } + + if buf == nil { + buf = make([]byte, x.StableSize()) + } + + protoutil.NestedStructureMarshal(fNumSnapshotResponseBodyNetMap, buf, x.netMap) + + return buf +} + +func (x *SnapshotResponseBody) StableSize() (size int) { + if x != nil { + size = protoutil.NestedStructureSize(fNumSnapshotResponseBodyNetMap, x.netMap) + } + + return +} diff --git a/netmap/message_test.go b/netmap/message_test.go index bbe6368..92a6027 100644 --- a/netmap/message_test.go +++ b/netmap/message_test.go @@ -23,5 +23,10 @@ func TestMessageConvert(t *testing.T) { func(empty bool) message.Message { return netmaptest.GenerateNetworkInfo(empty) }, func(empty bool) message.Message { return netmaptest.GenerateNetworkInfoRequest(empty) }, func(empty bool) message.Message { return netmaptest.GenerateNetworkInfoResponseBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateNetMap(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotRequestBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotRequest(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotResponseBody(empty) }, + func(empty bool) message.Message { return netmaptest.GenerateSnapshotResponse(empty) }, ) } diff --git a/netmap/test/generate.go b/netmap/test/generate.go index 7040550..87cdc50 100644 --- a/netmap/test/generate.go +++ b/netmap/test/generate.go @@ -267,3 +267,57 @@ func GenerateNetworkInfoResponse(empty bool) *netmap.NetworkInfoResponse { return m } + +func GenerateNetMap(empty bool) *netmap.NetMap { + m := new(netmap.NetMap) + + if !empty { + m.SetEpoch(987) + m.SetNodes([]netmap.NodeInfo{ + *GenerateNodeInfo(false), + *GenerateNodeInfo(false), + }) + } + + return m +} + +func GenerateSnapshotRequestBody(_ bool) *netmap.SnapshotRequestBody { + return new(netmap.SnapshotRequestBody) +} + +func GenerateSnapshotRequest(empty bool) *netmap.SnapshotRequest { + m := new(netmap.SnapshotRequest) + + if !empty { + m.SetBody(GenerateSnapshotRequestBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateRequestMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateRequestVerificationHeader(empty)) + + return m +} + +func GenerateSnapshotResponseBody(empty bool) *netmap.SnapshotResponseBody { + m := new(netmap.SnapshotResponseBody) + + if !empty { + m.SetNetMap(GenerateNetMap(false)) + } + + return m +} + +func GenerateSnapshotResponse(empty bool) *netmap.SnapshotResponse { + m := new(netmap.SnapshotResponse) + + if !empty { + m.SetBody(GenerateSnapshotResponseBody(false)) + } + + m.SetMetaHeader(sessiontest.GenerateResponseMetaHeader(empty)) + m.SetVerificationHeader(sessiontest.GenerateResponseVerificationHeader(empty)) + + return m +} diff --git a/netmap/types.go b/netmap/types.go index 122dda1..b581d3e 100644 --- a/netmap/types.go +++ b/netmap/types.go @@ -650,3 +650,98 @@ func (l *NetworkInfoResponse) GetBody() *NetworkInfoResponseBody { func (l *NetworkInfoResponse) SetBody(body *NetworkInfoResponseBody) { l.body = body } + +// NetMap represents structure of NeoFS network map. +type NetMap struct { + epoch uint64 + + nodes []NodeInfo +} + +// Epoch returns revision number of the NetMap. +func (x *NetMap) Epoch() uint64 { + if x != nil { + return x.epoch + } + + return 0 +} + +// SetEpoch sets revision number of the NetMap. +func (x *NetMap) SetEpoch(v uint64) { + x.epoch = v +} + +// Nodes returns nodes presented in the NetMap. +func (x *NetMap) Nodes() []NodeInfo { + if x != nil { + return x.nodes + } + + return nil +} + +// SetNodes sets nodes presented in the NetMap. +func (x *NetMap) SetNodes(v []NodeInfo) { + x.nodes = v +} + +// SnapshotRequestBody represents structure of Snapshot request body. +type SnapshotRequestBody struct{} + +// SnapshotRequest represents structure of Snapshot request. +type SnapshotRequest struct { + body *SnapshotRequestBody + + session.RequestHeaders +} + +func (x *SnapshotRequest) GetBody() *SnapshotRequestBody { + if x != nil { + return x.body + } + + return nil +} + +func (x *SnapshotRequest) SetBody(body *SnapshotRequestBody) { + x.body = body +} + +// SnapshotResponseBody represents structure of Snapshot response body. +type SnapshotResponseBody struct { + netMap *NetMap +} + +// NetMap returns current NetMap. +func (x *SnapshotResponseBody) NetMap() *NetMap { + if x != nil { + return x.netMap + } + + return nil +} + +// SetNetMap sets current NetMap. +func (x *SnapshotResponseBody) SetNetMap(netMap *NetMap) { + x.netMap = netMap +} + +// SnapshotResponse represents structure of Snapshot response. +type SnapshotResponse struct { + body *SnapshotResponseBody + + session.ResponseHeaders +} + +func (x *SnapshotResponse) GetBody() *SnapshotResponseBody { + if x != nil { + return x.body + } + + return nil +} + +func (x *SnapshotResponse) SetBody(body *SnapshotResponseBody) { + x.body = body +} diff --git a/object/grpc/service.pb.go b/object/grpc/service.pb.go index 7f15f44e02743909dd6b8aa749658cc46dfbeaf5..b0aa9bc335bb932938235d81ad5bd5dc02e91c19 100644 GIT binary patch delta 45 vcmdnez_F!)V?v0mg`NSIzPBh#^N&qqb25kTU diff --git a/object/grpc/types.pb.go b/object/grpc/types.pb.go index e1243b515109ab7292d1ee106f7a0be605b29dc6..4809930d65a3564f7811c241da58293c2553c4ce 100644 GIT binary patch delta 476 zcmYk2O-chn5QQNdfA9t()GiBS#~%<^aTjnSf>{dEGgC>I_H>WcHIZ562nrs+Gl*Nk zleqO9c8@dBUR4*5_r6z8AA|4D!SihIOdW2I$FNng7oS7-mM7}?NS(etyiRtfWbsOi zftw^uZ(3UmRb0J%P4-s`u8ps40YNkiJW`bEUOF5PLAwI#fY8nXG!$s5Bq6te(3F|C z3TCXyrbQBkU%w1{7jlAJF$xx-lf#l&YHgt)USTet8z?p3BP+O=$3XDeUEG6->fF1z zr98#;e(OpJEqyL^iKBLEn|1(3FA)qa3^G(qo=KV!WSHwzhorSz#e+~t1q%?L(t>au zv&CTI>+pmT)n7t;CHY@EqV#yqy8|pMY1V9@MVPW$us@FT5=mn0PMf>H7{}^;^L*p> E2MK_jga7~l delta 47 xcmaF1pQ(Qj(}WONb3H>YeSHPaf};GA{A2|vC^ObGGSoBOSUBHq^K*y)aR6cz4~GB% diff --git a/refs/grpc/types.pb.go b/refs/grpc/types.pb.go index be27e879d435ddbd05f28e1fc92c97005e4f309a..28798033580239863b53c025ef16ac2c94b39dfb 100644 GIT binary patch delta 42 scmaFyi1EcE#t9*^7J3F;`uYl-1x5KK`N;}UP-d)WWTT& delta 12 TcmdmOw%cq%1EcB2#$8eXBRT~y diff --git a/reputation/grpc/types.pb.go b/reputation/grpc/types.pb.go index ff668696b500a2addfff1f6e53ca53fec78629f6..873eab5c3098b1f33242b779d0a2854a559ee2c7 100644 GIT binary patch delta 42 scmccC!Fa8MaYBf!g`NSIzPoDd>wp=ZFQudl#aP?TSipR51{WyX3&hI(cj3um|i0Q(sWjsO4v delta 42 scmeC|W9;l>oDd>wu4l-ludl#aP?TSipR51{WyX3&hI*zO3um|i0Q(XPjQ{`u diff --git a/session/grpc/service_grpc.pb.go b/session/grpc/service_grpc.pb.go index a596be4f47239b0466785c06feae840eaebd6565..ebda887a95fb314cc9d2e90d928b2fa902f4d078 100644 GIT binary patch delta 12 Tcmdlbze|2X1Ebl-MoWGGAW#H! delta 12 Tcmdlbze|2X1EcB2MoWGGAWH;u diff --git a/session/grpc/types.pb.go b/session/grpc/types.pb.go index 1fa22f0f3439cf0a48db092fe4e3d59525962569..81b3f048d172dc8244fe57a6cf3d0300e86fbdcc 100644 GIT binary patch delta 42 scmeBMz}&Zhc|wS+g`NSIzP3RDp9=N}U9<{#?kq5zjr zuvIXe{E$y}@_DHMPEJEB1tpNm$%4{BlAK^BLX(me#2tp46Qt*BFd17+W^}o)V`!wK zU{C=e4H7|YgH#Y{VhSb=!K5*mOr9L?BsMwQRhol~6Q}^FY%-&p$m9nuu2LWYL$E5S z8EGILrY1lo_O9-15cQM&9Azi3bhQ%#aZL@tW?F*P8BH#57N0EOW&t+H4D2K$urtiS zhMED5o1En44v~gPfZYd@FsLvy14oP5eceez3F*~tO!(#jxv%)#o+!Nw#) s{0H$dm~Aq7f`$0xrS9q=t!LfE85Jf!a|fHF=OI4X!Hj=%s7E|E09rhLl>h($ delta 295 zcmZ3xl5xv&#t9*^=6Z%)`uYl-1x5KK`N;}UP-d)WWTlqp9nQbh5uLuDAmlqp9nQkn6uLuDAkqg%V diff --git a/subnet/grpc/types.pb.go b/subnet/grpc/types.pb.go index 2bec81de0669032d876f3dbd51e3d032214542ce..015e66ddd2e08654f22796a2a2aeab223483467b 100644 GIT binary patch delta 40 qcmeyV|5JZLh^&R40hhkM0%t){eo20^0u+=P>lqp9nQbiW5C;JLA`5Q- delta 40 qcmeyV|5JZLh^)DuA(y_s0%t){eo20^0u+=P>lqp9nQkoX5C;JL8w+j# diff --git a/tombstone/grpc/types.pb.go b/tombstone/grpc/types.pb.go index d971da2480b9d6f8e9fac1885260c68dacae29a1..84b0c3efd74f5c3784ed8139e41afeca1f72db9c 100644 GIT binary patch delta 40 qcmaEB{?>d#h^&R40hhkM0%t){eo20^0u+=P>lqp9nQbhrkp=+!#tUBn delta 40 qcmaEB{?>d#h^)DuA(y_s0%t){eo20^0u+=P>lqp9nQknskp=+!zYAUf diff --git a/util/proto/test/test.pb.go b/util/proto/test/test.pb.go index 6ac0c67450161eb42c19532ac3932f89a789e2c0..f884c084840fc4ac340a3746520f4c0d4ce2975f 100644 GIT binary patch delta 40 qcmbQ8GdpKOh^&R40hhkM0%t){eo20^0u+=P>lqp9nQbgwWeNcD{0nUW delta 40 qcmbQ8GdpKOh^)DuA(y_s0%t){eo20^0u+=P>lqp9nQkmxWeNcD^$TnO