From 51f6ebd73949e21e1c330323a869a3146ef3f752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Ram=C3=ADrez?= <58293609+ToniRamirezM@users.noreply.github.com> Date: Mon, 7 Aug 2023 09:48:24 +0200 Subject: [PATCH] Adaptation to new HashDB interface (#2367) * change hashdb go package * new hashdb interface * aggregator pb refactor * new prover image * change prover config * update prover image * update to latest proto and prover image --- Makefile | 4 +- aggregator/aggregator.go | 17 +- aggregator/aggregator_test.go | 8 +- aggregator/interfaces.go | 6 +- aggregator/mocks/mock_prover.go | 20 +- aggregator/{pb => prover}/aggregator.pb.go | 11 +- .../{pb => prover}/aggregator_grpc.pb.go | 10 +- aggregator/prover/prover.go | 127 +- .../environments/mainnet/prover.config.json | 2 +- .../environments/testnet/prover.config.json | 2 +- docker-compose.yml | 2 +- etherman/types/finalproofinputs.go | 4 +- merkletree/client.go | 6 +- merkletree/{pb => hashdb}/hashdb.pb.go | 1155 ++++++++++------- merkletree/{pb => hashdb}/hashdb_grpc.pb.go | 52 +- merkletree/tree.go | 57 +- .../src/proto/aggregator/v1/aggregator.proto | 2 +- proto/src/proto/hashdb/v1/hashdb.proto | 64 +- sequencer/closingsignalsmanager_test.go | 4 +- sequencer/dbmanager_test.go | 4 +- state/genesis.go | 13 +- state/state.go | 2 +- state/state_test.go | 6 +- synchronizer/mock_state.go | 9 +- .../test.permissionless.prover.config.json | 3 +- test/config/test.prover.config.json | 3 +- test/docker-compose.yml | 4 +- test/scripts/send_transfers/main.go | 11 +- 28 files changed, 919 insertions(+), 689 deletions(-) rename aggregator/{pb => prover}/aggregator.pb.go (99%) rename aggregator/{pb => prover}/aggregator_grpc.pb.go (95%) rename merkletree/{pb => hashdb}/hashdb.pb.go (57%) rename merkletree/{pb => hashdb}/hashdb_grpc.pb.go (88%) diff --git a/Makefile b/Makefile index fd2ee2816e..2d9de4fd5b 100644 --- a/Makefile +++ b/Makefile @@ -119,9 +119,9 @@ install-git-hooks: ## Moves hook files to the .git/hooks directory .PHONY: generate-code-from-proto generate-code-from-proto: ## Generates code from proto files - cd proto/src/proto/hashdb/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../merkletree/pb --go-grpc_out=../../../../../merkletree/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative hashdb.proto + cd proto/src/proto/hashdb/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../merkletree/hashdb --go-grpc_out=../../../../../merkletree/hashdb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative hashdb.proto cd proto/src/proto/executor/v1 && protoc --proto_path=. --go_out=../../../../../state/runtime/executor --go-grpc_out=../../../../../state/runtime/executor --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative executor.proto - cd proto/src/proto/aggregator/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../aggregator/pb --go-grpc_out=../../../../../aggregator/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative aggregator.proto + cd proto/src/proto/aggregator/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../aggregator/prover --go-grpc_out=../../../../../aggregator/prover --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative aggregator.proto ## Help display. ## Pulls comments from beside commands and prints a nicely formatted diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index 93420738f8..751000af1f 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -14,7 +14,6 @@ import ( "unicode" "github.com/0xPolygonHermez/zkevm-node/aggregator/metrics" - "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" "github.com/0xPolygonHermez/zkevm-node/aggregator/prover" "github.com/0xPolygonHermez/zkevm-node/config/types" "github.com/0xPolygonHermez/zkevm-node/encoding" @@ -41,12 +40,12 @@ type finalProofMsg struct { proverName string proverID string recursiveProof *state.Proof - finalProof *pb.FinalProof + finalProof *prover.FinalProof } // Aggregator represents an aggregator type Aggregator struct { - pb.UnimplementedAggregatorServiceServer + prover.UnimplementedAggregatorServiceServer cfg Config @@ -129,7 +128,7 @@ func (a *Aggregator) Start(ctx context.Context) error { } a.srv = grpc.NewServer() - pb.RegisterAggregatorServiceServer(a.srv, a) + prover.RegisterAggregatorServiceServer(a.srv, a) healthService := newHealthChecker() grpchealth.RegisterHealthServer(a.srv, healthService) @@ -159,7 +158,7 @@ func (a *Aggregator) Stop() { // Channel implements the bi-directional communication channel between the // Prover client and the Aggregator server. -func (a *Aggregator) Channel(stream pb.AggregatorService_ChannelServer) error { +func (a *Aggregator) Channel(stream prover.AggregatorService_ChannelServer) error { metrics.ConnectedProver() defer metrics.DisconnectedProver() @@ -306,7 +305,7 @@ func (a *Aggregator) handleFailureToAddVerifyBatchToBeMonitored(ctx context.Cont } // buildFinalProof builds and return the final proof for an aggregated/batch proof. -func (a *Aggregator) buildFinalProof(ctx context.Context, prover proverInterface, proof *state.Proof) (*pb.FinalProof, error) { +func (a *Aggregator) buildFinalProof(ctx context.Context, prover proverInterface, proof *state.Proof) (*prover.FinalProof, error) { log := log.WithFields( "prover", prover.Name(), "proverId", prover.ID(), @@ -972,14 +971,14 @@ func (a *Aggregator) isSynced(ctx context.Context, batchNum *uint64) bool { return true } -func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state.Batch) (*pb.InputProver, error) { +func (a *Aggregator) buildInputProver(ctx context.Context, batchToVerify *state.Batch) (*prover.InputProver, error) { previousBatch, err := a.State.GetBatchByNumber(ctx, batchToVerify.BatchNumber-1, nil) if err != nil && err != state.ErrStateNotSynchronized { return nil, fmt.Errorf("failed to get previous batch, err: %v", err) } - inputProver := &pb.InputProver{ - PublicInputs: &pb.PublicInputs{ + inputProver := &prover.InputProver{ + PublicInputs: &prover.PublicInputs{ OldStateRoot: previousBatch.StateRoot.Bytes(), OldAccInputHash: previousBatch.AccInputHash.Bytes(), OldBatchNum: previousBatch.BatchNumber, diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index f75d7237f3..d6e8166d04 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/0xPolygonHermez/zkevm-node/aggregator/mocks" - "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" + "github.com/0xPolygonHermez/zkevm-node/aggregator/prover" configTypes "github.com/0xPolygonHermez/zkevm-node/config/types" ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types" "github.com/0xPolygonHermez/zkevm-node/ethtxmanager" @@ -53,7 +53,7 @@ func TestSendFinalProof(t *testing.T) { BatchNumber: batchNum, BatchNumberFinal: batchNumFinal, } - finalProof := &pb.FinalProof{} + finalProof := &prover.FinalProof{} cfg := Config{SenderAddress: from.Hex()} testCases := []struct { @@ -1000,9 +1000,9 @@ func TestTryBuildFinalProof(t *testing.T) { proverName := "proverName" proverID := "proverID" finalProofID := "finalProofID" - finalProof := pb.FinalProof{ + finalProof := prover.FinalProof{ Proof: "", - Public: &pb.PublicInputsExtended{ + Public: &prover.PublicInputsExtended{ NewStateRoot: []byte("newStateRoot"), NewLocalExitRoot: []byte("newLocalExitRoot"), }, diff --git a/aggregator/interfaces.go b/aggregator/interfaces.go index f957e5178f..119ea48291 100644 --- a/aggregator/interfaces.go +++ b/aggregator/interfaces.go @@ -4,7 +4,7 @@ import ( "context" "math/big" - "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" + "github.com/0xPolygonHermez/zkevm-node/aggregator/prover" ethmanTypes "github.com/0xPolygonHermez/zkevm-node/etherman/types" "github.com/0xPolygonHermez/zkevm-node/ethtxmanager" "github.com/0xPolygonHermez/zkevm-node/state" @@ -19,11 +19,11 @@ type proverInterface interface { ID() string Addr() string IsIdle() (bool, error) - BatchProof(input *pb.InputProver) (*string, error) + BatchProof(input *prover.InputProver) (*string, error) AggregatedProof(inputProof1, inputProof2 string) (*string, error) FinalProof(inputProof string, aggregatorAddr string) (*string, error) WaitRecursiveProof(ctx context.Context, proofID string) (string, error) - WaitFinalProof(ctx context.Context, proofID string) (*pb.FinalProof, error) + WaitFinalProof(ctx context.Context, proofID string) (*prover.FinalProof, error) } // ethTxManager contains the methods required to send txs to diff --git a/aggregator/mocks/mock_prover.go b/aggregator/mocks/mock_prover.go index 7cba231d6e..0e7a01384b 100644 --- a/aggregator/mocks/mock_prover.go +++ b/aggregator/mocks/mock_prover.go @@ -5,7 +5,7 @@ package mocks import ( context "context" - pb "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" + prover "github.com/0xPolygonHermez/zkevm-node/aggregator/prover" mock "github.com/stretchr/testify/mock" ) @@ -55,15 +55,15 @@ func (_m *ProverMock) AggregatedProof(inputProof1 string, inputProof2 string) (* } // BatchProof provides a mock function with given fields: input -func (_m *ProverMock) BatchProof(input *pb.InputProver) (*string, error) { +func (_m *ProverMock) BatchProof(input *prover.InputProver) (*string, error) { ret := _m.Called(input) var r0 *string var r1 error - if rf, ok := ret.Get(0).(func(*pb.InputProver) (*string, error)); ok { + if rf, ok := ret.Get(0).(func(*prover.InputProver) (*string, error)); ok { return rf(input) } - if rf, ok := ret.Get(0).(func(*pb.InputProver) *string); ok { + if rf, ok := ret.Get(0).(func(*prover.InputProver) *string); ok { r0 = rf(input) } else { if ret.Get(0) != nil { @@ -71,7 +71,7 @@ func (_m *ProverMock) BatchProof(input *pb.InputProver) (*string, error) { } } - if rf, ok := ret.Get(1).(func(*pb.InputProver) error); ok { + if rf, ok := ret.Get(1).(func(*prover.InputProver) error); ok { r1 = rf(input) } else { r1 = ret.Error(1) @@ -159,19 +159,19 @@ func (_m *ProverMock) Name() string { } // WaitFinalProof provides a mock function with given fields: ctx, proofID -func (_m *ProverMock) WaitFinalProof(ctx context.Context, proofID string) (*pb.FinalProof, error) { +func (_m *ProverMock) WaitFinalProof(ctx context.Context, proofID string) (*prover.FinalProof, error) { ret := _m.Called(ctx, proofID) - var r0 *pb.FinalProof + var r0 *prover.FinalProof var r1 error - if rf, ok := ret.Get(0).(func(context.Context, string) (*pb.FinalProof, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) (*prover.FinalProof, error)); ok { return rf(ctx, proofID) } - if rf, ok := ret.Get(0).(func(context.Context, string) *pb.FinalProof); ok { + if rf, ok := ret.Get(0).(func(context.Context, string) *prover.FinalProof); ok { r0 = rf(ctx, proofID) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*pb.FinalProof) + r0 = ret.Get(0).(*prover.FinalProof) } } diff --git a/aggregator/pb/aggregator.pb.go b/aggregator/prover/aggregator.pb.go similarity index 99% rename from aggregator/pb/aggregator.pb.go rename to aggregator/prover/aggregator.pb.go index 54fd9044d7..1b54fe910f 100644 --- a/aggregator/pb/aggregator.pb.go +++ b/aggregator/prover/aggregator.pb.go @@ -1,10 +1,10 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 +// protoc-gen-go v1.30.0 // protoc v3.21.12 // source: aggregator.proto -package pb +package prover import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -247,6 +247,7 @@ type AggregatorMessage struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Request: + // // *AggregatorMessage_GetStatusRequest // *AggregatorMessage_GenBatchProofRequest // *AggregatorMessage_GenAggregatedProofRequest @@ -391,6 +392,7 @@ type ProverMessage struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Response: + // // *ProverMessage_GetStatusResponse // *ProverMessage_GenBatchProofResponse // *ProverMessage_GenAggregatedProofResponse @@ -1263,6 +1265,7 @@ type GetProofResponse struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Proof: + // // *GetProofResponse_FinalProof // *GetProofResponse_RecursiveProof Proof isGetProofResponse_Proof `protobuf_oneof:"proof"` @@ -1981,11 +1984,11 @@ var file_aggregator_proto_rawDesc = []byte{ 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x20, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x35, 0x5a, 0x33, 0x67, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, 0x76, 0x6d, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/aggregator/pb/aggregator_grpc.pb.go b/aggregator/prover/aggregator_grpc.pb.go similarity index 95% rename from aggregator/pb/aggregator_grpc.pb.go rename to aggregator/prover/aggregator_grpc.pb.go index 8d2b33815d..c2c1b6ed54 100644 --- a/aggregator/pb/aggregator_grpc.pb.go +++ b/aggregator/prover/aggregator_grpc.pb.go @@ -1,10 +1,10 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.2.0 +// - protoc-gen-go-grpc v1.3.0 // - protoc v3.21.12 // source: aggregator.proto -package pb +package prover import ( context "context" @@ -18,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + AggregatorService_Channel_FullMethodName = "/aggregator.v1.AggregatorService/Channel" +) + // AggregatorServiceClient is the client API for AggregatorService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. @@ -34,7 +38,7 @@ func NewAggregatorServiceClient(cc grpc.ClientConnInterface) AggregatorServiceCl } func (c *aggregatorServiceClient) Channel(ctx context.Context, opts ...grpc.CallOption) (AggregatorService_ChannelClient, error) { - stream, err := c.cc.NewStream(ctx, &AggregatorService_ServiceDesc.Streams[0], "/aggregator.v1.AggregatorService/Channel", opts...) + stream, err := c.cc.NewStream(ctx, &AggregatorService_ServiceDesc.Streams[0], AggregatorService_Channel_FullMethodName, opts...) if err != nil { return nil, err } diff --git a/aggregator/prover/prover.go b/aggregator/prover/prover.go index 2a61a1678d..fbaf72715f 100644 --- a/aggregator/prover/prover.go +++ b/aggregator/prover/prover.go @@ -8,7 +8,6 @@ import ( "time" "github.com/0xPolygonHermez/zkevm-node/aggregator/metrics" - "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" "github.com/0xPolygonHermez/zkevm-node/config/types" "github.com/0xPolygonHermez/zkevm-node/log" ) @@ -29,11 +28,11 @@ type Prover struct { id string address net.Addr proofStatePollingInterval types.Duration - stream pb.AggregatorService_ChannelServer + stream AggregatorService_ChannelServer } // New returns a new Prover instance. -func New(stream pb.AggregatorService_ChannelServer, addr net.Addr, proofStatePollingInterval types.Duration) (*Prover, error) { +func New(stream AggregatorService_ChannelServer, addr net.Addr, proofStatePollingInterval types.Duration) (*Prover, error) { p := &Prover{ stream: stream, address: addr, @@ -63,20 +62,20 @@ func (p *Prover) Addr() string { } // Status gets the prover status. -func (p *Prover) Status() (*pb.GetStatusResponse, error) { - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_GetStatusRequest{ - GetStatusRequest: &pb.GetStatusRequest{}, +func (p *Prover) Status() (*GetStatusResponse, error) { + req := &AggregatorMessage{ + Request: &AggregatorMessage_GetStatusRequest{ + GetStatusRequest: &GetStatusRequest{}, }, } res, err := p.call(req) if err != nil { return nil, err } - if msg, ok := res.Response.(*pb.ProverMessage_GetStatusResponse); ok { + if msg, ok := res.Response.(*ProverMessage_GetStatusResponse); ok { return msg.GetStatusResponse, nil } - return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_GetStatusResponse{}, res.Response) + return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_GetStatusResponse{}, res.Response) } // IsIdle returns true if the prover is idling. @@ -85,7 +84,7 @@ func (p *Prover) IsIdle() (bool, error) { if err != nil { return false, err } - return status.Status == pb.GetStatusResponse_STATUS_IDLE, nil + return status.Status == GetStatusResponse_STATUS_IDLE, nil } // SupportsForkID returns true if the prover supports the given fork id. @@ -103,12 +102,12 @@ func (p *Prover) SupportsForkID(forkID uint64) bool { // BatchProof instructs the prover to generate a batch proof for the provided // input. It returns the ID of the proof being computed. -func (p *Prover) BatchProof(input *pb.InputProver) (*string, error) { +func (p *Prover) BatchProof(input *InputProver) (*string, error) { metrics.WorkingProver() - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_GenBatchProofRequest{ - GenBatchProofRequest: &pb.GenBatchProofRequest{Input: input}, + req := &AggregatorMessage{ + Request: &AggregatorMessage_GenBatchProofRequest{ + GenBatchProofRequest: &GenBatchProofRequest{Input: input}, }, } res, err := p.call(req) @@ -116,22 +115,22 @@ func (p *Prover) BatchProof(input *pb.InputProver) (*string, error) { return nil, err } - if msg, ok := res.Response.(*pb.ProverMessage_GenBatchProofResponse); ok { + if msg, ok := res.Response.(*ProverMessage_GenBatchProofResponse); ok { switch msg.GenBatchProofResponse.Result { - case pb.Result_RESULT_UNSPECIFIED: + case Result_RESULT_UNSPECIFIED: return nil, fmt.Errorf("failed to generate proof %s, %w, input %v", msg.GenBatchProofResponse.String(), ErrUnspecified, input) - case pb.Result_RESULT_OK: + case Result_RESULT_OK: return &msg.GenBatchProofResponse.Id, nil - case pb.Result_RESULT_ERROR: + case Result_RESULT_ERROR: return nil, fmt.Errorf("failed to generate proof %s, %w, input %v", msg.GenBatchProofResponse.String(), ErrBadRequest, input) - case pb.Result_RESULT_INTERNAL_ERROR: + case Result_RESULT_INTERNAL_ERROR: return nil, fmt.Errorf("failed to generate proof %s, %w, input %v", msg.GenBatchProofResponse.String(), ErrProverInternalError, input) default: return nil, fmt.Errorf("failed to generate proof %s, %w,input %v", msg.GenBatchProofResponse.String(), ErrUnknown, input) } } - return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_GenBatchProofResponse{}, res.Response) + return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_GenBatchProofResponse{}, res.Response) } // AggregatedProof instructs the prover to generate an aggregated proof from @@ -139,9 +138,9 @@ func (p *Prover) BatchProof(input *pb.InputProver) (*string, error) { func (p *Prover) AggregatedProof(inputProof1, inputProof2 string) (*string, error) { metrics.WorkingProver() - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_GenAggregatedProofRequest{ - GenAggregatedProofRequest: &pb.GenAggregatedProofRequest{ + req := &AggregatorMessage{ + Request: &AggregatorMessage_GenAggregatedProofRequest{ + GenAggregatedProofRequest: &GenAggregatedProofRequest{ RecursiveProof_1: inputProof1, RecursiveProof_2: inputProof2, }, @@ -152,17 +151,17 @@ func (p *Prover) AggregatedProof(inputProof1, inputProof2 string) (*string, erro return nil, err } - if msg, ok := res.Response.(*pb.ProverMessage_GenAggregatedProofResponse); ok { + if msg, ok := res.Response.(*ProverMessage_GenAggregatedProofResponse); ok { switch msg.GenAggregatedProofResponse.Result { - case pb.Result_RESULT_UNSPECIFIED: + case Result_RESULT_UNSPECIFIED: return nil, fmt.Errorf("failed to aggregate proofs %s, %w, input 1 %s, input 2 %s", msg.GenAggregatedProofResponse.String(), ErrUnspecified, inputProof1, inputProof2) - case pb.Result_RESULT_OK: + case Result_RESULT_OK: return &msg.GenAggregatedProofResponse.Id, nil - case pb.Result_RESULT_ERROR: + case Result_RESULT_ERROR: return nil, fmt.Errorf("failed to aggregate proofs %s, %w, input 1 %s, input 2 %s", msg.GenAggregatedProofResponse.String(), ErrBadRequest, inputProof1, inputProof2) - case pb.Result_RESULT_INTERNAL_ERROR: + case Result_RESULT_INTERNAL_ERROR: return nil, fmt.Errorf("failed to aggregate proofs %s, %w, input 1 %s, input 2 %s", msg.GenAggregatedProofResponse.String(), ErrProverInternalError, inputProof1, inputProof2) default: @@ -171,7 +170,7 @@ func (p *Prover) AggregatedProof(inputProof1, inputProof2 string) (*string, erro } } - return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_GenAggregatedProofResponse{}, res.Response) + return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_GenAggregatedProofResponse{}, res.Response) } // FinalProof instructs the prover to generate a final proof for the given @@ -179,9 +178,9 @@ func (p *Prover) AggregatedProof(inputProof1, inputProof2 string) (*string, erro func (p *Prover) FinalProof(inputProof string, aggregatorAddr string) (*string, error) { metrics.WorkingProver() - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_GenFinalProofRequest{ - GenFinalProofRequest: &pb.GenFinalProofRequest{ + req := &AggregatorMessage{ + Request: &AggregatorMessage_GenFinalProofRequest{ + GenFinalProofRequest: &GenFinalProofRequest{ RecursiveProof: inputProof, AggregatorAddr: aggregatorAddr, }, @@ -192,17 +191,17 @@ func (p *Prover) FinalProof(inputProof string, aggregatorAddr string) (*string, return nil, err } - if msg, ok := res.Response.(*pb.ProverMessage_GenFinalProofResponse); ok { + if msg, ok := res.Response.(*ProverMessage_GenFinalProofResponse); ok { switch msg.GenFinalProofResponse.Result { - case pb.Result_RESULT_UNSPECIFIED: + case Result_RESULT_UNSPECIFIED: return nil, fmt.Errorf("failed to generate final proof %s, %w, input %s", msg.GenFinalProofResponse.String(), ErrUnspecified, inputProof) - case pb.Result_RESULT_OK: + case Result_RESULT_OK: return &msg.GenFinalProofResponse.Id, nil - case pb.Result_RESULT_ERROR: + case Result_RESULT_ERROR: return nil, fmt.Errorf("failed to generate final proof %s, %w, input %s", msg.GenFinalProofResponse.String(), ErrBadRequest, inputProof) - case pb.Result_RESULT_INTERNAL_ERROR: + case Result_RESULT_INTERNAL_ERROR: return nil, fmt.Errorf("failed to generate final proof %s, %w, input %s", msg.GenFinalProofResponse.String(), ErrProverInternalError, inputProof) default: @@ -210,32 +209,32 @@ func (p *Prover) FinalProof(inputProof string, aggregatorAddr string) (*string, msg.GenFinalProofResponse.String(), ErrUnknown, inputProof) } } - return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_GenFinalProofResponse{}, res.Response) + return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_GenFinalProofResponse{}, res.Response) } // CancelProofRequest asks the prover to stop the generation of the proof // matching the provided proofID. func (p *Prover) CancelProofRequest(proofID string) error { - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_CancelRequest{ - CancelRequest: &pb.CancelRequest{Id: proofID}, + req := &AggregatorMessage{ + Request: &AggregatorMessage_CancelRequest{ + CancelRequest: &CancelRequest{Id: proofID}, }, } res, err := p.call(req) if err != nil { return err } - if msg, ok := res.Response.(*pb.ProverMessage_CancelResponse); ok { + if msg, ok := res.Response.(*ProverMessage_CancelResponse); ok { switch msg.CancelResponse.Result { - case pb.Result_RESULT_UNSPECIFIED: + case Result_RESULT_UNSPECIFIED: return fmt.Errorf("failed to cancel proof id [%s], %w, %s", proofID, ErrUnspecified, msg.CancelResponse.String()) - case pb.Result_RESULT_OK: + case Result_RESULT_OK: return nil - case pb.Result_RESULT_ERROR: + case Result_RESULT_ERROR: return fmt.Errorf("failed to cancel proof id [%s], %w, %s", proofID, ErrBadRequest, msg.CancelResponse.String()) - case pb.Result_RESULT_INTERNAL_ERROR: + case Result_RESULT_INTERNAL_ERROR: return fmt.Errorf("failed to cancel proof id [%s], %w, %s", proofID, ErrProverInternalError, msg.CancelResponse.String()) default: @@ -243,7 +242,7 @@ func (p *Prover) CancelProofRequest(proofID string) error { proofID, ErrUnknown, msg.CancelResponse.String()) } } - return fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_CancelResponse{}, res.Response) + return fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_CancelResponse{}, res.Response) } // WaitRecursiveProof waits for a recursive proof to be generated by the prover @@ -253,29 +252,29 @@ func (p *Prover) WaitRecursiveProof(ctx context.Context, proofID string) (string if err != nil { return "", err } - resProof := res.Proof.(*pb.GetProofResponse_RecursiveProof) + resProof := res.Proof.(*GetProofResponse_RecursiveProof) return resProof.RecursiveProof, nil } // WaitFinalProof waits for the final proof to be generated by the prover and // returns it. -func (p *Prover) WaitFinalProof(ctx context.Context, proofID string) (*pb.FinalProof, error) { +func (p *Prover) WaitFinalProof(ctx context.Context, proofID string) (*FinalProof, error) { res, err := p.waitProof(ctx, proofID) if err != nil { return nil, err } - resProof := res.Proof.(*pb.GetProofResponse_FinalProof) + resProof := res.Proof.(*GetProofResponse_FinalProof) return resProof.FinalProof, nil } // waitProof waits for a proof to be generated by the prover and returns the // prover response. -func (p *Prover) waitProof(ctx context.Context, proofID string) (*pb.GetProofResponse, error) { +func (p *Prover) waitProof(ctx context.Context, proofID string) (*GetProofResponse, error) { defer metrics.IdlingProver() - req := &pb.AggregatorMessage{ - Request: &pb.AggregatorMessage_GetProofRequest{ - GetProofRequest: &pb.GetProofRequest{ + req := &AggregatorMessage{ + Request: &AggregatorMessage_GetProofRequest{ + GetProofRequest: &GetProofRequest{ // TODO(pg): set Timeout field? Id: proofID, }, @@ -291,26 +290,26 @@ func (p *Prover) waitProof(ctx context.Context, proofID string) (*pb.GetProofRes if err != nil { return nil, err } - if msg, ok := res.Response.(*pb.ProverMessage_GetProofResponse); ok { + if msg, ok := res.Response.(*ProverMessage_GetProofResponse); ok { switch msg.GetProofResponse.Result { - case pb.GetProofResponse_RESULT_PENDING: + case GetProofResponse_RESULT_PENDING: time.Sleep(p.proofStatePollingInterval.Duration) continue - case pb.GetProofResponse_RESULT_UNSPECIFIED: + case GetProofResponse_RESULT_UNSPECIFIED: return nil, fmt.Errorf("failed to get proof ID: %s, %w, prover response: %s", proofID, ErrUnspecified, msg.GetProofResponse.String()) - case pb.GetProofResponse_RESULT_COMPLETED_OK: + case GetProofResponse_RESULT_COMPLETED_OK: return msg.GetProofResponse, nil - case pb.GetProofResponse_RESULT_ERROR: + case GetProofResponse_RESULT_ERROR: return nil, fmt.Errorf("failed to get proof with ID %s, %w, prover response: %s", proofID, ErrBadRequest, msg.GetProofResponse.String()) - case pb.GetProofResponse_RESULT_COMPLETED_ERROR: + case GetProofResponse_RESULT_COMPLETED_ERROR: return nil, fmt.Errorf("failed to get proof with ID %s, %w, prover response: %s", proofID, ErrProverCompletedError, msg.GetProofResponse.String()) - case pb.GetProofResponse_RESULT_INTERNAL_ERROR: + case GetProofResponse_RESULT_INTERNAL_ERROR: return nil, fmt.Errorf("failed to get proof ID: %s, %w, prover response: %s", proofID, ErrProverInternalError, msg.GetProofResponse.String()) - case pb.GetProofResponse_RESULT_CANCEL: + case GetProofResponse_RESULT_CANCEL: return nil, fmt.Errorf("proof generation was cancelled for proof ID %s, %w, prover response: %s", proofID, ErrProofCanceled, msg.GetProofResponse.String()) default: @@ -318,14 +317,14 @@ func (p *Prover) waitProof(ctx context.Context, proofID string) (*pb.GetProofRes proofID, ErrUnknown, msg.GetProofResponse.String()) } } - return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &pb.ProverMessage_GetProofResponse{}, res.Response) + return nil, fmt.Errorf("%w, wanted %T, got %T", ErrBadProverResponse, &ProverMessage_GetProofResponse{}, res.Response) } } } // call sends a message to the prover and waits to receive the response over // the connection stream. -func (p *Prover) call(req *pb.AggregatorMessage) (*pb.ProverMessage, error) { +func (p *Prover) call(req *AggregatorMessage) (*ProverMessage, error) { if err := p.stream.Send(req); err != nil { return nil, err } diff --git a/config/environments/mainnet/prover.config.json b/config/environments/mainnet/prover.config.json index 0aec07e541..7b10066bc7 100644 --- a/config/environments/mainnet/prover.config.json +++ b/config/environments/mainnet/prover.config.json @@ -112,5 +112,5 @@ "maxHashDBThreads": 8, "ECRecoverPrecalc": true, "ECRecoverPrecalcNThreads": 16, - "dbMultiWriteSinglePosition": false + "stateManager": true } diff --git a/config/environments/testnet/prover.config.json b/config/environments/testnet/prover.config.json index 0aec07e541..7b10066bc7 100644 --- a/config/environments/testnet/prover.config.json +++ b/config/environments/testnet/prover.config.json @@ -112,5 +112,5 @@ "maxHashDBThreads": 8, "ECRecoverPrecalc": true, "ECRecoverPrecalcNThreads": 16, - "dbMultiWriteSinglePosition": false + "stateManager": true } diff --git a/docker-compose.yml b/docker-compose.yml index 0755564b29..fda0a68326 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: zkevm-prover: container_name: zkevm-prover restart: unless-stopped - image: hermeznetwork/zkevm-prover:v2.0.1 + image: hermeznetwork/zkevm-prover:v2.1.0-RC2 depends_on: zkevm-state-db: condition: service_healthy diff --git a/etherman/types/finalproofinputs.go b/etherman/types/finalproofinputs.go index f5686691b4..25a8d7e18f 100644 --- a/etherman/types/finalproofinputs.go +++ b/etherman/types/finalproofinputs.go @@ -1,10 +1,10 @@ package types -import "github.com/0xPolygonHermez/zkevm-node/aggregator/pb" +import "github.com/0xPolygonHermez/zkevm-node/aggregator/prover" // FinalProofInputs struct type FinalProofInputs struct { - FinalProof *pb.FinalProof + FinalProof *prover.FinalProof NewLocalExitRoot []byte NewStateRoot []byte } diff --git a/merkletree/client.go b/merkletree/client.go index 94af21c07a..798dea5e04 100644 --- a/merkletree/client.go +++ b/merkletree/client.go @@ -5,13 +5,13 @@ import ( "time" "github.com/0xPolygonHermez/zkevm-node/log" - "github.com/0xPolygonHermez/zkevm-node/merkletree/pb" + "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) // NewMTDBServiceClient creates a new MTDB client. -func NewMTDBServiceClient(ctx context.Context, c Config) (pb.HashDBServiceClient, *grpc.ClientConn, context.CancelFunc) { +func NewMTDBServiceClient(ctx context.Context, c Config) (hashdb.HashDBServiceClient, *grpc.ClientConn, context.CancelFunc) { opts := []grpc.DialOption{ grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock(), @@ -26,6 +26,6 @@ func NewMTDBServiceClient(ctx context.Context, c Config) (pb.HashDBServiceClient } log.Infof("connected to merkletree") - mtDBClient := pb.NewHashDBServiceClient(mtDBConn) + mtDBClient := hashdb.NewHashDBServiceClient(mtDBConn) return mtDBClient, mtDBConn, cancel } diff --git a/merkletree/pb/hashdb.pb.go b/merkletree/hashdb/hashdb.pb.go similarity index 57% rename from merkletree/pb/hashdb.pb.go rename to merkletree/hashdb/hashdb.pb.go index b1c0bfd768..68e7e3e3b0 100644 --- a/merkletree/pb/hashdb.pb.go +++ b/merkletree/hashdb/hashdb.pb.go @@ -4,15 +4,14 @@ // protoc v3.21.12 // source: hashdb.proto -package pb +package hashdb import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" + reflect "reflect" + sync "sync" ) const ( @@ -22,6 +21,55 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type Persistence int32 + +const ( + Persistence_PERSISTENCE_CACHE_UNSPECIFIED Persistence = 0 + Persistence_PERSISTENCE_DATABASE Persistence = 1 + Persistence_PERSISTENCE_TEMPORARY Persistence = 2 +) + +// Enum value maps for Persistence. +var ( + Persistence_name = map[int32]string{ + 0: "PERSISTENCE_CACHE_UNSPECIFIED", + 1: "PERSISTENCE_DATABASE", + 2: "PERSISTENCE_TEMPORARY", + } + Persistence_value = map[string]int32{ + "PERSISTENCE_CACHE_UNSPECIFIED": 0, + "PERSISTENCE_DATABASE": 1, + "PERSISTENCE_TEMPORARY": 2, + } +) + +func (x Persistence) Enum() *Persistence { + p := new(Persistence) + *p = x + return p +} + +func (x Persistence) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Persistence) Descriptor() protoreflect.EnumDescriptor { + return file_hashdb_proto_enumTypes[0].Descriptor() +} + +func (Persistence) Type() protoreflect.EnumType { + return &file_hashdb_proto_enumTypes[0] +} + +func (x Persistence) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Persistence.Descriptor instead. +func (Persistence) EnumDescriptor() ([]byte, []int) { + return file_hashdb_proto_rawDescGZIP(), []int{0} +} + type ResultCode_Code int32 const ( @@ -64,11 +112,11 @@ func (x ResultCode_Code) String() string { } func (ResultCode_Code) Descriptor() protoreflect.EnumDescriptor { - return file_hashdb_proto_enumTypes[0].Descriptor() + return file_hashdb_proto_enumTypes[1].Descriptor() } func (ResultCode_Code) Type() protoreflect.EnumType { - return &file_hashdb_proto_enumTypes[0] + return &file_hashdb_proto_enumTypes[1] } func (x ResultCode_Code) Number() protoreflect.EnumNumber { @@ -77,7 +125,7 @@ func (x ResultCode_Code) Number() protoreflect.EnumNumber { // Deprecated: Use ResultCode_Code.Descriptor instead. func (ResultCode_Code) EnumDescriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{19, 0} + return file_hashdb_proto_rawDescGZIP(), []int{20, 0} } type Version struct { @@ -132,20 +180,24 @@ func (x *Version) GetV0_0_1() string { // @param {old_root} - merkle-tree root // @param {key} - key to set // @param {value} - scalar value to set (HEX string format) -// @param {persistent} - indicates if it should be stored in the SQL database (true) or only in the memory cache (false) +// @param {persistence} - indicates if it should be stored only in CACHE, in the SQL DATABASE, or it is just TEMPORARY and should be deleted at the flush of this batch UUID // @param {details} - indicates if it should return all response parameters (true) or just the new root (false) // @param {get_db_read_log} - indicates if it should return the DB reads generated during the execution of the request +// @param {batch_uuid} - indicates a unique identifier of the current batch or session; data for this batch can be stored in memory until flushed to database +// @param {tx} - current transaction ordinal number: 0, 1, 2... type SetRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OldRoot *Fea `protobuf:"bytes,1,opt,name=old_root,json=oldRoot,proto3" json:"old_root,omitempty"` - Key *Fea `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` - Persistent bool `protobuf:"varint,4,opt,name=persistent,proto3" json:"persistent,omitempty"` - Details bool `protobuf:"varint,5,opt,name=details,proto3" json:"details,omitempty"` - GetDbReadLog bool `protobuf:"varint,6,opt,name=get_db_read_log,json=getDbReadLog,proto3" json:"get_db_read_log,omitempty"` + OldRoot *Fea `protobuf:"bytes,1,opt,name=old_root,json=oldRoot,proto3" json:"old_root,omitempty"` + Key *Fea `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Persistence Persistence `protobuf:"varint,4,opt,name=persistence,proto3,enum=hashdb.v1.Persistence" json:"persistence,omitempty"` + Details bool `protobuf:"varint,5,opt,name=details,proto3" json:"details,omitempty"` + GetDbReadLog bool `protobuf:"varint,6,opt,name=get_db_read_log,json=getDbReadLog,proto3" json:"get_db_read_log,omitempty"` + BatchUuid string `protobuf:"bytes,7,opt,name=batch_uuid,json=batchUuid,proto3" json:"batch_uuid,omitempty"` + Tx uint64 `protobuf:"varint,8,opt,name=tx,proto3" json:"tx,omitempty"` } func (x *SetRequest) Reset() { @@ -201,11 +253,11 @@ func (x *SetRequest) GetValue() string { return "" } -func (x *SetRequest) GetPersistent() bool { +func (x *SetRequest) GetPersistence() Persistence { if x != nil { - return x.Persistent + return x.Persistence } - return false + return Persistence_PERSISTENCE_CACHE_UNSPECIFIED } func (x *SetRequest) GetDetails() bool { @@ -222,21 +274,37 @@ func (x *SetRequest) GetGetDbReadLog() bool { return false } +func (x *SetRequest) GetBatchUuid() string { + if x != nil { + return x.BatchUuid + } + return "" +} + +func (x *SetRequest) GetTx() uint64 { + if x != nil { + return x.Tx + } + return 0 +} + // * // @dev GetRequest // @param {root} - merkle-tree root // @param {key} - key to look for // @param {details} - indicates if it should return all response parameters (true) or just the new root (false) // @param {get_db_read_log} - indicates if it should return the DB reads generated during the execution of the request +// @param {batch_uuid} - indicates a unique identifier of the current batch or session; data for this batch can be stored in memory until flushed to database type GetRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Root *Fea `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` - Key *Fea `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Details bool `protobuf:"varint,3,opt,name=details,proto3" json:"details,omitempty"` - GetDbReadLog bool `protobuf:"varint,4,opt,name=get_db_read_log,json=getDbReadLog,proto3" json:"get_db_read_log,omitempty"` + Root *Fea `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` + Key *Fea `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` + Details bool `protobuf:"varint,3,opt,name=details,proto3" json:"details,omitempty"` + GetDbReadLog bool `protobuf:"varint,4,opt,name=get_db_read_log,json=getDbReadLog,proto3" json:"get_db_read_log,omitempty"` + BatchUuid string `protobuf:"bytes,5,opt,name=batch_uuid,json=batchUuid,proto3" json:"batch_uuid,omitempty"` } func (x *GetRequest) Reset() { @@ -299,6 +367,13 @@ func (x *GetRequest) GetGetDbReadLog() bool { return false } +func (x *GetRequest) GetBatchUuid() string { + if x != nil { + return x.BatchUuid + } + return "" +} + // * // @dev SetProgramRequest // @param {key} - key to set @@ -535,6 +610,124 @@ func (x *LoadProgramDBRequest) GetPersistent() bool { return false } +// * +// @dev FlushRequest +// @param {batch_uuid} - indicates a unique identifier of the current batch or session which data will be flushed to cache (and database if required) +type FlushRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BatchUuid string `protobuf:"bytes,1,opt,name=batch_uuid,json=batchUuid,proto3" json:"batch_uuid,omitempty"` +} + +func (x *FlushRequest) Reset() { + *x = FlushRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hashdb_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FlushRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FlushRequest) ProtoMessage() {} + +func (x *FlushRequest) ProtoReflect() protoreflect.Message { + mi := &file_hashdb_proto_msgTypes[7] + 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 FlushRequest.ProtoReflect.Descriptor instead. +func (*FlushRequest) Descriptor() ([]byte, []int) { + return file_hashdb_proto_rawDescGZIP(), []int{7} +} + +func (x *FlushRequest) GetBatchUuid() string { + if x != nil { + return x.BatchUuid + } + return "" +} + +// * +// @dev SemiFlushRequest +// @param {batch_uuid} - indicates a unique identifier of the current batch or session which data will be semi-flushed +// @param {new_state_root} - state root at this point of the execution +// @param {persistence} - indicates if it should be stored only in CACHE, in the SQL DATABASE, or it is just TEMPORARY and should be deleted at the flush of this batch UUID +type SemiFlushRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BatchUuid string `protobuf:"bytes,1,opt,name=batch_uuid,json=batchUuid,proto3" json:"batch_uuid,omitempty"` + NewStateRoot string `protobuf:"bytes,2,opt,name=new_state_root,json=newStateRoot,proto3" json:"new_state_root,omitempty"` + Persistence Persistence `protobuf:"varint,3,opt,name=persistence,proto3,enum=hashdb.v1.Persistence" json:"persistence,omitempty"` +} + +func (x *SemiFlushRequest) Reset() { + *x = SemiFlushRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_hashdb_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SemiFlushRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SemiFlushRequest) ProtoMessage() {} + +func (x *SemiFlushRequest) ProtoReflect() protoreflect.Message { + mi := &file_hashdb_proto_msgTypes[8] + 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 SemiFlushRequest.ProtoReflect.Descriptor instead. +func (*SemiFlushRequest) Descriptor() ([]byte, []int) { + return file_hashdb_proto_rawDescGZIP(), []int{8} +} + +func (x *SemiFlushRequest) GetBatchUuid() string { + if x != nil { + return x.BatchUuid + } + return "" +} + +func (x *SemiFlushRequest) GetNewStateRoot() string { + if x != nil { + return x.NewStateRoot + } + return "" +} + +func (x *SemiFlushRequest) GetPersistence() Persistence { + if x != nil { + return x.Persistence + } + return Persistence_PERSISTENCE_CACHE_UNSPECIFIED +} + // * // @dev GetFlushDataRequest // @param {flush_id} - last stored flush ID got using this method, or 0 if it never was called before @@ -549,7 +742,7 @@ type GetFlushDataRequest struct { func (x *GetFlushDataRequest) Reset() { *x = GetFlushDataRequest{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[7] + mi := &file_hashdb_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -562,7 +755,7 @@ func (x *GetFlushDataRequest) String() string { func (*GetFlushDataRequest) ProtoMessage() {} func (x *GetFlushDataRequest) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[7] + mi := &file_hashdb_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -575,7 +768,7 @@ func (x *GetFlushDataRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFlushDataRequest.ProtoReflect.Descriptor instead. func (*GetFlushDataRequest) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{7} + return file_hashdb_proto_rawDescGZIP(), []int{9} } func (x *GetFlushDataRequest) GetFlushId() uint64 { @@ -623,7 +816,7 @@ type SetResponse struct { func (x *SetResponse) Reset() { *x = SetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[8] + mi := &file_hashdb_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -636,7 +829,7 @@ func (x *SetResponse) String() string { func (*SetResponse) ProtoMessage() {} func (x *SetResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[8] + mi := &file_hashdb_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -649,7 +842,7 @@ func (x *SetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetResponse.ProtoReflect.Descriptor instead. func (*SetResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{8} + return file_hashdb_proto_rawDescGZIP(), []int{10} } func (x *SetResponse) GetOldRoot() *Fea { @@ -775,7 +968,7 @@ type GetResponse struct { func (x *GetResponse) Reset() { *x = GetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[9] + mi := &file_hashdb_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -788,7 +981,7 @@ func (x *GetResponse) String() string { func (*GetResponse) ProtoMessage() {} func (x *GetResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[9] + mi := &file_hashdb_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -801,7 +994,7 @@ func (x *GetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetResponse.ProtoReflect.Descriptor instead. func (*GetResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{9} + return file_hashdb_proto_rawDescGZIP(), []int{11} } func (x *GetResponse) GetRoot() *Fea { @@ -888,7 +1081,7 @@ type SetProgramResponse struct { func (x *SetProgramResponse) Reset() { *x = SetProgramResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[10] + mi := &file_hashdb_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -901,7 +1094,7 @@ func (x *SetProgramResponse) String() string { func (*SetProgramResponse) ProtoMessage() {} func (x *SetProgramResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[10] + mi := &file_hashdb_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -914,7 +1107,7 @@ func (x *SetProgramResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetProgramResponse.ProtoReflect.Descriptor instead. func (*SetProgramResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{10} + return file_hashdb_proto_rawDescGZIP(), []int{12} } func (x *SetProgramResponse) GetResult() *ResultCode { @@ -940,7 +1133,7 @@ type GetProgramResponse struct { func (x *GetProgramResponse) Reset() { *x = GetProgramResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[11] + mi := &file_hashdb_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -953,7 +1146,7 @@ func (x *GetProgramResponse) String() string { func (*GetProgramResponse) ProtoMessage() {} func (x *GetProgramResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[11] + mi := &file_hashdb_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -966,7 +1159,7 @@ func (x *GetProgramResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetProgramResponse.ProtoReflect.Descriptor instead. func (*GetProgramResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{11} + return file_hashdb_proto_rawDescGZIP(), []int{13} } func (x *GetProgramResponse) GetData() []byte { @@ -1001,7 +1194,7 @@ type FlushResponse struct { func (x *FlushResponse) Reset() { *x = FlushResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[12] + mi := &file_hashdb_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1014,7 +1207,7 @@ func (x *FlushResponse) String() string { func (*FlushResponse) ProtoMessage() {} func (x *FlushResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[12] + mi := &file_hashdb_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1027,7 +1220,7 @@ func (x *FlushResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FlushResponse.ProtoReflect.Descriptor instead. func (*FlushResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{12} + return file_hashdb_proto_rawDescGZIP(), []int{14} } func (x *FlushResponse) GetFlushId() uint64 { @@ -1079,7 +1272,7 @@ type GetFlushStatusResponse struct { func (x *GetFlushStatusResponse) Reset() { *x = GetFlushStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[13] + mi := &file_hashdb_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1092,7 +1285,7 @@ func (x *GetFlushStatusResponse) String() string { func (*GetFlushStatusResponse) ProtoMessage() {} func (x *GetFlushStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[13] + mi := &file_hashdb_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1105,7 +1298,7 @@ func (x *GetFlushStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFlushStatusResponse.ProtoReflect.Descriptor instead. func (*GetFlushStatusResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{13} + return file_hashdb_proto_rawDescGZIP(), []int{15} } func (x *GetFlushStatusResponse) GetStoredFlushId() uint64 { @@ -1168,9 +1361,7 @@ func (x *GetFlushStatusResponse) GetProverId() string { // @dev GetFlushDataResponse // @param {stored_flush_id} - id of the last flush data sent to database // @param {nodes} - data to insert in the nodes table -// @param {nodes_update} - data to update in the nodes table // @param {program} - data to insert in the program table -// @param {program_update} - data to update in the program table // @param {nodes_state_root} - nodes state root to update in the nodes table // @param {result} - result code type GetFlushDataResponse struct { @@ -1178,19 +1369,17 @@ type GetFlushDataResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - StoredFlushId uint64 `protobuf:"varint,1,opt,name=stored_flush_id,json=storedFlushId,proto3" json:"stored_flush_id,omitempty"` - Nodes []*FlushData `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"` - NodesUpdate []*FlushData `protobuf:"bytes,3,rep,name=nodes_update,json=nodesUpdate,proto3" json:"nodes_update,omitempty"` - Program []*FlushData `protobuf:"bytes,4,rep,name=program,proto3" json:"program,omitempty"` - ProgramUpdate []*FlushData `protobuf:"bytes,5,rep,name=program_update,json=programUpdate,proto3" json:"program_update,omitempty"` - NodesStateRoot string `protobuf:"bytes,6,opt,name=nodes_state_root,json=nodesStateRoot,proto3" json:"nodes_state_root,omitempty"` - Result *ResultCode `protobuf:"bytes,7,opt,name=result,proto3" json:"result,omitempty"` + StoredFlushId uint64 `protobuf:"varint,1,opt,name=stored_flush_id,json=storedFlushId,proto3" json:"stored_flush_id,omitempty"` + Nodes map[string]string `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Program map[string]string `protobuf:"bytes,3,rep,name=program,proto3" json:"program,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + NodesStateRoot string `protobuf:"bytes,4,opt,name=nodes_state_root,json=nodesStateRoot,proto3" json:"nodes_state_root,omitempty"` + Result *ResultCode `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"` } func (x *GetFlushDataResponse) Reset() { *x = GetFlushDataResponse{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[14] + mi := &file_hashdb_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1203,7 +1392,7 @@ func (x *GetFlushDataResponse) String() string { func (*GetFlushDataResponse) ProtoMessage() {} func (x *GetFlushDataResponse) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[14] + mi := &file_hashdb_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1216,7 +1405,7 @@ func (x *GetFlushDataResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFlushDataResponse.ProtoReflect.Descriptor instead. func (*GetFlushDataResponse) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{14} + return file_hashdb_proto_rawDescGZIP(), []int{16} } func (x *GetFlushDataResponse) GetStoredFlushId() uint64 { @@ -1226,34 +1415,20 @@ func (x *GetFlushDataResponse) GetStoredFlushId() uint64 { return 0 } -func (x *GetFlushDataResponse) GetNodes() []*FlushData { +func (x *GetFlushDataResponse) GetNodes() map[string]string { if x != nil { return x.Nodes } return nil } -func (x *GetFlushDataResponse) GetNodesUpdate() []*FlushData { - if x != nil { - return x.NodesUpdate - } - return nil -} - -func (x *GetFlushDataResponse) GetProgram() []*FlushData { +func (x *GetFlushDataResponse) GetProgram() map[string]string { if x != nil { return x.Program } return nil } -func (x *GetFlushDataResponse) GetProgramUpdate() []*FlushData { - if x != nil { - return x.ProgramUpdate - } - return nil -} - func (x *GetFlushDataResponse) GetNodesStateRoot() string { if x != nil { return x.NodesStateRoot @@ -1288,7 +1463,7 @@ type Fea struct { func (x *Fea) Reset() { *x = Fea{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[15] + mi := &file_hashdb_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1476,7 @@ func (x *Fea) String() string { func (*Fea) ProtoMessage() {} func (x *Fea) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[15] + mi := &file_hashdb_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1489,7 @@ func (x *Fea) ProtoReflect() protoreflect.Message { // Deprecated: Use Fea.ProtoReflect.Descriptor instead. func (*Fea) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{15} + return file_hashdb_proto_rawDescGZIP(), []int{17} } func (x *Fea) GetFe0() uint64 { @@ -1359,7 +1534,7 @@ type FeList struct { func (x *FeList) Reset() { *x = FeList{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[16] + mi := &file_hashdb_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1372,7 +1547,7 @@ func (x *FeList) String() string { func (*FeList) ProtoMessage() {} func (x *FeList) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[16] + mi := &file_hashdb_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1385,7 +1560,7 @@ func (x *FeList) ProtoReflect() protoreflect.Message { // Deprecated: Use FeList.ProtoReflect.Descriptor instead. func (*FeList) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{16} + return file_hashdb_proto_rawDescGZIP(), []int{18} } func (x *FeList) GetFe() []uint64 { @@ -1409,7 +1584,7 @@ type SiblingList struct { func (x *SiblingList) Reset() { *x = SiblingList{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[17] + mi := &file_hashdb_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1422,7 +1597,7 @@ func (x *SiblingList) String() string { func (*SiblingList) ProtoMessage() {} func (x *SiblingList) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[17] + mi := &file_hashdb_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1435,7 +1610,7 @@ func (x *SiblingList) ProtoReflect() protoreflect.Message { // Deprecated: Use SiblingList.ProtoReflect.Descriptor instead. func (*SiblingList) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{17} + return file_hashdb_proto_rawDescGZIP(), []int{19} } func (x *SiblingList) GetSibling() []uint64 { @@ -1445,65 +1620,6 @@ func (x *SiblingList) GetSibling() []uint64 { return nil } -// * -// @dev Flush Data -// @param {key} - hash key -// @param {value} - string value -type FlushData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *FlushData) Reset() { - *x = FlushData{} - if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FlushData) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FlushData) ProtoMessage() {} - -func (x *FlushData) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[18] - 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 FlushData.ProtoReflect.Descriptor instead. -func (*FlushData) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{18} -} - -func (x *FlushData) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *FlushData) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - // * // @dev Result code // @param {code} - result code @@ -1518,7 +1634,7 @@ type ResultCode struct { func (x *ResultCode) Reset() { *x = ResultCode{} if protoimpl.UnsafeEnabled { - mi := &file_hashdb_proto_msgTypes[19] + mi := &file_hashdb_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1531,7 +1647,7 @@ func (x *ResultCode) String() string { func (*ResultCode) ProtoMessage() {} func (x *ResultCode) ProtoReflect() protoreflect.Message { - mi := &file_hashdb_proto_msgTypes[19] + mi := &file_hashdb_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1544,7 +1660,7 @@ func (x *ResultCode) ProtoReflect() protoreflect.Message { // Deprecated: Use ResultCode.ProtoReflect.Descriptor instead. func (*ResultCode) Descriptor() ([]byte, []int) { - return file_hashdb_proto_rawDescGZIP(), []int{19} + return file_hashdb_proto_rawDescGZIP(), []int{20} } func (x *ResultCode) GetCode() ResultCode_Code { @@ -1562,270 +1678,299 @@ var file_hashdb_proto_rawDesc = []byte{ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1f, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x06, 0x76, 0x30, 0x5f, 0x30, 0x5f, 0x31, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x76, 0x30, 0x30, 0x31, 0x22, 0xd0, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x52, + 0x09, 0x52, 0x04, 0x76, 0x30, 0x30, 0x31, 0x22, 0x99, 0x02, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, - 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, - 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, - 0x69, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x67, 0x65, - 0x74, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x22, 0x93, 0x01, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x04, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, + 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x65, 0x72, + 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, + 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x25, 0x0a, + 0x0f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x67, 0x65, 0x74, 0x44, 0x62, 0x52, 0x65, 0x61, + 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x75, 0x75, + 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x55, + 0x75, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x02, 0x74, 0x78, 0x22, 0xb2, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x22, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, + 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, + 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0f, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x61, + 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x67, 0x65, 0x74, + 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x55, 0x75, 0x69, 0x64, 0x22, 0x69, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x18, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x25, 0x0a, 0x0f, 0x67, 0x65, 0x74, - 0x5f, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x67, 0x65, 0x74, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, - 0x22, 0x69, 0x0a, 0x11, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, - 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x70, - 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x11, 0x47, - 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x22, 0xc0, 0x01, 0x0a, 0x0d, 0x4c, 0x6f, 0x61, 0x64, 0x44, 0x42, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x62, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x44, 0x62, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x4d, 0x0a, 0x0c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, - 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x74, 0x22, 0x35, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, + 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0xc0, 0x01, 0x0a, 0x0d, 0x4c, + 0x6f, 0x61, 0x64, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, + 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x62, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x44, + 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x62, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x62, 0x12, 0x1e, + 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x4d, + 0x0a, 0x0c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd8, 0x01, + 0x0a, 0x14, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5d, 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x64, 0x62, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x33, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, + 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x62, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x44, 0x62, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, + 0x73, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x50, 0x72, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2d, 0x0a, 0x0c, 0x46, 0x6c, 0x75, 0x73, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, 0x63, + 0x68, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x55, 0x75, 0x69, 0x64, 0x22, 0x91, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x6d, 0x69, + 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x55, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x6e, + 0x65, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, + 0x74, 0x12, 0x38, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0b, + 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x30, 0x0a, 0x13, 0x47, + 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x22, 0xbe, 0x05, + 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, + 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, + 0x07, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, + 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x52, + 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, + 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x73, + 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x69, 0x6e, 0x73, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x4b, 0x65, 0x79, + 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, + 0x07, 0x69, 0x73, 0x5f, 0x6f, 0x6c, 0x64, 0x30, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, + 0x69, 0x73, 0x4f, 0x6c, 0x64, 0x30, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x68, 0x61, + 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0b, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x6f, + 0x67, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, + 0x64, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, + 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x53, 0x0a, 0x0d, 0x53, 0x69, 0x62, 0x6c, + 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, + 0x0e, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd4, + 0x04, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, + 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, + 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x04, 0x72, 0x6f, + 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, + 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, + 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x73, 0x69, + 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x69, 0x6e, 0x73, 0x5f, 0x6b, 0x65, + 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, + 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x06, 0x69, 0x6e, 0x73, 0x4b, 0x65, 0x79, 0x12, + 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x73, 0x5f, 0x6f, 0x6c, 0x64, 0x30, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x73, 0x4f, 0x6c, 0x64, 0x30, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, + 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x61, + 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0b, 0x64, 0x62, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x64, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, + 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, + 0x53, 0x0a, 0x0d, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, + 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0e, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, + 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd8, 0x01, 0x0a, 0x14, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x5d, - 0x0a, 0x10, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, - 0x64, 0x62, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, - 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, - 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x50, - 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, - 0x6e, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x62, 0x12, 0x1e, 0x0a, - 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x41, 0x0a, - 0x13, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x62, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x30, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x75, 0x73, 0x68, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x6c, 0x75, 0x73, 0x68, - 0x49, 0x64, 0x22, 0xbe, 0x05, 0x0a, 0x0b, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x29, 0x0a, 0x08, 0x6f, 0x6c, 0x64, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x65, 0x61, 0x52, 0x07, 0x6f, 0x6c, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x29, 0x0a, - 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, - 0x07, 0x6e, 0x65, 0x77, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, - 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x69, - 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x07, - 0x69, 0x6e, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x06, 0x69, - 0x6e, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6f, 0x6c, 0x64, 0x30, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4f, 0x6c, 0x64, 0x30, 0x12, 0x1b, 0x0a, 0x09, 0x6f, - 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x77, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x48, 0x61, 0x73, 0x68, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x45, 0x0a, 0x0b, 0x64, 0x62, 0x5f, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x52, 0x09, 0x64, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x2d, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x53, 0x0a, - 0x0d, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x62, 0x6c, - 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0e, 0x44, 0x62, 0x52, 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, - 0x31, 0x2e, 0x46, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0xd4, 0x04, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, - 0x61, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x65, 0x61, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x08, 0x73, 0x69, 0x62, - 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x68, 0x61, - 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x08, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x07, 0x69, - 0x6e, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x61, 0x52, 0x06, 0x69, 0x6e, - 0x73, 0x4b, 0x65, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6f, 0x6c, 0x64, 0x30, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4f, 0x6c, 0x64, 0x30, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x48, 0x61, 0x73, 0x68, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x45, - 0x0a, 0x0b, 0x64, 0x62, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x18, 0x09, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x44, 0x62, 0x52, 0x65, - 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x64, 0x62, 0x52, 0x65, - 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x53, 0x0a, 0x0d, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x4f, 0x0a, 0x0e, 0x44, 0x62, 0x52, - 0x65, 0x61, 0x64, 0x4c, 0x6f, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x68, - 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x43, 0x0a, 0x12, 0x53, 0x65, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x43, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, + 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, + 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x57, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0x57, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, - 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x46, 0x6c, 0x75, - 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, - 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x6c, - 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, - 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2d, 0x0a, - 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe7, 0x02, 0x0a, - 0x16, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x64, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, - 0x28, 0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x6c, 0x61, 0x73, - 0x74, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x33, 0x0a, - 0x16, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x66, 0x6c, 0x75, 0x73, - 0x68, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x70, - 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, - 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x46, - 0x6c, 0x75, 0x73, 0x68, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x73, - 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x69, - 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, - 0x76, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, - 0x6f, 0x76, 0x65, 0x72, 0x49, 0x64, 0x22, 0xe9, 0x02, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x6c, - 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x26, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, - 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x6e, 0x6f, - 0x64, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x5f, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x61, 0x73, 0x68, - 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x2e, 0x0a, 0x07, - 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x3b, 0x0a, 0x0e, - 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x67, - 0x72, 0x61, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x6f, 0x64, - 0x65, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, - 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x22, 0x4d, 0x0a, 0x03, 0x46, 0x65, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x30, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, 0x30, 0x12, 0x10, 0x0a, 0x03, 0x66, - 0x65, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, 0x31, 0x12, 0x10, 0x0a, - 0x03, 0x66, 0x65, 0x32, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, 0x32, 0x12, - 0x10, 0x0a, 0x03, 0x66, 0x65, 0x33, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, - 0x33, 0x22, 0x18, 0x0a, 0x06, 0x46, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x66, - 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x02, 0x66, 0x65, 0x22, 0x27, 0x0a, 0x0b, 0x53, - 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x69, - 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x62, - 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x33, 0x0a, 0x09, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, - 0x61, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xd4, 0x01, 0x0a, 0x0a, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x2e, 0x43, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x95, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x43, 0x4f, 0x44, 0x45, 0x5f, - 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x44, - 0x45, 0x5f, 0x44, 0x42, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4e, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x55, - 0x4e, 0x44, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x42, 0x5f, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x44, 0x45, 0x5f, - 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, - 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x4d, 0x54, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x0e, - 0x32, 0x82, 0x05, 0x0a, 0x0d, 0x48, 0x61, 0x73, 0x68, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x36, 0x0a, 0x03, 0x53, 0x65, 0x74, 0x12, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, - 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, - 0x74, 0x12, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, - 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, - 0x12, 0x1c, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, - 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, - 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x72, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, - 0x4b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1c, 0x2e, - 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x61, - 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, - 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x06, - 0x4c, 0x6f, 0x61, 0x64, 0x44, 0x42, 0x12, 0x18, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, - 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0d, 0x4c, 0x6f, - 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, 0x12, 0x1f, 0x2e, 0x68, 0x61, - 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, - 0x72, 0x61, 0x6d, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x05, 0x46, 0x6c, 0x75, 0x73, 0x68, 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, 0x18, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x53, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x22, 0x81, 0x01, 0x0a, 0x0d, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, + 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, + 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe7, 0x02, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x46, + 0x6c, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x75, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x74, + 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x46, 0x6c, 0x75, + 0x73, 0x68, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x66, 0x6c, 0x75, + 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x6c, 0x61, 0x73, + 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x16, 0x70, 0x65, 0x6e, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x6e, 0x6f, 0x64, + 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, + 0x67, 0x54, 0x6f, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x37, 0x0a, + 0x18, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x5f, 0x66, 0x6c, 0x75, 0x73, + 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x15, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, + 0x67, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x73, + 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x49, + 0x64, 0x22, 0x97, 0x03, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x46, 0x6c, 0x75, 0x73, 0x68, + 0x49, 0x64, 0x12, 0x40, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2a, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6e, + 0x6f, 0x64, 0x65, 0x73, 0x12, 0x46, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x28, 0x0a, 0x10, + 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x1a, 0x38, 0x0a, 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, + 0x3a, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4d, 0x0a, 0x03, 0x46, + 0x65, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x30, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x66, 0x65, 0x30, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x31, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x03, 0x66, 0x65, 0x31, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x32, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x33, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x65, 0x33, 0x22, 0x18, 0x0a, 0x06, 0x46, 0x65, + 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x66, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, + 0x52, 0x02, 0x66, 0x65, 0x22, 0x27, 0x0a, 0x0b, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x4c, + 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x04, 0x52, 0x07, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0xd4, 0x01, + 0x0a, 0x0a, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2e, 0x0a, 0x04, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, + 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x95, 0x01, 0x0a, + 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x43, + 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x01, 0x12, 0x19, 0x0a, + 0x15, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x42, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4e, 0x4f, 0x54, + 0x5f, 0x46, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x44, 0x45, + 0x5f, 0x44, 0x42, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, + 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x4d, 0x54, + 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x53, 0x49, + 0x5a, 0x45, 0x10, 0x0e, 0x2a, 0x65, 0x0a, 0x0b, 0x50, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, + 0x6e, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, + 0x43, 0x45, 0x5f, 0x43, 0x41, 0x43, 0x48, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x45, 0x52, 0x53, 0x49, 0x53, + 0x54, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, + 0x12, 0x19, 0x0a, 0x15, 0x50, 0x45, 0x52, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x43, 0x45, 0x5f, + 0x54, 0x45, 0x4d, 0x50, 0x4f, 0x52, 0x41, 0x52, 0x59, 0x10, 0x02, 0x32, 0xc7, 0x05, 0x0a, 0x0d, + 0x48, 0x61, 0x73, 0x68, 0x44, 0x42, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x36, 0x0a, + 0x03, 0x53, 0x65, 0x74, 0x12, 0x15, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x61, + 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, 0x15, 0x2e, 0x68, + 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, + 0x0a, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x68, 0x61, + 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, + 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x61, 0x73, 0x68, + 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x1c, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, + 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x06, 0x4c, 0x6f, 0x61, 0x64, 0x44, + 0x42, 0x12, 0x18, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, + 0x61, 0x64, 0x44, 0x42, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x0d, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, 0x12, 0x1f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x44, 0x42, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, + 0x00, 0x12, 0x3c, 0x0a, 0x05, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x17, 0x2e, 0x68, 0x61, 0x73, + 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x6c, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x42, 0x0a, 0x09, 0x53, 0x65, 0x6d, 0x69, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x1b, 0x2e, 0x68, + 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6d, 0x69, 0x46, 0x6c, 0x75, + 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 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, 0x21, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, @@ -1835,11 +1980,11 @@ var file_hashdb_proto_rawDesc = []byte{ 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x6c, 0x75, 0x73, 0x68, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x35, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x78, 0x50, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x48, 0x65, 0x72, 0x6d, 0x65, 0x7a, 0x2f, 0x7a, 0x6b, 0x65, 0x76, 0x6d, 0x2d, 0x6e, 0x6f, 0x64, 0x65, 0x2f, 0x6d, - 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x74, 0x72, 0x65, 0x65, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x64, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1854,94 +1999,100 @@ func file_hashdb_proto_rawDescGZIP() []byte { return file_hashdb_proto_rawDescData } -var file_hashdb_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_hashdb_proto_msgTypes = make([]protoimpl.MessageInfo, 26) +var file_hashdb_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_hashdb_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_hashdb_proto_goTypes = []interface{}{ - (ResultCode_Code)(0), // 0: hashdb.v1.ResultCode.Code - (*Version)(nil), // 1: hashdb.v1.Version - (*SetRequest)(nil), // 2: hashdb.v1.SetRequest - (*GetRequest)(nil), // 3: hashdb.v1.GetRequest - (*SetProgramRequest)(nil), // 4: hashdb.v1.SetProgramRequest - (*GetProgramRequest)(nil), // 5: hashdb.v1.GetProgramRequest - (*LoadDBRequest)(nil), // 6: hashdb.v1.LoadDBRequest - (*LoadProgramDBRequest)(nil), // 7: hashdb.v1.LoadProgramDBRequest - (*GetFlushDataRequest)(nil), // 8: hashdb.v1.GetFlushDataRequest - (*SetResponse)(nil), // 9: hashdb.v1.SetResponse - (*GetResponse)(nil), // 10: hashdb.v1.GetResponse - (*SetProgramResponse)(nil), // 11: hashdb.v1.SetProgramResponse - (*GetProgramResponse)(nil), // 12: hashdb.v1.GetProgramResponse - (*FlushResponse)(nil), // 13: hashdb.v1.FlushResponse - (*GetFlushStatusResponse)(nil), // 14: hashdb.v1.GetFlushStatusResponse - (*GetFlushDataResponse)(nil), // 15: hashdb.v1.GetFlushDataResponse - (*Fea)(nil), // 16: hashdb.v1.Fea - (*FeList)(nil), // 17: hashdb.v1.FeList - (*SiblingList)(nil), // 18: hashdb.v1.SiblingList - (*FlushData)(nil), // 19: hashdb.v1.FlushData - (*ResultCode)(nil), // 20: hashdb.v1.ResultCode - nil, // 21: hashdb.v1.LoadDBRequest.InputDbEntry - nil, // 22: hashdb.v1.LoadProgramDBRequest.InputProgramDbEntry - nil, // 23: hashdb.v1.SetResponse.SiblingsEntry - nil, // 24: hashdb.v1.SetResponse.DbReadLogEntry - nil, // 25: hashdb.v1.GetResponse.SiblingsEntry - nil, // 26: hashdb.v1.GetResponse.DbReadLogEntry - (*emptypb.Empty)(nil), // 27: google.protobuf.Empty + (Persistence)(0), // 0: hashdb.v1.Persistence + (ResultCode_Code)(0), // 1: hashdb.v1.ResultCode.Code + (*Version)(nil), // 2: hashdb.v1.Version + (*SetRequest)(nil), // 3: hashdb.v1.SetRequest + (*GetRequest)(nil), // 4: hashdb.v1.GetRequest + (*SetProgramRequest)(nil), // 5: hashdb.v1.SetProgramRequest + (*GetProgramRequest)(nil), // 6: hashdb.v1.GetProgramRequest + (*LoadDBRequest)(nil), // 7: hashdb.v1.LoadDBRequest + (*LoadProgramDBRequest)(nil), // 8: hashdb.v1.LoadProgramDBRequest + (*FlushRequest)(nil), // 9: hashdb.v1.FlushRequest + (*SemiFlushRequest)(nil), // 10: hashdb.v1.SemiFlushRequest + (*GetFlushDataRequest)(nil), // 11: hashdb.v1.GetFlushDataRequest + (*SetResponse)(nil), // 12: hashdb.v1.SetResponse + (*GetResponse)(nil), // 13: hashdb.v1.GetResponse + (*SetProgramResponse)(nil), // 14: hashdb.v1.SetProgramResponse + (*GetProgramResponse)(nil), // 15: hashdb.v1.GetProgramResponse + (*FlushResponse)(nil), // 16: hashdb.v1.FlushResponse + (*GetFlushStatusResponse)(nil), // 17: hashdb.v1.GetFlushStatusResponse + (*GetFlushDataResponse)(nil), // 18: hashdb.v1.GetFlushDataResponse + (*Fea)(nil), // 19: hashdb.v1.Fea + (*FeList)(nil), // 20: hashdb.v1.FeList + (*SiblingList)(nil), // 21: hashdb.v1.SiblingList + (*ResultCode)(nil), // 22: hashdb.v1.ResultCode + nil, // 23: hashdb.v1.LoadDBRequest.InputDbEntry + nil, // 24: hashdb.v1.LoadProgramDBRequest.InputProgramDbEntry + nil, // 25: hashdb.v1.SetResponse.SiblingsEntry + nil, // 26: hashdb.v1.SetResponse.DbReadLogEntry + nil, // 27: hashdb.v1.GetResponse.SiblingsEntry + nil, // 28: hashdb.v1.GetResponse.DbReadLogEntry + nil, // 29: hashdb.v1.GetFlushDataResponse.NodesEntry + nil, // 30: hashdb.v1.GetFlushDataResponse.ProgramEntry + (*emptypb.Empty)(nil), // 31: google.protobuf.Empty } var file_hashdb_proto_depIdxs = []int32{ - 16, // 0: hashdb.v1.SetRequest.old_root:type_name -> hashdb.v1.Fea - 16, // 1: hashdb.v1.SetRequest.key:type_name -> hashdb.v1.Fea - 16, // 2: hashdb.v1.GetRequest.root:type_name -> hashdb.v1.Fea - 16, // 3: hashdb.v1.GetRequest.key:type_name -> hashdb.v1.Fea - 16, // 4: hashdb.v1.SetProgramRequest.key:type_name -> hashdb.v1.Fea - 16, // 5: hashdb.v1.GetProgramRequest.key:type_name -> hashdb.v1.Fea - 21, // 6: hashdb.v1.LoadDBRequest.input_db:type_name -> hashdb.v1.LoadDBRequest.InputDbEntry - 22, // 7: hashdb.v1.LoadProgramDBRequest.input_program_db:type_name -> hashdb.v1.LoadProgramDBRequest.InputProgramDbEntry - 16, // 8: hashdb.v1.SetResponse.old_root:type_name -> hashdb.v1.Fea - 16, // 9: hashdb.v1.SetResponse.new_root:type_name -> hashdb.v1.Fea - 16, // 10: hashdb.v1.SetResponse.key:type_name -> hashdb.v1.Fea - 23, // 11: hashdb.v1.SetResponse.siblings:type_name -> hashdb.v1.SetResponse.SiblingsEntry - 16, // 12: hashdb.v1.SetResponse.ins_key:type_name -> hashdb.v1.Fea - 24, // 13: hashdb.v1.SetResponse.db_read_log:type_name -> hashdb.v1.SetResponse.DbReadLogEntry - 20, // 14: hashdb.v1.SetResponse.result:type_name -> hashdb.v1.ResultCode - 16, // 15: hashdb.v1.GetResponse.root:type_name -> hashdb.v1.Fea - 16, // 16: hashdb.v1.GetResponse.key:type_name -> hashdb.v1.Fea - 25, // 17: hashdb.v1.GetResponse.siblings:type_name -> hashdb.v1.GetResponse.SiblingsEntry - 16, // 18: hashdb.v1.GetResponse.ins_key:type_name -> hashdb.v1.Fea - 26, // 19: hashdb.v1.GetResponse.db_read_log:type_name -> hashdb.v1.GetResponse.DbReadLogEntry - 20, // 20: hashdb.v1.GetResponse.result:type_name -> hashdb.v1.ResultCode - 20, // 21: hashdb.v1.SetProgramResponse.result:type_name -> hashdb.v1.ResultCode - 20, // 22: hashdb.v1.GetProgramResponse.result:type_name -> hashdb.v1.ResultCode - 20, // 23: hashdb.v1.FlushResponse.result:type_name -> hashdb.v1.ResultCode - 19, // 24: hashdb.v1.GetFlushDataResponse.nodes:type_name -> hashdb.v1.FlushData - 19, // 25: hashdb.v1.GetFlushDataResponse.nodes_update:type_name -> hashdb.v1.FlushData - 19, // 26: hashdb.v1.GetFlushDataResponse.program:type_name -> hashdb.v1.FlushData - 19, // 27: hashdb.v1.GetFlushDataResponse.program_update:type_name -> hashdb.v1.FlushData - 20, // 28: hashdb.v1.GetFlushDataResponse.result:type_name -> hashdb.v1.ResultCode - 0, // 29: hashdb.v1.ResultCode.code:type_name -> hashdb.v1.ResultCode.Code - 17, // 30: hashdb.v1.LoadDBRequest.InputDbEntry.value:type_name -> hashdb.v1.FeList - 18, // 31: hashdb.v1.SetResponse.SiblingsEntry.value:type_name -> hashdb.v1.SiblingList - 17, // 32: hashdb.v1.SetResponse.DbReadLogEntry.value:type_name -> hashdb.v1.FeList - 18, // 33: hashdb.v1.GetResponse.SiblingsEntry.value:type_name -> hashdb.v1.SiblingList - 17, // 34: hashdb.v1.GetResponse.DbReadLogEntry.value:type_name -> hashdb.v1.FeList - 2, // 35: hashdb.v1.HashDBService.Set:input_type -> hashdb.v1.SetRequest - 3, // 36: hashdb.v1.HashDBService.Get:input_type -> hashdb.v1.GetRequest - 4, // 37: hashdb.v1.HashDBService.SetProgram:input_type -> hashdb.v1.SetProgramRequest - 5, // 38: hashdb.v1.HashDBService.GetProgram:input_type -> hashdb.v1.GetProgramRequest - 6, // 39: hashdb.v1.HashDBService.LoadDB:input_type -> hashdb.v1.LoadDBRequest - 7, // 40: hashdb.v1.HashDBService.LoadProgramDB:input_type -> hashdb.v1.LoadProgramDBRequest - 27, // 41: hashdb.v1.HashDBService.Flush:input_type -> google.protobuf.Empty - 27, // 42: hashdb.v1.HashDBService.GetFlushStatus:input_type -> google.protobuf.Empty - 8, // 43: hashdb.v1.HashDBService.GetFlushData:input_type -> hashdb.v1.GetFlushDataRequest - 9, // 44: hashdb.v1.HashDBService.Set:output_type -> hashdb.v1.SetResponse - 10, // 45: hashdb.v1.HashDBService.Get:output_type -> hashdb.v1.GetResponse - 11, // 46: hashdb.v1.HashDBService.SetProgram:output_type -> hashdb.v1.SetProgramResponse - 12, // 47: hashdb.v1.HashDBService.GetProgram:output_type -> hashdb.v1.GetProgramResponse - 27, // 48: hashdb.v1.HashDBService.LoadDB:output_type -> google.protobuf.Empty - 27, // 49: hashdb.v1.HashDBService.LoadProgramDB:output_type -> google.protobuf.Empty - 13, // 50: hashdb.v1.HashDBService.Flush:output_type -> hashdb.v1.FlushResponse - 14, // 51: hashdb.v1.HashDBService.GetFlushStatus:output_type -> hashdb.v1.GetFlushStatusResponse - 15, // 52: hashdb.v1.HashDBService.GetFlushData:output_type -> hashdb.v1.GetFlushDataResponse - 44, // [44:53] is the sub-list for method output_type - 35, // [35:44] is the sub-list for method input_type + 19, // 0: hashdb.v1.SetRequest.old_root:type_name -> hashdb.v1.Fea + 19, // 1: hashdb.v1.SetRequest.key:type_name -> hashdb.v1.Fea + 0, // 2: hashdb.v1.SetRequest.persistence:type_name -> hashdb.v1.Persistence + 19, // 3: hashdb.v1.GetRequest.root:type_name -> hashdb.v1.Fea + 19, // 4: hashdb.v1.GetRequest.key:type_name -> hashdb.v1.Fea + 19, // 5: hashdb.v1.SetProgramRequest.key:type_name -> hashdb.v1.Fea + 19, // 6: hashdb.v1.GetProgramRequest.key:type_name -> hashdb.v1.Fea + 23, // 7: hashdb.v1.LoadDBRequest.input_db:type_name -> hashdb.v1.LoadDBRequest.InputDbEntry + 24, // 8: hashdb.v1.LoadProgramDBRequest.input_program_db:type_name -> hashdb.v1.LoadProgramDBRequest.InputProgramDbEntry + 0, // 9: hashdb.v1.SemiFlushRequest.persistence:type_name -> hashdb.v1.Persistence + 19, // 10: hashdb.v1.SetResponse.old_root:type_name -> hashdb.v1.Fea + 19, // 11: hashdb.v1.SetResponse.new_root:type_name -> hashdb.v1.Fea + 19, // 12: hashdb.v1.SetResponse.key:type_name -> hashdb.v1.Fea + 25, // 13: hashdb.v1.SetResponse.siblings:type_name -> hashdb.v1.SetResponse.SiblingsEntry + 19, // 14: hashdb.v1.SetResponse.ins_key:type_name -> hashdb.v1.Fea + 26, // 15: hashdb.v1.SetResponse.db_read_log:type_name -> hashdb.v1.SetResponse.DbReadLogEntry + 22, // 16: hashdb.v1.SetResponse.result:type_name -> hashdb.v1.ResultCode + 19, // 17: hashdb.v1.GetResponse.root:type_name -> hashdb.v1.Fea + 19, // 18: hashdb.v1.GetResponse.key:type_name -> hashdb.v1.Fea + 27, // 19: hashdb.v1.GetResponse.siblings:type_name -> hashdb.v1.GetResponse.SiblingsEntry + 19, // 20: hashdb.v1.GetResponse.ins_key:type_name -> hashdb.v1.Fea + 28, // 21: hashdb.v1.GetResponse.db_read_log:type_name -> hashdb.v1.GetResponse.DbReadLogEntry + 22, // 22: hashdb.v1.GetResponse.result:type_name -> hashdb.v1.ResultCode + 22, // 23: hashdb.v1.SetProgramResponse.result:type_name -> hashdb.v1.ResultCode + 22, // 24: hashdb.v1.GetProgramResponse.result:type_name -> hashdb.v1.ResultCode + 22, // 25: hashdb.v1.FlushResponse.result:type_name -> hashdb.v1.ResultCode + 29, // 26: hashdb.v1.GetFlushDataResponse.nodes:type_name -> hashdb.v1.GetFlushDataResponse.NodesEntry + 30, // 27: hashdb.v1.GetFlushDataResponse.program:type_name -> hashdb.v1.GetFlushDataResponse.ProgramEntry + 22, // 28: hashdb.v1.GetFlushDataResponse.result:type_name -> hashdb.v1.ResultCode + 1, // 29: hashdb.v1.ResultCode.code:type_name -> hashdb.v1.ResultCode.Code + 20, // 30: hashdb.v1.LoadDBRequest.InputDbEntry.value:type_name -> hashdb.v1.FeList + 21, // 31: hashdb.v1.SetResponse.SiblingsEntry.value:type_name -> hashdb.v1.SiblingList + 20, // 32: hashdb.v1.SetResponse.DbReadLogEntry.value:type_name -> hashdb.v1.FeList + 21, // 33: hashdb.v1.GetResponse.SiblingsEntry.value:type_name -> hashdb.v1.SiblingList + 20, // 34: hashdb.v1.GetResponse.DbReadLogEntry.value:type_name -> hashdb.v1.FeList + 3, // 35: hashdb.v1.HashDBService.Set:input_type -> hashdb.v1.SetRequest + 4, // 36: hashdb.v1.HashDBService.Get:input_type -> hashdb.v1.GetRequest + 5, // 37: hashdb.v1.HashDBService.SetProgram:input_type -> hashdb.v1.SetProgramRequest + 6, // 38: hashdb.v1.HashDBService.GetProgram:input_type -> hashdb.v1.GetProgramRequest + 7, // 39: hashdb.v1.HashDBService.LoadDB:input_type -> hashdb.v1.LoadDBRequest + 8, // 40: hashdb.v1.HashDBService.LoadProgramDB:input_type -> hashdb.v1.LoadProgramDBRequest + 9, // 41: hashdb.v1.HashDBService.Flush:input_type -> hashdb.v1.FlushRequest + 10, // 42: hashdb.v1.HashDBService.SemiFlush:input_type -> hashdb.v1.SemiFlushRequest + 31, // 43: hashdb.v1.HashDBService.GetFlushStatus:input_type -> google.protobuf.Empty + 11, // 44: hashdb.v1.HashDBService.GetFlushData:input_type -> hashdb.v1.GetFlushDataRequest + 12, // 45: hashdb.v1.HashDBService.Set:output_type -> hashdb.v1.SetResponse + 13, // 46: hashdb.v1.HashDBService.Get:output_type -> hashdb.v1.GetResponse + 14, // 47: hashdb.v1.HashDBService.SetProgram:output_type -> hashdb.v1.SetProgramResponse + 15, // 48: hashdb.v1.HashDBService.GetProgram:output_type -> hashdb.v1.GetProgramResponse + 31, // 49: hashdb.v1.HashDBService.LoadDB:output_type -> google.protobuf.Empty + 31, // 50: hashdb.v1.HashDBService.LoadProgramDB:output_type -> google.protobuf.Empty + 16, // 51: hashdb.v1.HashDBService.Flush:output_type -> hashdb.v1.FlushResponse + 31, // 52: hashdb.v1.HashDBService.SemiFlush:output_type -> google.protobuf.Empty + 17, // 53: hashdb.v1.HashDBService.GetFlushStatus:output_type -> hashdb.v1.GetFlushStatusResponse + 18, // 54: hashdb.v1.HashDBService.GetFlushData:output_type -> hashdb.v1.GetFlushDataResponse + 45, // [45:55] is the sub-list for method output_type + 35, // [35:45] is the sub-list for method input_type 35, // [35:35] is the sub-list for extension type_name 35, // [35:35] is the sub-list for extension extendee 0, // [0:35] is the sub-list for field type_name @@ -2038,7 +2189,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlushDataRequest); i { + switch v := v.(*FlushRequest); i { case 0: return &v.state case 1: @@ -2050,7 +2201,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetResponse); i { + switch v := v.(*SemiFlushRequest); i { case 0: return &v.state case 1: @@ -2062,7 +2213,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResponse); i { + switch v := v.(*GetFlushDataRequest); i { case 0: return &v.state case 1: @@ -2074,7 +2225,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetProgramResponse); i { + switch v := v.(*SetResponse); i { case 0: return &v.state case 1: @@ -2086,7 +2237,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetProgramResponse); i { + switch v := v.(*GetResponse); i { case 0: return &v.state case 1: @@ -2098,7 +2249,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlushResponse); i { + switch v := v.(*SetProgramResponse); i { case 0: return &v.state case 1: @@ -2110,7 +2261,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlushStatusResponse); i { + switch v := v.(*GetProgramResponse); i { case 0: return &v.state case 1: @@ -2122,7 +2273,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetFlushDataResponse); i { + switch v := v.(*FlushResponse); i { case 0: return &v.state case 1: @@ -2134,7 +2285,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Fea); i { + switch v := v.(*GetFlushStatusResponse); i { case 0: return &v.state case 1: @@ -2146,7 +2297,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FeList); i { + switch v := v.(*GetFlushDataResponse); i { case 0: return &v.state case 1: @@ -2158,7 +2309,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SiblingList); i { + switch v := v.(*Fea); i { case 0: return &v.state case 1: @@ -2170,7 +2321,7 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FlushData); i { + switch v := v.(*FeList); i { case 0: return &v.state case 1: @@ -2182,6 +2333,18 @@ func file_hashdb_proto_init() { } } file_hashdb_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SiblingList); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_hashdb_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResultCode); i { case 0: return &v.state @@ -2199,8 +2362,8 @@ func file_hashdb_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_hashdb_proto_rawDesc, - NumEnums: 1, - NumMessages: 26, + NumEnums: 2, + NumMessages: 29, NumExtensions: 0, NumServices: 1, }, diff --git a/merkletree/pb/hashdb_grpc.pb.go b/merkletree/hashdb/hashdb_grpc.pb.go similarity index 88% rename from merkletree/pb/hashdb_grpc.pb.go rename to merkletree/hashdb/hashdb_grpc.pb.go index 10ec44f17a..41d28b5654 100644 --- a/merkletree/pb/hashdb_grpc.pb.go +++ b/merkletree/hashdb/hashdb_grpc.pb.go @@ -4,11 +4,10 @@ // - protoc v3.21.12 // source: hashdb.proto -package pb +package hashdb import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -28,6 +27,7 @@ const ( HashDBService_LoadDB_FullMethodName = "/hashdb.v1.HashDBService/LoadDB" HashDBService_LoadProgramDB_FullMethodName = "/hashdb.v1.HashDBService/LoadProgramDB" HashDBService_Flush_FullMethodName = "/hashdb.v1.HashDBService/Flush" + HashDBService_SemiFlush_FullMethodName = "/hashdb.v1.HashDBService/SemiFlush" HashDBService_GetFlushStatus_FullMethodName = "/hashdb.v1.HashDBService/GetFlushStatus" HashDBService_GetFlushData_FullMethodName = "/hashdb.v1.HashDBService/GetFlushData" ) @@ -42,7 +42,8 @@ type HashDBServiceClient interface { GetProgram(ctx context.Context, in *GetProgramRequest, opts ...grpc.CallOption) (*GetProgramResponse, error) LoadDB(ctx context.Context, in *LoadDBRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) LoadProgramDB(ctx context.Context, in *LoadProgramDBRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - Flush(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FlushResponse, error) + Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error) + SemiFlush(ctx context.Context, in *SemiFlushRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) GetFlushStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetFlushStatusResponse, error) GetFlushData(ctx context.Context, in *GetFlushDataRequest, opts ...grpc.CallOption) (*GetFlushDataResponse, error) } @@ -109,7 +110,7 @@ func (c *hashDBServiceClient) LoadProgramDB(ctx context.Context, in *LoadProgram return out, nil } -func (c *hashDBServiceClient) Flush(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*FlushResponse, error) { +func (c *hashDBServiceClient) Flush(ctx context.Context, in *FlushRequest, opts ...grpc.CallOption) (*FlushResponse, error) { out := new(FlushResponse) err := c.cc.Invoke(ctx, HashDBService_Flush_FullMethodName, in, out, opts...) if err != nil { @@ -118,6 +119,15 @@ func (c *hashDBServiceClient) Flush(ctx context.Context, in *emptypb.Empty, opts return out, nil } +func (c *hashDBServiceClient) SemiFlush(ctx context.Context, in *SemiFlushRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, HashDBService_SemiFlush_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *hashDBServiceClient) GetFlushStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*GetFlushStatusResponse, error) { out := new(GetFlushStatusResponse) err := c.cc.Invoke(ctx, HashDBService_GetFlushStatus_FullMethodName, in, out, opts...) @@ -146,7 +156,8 @@ type HashDBServiceServer interface { GetProgram(context.Context, *GetProgramRequest) (*GetProgramResponse, error) LoadDB(context.Context, *LoadDBRequest) (*emptypb.Empty, error) LoadProgramDB(context.Context, *LoadProgramDBRequest) (*emptypb.Empty, error) - Flush(context.Context, *emptypb.Empty) (*FlushResponse, error) + Flush(context.Context, *FlushRequest) (*FlushResponse, error) + SemiFlush(context.Context, *SemiFlushRequest) (*emptypb.Empty, error) GetFlushStatus(context.Context, *emptypb.Empty) (*GetFlushStatusResponse, error) GetFlushData(context.Context, *GetFlushDataRequest) (*GetFlushDataResponse, error) mustEmbedUnimplementedHashDBServiceServer() @@ -174,9 +185,12 @@ func (UnimplementedHashDBServiceServer) LoadDB(context.Context, *LoadDBRequest) func (UnimplementedHashDBServiceServer) LoadProgramDB(context.Context, *LoadProgramDBRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method LoadProgramDB not implemented") } -func (UnimplementedHashDBServiceServer) Flush(context.Context, *emptypb.Empty) (*FlushResponse, error) { +func (UnimplementedHashDBServiceServer) Flush(context.Context, *FlushRequest) (*FlushResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Flush not implemented") } +func (UnimplementedHashDBServiceServer) SemiFlush(context.Context, *SemiFlushRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SemiFlush not implemented") +} func (UnimplementedHashDBServiceServer) GetFlushStatus(context.Context, *emptypb.Empty) (*GetFlushStatusResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetFlushStatus not implemented") } @@ -305,7 +319,7 @@ func _HashDBService_LoadProgramDB_Handler(srv interface{}, ctx context.Context, } func _HashDBService_Flush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) + in := new(FlushRequest) if err := dec(in); err != nil { return nil, err } @@ -317,7 +331,25 @@ func _HashDBService_Flush_Handler(srv interface{}, ctx context.Context, dec func FullMethod: HashDBService_Flush_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(HashDBServiceServer).Flush(ctx, req.(*emptypb.Empty)) + return srv.(HashDBServiceServer).Flush(ctx, req.(*FlushRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _HashDBService_SemiFlush_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SemiFlushRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HashDBServiceServer).SemiFlush(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HashDBService_SemiFlush_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HashDBServiceServer).SemiFlush(ctx, req.(*SemiFlushRequest)) } return interceptor(ctx, in, info, handler) } @@ -393,6 +425,10 @@ var HashDBService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Flush", Handler: _HashDBService_Flush_Handler, }, + { + MethodName: "SemiFlush", + Handler: _HashDBService_SemiFlush_Handler, + }, { MethodName: "GetFlushStatus", Handler: _HashDBService_GetFlushStatus_Handler, diff --git a/merkletree/tree.go b/merkletree/tree.go index 36cefa572d..c6da917417 100644 --- a/merkletree/tree.go +++ b/merkletree/tree.go @@ -7,18 +7,17 @@ import ( "strings" "github.com/0xPolygonHermez/zkevm-node/hex" - "github.com/0xPolygonHermez/zkevm-node/merkletree/pb" + "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb" "github.com/ethereum/go-ethereum/common" - "google.golang.org/protobuf/types/known/emptypb" ) // StateTree provides methods to access and modify state in merkletree type StateTree struct { - grpcClient pb.HashDBServiceClient + grpcClient hashdb.HashDBServiceClient } // NewStateTree creates new StateTree. -func NewStateTree(client pb.HashDBServiceClient) *StateTree { +func NewStateTree(client hashdb.HashDBServiceClient) *StateTree { return &StateTree{ grpcClient: client, } @@ -125,7 +124,7 @@ func (tree *StateTree) GetStorageAt(ctx context.Context, address common.Address, } // SetBalance sets balance. -func (tree *StateTree) SetBalance(ctx context.Context, address common.Address, balance *big.Int, root []byte) (newRoot []byte, proof *UpdateProof, err error) { +func (tree *StateTree) SetBalance(ctx context.Context, address common.Address, balance *big.Int, root []byte, uuid string) (newRoot []byte, proof *UpdateProof, err error) { if balance.Cmp(big.NewInt(0)) == -1 { return nil, nil, fmt.Errorf("invalid balance") } @@ -139,7 +138,7 @@ func (tree *StateTree) SetBalance(ctx context.Context, address common.Address, b k := new(big.Int).SetBytes(key) balanceH8 := scalar2fea(balance) - updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), balanceH8) + updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), balanceH8, uuid) if err != nil { return nil, nil, err } @@ -148,7 +147,7 @@ func (tree *StateTree) SetBalance(ctx context.Context, address common.Address, b } // SetNonce sets nonce. -func (tree *StateTree) SetNonce(ctx context.Context, address common.Address, nonce *big.Int, root []byte) (newRoot []byte, proof *UpdateProof, err error) { +func (tree *StateTree) SetNonce(ctx context.Context, address common.Address, nonce *big.Int, root []byte, uuid string) (newRoot []byte, proof *UpdateProof, err error) { if nonce.Cmp(big.NewInt(0)) == -1 { return nil, nil, fmt.Errorf("invalid nonce") } @@ -163,7 +162,7 @@ func (tree *StateTree) SetNonce(ctx context.Context, address common.Address, non nonceH8 := scalar2fea(nonce) - updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), nonceH8) + updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), nonceH8, uuid) if err != nil { return nil, nil, err } @@ -172,7 +171,7 @@ func (tree *StateTree) SetNonce(ctx context.Context, address common.Address, non } // SetCode sets smart contract code. -func (tree *StateTree) SetCode(ctx context.Context, address common.Address, code []byte, root []byte) (newRoot []byte, proof *UpdateProof, err error) { +func (tree *StateTree) SetCode(ctx context.Context, address common.Address, code []byte, root []byte, uuid string) (newRoot []byte, proof *UpdateProof, err error) { // calculating smart contract code hash scCodeHash4, err := hashContractBytecode(code) if err != nil { @@ -201,7 +200,7 @@ func (tree *StateTree) SetCode(ctx context.Context, address common.Address, code scCodeHashBI := new(big.Int).SetBytes(scCodeHash[:]) scCodeHashH8 := scalar2fea(scCodeHashBI) - updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), scCodeHashH8) + updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), scCodeHashH8, uuid) if err != nil { return nil, nil, err } @@ -215,7 +214,7 @@ func (tree *StateTree) SetCode(ctx context.Context, address common.Address, code scCodeLengthBI := new(big.Int).SetInt64(int64(len(code))) scCodeLengthH8 := scalar2fea(scCodeLengthBI) - updateProof, err = tree.set(ctx, updateProof.NewRoot, scalarToh4(k), scCodeLengthH8) + updateProof, err = tree.set(ctx, updateProof.NewRoot, scalarToh4(k), scCodeLengthH8, uuid) if err != nil { return nil, nil, err } @@ -224,7 +223,7 @@ func (tree *StateTree) SetCode(ctx context.Context, address common.Address, code } // SetStorageAt sets storage value at specified position. -func (tree *StateTree) SetStorageAt(ctx context.Context, address common.Address, position *big.Int, value *big.Int, root []byte) (newRoot []byte, proof *UpdateProof, err error) { +func (tree *StateTree) SetStorageAt(ctx context.Context, address common.Address, position *big.Int, value *big.Int, root []byte, uuid string) (newRoot []byte, proof *UpdateProof, err error) { r := new(big.Int).SetBytes(root) key, err := KeyContractStorage(address, position.Bytes()) if err != nil { @@ -233,7 +232,7 @@ func (tree *StateTree) SetStorageAt(ctx context.Context, address common.Address, k := new(big.Int).SetBytes(key[:]) valueH8 := scalar2fea(value) - updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), valueH8) + updateProof, err := tree.set(ctx, scalarToh4(r), scalarToh4(k), valueH8, uuid) if err != nil { return nil, nil, err } @@ -242,9 +241,9 @@ func (tree *StateTree) SetStorageAt(ctx context.Context, address common.Address, } func (tree *StateTree) get(ctx context.Context, root, key []uint64) (*Proof, error) { - result, err := tree.grpcClient.Get(ctx, &pb.GetRequest{ - Root: &pb.Fea{Fe0: root[0], Fe1: root[1], Fe2: root[2], Fe3: root[3]}, - Key: &pb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, + result, err := tree.grpcClient.Get(ctx, &hashdb.GetRequest{ + Root: &hashdb.Fea{Fe0: root[0], Fe1: root[1], Fe2: root[2], Fe3: root[3]}, + Key: &hashdb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, }) if err != nil { return nil, err @@ -262,8 +261,8 @@ func (tree *StateTree) get(ctx context.Context, root, key []uint64) (*Proof, err } func (tree *StateTree) getProgram(ctx context.Context, key []uint64) (*ProgramProof, error) { - result, err := tree.grpcClient.GetProgram(ctx, &pb.GetProgramRequest{ - Key: &pb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, + result, err := tree.grpcClient.GetProgram(ctx, &hashdb.GetProgramRequest{ + Key: &hashdb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, }) if err != nil { return nil, err @@ -274,16 +273,17 @@ func (tree *StateTree) getProgram(ctx context.Context, key []uint64) (*ProgramPr }, nil } -func (tree *StateTree) set(ctx context.Context, oldRoot, key, value []uint64) (*UpdateProof, error) { +func (tree *StateTree) set(ctx context.Context, oldRoot, key, value []uint64, uuid string) (*UpdateProof, error) { feaValue := fea2string(value) if strings.HasPrefix(feaValue, "0x") { // nolint feaValue = feaValue[2:] } - result, err := tree.grpcClient.Set(ctx, &pb.SetRequest{ - OldRoot: &pb.Fea{Fe0: oldRoot[0], Fe1: oldRoot[1], Fe2: oldRoot[2], Fe3: oldRoot[3]}, - Key: &pb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, - Value: feaValue, - Persistent: true, + result, err := tree.grpcClient.Set(ctx, &hashdb.SetRequest{ + OldRoot: &hashdb.Fea{Fe0: oldRoot[0], Fe1: oldRoot[1], Fe2: oldRoot[2], Fe3: oldRoot[3]}, + Key: &hashdb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, + Value: feaValue, + Persistence: hashdb.Persistence_PERSISTENCE_DATABASE, + BatchUuid: uuid, }) if err != nil { return nil, err @@ -306,8 +306,8 @@ func (tree *StateTree) set(ctx context.Context, oldRoot, key, value []uint64) (* } func (tree *StateTree) setProgram(ctx context.Context, key []uint64, data []byte, persistent bool) error { - _, err := tree.grpcClient.SetProgram(ctx, &pb.SetProgramRequest{ - Key: &pb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, + _, err := tree.grpcClient.SetProgram(ctx, &hashdb.SetProgramRequest{ + Key: &hashdb.Fea{Fe0: key[0], Fe1: key[1], Fe2: key[2], Fe3: key[3]}, Data: data, Persistent: persistent, }) @@ -315,7 +315,8 @@ func (tree *StateTree) setProgram(ctx context.Context, key []uint64, data []byte } // Flush flushes all changes to the persistent storage. -func (tree *StateTree) Flush(ctx context.Context) error { - _, err := tree.grpcClient.Flush(ctx, &emptypb.Empty{}) +func (tree *StateTree) Flush(ctx context.Context, uuid string) error { + flushRequest := &hashdb.FlushRequest{BatchUuid: uuid} + _, err := tree.grpcClient.Flush(ctx, flushRequest) return err } diff --git a/proto/src/proto/aggregator/v1/aggregator.proto b/proto/src/proto/aggregator/v1/aggregator.proto index 66be538775..4c22903571 100644 --- a/proto/src/proto/aggregator/v1/aggregator.proto +++ b/proto/src/proto/aggregator/v1/aggregator.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package aggregator.v1; -option go_package = "github.com/0xPolygonHermez/zkevm-node/aggregator/pb"; +option go_package = "github.com/0xPolygonHermez/zkevm-node/aggregator/prover"; message Version { string v0_0_1 = 1; diff --git a/proto/src/proto/hashdb/v1/hashdb.proto b/proto/src/proto/hashdb/v1/hashdb.proto index cd41cf7c23..1f887839d7 100644 --- a/proto/src/proto/hashdb/v1/hashdb.proto +++ b/proto/src/proto/hashdb/v1/hashdb.proto @@ -4,7 +4,7 @@ import "google/protobuf/empty.proto"; package hashdb.v1; -option go_package = "github.com/0xPolygonHermez/zkevm-node/merkletree/pb"; +option go_package = "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb"; message Version { string v0_0_1 = 1; @@ -27,7 +27,8 @@ service HashDBService { rpc GetProgram(GetProgramRequest) returns (GetProgramResponse) {} rpc LoadDB(LoadDBRequest) returns (google.protobuf.Empty) {} rpc LoadProgramDB(LoadProgramDBRequest) returns (google.protobuf.Empty) {} - rpc Flush (google.protobuf.Empty) returns (FlushResponse) {} + rpc Flush (FlushRequest) returns (FlushResponse) {} + rpc SemiFlush (SemiFlushRequest) returns (google.protobuf.Empty) {} rpc GetFlushStatus (google.protobuf.Empty) returns (GetFlushStatusResponse) {} rpc GetFlushData (GetFlushDataRequest) returns (GetFlushDataResponse) {} } @@ -36,22 +37,33 @@ service HashDBService { // Request messages /////////////////// +enum Persistence { + PERSISTENCE_CACHE_UNSPECIFIED = 0; + PERSISTENCE_DATABASE = 1; + PERSISTENCE_TEMPORARY = 2; +} + /** * @dev SetRequest * @param {old_root} - merkle-tree root * @param {key} - key to set * @param {value} - scalar value to set (HEX string format) - * @param {persistent} - indicates if it should be stored in the SQL database (true) or only in the memory cache (false) + * @param {persistence} - indicates if it should be stored only in CACHE, in the SQL DATABASE, or it is just TEMPORARY and should be deleted at the flush of this batch UUID * @param {details} - indicates if it should return all response parameters (true) or just the new root (false) * @param {get_db_read_log} - indicates if it should return the DB reads generated during the execution of the request + * @param {batch_uuid} - indicates a unique identifier of the current batch or session; data for this batch can be stored in memory until flushed to database + * @param {tx} - current transaction ordinal number: 0, 1, 2... */ message SetRequest { Fea old_root = 1; Fea key = 2; string value = 3; - bool persistent = 4; + Persistence persistence = 4; bool details = 5; bool get_db_read_log = 6; + string batch_uuid = 7; + uint64 tx = 8; + } /** @@ -60,12 +72,14 @@ message SetRequest { * @param {key} - key to look for * @param {details} - indicates if it should return all response parameters (true) or just the new root (false) * @param {get_db_read_log} - indicates if it should return the DB reads generated during the execution of the request + * @param {batch_uuid} - indicates a unique identifier of the current batch or session; data for this batch can be stored in memory until flushed to database */ message GetRequest { Fea root = 1; Fea key = 2; bool details = 3; bool get_db_read_log = 4; + string batch_uuid = 5; } /** @@ -108,6 +122,26 @@ message LoadProgramDBRequest { bool persistent = 2; } +/** + * @dev FlushRequest + * @param {batch_uuid} - indicates a unique identifier of the current batch or session which data will be flushed to cache (and database if required) + */ +message FlushRequest { + string batch_uuid = 1; +} + +/** + * @dev SemiFlushRequest + * @param {batch_uuid} - indicates a unique identifier of the current batch or session which data will be semi-flushed + * @param {new_state_root} - state root at this point of the execution + * @param {persistence} - indicates if it should be stored only in CACHE, in the SQL DATABASE, or it is just TEMPORARY and should be deleted at the flush of this batch UUID + */ +message SemiFlushRequest { + string batch_uuid = 1; + string new_state_root = 2; + Persistence persistence = 3; +} + /** * @dev GetFlushDataRequest * @param {flush_id} - last stored flush ID got using this method, or 0 if it never was called before @@ -234,20 +268,16 @@ message GetFlushStatusResponse { * @dev GetFlushDataResponse * @param {stored_flush_id} - id of the last flush data sent to database * @param {nodes} - data to insert in the nodes table - * @param {nodes_update} - data to update in the nodes table * @param {program} - data to insert in the program table - * @param {program_update} - data to update in the program table * @param {nodes_state_root} - nodes state root to update in the nodes table * @param {result} - result code */ message GetFlushDataResponse { uint64 stored_flush_id = 1; - repeated FlushData nodes = 2; - repeated FlushData nodes_update = 3; - repeated FlushData program = 4; - repeated FlushData program_update = 5; - string nodes_state_root = 6; - ResultCode result = 7; + map nodes = 2; + map program = 3; + string nodes_state_root = 4; + ResultCode result = 5; } /** @@ -280,16 +310,6 @@ message SiblingList { repeated uint64 sibling = 1; } -/** - * @dev Flush Data - * @param {key} - hash key - * @param {value} - string value -*/ -message FlushData { - string key = 1; - string value = 2; -} - /** * @dev Result code * @param {code} - result code diff --git a/sequencer/closingsignalsmanager_test.go b/sequencer/closingsignalsmanager_test.go index cb09f40e34..e6eca56cef 100644 --- a/sequencer/closingsignalsmanager_test.go +++ b/sequencer/closingsignalsmanager_test.go @@ -11,7 +11,7 @@ import ( "github.com/0xPolygonHermez/zkevm-node/event/nileventstorage" "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/merkletree" - mtDBclientpb "github.com/0xPolygonHermez/zkevm-node/merkletree/pb" + "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb" "github.com/0xPolygonHermez/zkevm-node/state" "github.com/0xPolygonHermez/zkevm-node/state/runtime/executor" "github.com/0xPolygonHermez/zkevm-node/test/dbutils" @@ -30,7 +30,7 @@ var ( localTestDbManager *dbManager localCtx context.Context localMtDBCancel, localExecutorCancel context.CancelFunc - localMtDBServiceClient mtDBclientpb.HashDBServiceClient + localMtDBServiceClient hashdb.HashDBServiceClient localMtDBClientConn, localExecutorClientConn *grpc.ClientConn localState *state.State localExecutorClient executor.ExecutorServiceClient diff --git a/sequencer/dbmanager_test.go b/sequencer/dbmanager_test.go index 647a134dbf..0a8cf82c23 100644 --- a/sequencer/dbmanager_test.go +++ b/sequencer/dbmanager_test.go @@ -12,7 +12,7 @@ import ( "github.com/0xPolygonHermez/zkevm-node/event/nileventstorage" "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/merkletree" - mtDBclientpb "github.com/0xPolygonHermez/zkevm-node/merkletree/pb" + "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb" "github.com/0xPolygonHermez/zkevm-node/state" "github.com/0xPolygonHermez/zkevm-node/state/runtime/executor" "github.com/0xPolygonHermez/zkevm-node/test/dbutils" @@ -37,7 +37,7 @@ var ( } dbManagerCfg = DBManagerCfg{PoolRetrievalInterval: types.NewDuration(500 * time.Millisecond)} executorClient executor.ExecutorServiceClient - mtDBServiceClient mtDBclientpb.HashDBServiceClient + mtDBServiceClient hashdb.HashDBServiceClient mtDBClientConn *grpc.ClientConn testDbManager *dbManager ) diff --git a/state/genesis.go b/state/genesis.go index e48a89a3b6..ab05bbed17 100644 --- a/state/genesis.go +++ b/state/genesis.go @@ -12,6 +12,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/trie" + "github.com/google/uuid" "github.com/jackc/pgx/v4" ) @@ -50,6 +51,8 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db return newRoot, ErrStateTreeNil } + uuid := uuid.New().String() + for _, action := range genesis.GenesisActions { address := common.HexToAddress(action.Address) switch action.Type { @@ -58,7 +61,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db if err != nil { return newRoot, err } - newRoot, _, err = s.tree.SetBalance(ctx, address, balance, newRoot) + newRoot, _, err = s.tree.SetBalance(ctx, address, balance, newRoot, uuid) if err != nil { return newRoot, err } @@ -67,7 +70,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db if err != nil { return newRoot, err } - newRoot, _, err = s.tree.SetNonce(ctx, address, nonce, newRoot) + newRoot, _, err = s.tree.SetNonce(ctx, address, nonce, newRoot, uuid) if err != nil { return newRoot, err } @@ -76,7 +79,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db if err != nil { return newRoot, fmt.Errorf("could not decode SC bytecode for address %q: %v", address, err) } - newRoot, _, err = s.tree.SetCode(ctx, address, code, newRoot) + newRoot, _, err = s.tree.SetCode(ctx, address, code, newRoot, uuid) if err != nil { return newRoot, err } @@ -91,7 +94,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db return newRoot, err } // Store - newRoot, _, err = s.tree.SetStorageAt(ctx, address, positionBI, valueBI, newRoot) + newRoot, _, err = s.tree.SetStorageAt(ctx, address, positionBI, valueBI, newRoot, uuid) if err != nil { return newRoot, err } @@ -105,7 +108,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db root.SetBytes(newRoot) // flush state db - err = s.tree.Flush(ctx) + err = s.tree.Flush(ctx, uuid) if err != nil { log.Errorf("error flushing state tree after genesis: %v", err) return newRoot, err diff --git a/state/state.go b/state/state.go index caeb538759..487c19f726 100644 --- a/state/state.go +++ b/state/state.go @@ -139,7 +139,7 @@ func (s *State) FlushMerkleTree(ctx context.Context) error { if s.tree == nil { return ErrStateTreeNil } - return s.tree.Flush(ctx) + return s.tree.Flush(ctx, "") } // GetStoredFlushID returns the stored flush ID and Prover ID diff --git a/state/state_test.go b/state/state_test.go index d02ed66227..d72c82e89d 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -21,7 +21,7 @@ import ( "github.com/0xPolygonHermez/zkevm-node/hex" "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/merkletree" - mtDBclientpb "github.com/0xPolygonHermez/zkevm-node/merkletree/pb" + "github.com/0xPolygonHermez/zkevm-node/merkletree/hashdb" state "github.com/0xPolygonHermez/zkevm-node/state" "github.com/0xPolygonHermez/zkevm-node/state/metrics" "github.com/0xPolygonHermez/zkevm-node/state/runtime" @@ -67,7 +67,7 @@ var ( } forkID uint64 = 5 executorClient executor.ExecutorServiceClient - mtDBServiceClient mtDBclientpb.HashDBServiceClient + mtDBServiceClient hashdb.HashDBServiceClient executorClientConn, mtDBClientConn *grpc.ClientConn batchResources = state.BatchResources{ ZKCounters: state.ZKCounters{ @@ -726,7 +726,7 @@ func TestGenesis(t *testing.T) { } } - err = testState.GetTree().Flush(ctx) + err = testState.GetTree().Flush(ctx, "") require.NoError(t, err) } diff --git a/synchronizer/mock_state.go b/synchronizer/mock_state.go index a65375c1d8..052f4f848e 100644 --- a/synchronizer/mock_state.go +++ b/synchronizer/mock_state.go @@ -711,12 +711,13 @@ func (_m *stateMock) UpdateForkIDIntervals(intervals []state.ForkIDInterval) { _m.Called(intervals) } -// newStateMock creates a new instance of stateMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func newStateMock(t interface { +type mockConstructorTestingTnewStateMock interface { mock.TestingT Cleanup(func()) -}) *stateMock { +} + +// newStateMock creates a new instance of stateMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func newStateMock(t mockConstructorTestingTnewStateMock) *stateMock { mock := &stateMock{} mock.Mock.Test(t) diff --git a/test/config/test.permissionless.prover.config.json b/test/config/test.permissionless.prover.config.json index 0f879c9c17..52f7bc3744 100644 --- a/test/config/test.permissionless.prover.config.json +++ b/test/config/test.permissionless.prover.config.json @@ -81,9 +81,8 @@ "maxExecutorThreads": 20, "maxProverThreads": 8, "maxHashDBThreads": 8, - "ECRecoverPrecalc": true, "ECRecoverPrecalcNThreads": 16, - "dbMultiWriteSinglePosition": false + "stateManager": true } diff --git a/test/config/test.prover.config.json b/test/config/test.prover.config.json index 86f511f0c2..d1e0bc5da2 100644 --- a/test/config/test.prover.config.json +++ b/test/config/test.prover.config.json @@ -83,9 +83,8 @@ "maxExecutorThreads": 20, "maxProverThreads": 8, "maxHashDBThreads": 8, - "ECRecoverPrecalc": true, "ECRecoverPrecalcNThreads": 16, - "dbMultiWriteSinglePosition": false + "stateManager": true } diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 6c50ab1853..ef4c453a45 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -338,7 +338,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:v2.0.1 + image: hermeznetwork/zkevm-prover:v2.1.0-RC2 ports: # - 50051:50051 # Prover - 50052:50052 # Mock prover @@ -414,7 +414,7 @@ services: zkevm-permissionless-prover: container_name: zkevm-permissionless-prover - image: hermeznetwork/zkevm-prover:v2.0.1 + image: hermeznetwork/zkevm-prover:v2.1.0-RC2 ports: # - 50058:50058 # Prover - 50059:50052 # Mock prover diff --git a/test/scripts/send_transfers/main.go b/test/scripts/send_transfers/main.go index 136252b275..4a56b48c3f 100644 --- a/test/scripts/send_transfers/main.go +++ b/test/scripts/send_transfers/main.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "math/big" + "time" "github.com/0xPolygonHermez/zkevm-node/hex" "github.com/0xPolygonHermez/zkevm-node/log" @@ -22,8 +23,9 @@ func main() { ChainID uint64 PrivateKey string }{ - //{Name: "Local L1", URL: operations.DefaultL1NetworkURL, ChainID: operations.DefaultL1ChainID, PrivateKey: operations.DefaultSequencerPrivateKey}, - {Name: "Local L2", URL: operations.DefaultL2NetworkURL, ChainID: operations.DefaultL2ChainID, PrivateKey: operations.DefaultSequencerPrivateKey}, + // {Name: "Local L1", URL: operations.DefaultL1NetworkURL, ChainID: operations.DefaultL1ChainID, PrivateKey: operations.DefaultSequencerPrivateKey}, + // {Name: "Local L2", URL: "http://34.90.16.102:8545/", ChainID: 1234, PrivateKey: operations.DefaultSequencerPrivateKey}, + {Name: "Local L2", URL: "https://rpc.public.zkevm-test.net/", ChainID: 1442, PrivateKey: "5d120f76469fb621f9b74587096f9bb292a27ebe346a2c84071010030356c20c"}, } for _, network := range networks { @@ -37,7 +39,7 @@ func main() { auth := operations.MustGetAuth(network.PrivateKey, network.ChainID) chkErr(err) - const receiverAddr = "0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D" + const receiverAddr = "0xdc6Bf73BC0A688bC11D5234Cb0F2719672Babd30" balance, err := client.BalanceAt(ctx, auth.From, nil) chkErr(err) @@ -53,13 +55,14 @@ func main() { nonce, err := client.NonceAt(ctx, auth.From, nil) chkErr(err) // var lastTxHash common.Hash - for i := 0; i < 1000; i++ { + for i := 0; i < 100000; i++ { nonce := nonce + uint64(i) log.Debugf("Sending TX to transfer ETH") to := common.HexToAddress(receiverAddr) tx := ethTransfer(ctx, client, auth, to, transferAmount, &nonce) fmt.Println("tx sent: ", tx.Hash().String()) // lastTxHash = tx.Hash() + time.Sleep(500 * time.Millisecond) } // err = operations.WaitTxToBeMined(client, lastTxHash, txTimeout)