From c5b90be1920237257e38e1bd27194892ca8f0e82 Mon Sep 17 00:00:00 2001 From: Thiago Coimbra Lemos Date: Tue, 7 Mar 2023 13:04:13 -0300 Subject: [PATCH] JRPC - debug methods review (#1650) --- .github/workflows/test-e2e.yml | 4 +- aggregator/mocks/mock_dbtx.go | 2 +- aggregator/mocks/mock_etherman.go | 2 +- aggregator/mocks/mock_ethtxmanager.go | 2 +- aggregator/mocks/mock_profitabilitychecker.go | 2 +- aggregator/mocks/mock_prover.go | 2 +- aggregator/mocks/mock_state.go | 2 +- aggregator/pb/aggregator.pb.go | 56 +- aggregator/pb/aggregator_grpc.pb.go | 4 + ci/e2e-group5/debug_test.go | 1 + ci/e2e-group5/shared.go | 1 + docker-compose.yml | 5 +- docs/ci/groups.md | 2 +- etherman/mock_etherscan.go | 2 +- etherman/mock_ethgasstation.go | 2 +- ethtxmanager/mock_etherman_test.go | 2 +- ethtxmanager/mock_state_test.go | 2 +- gasprice/mock_etherman.go | 2 +- gasprice/mock_pool.go | 2 +- jsonrpc/endpoints_debug.go | 246 +++-- jsonrpc/endpoints_debug_test.go | 235 ----- jsonrpc/endpoints_eth.go | 5 + jsonrpc/endpoints_eth_test.go | 36 + jsonrpc/interfaces.go | 2 +- jsonrpc/mock_dbtx_test.go | 2 +- jsonrpc/mock_pool_test.go | 2 +- jsonrpc/mock_state_test.go | 16 +- jsonrpc/mock_storage_test.go | 2 +- .../src/proto/aggregator/v1/aggregator.proto | 1 - proto/src/proto/executor/v1/executor.proto | 26 +- sequencer/broadcast/mocks/mock_state.go | 2 +- sequencer/mock_db_manager.go | 2 +- sequencer/mock_dbtx.go | 2 +- sequencer/mock_pool.go | 2 +- sequencer/mock_state.go | 2 +- sequencer/mock_worker.go | 2 +- state/runtime/executor/pb/executor.pb.go | 949 ++++++++++-------- state/state.go | 58 +- state/types.go | 9 + synchronizer/mock_dbtx.go | 2 +- synchronizer/mock_etherman.go | 2 +- synchronizer/mock_ethtxmanager.go | 2 +- synchronizer/mock_pool.go | 2 +- synchronizer/mock_state.go | 2 +- test/Makefile | 27 +- test/config/test.node.config.toml | 4 - test/docker-compose.yml | 2 +- test/e2e/debug_test.go | 606 ++++++++++- test/operations/manager.go | 7 +- test/operations/wait.go | 4 +- 50 files changed, 1526 insertions(+), 832 deletions(-) create mode 120000 ci/e2e-group5/debug_test.go create mode 120000 ci/e2e-group5/shared.go delete mode 100644 jsonrpc/endpoints_debug_test.go diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index b6805a6f32..39942fba56 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -20,7 +20,7 @@ jobs: matrix: go-version: [ 1.18.x ] goarch: [ "amd64" ] - e2e-group: [ 1, 2, 3, 4 ] + e2e-group: [ 1, 2, 3, 4, 5 ] runs-on: ubuntu-latest steps: - name: Checkout code @@ -59,7 +59,7 @@ jobs: matrix: go-version: [ 1.18.x ] goarch: [ "amd64" ] - e2e-group: [ 1, 2, 3, 4 ] + e2e-group: [ 1, 2, 3, 4, 5 ] runs-on: ubuntu-latest steps: - name: Fork based /ok-to-test checkout diff --git a/aggregator/mocks/mock_dbtx.go b/aggregator/mocks/mock_dbtx.go index d484b8664f..a6b5615555 100644 --- a/aggregator/mocks/mock_dbtx.go +++ b/aggregator/mocks/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/mocks/mock_etherman.go b/aggregator/mocks/mock_etherman.go index 5e44e36ad7..4551ec41d8 100644 --- a/aggregator/mocks/mock_etherman.go +++ b/aggregator/mocks/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/mocks/mock_ethtxmanager.go b/aggregator/mocks/mock_ethtxmanager.go index 3389421ec3..9c156346ba 100644 --- a/aggregator/mocks/mock_ethtxmanager.go +++ b/aggregator/mocks/mock_ethtxmanager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/mocks/mock_profitabilitychecker.go b/aggregator/mocks/mock_profitabilitychecker.go index 924b6cc7a4..daa2cf920b 100644 --- a/aggregator/mocks/mock_profitabilitychecker.go +++ b/aggregator/mocks/mock_profitabilitychecker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/mocks/mock_prover.go b/aggregator/mocks/mock_prover.go index 6b54fc0949..1894fa4d42 100644 --- a/aggregator/mocks/mock_prover.go +++ b/aggregator/mocks/mock_prover.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/mocks/mock_state.go b/aggregator/mocks/mock_state.go index 9cebdce97a..65e22e61d7 100644 --- a/aggregator/mocks/mock_state.go +++ b/aggregator/mocks/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/aggregator/pb/aggregator.pb.go b/aggregator/pb/aggregator.pb.go index e4dd97af97..80a24a9fea 100644 --- a/aggregator/pb/aggregator.pb.go +++ b/aggregator/pb/aggregator.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.8 +// protoc v3.21.12 // source: aggregator.proto package pb @@ -20,11 +20,11 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// * +//* // @dev Result -// - OK: succesfully completed -// - ERROR: request is not correct, i.e. input data is wrong -// - INTERNAL_ERROR: internal server error when delivering the response +// - OK: succesfully completed +// - ERROR: request is not correct, i.e. input data is wrong +// - INTERNAL_ERROR: internal server error when delivering the response type Result int32 const ( @@ -247,7 +247,6 @@ 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 @@ -392,7 +391,6 @@ 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 @@ -530,7 +528,7 @@ func (*ProverMessage_CancelResponse) isProverMessage_Response() {} func (*ProverMessage_GetProofResponse) isProverMessage_Response() {} -// * +//* // @dev GetStatusRequest type GetStatusRequest struct { state protoimpl.MessageState @@ -570,7 +568,7 @@ func (*GetStatusRequest) Descriptor() ([]byte, []int) { return file_aggregator_proto_rawDescGZIP(), []int{3} } -// * +//* // @dev GenBatchProofRequest // @param {input} - input prover type GenBatchProofRequest struct { @@ -620,7 +618,7 @@ func (x *GenBatchProofRequest) GetInput() *InputProver { return nil } -// * +//* // @dev GenAggregatedProofRequest // @param {recursive_proof_1} - proof json of the first batch to aggregate // @param {recursive_proof_2} - proof json of the second batch to aggregate @@ -679,7 +677,7 @@ func (x *GenAggregatedProofRequest) GetRecursiveProof_2() string { return "" } -// * +//* // @dev GenFinalProofRequest // @param {recursive_proof} - proof json of the batch or aggregated proof to finalise // @param {aggregator_addr} - address of the aggregator @@ -738,7 +736,7 @@ func (x *GenFinalProofRequest) GetAggregatorAddr() string { return "" } -// * +//* // @dev CancelRequest // @param {id} - identifier of the proof request to cancel type CancelRequest struct { @@ -788,7 +786,7 @@ func (x *CancelRequest) GetId() string { return "" } -// * +//* // @dev Request GetProof // @param {id} - proof identifier of the proof request // @param {timeout} - time to wait until the service responds @@ -847,7 +845,7 @@ func (x *GetProofRequest) GetTimeout() uint64 { return 0 } -// * +//* // @dev Response GetStatus // @param {status} - server status // - BOOTING: being ready to compute proofs @@ -1017,7 +1015,7 @@ func (x *GetStatusResponse) GetForkId() uint64 { return 0 } -// * +//* // @dev GenBatchProofResponse // @param {id} - proof identifier, to be used in GetProofRequest() // @param {result} - request result @@ -1076,7 +1074,7 @@ func (x *GenBatchProofResponse) GetResult() Result { return Result_RESULT_UNSPECIFIED } -// * +//* // @dev GenAggregatedProofResponse // @param {id} - proof identifier, to be used in GetProofRequest() // @param {result} - request result @@ -1135,7 +1133,7 @@ func (x *GenAggregatedProofResponse) GetResult() Result { return Result_RESULT_UNSPECIFIED } -// * +//* // @dev Response GenFinalProof // @param {id} - proof identifier, to be used in GetProofRequest() // @param {result} - request result @@ -1194,7 +1192,7 @@ func (x *GenFinalProofResponse) GetResult() Result { return Result_RESULT_UNSPECIFIED } -// * +//* // @dev CancelResponse // @param {result} - request result type CancelResponse struct { @@ -1244,19 +1242,18 @@ func (x *CancelResponse) GetResult() Result { return Result_RESULT_UNSPECIFIED } -// * +//* // @dev GetProofResponse // @param {id} - proof identifier // @param {final_proof} - groth16 proof + public circuit inputs // @param {recursive_proof} - recursive proof json // @param {result} - proof result -// - COMPLETED_OK: proof has been computed successfully and it is valid -// - ERROR: request error -// - COMPLETED_ERROR: proof has been computed successfully and it is not valid -// - PENDING: proof is being computed -// - INTERNAL_ERROR: server error during proof computation -// - CANCEL: proof has been cancelled -// +// - COMPLETED_OK: proof has been computed successfully and it is valid +// - ERROR: request error +// - COMPLETED_ERROR: proof has been computed successfully and it is not valid +// - PENDING: proof is being computed +// - INTERNAL_ERROR: server error during proof computation +// - CANCEL: proof has been cancelled // @param {result_string} - extends result information type GetProofResponse struct { state protoimpl.MessageState @@ -1265,7 +1262,6 @@ 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"` @@ -1363,6 +1359,7 @@ func (*GetProofResponse_FinalProof) isGetProofResponse_Proof() {} func (*GetProofResponse_RecursiveProof) isGetProofResponse_Proof() {} +// // @dev FinalProof // @param {proof} - groth16 proof // @param {public} - public circuit inputs @@ -1421,6 +1418,7 @@ func (x *FinalProof) GetPublic() *PublicInputsExtended { return nil } +// // @dev PublicInputs // @param {old_state_root} // @param {old_acc_input_hash} @@ -1549,7 +1547,7 @@ func (x *PublicInputs) GetAggregatorAddr() string { return "" } -// * +//* // @dev InputProver // @param {public_inputs} - public inputs // @param {db} - database containing all key-values in smt matching the old state root @@ -1617,7 +1615,7 @@ func (x *InputProver) GetContractsBytecode() map[string]string { return nil } -// * +//* // @dev PublicInputsExtended // @param {public_inputs} - public inputs // @param {new_state_root} - final state root. Used as a sanity check. diff --git a/aggregator/pb/aggregator_grpc.pb.go b/aggregator/pb/aggregator_grpc.pb.go index 8589c83aa6..8d2b33815d 100644 --- a/aggregator/pb/aggregator_grpc.pb.go +++ b/aggregator/pb/aggregator_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.21.12 +// source: aggregator.proto package pb diff --git a/ci/e2e-group5/debug_test.go b/ci/e2e-group5/debug_test.go new file mode 120000 index 0000000000..59afb4b681 --- /dev/null +++ b/ci/e2e-group5/debug_test.go @@ -0,0 +1 @@ +../../test/e2e/debug_test.go \ No newline at end of file diff --git a/ci/e2e-group5/shared.go b/ci/e2e-group5/shared.go new file mode 120000 index 0000000000..2762ace935 --- /dev/null +++ b/ci/e2e-group5/shared.go @@ -0,0 +1 @@ +../../test/e2e/shared.go \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b184746c64..3f77a60fe3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -93,10 +93,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:798d9e0 - depends_on: - zkevm-state-db: - condition: service_healthy + image: hermeznetwork/zkevm-prover:1d31dc6 ports: - 50061:50061 # MT - 50071:50071 # Executor diff --git a/docs/ci/groups.md b/docs/ci/groups.md index 786769837a..b411805538 100644 --- a/docs/ci/groups.md +++ b/docs/ci/groups.md @@ -10,7 +10,7 @@ We have 3 different github actions workflows: * `test-e2e`, which uses a matrix strategy to run the e2e tests, currently using 3 groups. -The e2e CI groups are defined in the `./ci/e2e-group{1,3}` directories. In each +The e2e CI groups are defined in the `./ci/e2e-group{1,N}` directories. In each directory we have symlinks that point to the actual e2e test to be executed (these tests are defined under `./test/e2e`). The goal of these symlinks is keeping the same code organization we have now while being able to run the costly e2e tests diff --git a/etherman/mock_etherscan.go b/etherman/mock_etherscan.go index 496750917a..4ade68954a 100644 --- a/etherman/mock_etherscan.go +++ b/etherman/mock_etherscan.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package etherman diff --git a/etherman/mock_ethgasstation.go b/etherman/mock_ethgasstation.go index 27d437b918..ab968c2d2d 100644 --- a/etherman/mock_ethgasstation.go +++ b/etherman/mock_ethgasstation.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package etherman diff --git a/ethtxmanager/mock_etherman_test.go b/ethtxmanager/mock_etherman_test.go index 6cf88ecb03..b021bde967 100644 --- a/ethtxmanager/mock_etherman_test.go +++ b/ethtxmanager/mock_etherman_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package ethtxmanager diff --git a/ethtxmanager/mock_state_test.go b/ethtxmanager/mock_state_test.go index 25177a1080..48aaf907f3 100644 --- a/ethtxmanager/mock_state_test.go +++ b/ethtxmanager/mock_state_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package ethtxmanager diff --git a/gasprice/mock_etherman.go b/gasprice/mock_etherman.go index a441ace882..39bc0dbb32 100644 --- a/gasprice/mock_etherman.go +++ b/gasprice/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package gasprice diff --git a/gasprice/mock_pool.go b/gasprice/mock_pool.go index bb22298330..d38aa99d90 100644 --- a/gasprice/mock_pool.go +++ b/gasprice/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package gasprice diff --git a/jsonrpc/endpoints_debug.go b/jsonrpc/endpoints_debug.go index 44e8c9eef9..0feea79ec4 100644 --- a/jsonrpc/endpoints_debug.go +++ b/jsonrpc/endpoints_debug.go @@ -2,9 +2,15 @@ package jsonrpc import ( "context" + "encoding/hex" + "errors" + "fmt" "github.com/0xPolygonHermez/zkevm-node/log" + "github.com/0xPolygonHermez/zkevm-node/state" + "github.com/0xPolygonHermez/zkevm-node/state/runtime/instrumentation" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/jackc/pgx/v4" ) @@ -15,17 +21,14 @@ type DebugEndpoints struct { } type traceConfig struct { - Tracer *string `json:"tracer"` + DisableStorage bool `json:"disableStorage"` + DisableStack bool `json:"disableStack"` + EnableMemory bool `json:"enableMemory"` + EnableReturnData bool `json:"enableReturnData"` + Tracer *string `json:"tracer"` } -type traceTransactionResponse struct { - Gas uint64 `json:"gas"` - Failed bool `json:"failed"` - ReturnValue interface{} `json:"returnValue"` - StructLogs []StructLogRes `json:"structLogs"` -} - -// StructLogRes represents a log response. +// StructLogRes represents the debug trace information for each opcode type StructLogRes struct { Pc uint64 `json:"pc"` Op string `json:"op"` @@ -34,89 +37,188 @@ type StructLogRes struct { Depth int `json:"depth"` Error string `json:"error,omitempty"` Stack *[]argBig `json:"stack,omitempty"` - Memory *argBytes `json:"memory,omitempty"` + Memory *[]string `json:"memory,omitempty"` Storage *map[string]string `json:"storage,omitempty"` RefundCounter uint64 `json:"refund,omitempty"` } +type traceTransactionResponse struct { + Gas uint64 `json:"gas"` + Failed bool `json:"failed"` + ReturnValue interface{} `json:"returnValue"` + StructLogs []StructLogRes `json:"structLogs"` +} + +type traceBlockTransactionResponse struct { + Result traceTransactionResponse `json:"result"` +} + // TraceTransaction creates a response for debug_traceTransaction request. -// See https://geth.ethereum.org/docs/rpc/ns-debug#debug_tracetransaction +// See https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtracetransaction func (d *DebugEndpoints) TraceTransaction(hash common.Hash, cfg *traceConfig) (interface{}, rpcError) { return d.txMan.NewDbTxScope(d.state, func(ctx context.Context, dbTx pgx.Tx) (interface{}, rpcError) { - tracer := "" - if cfg != nil && cfg.Tracer != nil { - tracer = *cfg.Tracer + return d.buildTraceTransaction(ctx, hash, cfg, dbTx) + }) +} + +// TraceBlockByNumber creates a response for debug_traceBlockByNumber request. +// See https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtraceblockbynumber +func (d *DebugEndpoints) TraceBlockByNumber(number BlockNumber, cfg *traceConfig) (interface{}, rpcError) { + return d.txMan.NewDbTxScope(d.state, func(ctx context.Context, dbTx pgx.Tx) (interface{}, rpcError) { + blockNumber, rpcErr := number.getNumericBlockNumber(ctx, d.state, dbTx) + if rpcErr != nil { + return nil, rpcErr } - result, err := d.state.DebugTransaction(ctx, hash, tracer, dbTx) + block, err := d.state.GetL2BlockByNumber(ctx, blockNumber, dbTx) + if errors.Is(err, state.ErrNotFound) { + return nil, newRPCError(defaultErrorCode, "genesis is not traceable") + } else if err == state.ErrNotFound { + return rpcErrorResponse(defaultErrorCode, "failed to get block by number", err) + } + + traces, rpcErr := d.buildTraceBlock(ctx, block.Transactions(), cfg, dbTx) if err != nil { - const errorMessage = "failed to debug trace the transaction" - log.Infof("%v: %v", errorMessage, err) - return nil, newRPCError(defaultErrorCode, errorMessage) + return nil, rpcErr } - if tracer != "" && len(result.ExecutorTraceResult) > 0 { - return result.ExecutorTraceResult, nil + return traces, nil + }) +} + +// TraceBlockByHash creates a response for debug_traceBlockByHash request. +// See https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-debug#debugtraceblockbyhash +func (d *DebugEndpoints) TraceBlockByHash(hash common.Hash, cfg *traceConfig) (interface{}, rpcError) { + return d.txMan.NewDbTxScope(d.state, func(ctx context.Context, dbTx pgx.Tx) (interface{}, rpcError) { + block, err := d.state.GetL2BlockByHash(ctx, hash, dbTx) + if errors.Is(err, state.ErrNotFound) { + return nil, newRPCError(defaultErrorCode, "genesis is not traceable") + } else if err == state.ErrNotFound { + return rpcErrorResponse(defaultErrorCode, "failed to get block by hash", err) } - failed := result.Failed() - structLogs := make([]StructLogRes, 0, len(result.StructLogs)) - for _, structLog := range result.StructLogs { - var stackRes *[]argBig - if len(structLog.Stack) > 0 { - stack := make([]argBig, 0, len(structLog.Stack)) - for _, stackItem := range structLog.Stack { - if stackItem != nil { - stack = append(stack, argBig(*stackItem)) - } - } - stackRes = &stack - } + traces, rpcErr := d.buildTraceBlock(ctx, block.Transactions(), cfg, dbTx) + if err != nil { + return nil, rpcErr + } - var memoryRes *argBytes - if len(structLog.Memory) > 0 { - memory := make(argBytes, 0, len(structLog.Memory)) - for _, memoryItem := range structLog.Memory { - memory = append(memory, memoryItem) - } - memoryRes = &memory - } + return traces, nil + }) +} - var storageRes *map[string]string - if len(structLog.Storage) > 0 { - storage := make(map[string]string, len(structLog.Storage)) - for storageKey, storageValue := range structLog.Storage { - storage[storageKey.Hex()] = storageValue.Hex() - } - storageRes = &storage - } +func (d *DebugEndpoints) buildTraceBlock(ctx context.Context, txs []*types.Transaction, cfg *traceConfig, dbTx pgx.Tx) (interface{}, rpcError) { + traces := []traceBlockTransactionResponse{} + for _, tx := range txs { + traceTransaction, err := d.buildTraceTransaction(ctx, tx.Hash(), cfg, dbTx) + if err != nil { + errMsg := fmt.Sprintf("failed to get trace for transaction %v", tx.Hash().String()) + return rpcErrorResponse(defaultErrorCode, errMsg, err) + } + traceBlockTransaction := traceBlockTransactionResponse{ + Result: traceTransaction.(traceTransactionResponse), + } + traces = append(traces, traceBlockTransaction) + } - errRes := "" - if structLog.Err != nil { - errRes = structLog.Err.Error() - } + return traces, nil +} - structLogs = append(structLogs, StructLogRes{ - Pc: structLog.Pc, - Op: structLog.Op, - Gas: structLog.Gas, - GasCost: structLog.GasCost, - Depth: structLog.Depth, - Error: errRes, - Stack: stackRes, - Memory: memoryRes, - Storage: storageRes, - RefundCounter: structLog.RefundCounter, - }) +func (d *DebugEndpoints) buildTraceTransaction(ctx context.Context, hash common.Hash, cfg *traceConfig, dbTx pgx.Tx) (interface{}, rpcError) { + traceConfig := state.TraceConfig{} + + if cfg != nil { + traceConfig.DisableStack = cfg.DisableStack + traceConfig.DisableStorage = cfg.DisableStorage + traceConfig.EnableMemory = cfg.EnableMemory + traceConfig.EnableReturnData = cfg.EnableReturnData + traceConfig.Tracer = cfg.Tracer + } + + result, err := d.state.DebugTransaction(ctx, hash, traceConfig, dbTx) + if err != nil { + const errorMessage = "failed to get trace" + log.Infof("%v: %v", errorMessage, err) + return nil, newRPCError(defaultErrorCode, errorMessage) + } + + if traceConfig.Tracer != nil && *traceConfig.Tracer != "" && len(result.ExecutorTraceResult) > 0 { + return result.ExecutorTraceResult, nil + } + + failed := result.Failed() + var returnValue interface{} + if traceConfig.EnableReturnData { + returnValue = common.Bytes2Hex(result.ReturnValue) + } + + structLogs := d.buildStructLogs(result.StructLogs, cfg) + + resp := traceTransactionResponse{ + Gas: result.GasUsed, + Failed: failed, + ReturnValue: returnValue, + StructLogs: structLogs, + } + + return resp, nil +} + +func (d *DebugEndpoints) buildStructLogs(stateStructLogs []instrumentation.StructLog, cfg *traceConfig) []StructLogRes { + structLogs := make([]StructLogRes, 0, len(stateStructLogs)) + for _, structLog := range stateStructLogs { + errRes := "" + if structLog.Err != nil { + errRes = structLog.Err.Error() } - resp := traceTransactionResponse{ - Gas: result.GasUsed, - Failed: failed, - ReturnValue: common.Bytes2Hex(result.ReturnValue), - StructLogs: structLogs, + op := structLog.Op + if op == "SHA3" { + op = "KECCAK256" } - return resp, nil - }) + structLogRes := StructLogRes{ + Pc: structLog.Pc, + Op: op, + Gas: structLog.Gas, + GasCost: structLog.GasCost, + Depth: structLog.Depth, + Error: errRes, + RefundCounter: structLog.RefundCounter, + } + + stack := make([]argBig, 0, len(structLog.Stack)) + if !cfg.DisableStack && len(structLog.Stack) > 0 { + for _, stackItem := range structLog.Stack { + if stackItem != nil { + stack = append(stack, argBig(*stackItem)) + } + } + } + structLogRes.Stack = &stack + + const memoryChunkSize = 32 + memory := make([]string, 0, len(structLog.Memory)) + if cfg.EnableMemory { + for i := 0; i < len(structLog.Memory); i = i + memoryChunkSize { + slice32Bytes := make([]byte, memoryChunkSize) + copy(slice32Bytes, structLog.Memory[i:i+memoryChunkSize]) + memoryStringItem := hex.EncodeToString(slice32Bytes) + memory = append(memory, memoryStringItem) + } + } + structLogRes.Memory = &memory + + if !cfg.DisableStorage && len(structLog.Storage) > 0 { + storage := make(map[string]string, len(structLog.Storage)) + for storageKey, storageValue := range structLog.Storage { + k := hex.EncodeToString(storageKey.Bytes()) + v := hex.EncodeToString(storageValue.Bytes()) + storage[k] = v + } + structLogRes.Storage = &storage + } + + structLogs = append(structLogs, structLogRes) + } + return structLogs } diff --git a/jsonrpc/endpoints_debug_test.go b/jsonrpc/endpoints_debug_test.go deleted file mode 100644 index 8acf60be1f..0000000000 --- a/jsonrpc/endpoints_debug_test.go +++ /dev/null @@ -1,235 +0,0 @@ -package jsonrpc_test - -// Test to be run with full node working and synchronized -// to compare result of debug_traceTransaction between geth and zkevm-node - -/* -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "math/big" - "net/http" - "os" - "strings" - "testing" - "time" - - "github.com/0xPolygonHermez/zkevm-node/db" - "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/state" - "github.com/0xPolygonHermez/zkevm-node/state/runtime/executor" - executorclientpb "github.com/0xPolygonHermez/zkevm-node/state/runtime/executor/pb" - "github.com/0xPolygonHermez/zkevm-node/state/runtime/instrumentation" - "github.com/0xPolygonHermez/zkevm-node/test/dbutils" - "github.com/0xPolygonHermez/zkevm-node/test/operations" - "github.com/0xPolygonHermez/zkevm-node/test/testutils" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/jackc/pgx/v4/pgxpool" - "github.com/stretchr/testify/require" - "google.golang.org/grpc" -) - -const ( - l1URL = "http://localhost:8545" - l2URL = "http://localhost:8123" - txTimeout = 60 * time.Second * 2 -) - -var ( - testState *state.State - stateTree *merkletree.StateTree - stateDb *pgxpool.Pool - err error - stateDBCfg = dbutils.NewStateConfigFromEnv() - ctx = context.Background() - stateCfg = state.Config{ - MaxCumulativeGasUsed: 800000, - } - executorClient executorclientpb.ExecutorServiceClient - mtDBServiceClient mtDBclientpb.StateDBServiceClient - executorClientConn, mtDBClientConn *grpc.ClientConn -) - -func TestMain(m *testing.M) { - // initOrResetDB() - - stateDb, err = db.NewSQLDB(stateDBCfg) - if err != nil { - panic(err) - } - defer stateDb.Close() - - zkProverURI := testutils.GetEnv("ZKPROVER_URI", "localhost") - - executorServerConfig := executor.Config{URI: fmt.Sprintf("%s:50071", zkProverURI)} - var executorCancel context.CancelFunc - executorClient, executorClientConn, executorCancel = executor.NewExecutorClient(ctx, executorServerConfig) - s := executorClientConn.GetState() - log.Infof("executorClientConn state: %s", s.String()) - defer func() { - executorCancel() - executorClientConn.Close() - }() - - mtDBServerConfig := merkletree.Config{URI: fmt.Sprintf("%s:50061", zkProverURI)} - var mtDBCancel context.CancelFunc - mtDBServiceClient, mtDBClientConn, mtDBCancel = merkletree.NewMTDBServiceClient(ctx, mtDBServerConfig) - s = mtDBClientConn.GetState() - log.Infof("stateDbClientConn state: %s", s.String()) - defer func() { - mtDBCancel() - mtDBClientConn.Close() - }() - - stateTree = merkletree.NewStateTree(mtDBServiceClient) - testState = state.NewState(stateCfg, state.NewPostgresStorage(stateDb), executorClient, stateTree) - - result := m.Run() - os.Exit(result) -} - -func initOrResetDB() { - if err := dbutils.InitOrResetState(stateDBCfg); err != nil { - panic(err) - } -} - -func TestTraceTransaction(t *testing.T) { - var senderAddress = common.HexToAddress("0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266") - var senderPvtKey = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" - - l1Client, err := ethclient.Dial(l1URL) - require.NoError(t, err) - l1ChainID, err := l1Client.ChainID(ctx) - require.NoError(t, err) - log.Debugf("L1 ChainID = %v", l1ChainID) - - l2Client, err := ethclient.Dial(l2URL) - require.NoError(t, err) - l2ChainID, err := l2Client.ChainID(ctx) - require.NoError(t, err) - log.Debugf("L2 ChainID = %v", l2ChainID) - - nonceL1, err := l1Client.PendingNonceAt(ctx, senderAddress) - require.NoError(t, err) - log.Debugf("L1 nonce = %v", nonceL1) - - nonceL2, err := l2Client.PendingNonceAt(ctx, senderAddress) - require.NoError(t, err) - log.Debugf("L2 nonce = %v", nonceL2) - - privateKey, err := crypto.HexToECDSA(strings.TrimPrefix(senderPvtKey, "0x")) - require.NoError(t, err) - authL1, err := bind.NewKeyedTransactorWithChainID(privateKey, l1ChainID) - require.NoError(t, err) - authL2, err := bind.NewKeyedTransactorWithChainID(privateKey, l2ChainID) - require.NoError(t, err) - - // L2 - balance, err := l2Client.BalanceAt(context.Background(), senderAddress, nil) - require.NoError(t, err) - require.NotEqual(t, "0", balance.String()) - - // Deploy SC - scRevertByteCode, err := testutils.ReadBytecode("Revert2/Revert2.bin") - require.NoError(t, err) - - gasPrice, err := l1Client.SuggestGasPrice(ctx) - require.NoError(t, err) - - // Deploy revert.sol - txL1 := types.NewTx(&types.LegacyTx{ - Nonce: nonceL1, - To: nil, - Value: new(big.Int), - Gas: uint64(4000000), - GasPrice: gasPrice, - Data: common.Hex2Bytes(scRevertByteCode), - }) - - signedTxL1, err := authL1.Signer(authL1.From, txL1) - require.NoError(t, err) - - err = l1Client.SendTransaction(ctx, signedTxL1) - require.NoError(t, err) - - log.Debugf("txHash L1 = %v", signedTxL1.Hash()) - - // Wait fot the transaction to be mined - err = operations.WaitTxToBeMined(ctx, l1Client, signedTxL1, txTimeout) - require.NoError(t, err) - - gasPrice, err = l2Client.SuggestGasPrice(ctx) - require.NoError(t, err) - - // Deploy revert.sol - txL2 := types.NewTx(&types.LegacyTx{ - Nonce: nonceL2, - To: nil, - Value: new(big.Int), - Gas: uint64(4000000), - GasPrice: gasPrice, - Data: common.Hex2Bytes(scRevertByteCode), - }) - - signedTxL2, err := authL2.Signer(authL2.From, txL2) - require.NoError(t, err) - - err = l2Client.SendTransaction(ctx, signedTxL2) - require.NoError(t, err) - - log.Debugf("txHash L2 = %v", signedTxL2.Hash()) - - // Wait fot the transaction to be mined - err = operations.WaitTxToBeMined(ctx, l2Client, signedTxL2, txTimeout) - require.NoError(t, err) - - // Debug Transaction - _, err = debugTransaction(t, l1URL, signedTxL1.Hash().String()) - require.NoError(t, err) - - _, err = debugTransaction(t, l2URL, signedTxL2.Hash().String()) - require.NoError(t, err) - -} - -func debugTransaction(t *testing.T, nodeURL string, hash string) (string, error) { - var tracer instrumentation.Tracer - - client := http.Client{ - Timeout: 60 * time.Second, - } - - tracerFile, err := os.Open("../test/tracers/tracer.json") - require.NoError(t, err) - defer tracerFile.Close() - - byteCode, err := ioutil.ReadAll(tracerFile) - require.NoError(t, err) - - err = json.Unmarshal(byteCode, &tracer) - require.NoError(t, err) - - json := `{"jsonrpc": "2.0", "id": 1, "method": "debug_traceTransaction", "params": ["` + hash + `", {"tracer":"` + tracer.Code + `", "disableStack": false, "disableMemory": false, "disableStorage": false}]}` - - // log.Debugf("Request with:", json) - jsonByte := []byte(json) - req, err := http.NewRequest("POST", nodeURL, bytes.NewBuffer(jsonByte)) - require.NoError(t, err) - req.Header.Set("Content-Type", "application/json") - resp, err := client.Do(req) - require.NoError(t, err) - body, err := ioutil.ReadAll(resp.Body) - log.Debugf("Response info: " + resp.Status + " " + string(body)) - return string(body), err -} -*/ diff --git a/jsonrpc/endpoints_eth.go b/jsonrpc/endpoints_eth.go index d19c5b3ff2..cbaf6ed657 100644 --- a/jsonrpc/endpoints_eth.go +++ b/jsonrpc/endpoints_eth.go @@ -668,6 +668,11 @@ func (e *EthEndpoints) UninstallFilter(filterID string) (interface{}, rpcError) // https://eth.wiki/json-rpc/API#eth_syncing func (e *EthEndpoints) Syncing() (interface{}, rpcError) { return e.txMan.NewDbTxScope(e.state, func(ctx context.Context, dbTx pgx.Tx) (interface{}, rpcError) { + _, err := e.state.GetLastL2BlockNumber(ctx, dbTx) + if err != nil { + return rpcErrorResponse(defaultErrorCode, "failed to get last block number from state", err) + } + syncInfo, err := e.state.GetSyncingInfo(ctx, dbTx) if err != nil { return rpcErrorResponse(defaultErrorCode, "failed to get syncing info from state", err) diff --git a/jsonrpc/endpoints_eth_test.go b/jsonrpc/endpoints_eth_test.go index bb6812ba06..0fedf61454 100644 --- a/jsonrpc/endpoints_eth_test.go +++ b/jsonrpc/endpoints_eth_test.go @@ -1342,6 +1342,27 @@ func TestSyncing(t *testing.T) { } testCases := []testCase{ + { + Name: "failed to get last l2 block number", + ExpectedResult: nil, + ExpectedError: newRPCError(defaultErrorCode, "failed to get last block number from state"), + SetupMocks: func(m *mocks, tc testCase) { + m.DbTx. + On("Rollback", context.Background()). + Return(nil). + Once() + + m.State. + On("BeginStateTransaction", context.Background()). + Return(m.DbTx, nil). + Once() + + m.State. + On("GetLastL2BlockNumber", context.Background(), m.DbTx). + Return(uint64(0), errors.New("failed to get last l2 block number from state")). + Once() + }, + }, { Name: "failed to get syncing information", ExpectedResult: nil, @@ -1357,6 +1378,11 @@ func TestSyncing(t *testing.T) { Return(m.DbTx, nil). Once() + m.State. + On("GetLastL2BlockNumber", context.Background(), m.DbTx). + Return(uint64(10), nil). + Once() + m.State. On("GetSyncingInfo", context.Background(), m.DbTx). Return(state.SyncingInfo{}, errors.New("failed to get syncing info from state")). @@ -1378,6 +1404,11 @@ func TestSyncing(t *testing.T) { Return(m.DbTx, nil). Once() + m.State. + On("GetLastL2BlockNumber", context.Background(), m.DbTx). + Return(uint64(10), nil). + Once() + m.State. On("GetSyncingInfo", context.Background(), m.DbTx). Return(state.SyncingInfo{InitialSyncingBlock: 1, CurrentBlockNumber: 2, LastBlockNumberSeen: 3, LastBlockNumberConsolidated: 3}, nil). @@ -1399,6 +1430,11 @@ func TestSyncing(t *testing.T) { Return(m.DbTx, nil). Once() + m.State. + On("GetLastL2BlockNumber", context.Background(), m.DbTx). + Return(uint64(10), nil). + Once() + m.State. On("GetSyncingInfo", context.Background(), m.DbTx). Return(state.SyncingInfo{InitialSyncingBlock: 1, CurrentBlockNumber: 1, LastBlockNumberSeen: 1, LastBlockNumberConsolidated: 1}, nil). diff --git a/jsonrpc/interfaces.go b/jsonrpc/interfaces.go index 23ea190026..a1534922c0 100644 --- a/jsonrpc/interfaces.go +++ b/jsonrpc/interfaces.go @@ -29,7 +29,7 @@ type jsonRPCTxPool interface { type stateInterface interface { PrepareWebSocket() BeginStateTransaction(ctx context.Context) (pgx.Tx, error) - DebugTransaction(ctx context.Context, transactionHash common.Hash, tracer string, dbTx pgx.Tx) (*runtime.ExecutionResult, error) + DebugTransaction(ctx context.Context, transactionHash common.Hash, traceConfig state.TraceConfig, dbTx pgx.Tx) (*runtime.ExecutionResult, error) EstimateGas(transaction *types.Transaction, senderAddress common.Address, l2BlockNumber *uint64, dbTx pgx.Tx) (uint64, error) GetBalance(ctx context.Context, address common.Address, blockNumber uint64, dbTx pgx.Tx) (*big.Int, error) GetCode(ctx context.Context, address common.Address, blockNumber uint64, dbTx pgx.Tx) ([]byte, error) diff --git a/jsonrpc/mock_dbtx_test.go b/jsonrpc/mock_dbtx_test.go index 1715f99fac..01a73ae3ba 100644 --- a/jsonrpc/mock_dbtx_test.go +++ b/jsonrpc/mock_dbtx_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package jsonrpc diff --git a/jsonrpc/mock_pool_test.go b/jsonrpc/mock_pool_test.go index 845d7df52a..9749495e98 100644 --- a/jsonrpc/mock_pool_test.go +++ b/jsonrpc/mock_pool_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package jsonrpc diff --git a/jsonrpc/mock_state_test.go b/jsonrpc/mock_state_test.go index 2a3524d241..4f0a186246 100644 --- a/jsonrpc/mock_state_test.go +++ b/jsonrpc/mock_state_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package jsonrpc @@ -70,13 +70,13 @@ func (_m *stateMock) BeginStateTransaction(ctx context.Context) (pgx.Tx, error) return r0, r1 } -// DebugTransaction provides a mock function with given fields: ctx, transactionHash, tracer, dbTx -func (_m *stateMock) DebugTransaction(ctx context.Context, transactionHash common.Hash, tracer string, dbTx pgx.Tx) (*runtime.ExecutionResult, error) { - ret := _m.Called(ctx, transactionHash, tracer, dbTx) +// DebugTransaction provides a mock function with given fields: ctx, transactionHash, traceConfig, dbTx +func (_m *stateMock) DebugTransaction(ctx context.Context, transactionHash common.Hash, traceConfig state.TraceConfig, dbTx pgx.Tx) (*runtime.ExecutionResult, error) { + ret := _m.Called(ctx, transactionHash, traceConfig, dbTx) var r0 *runtime.ExecutionResult - if rf, ok := ret.Get(0).(func(context.Context, common.Hash, string, pgx.Tx) *runtime.ExecutionResult); ok { - r0 = rf(ctx, transactionHash, tracer, dbTx) + if rf, ok := ret.Get(0).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) *runtime.ExecutionResult); ok { + r0 = rf(ctx, transactionHash, traceConfig, dbTx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*runtime.ExecutionResult) @@ -84,8 +84,8 @@ func (_m *stateMock) DebugTransaction(ctx context.Context, transactionHash commo } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, common.Hash, string, pgx.Tx) error); ok { - r1 = rf(ctx, transactionHash, tracer, dbTx) + if rf, ok := ret.Get(1).(func(context.Context, common.Hash, state.TraceConfig, pgx.Tx) error); ok { + r1 = rf(ctx, transactionHash, traceConfig, dbTx) } else { r1 = ret.Error(1) } diff --git a/jsonrpc/mock_storage_test.go b/jsonrpc/mock_storage_test.go index c93e944eb2..c40bd465e9 100644 --- a/jsonrpc/mock_storage_test.go +++ b/jsonrpc/mock_storage_test.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package jsonrpc diff --git a/proto/src/proto/aggregator/v1/aggregator.proto b/proto/src/proto/aggregator/v1/aggregator.proto index 3dabe489e9..66be538775 100644 --- a/proto/src/proto/aggregator/v1/aggregator.proto +++ b/proto/src/proto/aggregator/v1/aggregator.proto @@ -294,4 +294,3 @@ message PublicInputsExtended { bytes new_local_exit_root = 4; uint64 new_batch_num = 5; } - diff --git a/proto/src/proto/executor/v1/executor.proto b/proto/src/proto/executor/v1/executor.proto index 99f88f3fc0..afe1a31a00 100644 --- a/proto/src/proto/executor/v1/executor.proto +++ b/proto/src/proto/executor/v1/executor.proto @@ -20,15 +20,14 @@ message ProcessBatchRequest { uint64 eth_timestamp = 8; string coinbase = 9; uint32 update_merkle_tree = 10; - bytes tx_hash_to_generate_execute_trace = 11; - bytes tx_hash_to_generate_call_trace = 12; // flag to indicate that counters should not be taken into account - uint64 no_counters = 13; + uint64 no_counters = 11; // from is used for unsigned transactions with sender - string from = 14; + string from = 12; // For testing purposes only - map db = 15; - map contracts_bytecode = 16; // For debug/testing purpposes only. Don't fill this on production + map db = 13; + map contracts_bytecode = 14; // For debug/testing purpposes only. Don't fill this on production + TraceConfig trace_config = 15; } message ProcessBatchResponse { @@ -49,6 +48,21 @@ message ProcessBatchResponse { map read_write_addresses = 15; } +// Trace configuration request params +message TraceConfig { + // Disables storage (default=false) + uint32 disable_storage = 1; + // Disables stack (default=false) + uint32 disable_stack = 2; + // Enables memory (default=false) + uint32 enable_memory = 3; + // Enables return data (default=false) + uint32 enable_return_data = 4; + // Hash of tx in batch to retrieve the execution trace + bytes tx_hash_to_generate_execute_trace = 5; + // Hash of tx in batch to retrieve the call trace + bytes tx_hash_to_generate_call_trace = 6; +} message InfoReadWrite { // If nonce="" then it has not been set; if set, string is in decimal (base 10) string nonce = 1; diff --git a/sequencer/broadcast/mocks/mock_state.go b/sequencer/broadcast/mocks/mock_state.go index 96f6ae2b32..cc3d8b9a06 100644 --- a/sequencer/broadcast/mocks/mock_state.go +++ b/sequencer/broadcast/mocks/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package mocks diff --git a/sequencer/mock_db_manager.go b/sequencer/mock_db_manager.go index 3f486119bc..3b030cd796 100644 --- a/sequencer/mock_db_manager.go +++ b/sequencer/mock_db_manager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package sequencer diff --git a/sequencer/mock_dbtx.go b/sequencer/mock_dbtx.go index 9f4402d20c..41cfe68ae7 100644 --- a/sequencer/mock_dbtx.go +++ b/sequencer/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package sequencer diff --git a/sequencer/mock_pool.go b/sequencer/mock_pool.go index 54285166e0..115ce5ad62 100644 --- a/sequencer/mock_pool.go +++ b/sequencer/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package sequencer diff --git a/sequencer/mock_state.go b/sequencer/mock_state.go index e872bc3f05..8ebab06d79 100644 --- a/sequencer/mock_state.go +++ b/sequencer/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package sequencer diff --git a/sequencer/mock_worker.go b/sequencer/mock_worker.go index 00e97fc09a..400c238c12 100644 --- a/sequencer/mock_worker.go +++ b/sequencer/mock_worker.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package sequencer diff --git a/state/runtime/executor/pb/executor.pb.go b/state/runtime/executor/pb/executor.pb.go index 8311c17ca2..2d8c67848f 100644 --- a/state/runtime/executor/pb/executor.pb.go +++ b/state/runtime/executor/pb/executor.pb.go @@ -259,25 +259,24 @@ type ProcessBatchRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OldStateRoot []byte `protobuf:"bytes,1,opt,name=old_state_root,json=oldStateRoot,proto3" json:"old_state_root,omitempty"` - OldAccInputHash []byte `protobuf:"bytes,2,opt,name=old_acc_input_hash,json=oldAccInputHash,proto3" json:"old_acc_input_hash,omitempty"` - OldBatchNum uint64 `protobuf:"varint,3,opt,name=old_batch_num,json=oldBatchNum,proto3" json:"old_batch_num,omitempty"` - ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - ForkId uint64 `protobuf:"varint,5,opt,name=fork_id,json=forkId,proto3" json:"fork_id,omitempty"` - BatchL2Data []byte `protobuf:"bytes,6,opt,name=batch_l2_data,json=batchL2Data,proto3" json:"batch_l2_data,omitempty"` - GlobalExitRoot []byte `protobuf:"bytes,7,opt,name=global_exit_root,json=globalExitRoot,proto3" json:"global_exit_root,omitempty"` - EthTimestamp uint64 `protobuf:"varint,8,opt,name=eth_timestamp,json=ethTimestamp,proto3" json:"eth_timestamp,omitempty"` - Coinbase string `protobuf:"bytes,9,opt,name=coinbase,proto3" json:"coinbase,omitempty"` - UpdateMerkleTree uint32 `protobuf:"varint,10,opt,name=update_merkle_tree,json=updateMerkleTree,proto3" json:"update_merkle_tree,omitempty"` - TxHashToGenerateExecuteTrace []byte `protobuf:"bytes,11,opt,name=tx_hash_to_generate_execute_trace,json=txHashToGenerateExecuteTrace,proto3" json:"tx_hash_to_generate_execute_trace,omitempty"` - TxHashToGenerateCallTrace []byte `protobuf:"bytes,12,opt,name=tx_hash_to_generate_call_trace,json=txHashToGenerateCallTrace,proto3" json:"tx_hash_to_generate_call_trace,omitempty"` + OldStateRoot []byte `protobuf:"bytes,1,opt,name=old_state_root,json=oldStateRoot,proto3" json:"old_state_root,omitempty"` + OldAccInputHash []byte `protobuf:"bytes,2,opt,name=old_acc_input_hash,json=oldAccInputHash,proto3" json:"old_acc_input_hash,omitempty"` + OldBatchNum uint64 `protobuf:"varint,3,opt,name=old_batch_num,json=oldBatchNum,proto3" json:"old_batch_num,omitempty"` + ChainId uint64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` + ForkId uint64 `protobuf:"varint,5,opt,name=fork_id,json=forkId,proto3" json:"fork_id,omitempty"` + BatchL2Data []byte `protobuf:"bytes,6,opt,name=batch_l2_data,json=batchL2Data,proto3" json:"batch_l2_data,omitempty"` + GlobalExitRoot []byte `protobuf:"bytes,7,opt,name=global_exit_root,json=globalExitRoot,proto3" json:"global_exit_root,omitempty"` + EthTimestamp uint64 `protobuf:"varint,8,opt,name=eth_timestamp,json=ethTimestamp,proto3" json:"eth_timestamp,omitempty"` + Coinbase string `protobuf:"bytes,9,opt,name=coinbase,proto3" json:"coinbase,omitempty"` + UpdateMerkleTree uint32 `protobuf:"varint,10,opt,name=update_merkle_tree,json=updateMerkleTree,proto3" json:"update_merkle_tree,omitempty"` // flag to indicate that counters should not be taken into account - NoCounters uint64 `protobuf:"varint,13,opt,name=no_counters,json=noCounters,proto3" json:"no_counters,omitempty"` + NoCounters uint64 `protobuf:"varint,11,opt,name=no_counters,json=noCounters,proto3" json:"no_counters,omitempty"` // from is used for unsigned transactions with sender - From string `protobuf:"bytes,14,opt,name=from,proto3" json:"from,omitempty"` + From string `protobuf:"bytes,12,opt,name=from,proto3" json:"from,omitempty"` // For testing purposes only - Db map[string]string `protobuf:"bytes,15,rep,name=db,proto3" json:"db,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - ContractsBytecode map[string]string `protobuf:"bytes,16,rep,name=contracts_bytecode,json=contractsBytecode,proto3" json:"contracts_bytecode,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // For debug/testing purpposes only. Don't fill this on production + Db map[string]string `protobuf:"bytes,13,rep,name=db,proto3" json:"db,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ContractsBytecode map[string]string `protobuf:"bytes,14,rep,name=contracts_bytecode,json=contractsBytecode,proto3" json:"contracts_bytecode,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // For debug/testing purpposes only. Don't fill this on production + TraceConfig *TraceConfig `protobuf:"bytes,15,opt,name=trace_config,json=traceConfig,proto3" json:"trace_config,omitempty"` } func (x *ProcessBatchRequest) Reset() { @@ -382,20 +381,6 @@ func (x *ProcessBatchRequest) GetUpdateMerkleTree() uint32 { return 0 } -func (x *ProcessBatchRequest) GetTxHashToGenerateExecuteTrace() []byte { - if x != nil { - return x.TxHashToGenerateExecuteTrace - } - return nil -} - -func (x *ProcessBatchRequest) GetTxHashToGenerateCallTrace() []byte { - if x != nil { - return x.TxHashToGenerateCallTrace - } - return nil -} - func (x *ProcessBatchRequest) GetNoCounters() uint64 { if x != nil { return x.NoCounters @@ -424,6 +409,13 @@ func (x *ProcessBatchRequest) GetContractsBytecode() map[string]string { return nil } +func (x *ProcessBatchRequest) GetTraceConfig() *TraceConfig { + if x != nil { + return x.TraceConfig + } + return nil +} + type ProcessBatchResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -583,6 +575,100 @@ func (x *ProcessBatchResponse) GetReadWriteAddresses() map[string]*InfoReadWrite return nil } +// Trace configuration request params +type TraceConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Disables storage (default=false) + DisableStorage uint32 `protobuf:"varint,1,opt,name=disable_storage,json=disableStorage,proto3" json:"disable_storage,omitempty"` + // Disables stack (default=false) + DisableStack uint32 `protobuf:"varint,2,opt,name=disable_stack,json=disableStack,proto3" json:"disable_stack,omitempty"` + // Enables memory (default=false) + EnableMemory uint32 `protobuf:"varint,3,opt,name=enable_memory,json=enableMemory,proto3" json:"enable_memory,omitempty"` + // Enables return data (default=false) + EnableReturnData uint32 `protobuf:"varint,4,opt,name=enable_return_data,json=enableReturnData,proto3" json:"enable_return_data,omitempty"` + // Hash of tx in batch to retrieve the execution trace + TxHashToGenerateExecuteTrace []byte `protobuf:"bytes,5,opt,name=tx_hash_to_generate_execute_trace,json=txHashToGenerateExecuteTrace,proto3" json:"tx_hash_to_generate_execute_trace,omitempty"` + // Hash of tx in batch to retrieve the call trace + TxHashToGenerateCallTrace []byte `protobuf:"bytes,6,opt,name=tx_hash_to_generate_call_trace,json=txHashToGenerateCallTrace,proto3" json:"tx_hash_to_generate_call_trace,omitempty"` +} + +func (x *TraceConfig) Reset() { + *x = TraceConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_executor_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TraceConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TraceConfig) ProtoMessage() {} + +func (x *TraceConfig) ProtoReflect() protoreflect.Message { + mi := &file_executor_proto_msgTypes[2] + 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 TraceConfig.ProtoReflect.Descriptor instead. +func (*TraceConfig) Descriptor() ([]byte, []int) { + return file_executor_proto_rawDescGZIP(), []int{2} +} + +func (x *TraceConfig) GetDisableStorage() uint32 { + if x != nil { + return x.DisableStorage + } + return 0 +} + +func (x *TraceConfig) GetDisableStack() uint32 { + if x != nil { + return x.DisableStack + } + return 0 +} + +func (x *TraceConfig) GetEnableMemory() uint32 { + if x != nil { + return x.EnableMemory + } + return 0 +} + +func (x *TraceConfig) GetEnableReturnData() uint32 { + if x != nil { + return x.EnableReturnData + } + return 0 +} + +func (x *TraceConfig) GetTxHashToGenerateExecuteTrace() []byte { + if x != nil { + return x.TxHashToGenerateExecuteTrace + } + return nil +} + +func (x *TraceConfig) GetTxHashToGenerateCallTrace() []byte { + if x != nil { + return x.TxHashToGenerateCallTrace + } + return nil +} + type InfoReadWrite struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -597,7 +683,7 @@ type InfoReadWrite struct { func (x *InfoReadWrite) Reset() { *x = InfoReadWrite{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[2] + mi := &file_executor_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +696,7 @@ func (x *InfoReadWrite) String() string { func (*InfoReadWrite) ProtoMessage() {} func (x *InfoReadWrite) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[2] + mi := &file_executor_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +709,7 @@ func (x *InfoReadWrite) ProtoReflect() protoreflect.Message { // Deprecated: Use InfoReadWrite.ProtoReflect.Descriptor instead. func (*InfoReadWrite) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{2} + return file_executor_proto_rawDescGZIP(), []int{3} } func (x *InfoReadWrite) GetNonce() string { @@ -652,7 +738,7 @@ type CallTrace struct { func (x *CallTrace) Reset() { *x = CallTrace{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[3] + mi := &file_executor_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -665,7 +751,7 @@ func (x *CallTrace) String() string { func (*CallTrace) ProtoMessage() {} func (x *CallTrace) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[3] + mi := &file_executor_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -678,7 +764,7 @@ func (x *CallTrace) ProtoReflect() protoreflect.Message { // Deprecated: Use CallTrace.ProtoReflect.Descriptor instead. func (*CallTrace) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{3} + return file_executor_proto_rawDescGZIP(), []int{4} } func (x *CallTrace) GetContext() *TransactionContext { @@ -729,7 +815,7 @@ type TransactionContext struct { func (x *TransactionContext) Reset() { *x = TransactionContext{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[4] + mi := &file_executor_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -742,7 +828,7 @@ func (x *TransactionContext) String() string { func (*TransactionContext) ProtoMessage() {} func (x *TransactionContext) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[4] + mi := &file_executor_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -755,7 +841,7 @@ func (x *TransactionContext) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionContext.ProtoReflect.Descriptor instead. func (*TransactionContext) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{4} + return file_executor_proto_rawDescGZIP(), []int{5} } func (x *TransactionContext) GetType() string { @@ -875,7 +961,7 @@ type TransactionStep struct { func (x *TransactionStep) Reset() { *x = TransactionStep{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[5] + mi := &file_executor_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -888,7 +974,7 @@ func (x *TransactionStep) String() string { func (*TransactionStep) ProtoMessage() {} func (x *TransactionStep) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[5] + mi := &file_executor_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -901,7 +987,7 @@ func (x *TransactionStep) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionStep.ProtoReflect.Descriptor instead. func (*TransactionStep) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{5} + return file_executor_proto_rawDescGZIP(), []int{6} } func (x *TransactionStep) GetStateRoot() []byte { @@ -1003,7 +1089,7 @@ type Contract struct { func (x *Contract) Reset() { *x = Contract{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[6] + mi := &file_executor_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1016,7 +1102,7 @@ func (x *Contract) String() string { func (*Contract) ProtoMessage() {} func (x *Contract) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[6] + mi := &file_executor_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1029,7 +1115,7 @@ func (x *Contract) ProtoReflect() protoreflect.Message { // Deprecated: Use Contract.ProtoReflect.Descriptor instead. func (*Contract) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{6} + return file_executor_proto_rawDescGZIP(), []int{7} } func (x *Contract) GetAddress() string { @@ -1104,7 +1190,7 @@ type ProcessTransactionResponse struct { func (x *ProcessTransactionResponse) Reset() { *x = ProcessTransactionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[7] + mi := &file_executor_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1117,7 +1203,7 @@ func (x *ProcessTransactionResponse) String() string { func (*ProcessTransactionResponse) ProtoMessage() {} func (x *ProcessTransactionResponse) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[7] + mi := &file_executor_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1130,7 +1216,7 @@ func (x *ProcessTransactionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ProcessTransactionResponse.ProtoReflect.Descriptor instead. func (*ProcessTransactionResponse) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{7} + return file_executor_proto_rawDescGZIP(), []int{8} } func (x *ProcessTransactionResponse) GetTxHash() []byte { @@ -1250,7 +1336,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[8] + mi := &file_executor_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1263,7 +1349,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[8] + mi := &file_executor_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1276,7 +1362,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{8} + return file_executor_proto_rawDescGZIP(), []int{9} } func (x *Log) GetAddress() string { @@ -1369,7 +1455,7 @@ type ExecutionTraceStep struct { func (x *ExecutionTraceStep) Reset() { *x = ExecutionTraceStep{} if protoimpl.UnsafeEnabled { - mi := &file_executor_proto_msgTypes[9] + mi := &file_executor_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1382,7 +1468,7 @@ func (x *ExecutionTraceStep) String() string { func (*ExecutionTraceStep) ProtoMessage() {} func (x *ExecutionTraceStep) ProtoReflect() protoreflect.Message { - mi := &file_executor_proto_msgTypes[9] + mi := &file_executor_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1395,7 +1481,7 @@ func (x *ExecutionTraceStep) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionTraceStep.ProtoReflect.Descriptor instead. func (*ExecutionTraceStep) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{9} + return file_executor_proto_rawDescGZIP(), []int{10} } func (x *ExecutionTraceStep) GetPc() uint64 { @@ -1486,7 +1572,7 @@ var File_executor_proto protoreflect.FileDescriptor var file_executor_proto_rawDesc = []byte{ 0x0a, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x22, 0xdd, 0x06, + 0x12, 0x0b, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x22, 0x8e, 0x06, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x6f, @@ -1510,331 +1596,346 @@ var file_executor_proto_rawDesc = []byte{ 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x61, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x47, 0x0a, - 0x21, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, - 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x54, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x41, 0x0a, 0x1e, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, - 0x68, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x19, - 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x54, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x6f, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, - 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x38, - 0x0a, 0x02, 0x64, 0x62, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, - 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x44, 0x62, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x02, 0x64, 0x62, 0x12, 0x66, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x10, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, - 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, - 0x1a, 0x35, 0x0a, 0x07, 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, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x73, 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 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, 0xd4, 0x06, - 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, - 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x12, - 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x63, 0x63, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x41, 0x63, 0x63, - 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x13, 0x6e, 0x65, 0x77, - 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, 0x6c, - 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x65, 0x77, 0x5f, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x11, - 0x63, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6e, 0x74, 0x4b, 0x65, 0x63, 0x63, - 0x61, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6e, 0x74, 0x5f, - 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x63, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x65, 0x69, 0x64, - 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6e, 0x74, 0x5f, - 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x63, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x65, - 0x69, 0x64, 0x6f, 0x6e, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x24, 0x0a, 0x0e, - 0x63, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x6d, 0x5f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x73, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x41, 0x6c, 0x69, 0x67, - 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6e, 0x74, 0x5f, 0x61, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x65, 0x74, 0x69, 0x63, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x63, 0x6e, 0x74, - 0x41, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, - 0x6e, 0x74, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x0b, 0x63, 0x6e, 0x74, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1b, - 0x0a, 0x09, 0x63, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x63, 0x6e, 0x74, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x63, - 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, - 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, - 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x09, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, + 0x61, 0x74, 0x65, 0x4d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1f, 0x0a, + 0x0b, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0a, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x12, 0x38, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x6b, 0x0a, 0x14, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0f, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, 0x72, - 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x1a, 0x61, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 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, 0x30, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x3f, 0x0a, 0x0d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x61, 0x64, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x7a, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, - 0x63, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x32, 0x0a, - 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, - 0x73, 0x22, 0xbb, 0x02, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x62, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x61, 0x74, - 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, - 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, - 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0c, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22, - 0xe1, 0x02, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x74, 0x65, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6f, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x63, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x70, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, - 0x73, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, - 0x73, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x66, - 0x75, 0x6e, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x67, 0x61, 0x73, 0x52, 0x65, - 0x66, 0x75, 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x02, 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, - 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, - 0x72, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, - 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x08, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x22, 0x78, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, - 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, - 0x72, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, - 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x22, 0xf6, 0x03, - 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, - 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, - 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x6c, 0x70, 0x5f, 0x74, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x6c, 0x70, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, - 0x5f, 0x72, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x0b, 0x67, 0x61, 0x73, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, - 0x24, 0x0a, 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, - 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, - 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, - 0x35, 0x0a, 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x09, 0x63, 0x61, 0x6c, - 0x6c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x22, 0xd7, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, - 0x63, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, - 0x68, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, - 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, - 0x12, 0x19, 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x62, - 0x61, 0x74, 0x63, 0x68, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x09, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x22, 0xca, 0x03, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, - 0x61, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x63, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x02, 0x70, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6d, 0x61, 0x69, - 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, - 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x47, 0x61, 0x73, 0x12, 0x19, 0x0a, 0x08, - 0x67, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x67, 0x61, 0x73, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, - 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, - 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x65, 0x74, - 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, - 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x66, - 0x75, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x67, 0x61, 0x73, 0x52, 0x65, - 0x66, 0x75, 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, + 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x2e, 0x44, 0x62, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x02, 0x64, 0x62, 0x12, 0x66, 0x0a, 0x12, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, + 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x73, 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x42, 0x79, 0x74, 0x65, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x1a, 0x35, 0x0a, 0x07, 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, 0x09, 0x52, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x73, 0x42, 0x79, 0x74, 0x65, 0x63, 0x6f, 0x64, 0x65, 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, 0xd4, + 0x06, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x65, 0x77, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0c, 0x6e, 0x65, 0x77, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x2b, 0x0a, + 0x12, 0x6e, 0x65, 0x77, 0x5f, 0x61, 0x63, 0x63, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x68, + 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x6e, 0x65, 0x77, 0x41, 0x63, + 0x63, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2d, 0x0a, 0x13, 0x6e, 0x65, + 0x77, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6e, 0x65, 0x77, 0x4c, 0x6f, 0x63, 0x61, + 0x6c, 0x45, 0x78, 0x69, 0x74, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x22, 0x0a, 0x0d, 0x6e, 0x65, 0x77, + 0x5f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x74, 0x63, 0x68, 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, + 0x11, 0x63, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x63, 0x63, 0x61, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x63, 0x6e, 0x74, 0x4b, 0x65, 0x63, + 0x63, 0x61, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6e, 0x74, + 0x5f, 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x63, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x65, 0x69, + 0x64, 0x6f, 0x6e, 0x48, 0x61, 0x73, 0x68, 0x65, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x63, 0x6e, 0x74, + 0x5f, 0x70, 0x6f, 0x73, 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, + 0x67, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x63, 0x6e, 0x74, 0x50, 0x6f, 0x73, + 0x65, 0x69, 0x64, 0x6f, 0x6e, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x24, 0x0a, + 0x0e, 0x63, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x6d, 0x5f, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x73, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6e, 0x74, 0x4d, 0x65, 0x6d, 0x41, 0x6c, 0x69, + 0x67, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6e, 0x74, 0x5f, 0x61, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x65, 0x74, 0x69, 0x63, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, 0x63, 0x6e, + 0x74, 0x41, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x65, 0x74, 0x69, 0x63, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x6e, 0x74, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0b, 0x63, 0x6e, 0x74, 0x42, 0x69, 0x6e, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, + 0x1b, 0x0a, 0x09, 0x63, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x63, 0x6e, 0x74, 0x53, 0x74, 0x65, 0x70, 0x73, 0x12, 0x2e, 0x0a, 0x13, + 0x63, 0x75, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, + 0x73, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x63, 0x75, 0x6d, 0x75, 0x6c, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x09, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0e, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x6b, 0x0a, 0x14, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x0f, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x12, + 0x72, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x1a, 0x61, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 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, + 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xba, 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0e, + 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, + 0x61, 0x63, 0x6b, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, 0x65, + 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x74, 0x75, + 0x72, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x21, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x1c, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x54, 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, + 0x41, 0x0a, 0x1e, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x63, + 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x19, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x54, + 0x6f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x22, 0x3f, 0x0a, 0x0d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, + 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x22, 0x7a, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x65, + 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, + 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x73, + 0x74, 0x65, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x22, + 0xbb, 0x02, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, + 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, + 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x61, 0x74, 0x63, 0x68, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x06, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, + 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, + 0x73, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0d, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x6f, 0x6c, 0x64, 0x5f, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x0c, 0x6f, 0x6c, 0x64, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xe1, 0x02, + 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x65, + 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x63, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x02, 0x70, 0x63, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, + 0x63, 0x6f, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x43, + 0x6f, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x66, 0x75, 0x6e, + 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x67, 0x61, 0x73, 0x52, 0x65, 0x66, 0x75, + 0x6e, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, + 0x6f, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, + 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, + 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x44, 0x61, 0x74, + 0x61, 0x12, 0x31, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x0b, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x1a, 0x3a, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 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, 0x2a, 0xab, 0x08, - 0x0a, 0x08, 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x4f, - 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, - 0x14, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, - 0x46, 0x5f, 0x47, 0x41, 0x53, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, - 0x4c, 0x4f, 0x57, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x46, 0x4c, - 0x4f, 0x57, 0x10, 0x04, 0x12, 0x24, 0x0a, 0x20, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, - 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x05, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, - 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, - 0x5f, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x43, 0x4f, 0x4c, 0x4c, 0x49, 0x53, 0x49, - 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x56, 0x45, - 0x52, 0x54, 0x45, 0x44, 0x10, 0x07, 0x12, 0x22, 0x0a, 0x1e, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, - 0x45, 0x52, 0x53, 0x5f, 0x53, 0x54, 0x45, 0x50, 0x10, 0x08, 0x12, 0x24, 0x0a, 0x20, 0x52, 0x4f, - 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, - 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x10, 0x09, - 0x12, 0x24, 0x0a, 0x20, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, - 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x42, 0x49, - 0x4e, 0x41, 0x52, 0x59, 0x10, 0x0a, 0x12, 0x21, 0x0a, 0x1d, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, - 0x45, 0x52, 0x53, 0x5f, 0x4d, 0x45, 0x4d, 0x10, 0x0b, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x4f, 0x4d, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, - 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x41, 0x52, 0x49, 0x54, 0x48, 0x10, 0x0c, 0x12, 0x25, - 0x0a, 0x21, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, - 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x50, 0x41, 0x44, 0x44, - 0x49, 0x4e, 0x47, 0x10, 0x0d, 0x12, 0x26, 0x0a, 0x22, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, - 0x52, 0x53, 0x5f, 0x50, 0x4f, 0x53, 0x45, 0x49, 0x44, 0x4f, 0x4e, 0x10, 0x0e, 0x12, 0x1a, 0x0a, - 0x16, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, - 0x49, 0x44, 0x5f, 0x4a, 0x55, 0x4d, 0x50, 0x10, 0x0f, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4f, - 0x50, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x10, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, 0x5f, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x49, 0x43, 0x10, 0x11, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, - 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x43, - 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x53, 0x5f, 0x45, 0x46, 0x10, 0x12, 0x12, - 0x29, 0x0a, 0x25, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, - 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, - 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x10, 0x13, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, - 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, - 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, - 0x49, 0x44, 0x10, 0x14, 0x12, 0x25, 0x0a, 0x21, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x72, 0x22, 0x78, 0x0a, 0x08, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x61, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x67, 0x61, 0x73, 0x22, 0xf6, 0x03, 0x0a, 0x1a, + 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x72, 0x6c, 0x70, 0x5f, 0x74, 0x78, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x72, 0x6c, 0x70, 0x54, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x65, 0x66, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x12, 0x19, 0x0a, 0x08, + 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, + 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x61, 0x73, 0x5f, 0x72, + 0x65, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x67, + 0x61, 0x73, 0x52, 0x65, 0x66, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, + 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x24, 0x0a, + 0x04, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x65, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x04, 0x6c, + 0x6f, 0x67, 0x73, 0x12, 0x48, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x52, 0x0e, 0x65, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x35, 0x0a, + 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x43, 0x61, 0x6c, 0x6c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x52, 0x09, 0x63, 0x61, 0x6c, 0x6c, 0x54, + 0x72, 0x61, 0x63, 0x65, 0x22, 0xd7, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x12, 0x12, + 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x21, 0x0a, 0x0c, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x61, 0x74, 0x63, 0x68, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x78, 0x5f, 0x68, 0x61, 0x73, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x74, 0x78, 0x48, 0x61, 0x73, 0x68, 0x12, 0x19, + 0x0a, 0x08, 0x74, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x74, 0x78, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x61, 0x74, + 0x63, 0x68, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, + 0x61, 0x74, 0x63, 0x68, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xca, + 0x03, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x61, 0x63, + 0x65, 0x53, 0x74, 0x65, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x02, 0x70, 0x63, 0x12, 0x0e, 0x0a, 0x02, 0x6f, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x6f, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x69, + 0x6e, 0x67, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x65, + 0x6d, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x47, 0x61, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, + 0x73, 0x5f, 0x63, 0x6f, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x67, 0x61, + 0x73, 0x43, 0x6f, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x12, 0x1f, 0x0a, + 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x63, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x64, + 0x61, 0x74, 0x61, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, + 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x46, 0x0a, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, + 0x61, 0x63, 0x65, 0x53, 0x74, 0x65, 0x70, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x64, 0x65, 0x70, 0x74, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, + 0x70, 0x74, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x66, 0x75, 0x6e, + 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x67, 0x61, 0x73, 0x52, 0x65, 0x66, 0x75, + 0x6e, 0x64, 0x12, 0x2b, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x15, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, + 0x3a, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 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, 0x2a, 0xab, 0x08, 0x0a, 0x08, + 0x52, 0x6f, 0x6d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x4f, 0x4d, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x4e, 0x4f, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x52, + 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, + 0x47, 0x41, 0x53, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, + 0x57, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, + 0x10, 0x04, 0x12, 0x24, 0x0a, 0x20, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x45, 0x58, + 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x05, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, 0x4d, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x5f, 0x41, + 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x5f, 0x43, 0x4f, 0x4c, 0x4c, 0x49, 0x53, 0x49, 0x4f, 0x4e, + 0x10, 0x06, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x56, 0x45, 0x52, 0x54, + 0x45, 0x44, 0x10, 0x07, 0x12, 0x22, 0x0a, 0x1e, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, + 0x53, 0x5f, 0x53, 0x54, 0x45, 0x50, 0x10, 0x08, 0x12, 0x24, 0x0a, 0x20, 0x52, 0x4f, 0x4d, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, + 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x10, 0x09, 0x12, 0x24, + 0x0a, 0x20, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, + 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x42, 0x49, 0x4e, 0x41, + 0x52, 0x59, 0x10, 0x0a, 0x12, 0x21, 0x0a, 0x1d, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, + 0x53, 0x5f, 0x4d, 0x45, 0x4d, 0x10, 0x0b, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x4f, 0x4d, 0x5f, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, + 0x54, 0x45, 0x52, 0x53, 0x5f, 0x41, 0x52, 0x49, 0x54, 0x48, 0x10, 0x0c, 0x12, 0x25, 0x0a, 0x21, + 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, + 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x50, 0x41, 0x44, 0x44, 0x49, 0x4e, + 0x47, 0x10, 0x0d, 0x12, 0x26, 0x0a, 0x22, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, + 0x5f, 0x50, 0x4f, 0x53, 0x45, 0x49, 0x44, 0x4f, 0x4e, 0x10, 0x0e, 0x12, 0x1a, 0x0a, 0x16, 0x52, + 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x4a, 0x55, 0x4d, 0x50, 0x10, 0x0f, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, 0x5f, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4f, 0x50, 0x43, + 0x4f, 0x44, 0x45, 0x10, 0x10, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, + 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, + 0x43, 0x10, 0x11, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, + 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x43, 0x4f, 0x44, + 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x53, 0x5f, 0x45, 0x46, 0x10, 0x12, 0x12, 0x29, 0x0a, + 0x25, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, + 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x49, 0x47, + 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x10, 0x13, 0x12, 0x28, 0x0a, 0x24, 0x52, 0x4f, 0x4d, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x49, 0x4e, 0x5f, 0x49, 0x44, + 0x10, 0x14, 0x12, 0x25, 0x0a, 0x21, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x5f, 0x4e, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x15, 0x12, 0x29, 0x0a, 0x25, 0x52, 0x4f, 0x4d, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, + 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4c, 0x49, 0x4d, + 0x49, 0x54, 0x10, 0x16, 0x12, 0x27, 0x0a, 0x23, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x5f, 0x4e, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x15, 0x12, 0x29, 0x0a, 0x25, 0x52, + 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x17, 0x12, 0x2f, 0x0a, + 0x2b, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, + 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x41, 0x54, + 0x43, 0x48, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x18, 0x12, 0x2b, + 0x0a, 0x27, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, + 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x45, + 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x19, 0x12, 0x27, 0x0a, 0x23, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, - 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4c, - 0x49, 0x4d, 0x49, 0x54, 0x10, 0x16, 0x12, 0x27, 0x0a, 0x23, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x10, 0x17, 0x12, - 0x2f, 0x0a, 0x2b, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, - 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x42, - 0x41, 0x54, 0x43, 0x48, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x10, 0x18, - 0x12, 0x2b, 0x0a, 0x27, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, - 0x54, 0x52, 0x49, 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, - 0x53, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x19, 0x12, 0x27, 0x0a, - 0x23, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x54, 0x52, 0x49, - 0x4e, 0x53, 0x49, 0x43, 0x5f, 0x54, 0x58, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, - 0x46, 0x4c, 0x4f, 0x57, 0x10, 0x1a, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, - 0x52, 0x4f, 0x52, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, - 0x4f, 0x4f, 0x5f, 0x42, 0x49, 0x47, 0x10, 0x1b, 0x12, 0x21, 0x0a, 0x1d, 0x52, 0x4f, 0x4d, 0x5f, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, - 0x44, 0x5f, 0x46, 0x4f, 0x52, 0x4b, 0x5f, 0x49, 0x44, 0x10, 0x1c, 0x2a, 0xa6, 0x03, 0x0a, 0x0d, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, - 0x1a, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, - 0x17, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, - 0x4e, 0x4f, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x45, 0x58, - 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, - 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x4b, - 0x45, 0x43, 0x43, 0x41, 0x4b, 0x10, 0x02, 0x12, 0x2b, 0x0a, 0x27, 0x45, 0x58, 0x45, 0x43, 0x55, - 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, - 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x42, 0x49, 0x4e, 0x41, - 0x52, 0x59, 0x10, 0x03, 0x12, 0x28, 0x0a, 0x24, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, - 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, - 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x4d, 0x45, 0x4d, 0x10, 0x04, 0x12, 0x2a, - 0x0a, 0x26, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, - 0x4f, 0x57, 0x5f, 0x41, 0x52, 0x49, 0x54, 0x48, 0x10, 0x05, 0x12, 0x2c, 0x0a, 0x28, 0x45, 0x58, - 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, - 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x50, - 0x41, 0x44, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x2d, 0x0a, 0x29, 0x45, 0x58, 0x45, 0x43, + 0x49, 0x43, 0x5f, 0x54, 0x58, 0x5f, 0x47, 0x41, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, + 0x4f, 0x57, 0x10, 0x1a, 0x12, 0x20, 0x0a, 0x1c, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, 0x52, 0x4f, + 0x52, 0x5f, 0x42, 0x41, 0x54, 0x43, 0x48, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x4f, + 0x5f, 0x42, 0x49, 0x47, 0x10, 0x1b, 0x12, 0x21, 0x0a, 0x1d, 0x52, 0x4f, 0x4d, 0x5f, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, + 0x46, 0x4f, 0x52, 0x4b, 0x5f, 0x49, 0x44, 0x10, 0x1c, 0x2a, 0xa6, 0x03, 0x0a, 0x0d, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x1a, 0x45, + 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x45, + 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, + 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x2b, 0x0a, 0x27, 0x45, 0x58, 0x45, 0x43, + 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, + 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x4b, 0x45, 0x43, + 0x43, 0x41, 0x4b, 0x10, 0x02, 0x12, 0x2b, 0x0a, 0x27, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, + 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, + 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, + 0x10, 0x03, 0x12, 0x28, 0x0a, 0x24, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, + 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, + 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x4d, 0x45, 0x4d, 0x10, 0x04, 0x12, 0x2a, 0x0a, 0x26, + 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, + 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, + 0x5f, 0x41, 0x52, 0x49, 0x54, 0x48, 0x10, 0x05, 0x12, 0x2c, 0x0a, 0x28, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, - 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x50, 0x4f, 0x53, - 0x45, 0x49, 0x44, 0x4f, 0x4e, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x45, 0x58, 0x45, 0x43, 0x55, - 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, - 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x4f, 0x52, 0x4b, 0x5f, 0x49, 0x44, 0x10, 0x08, 0x12, - 0x23, 0x0a, 0x1f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, - 0x52, 0x5f, 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4d, 0x49, 0x53, 0x4d, 0x41, 0x54, - 0x43, 0x48, 0x10, 0x09, 0x32, 0x68, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, - 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x45, 0x52, 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x50, 0x41, 0x44, + 0x44, 0x49, 0x4e, 0x47, 0x10, 0x06, 0x12, 0x2d, 0x0a, 0x29, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, + 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, + 0x53, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x50, 0x4f, 0x53, 0x45, 0x49, + 0x44, 0x4f, 0x4e, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, + 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, + 0x54, 0x45, 0x44, 0x5f, 0x46, 0x4f, 0x52, 0x4b, 0x5f, 0x49, 0x44, 0x10, 0x08, 0x12, 0x23, 0x0a, + 0x1f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, + 0x42, 0x41, 0x4c, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x4d, 0x49, 0x53, 0x4d, 0x41, 0x54, 0x43, 0x48, + 0x10, 0x09, 0x32, 0x68, 0x0a, 0x0f, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x55, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 0x42, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, 0x63, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x65, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x42, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x41, - 0x5a, 0x3f, 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, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2f, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x41, 0x5a, 0x3f, + 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, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x74, + 0x69, 0x6d, 0x65, 0x2f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2f, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1850,49 +1951,51 @@ func file_executor_proto_rawDescGZIP() []byte { } var file_executor_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_executor_proto_goTypes = []interface{}{ (RomError)(0), // 0: executor.v1.RomError (ExecutorError)(0), // 1: executor.v1.ExecutorError (*ProcessBatchRequest)(nil), // 2: executor.v1.ProcessBatchRequest (*ProcessBatchResponse)(nil), // 3: executor.v1.ProcessBatchResponse - (*InfoReadWrite)(nil), // 4: executor.v1.InfoReadWrite - (*CallTrace)(nil), // 5: executor.v1.CallTrace - (*TransactionContext)(nil), // 6: executor.v1.TransactionContext - (*TransactionStep)(nil), // 7: executor.v1.TransactionStep - (*Contract)(nil), // 8: executor.v1.Contract - (*ProcessTransactionResponse)(nil), // 9: executor.v1.ProcessTransactionResponse - (*Log)(nil), // 10: executor.v1.Log - (*ExecutionTraceStep)(nil), // 11: executor.v1.ExecutionTraceStep - nil, // 12: executor.v1.ProcessBatchRequest.DbEntry - nil, // 13: executor.v1.ProcessBatchRequest.ContractsBytecodeEntry - nil, // 14: executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry - nil, // 15: executor.v1.ExecutionTraceStep.StorageEntry + (*TraceConfig)(nil), // 4: executor.v1.TraceConfig + (*InfoReadWrite)(nil), // 5: executor.v1.InfoReadWrite + (*CallTrace)(nil), // 6: executor.v1.CallTrace + (*TransactionContext)(nil), // 7: executor.v1.TransactionContext + (*TransactionStep)(nil), // 8: executor.v1.TransactionStep + (*Contract)(nil), // 9: executor.v1.Contract + (*ProcessTransactionResponse)(nil), // 10: executor.v1.ProcessTransactionResponse + (*Log)(nil), // 11: executor.v1.Log + (*ExecutionTraceStep)(nil), // 12: executor.v1.ExecutionTraceStep + nil, // 13: executor.v1.ProcessBatchRequest.DbEntry + nil, // 14: executor.v1.ProcessBatchRequest.ContractsBytecodeEntry + nil, // 15: executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry + nil, // 16: executor.v1.ExecutionTraceStep.StorageEntry } var file_executor_proto_depIdxs = []int32{ - 12, // 0: executor.v1.ProcessBatchRequest.db:type_name -> executor.v1.ProcessBatchRequest.DbEntry - 13, // 1: executor.v1.ProcessBatchRequest.contracts_bytecode:type_name -> executor.v1.ProcessBatchRequest.ContractsBytecodeEntry - 9, // 2: executor.v1.ProcessBatchResponse.responses:type_name -> executor.v1.ProcessTransactionResponse - 1, // 3: executor.v1.ProcessBatchResponse.error:type_name -> executor.v1.ExecutorError - 14, // 4: executor.v1.ProcessBatchResponse.read_write_addresses:type_name -> executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry - 6, // 5: executor.v1.CallTrace.context:type_name -> executor.v1.TransactionContext - 7, // 6: executor.v1.CallTrace.steps:type_name -> executor.v1.TransactionStep - 8, // 7: executor.v1.TransactionStep.contract:type_name -> executor.v1.Contract - 0, // 8: executor.v1.TransactionStep.error:type_name -> executor.v1.RomError - 0, // 9: executor.v1.ProcessTransactionResponse.error:type_name -> executor.v1.RomError - 10, // 10: executor.v1.ProcessTransactionResponse.logs:type_name -> executor.v1.Log - 11, // 11: executor.v1.ProcessTransactionResponse.execution_trace:type_name -> executor.v1.ExecutionTraceStep - 5, // 12: executor.v1.ProcessTransactionResponse.call_trace:type_name -> executor.v1.CallTrace - 15, // 13: executor.v1.ExecutionTraceStep.storage:type_name -> executor.v1.ExecutionTraceStep.StorageEntry - 0, // 14: executor.v1.ExecutionTraceStep.error:type_name -> executor.v1.RomError - 4, // 15: executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry.value:type_name -> executor.v1.InfoReadWrite - 2, // 16: executor.v1.ExecutorService.ProcessBatch:input_type -> executor.v1.ProcessBatchRequest - 3, // 17: executor.v1.ExecutorService.ProcessBatch:output_type -> executor.v1.ProcessBatchResponse - 17, // [17:18] is the sub-list for method output_type - 16, // [16:17] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 13, // 0: executor.v1.ProcessBatchRequest.db:type_name -> executor.v1.ProcessBatchRequest.DbEntry + 14, // 1: executor.v1.ProcessBatchRequest.contracts_bytecode:type_name -> executor.v1.ProcessBatchRequest.ContractsBytecodeEntry + 4, // 2: executor.v1.ProcessBatchRequest.trace_config:type_name -> executor.v1.TraceConfig + 10, // 3: executor.v1.ProcessBatchResponse.responses:type_name -> executor.v1.ProcessTransactionResponse + 1, // 4: executor.v1.ProcessBatchResponse.error:type_name -> executor.v1.ExecutorError + 15, // 5: executor.v1.ProcessBatchResponse.read_write_addresses:type_name -> executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry + 7, // 6: executor.v1.CallTrace.context:type_name -> executor.v1.TransactionContext + 8, // 7: executor.v1.CallTrace.steps:type_name -> executor.v1.TransactionStep + 9, // 8: executor.v1.TransactionStep.contract:type_name -> executor.v1.Contract + 0, // 9: executor.v1.TransactionStep.error:type_name -> executor.v1.RomError + 0, // 10: executor.v1.ProcessTransactionResponse.error:type_name -> executor.v1.RomError + 11, // 11: executor.v1.ProcessTransactionResponse.logs:type_name -> executor.v1.Log + 12, // 12: executor.v1.ProcessTransactionResponse.execution_trace:type_name -> executor.v1.ExecutionTraceStep + 6, // 13: executor.v1.ProcessTransactionResponse.call_trace:type_name -> executor.v1.CallTrace + 16, // 14: executor.v1.ExecutionTraceStep.storage:type_name -> executor.v1.ExecutionTraceStep.StorageEntry + 0, // 15: executor.v1.ExecutionTraceStep.error:type_name -> executor.v1.RomError + 5, // 16: executor.v1.ProcessBatchResponse.ReadWriteAddressesEntry.value:type_name -> executor.v1.InfoReadWrite + 2, // 17: executor.v1.ExecutorService.ProcessBatch:input_type -> executor.v1.ProcessBatchRequest + 3, // 18: executor.v1.ExecutorService.ProcessBatch:output_type -> executor.v1.ProcessBatchResponse + 18, // [18:19] is the sub-list for method output_type + 17, // [17:18] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_executor_proto_init() } @@ -1926,7 +2029,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InfoReadWrite); i { + switch v := v.(*TraceConfig); i { case 0: return &v.state case 1: @@ -1938,7 +2041,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallTrace); i { + switch v := v.(*InfoReadWrite); i { case 0: return &v.state case 1: @@ -1950,7 +2053,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionContext); i { + switch v := v.(*CallTrace); i { case 0: return &v.state case 1: @@ -1962,7 +2065,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStep); i { + switch v := v.(*TransactionContext); i { case 0: return &v.state case 1: @@ -1974,7 +2077,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Contract); i { + switch v := v.(*TransactionStep); i { case 0: return &v.state case 1: @@ -1986,7 +2089,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessTransactionResponse); i { + switch v := v.(*Contract); i { case 0: return &v.state case 1: @@ -1998,7 +2101,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Log); i { + switch v := v.(*ProcessTransactionResponse); i { case 0: return &v.state case 1: @@ -2010,6 +2113,18 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Log); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_executor_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionTraceStep); i { case 0: return &v.state @@ -2028,7 +2143,7 @@ func file_executor_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_executor_proto_rawDesc, NumEnums: 2, - NumMessages: 14, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/state/state.go b/state/state.go index a019a3d6f0..5a01902882 100644 --- a/state/state.go +++ b/state/state.go @@ -454,7 +454,6 @@ func (s *State) ProcessSequencerBatch(ctx context.Context, batchNumber uint64, b if err != nil && !errors.Is(err, InvalidData) { return nil, err } - result, err := s.convertToProcessBatchResponse(txs, processBatchResponse) if err != nil { return nil, err @@ -858,7 +857,7 @@ func (s *State) GetLastBatch(ctx context.Context, dbTx pgx.Tx) (*Batch, error) { } // DebugTransaction re-executes a tx to generate its trace -func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Hash, tracer string, dbTx pgx.Tx) (*runtime.ExecutionResult, error) { +func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Hash, traceConfig TraceConfig, dbTx pgx.Tx) (*runtime.ExecutionResult, error) { result := new(runtime.ExecutionResult) // Get the transaction @@ -899,19 +898,36 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has forkId := s.GetForkIdByBatchNumber(batch.BatchNumber) // Create Batch - processBatchRequest := &pb.ProcessBatchRequest{ - OldBatchNum: batch.BatchNumber - 1, - BatchL2Data: batchL2Data, - OldStateRoot: pBatch.StateRoot.Bytes(), - GlobalExitRoot: batch.GlobalExitRoot.Bytes(), - OldAccInputHash: pBatch.AccInputHash.Bytes(), - EthTimestamp: uint64(batch.Timestamp.Unix()), - Coinbase: batch.Coinbase.String(), - UpdateMerkleTree: cFalse, + traceConfigRequest := &pb.TraceConfig{ TxHashToGenerateCallTrace: transactionHash.Bytes(), TxHashToGenerateExecuteTrace: transactionHash.Bytes(), - ChainId: s.cfg.ChainID, - ForkId: forkId, + } + + if traceConfig.DisableStorage { + traceConfigRequest.DisableStorage = cTrue + } + if traceConfig.DisableStack { + traceConfigRequest.DisableStack = cTrue + } + if traceConfig.EnableMemory { + traceConfigRequest.EnableMemory = cTrue + } + if traceConfig.EnableReturnData { + traceConfigRequest.EnableReturnData = cTrue + } + + processBatchRequest := &pb.ProcessBatchRequest{ + OldBatchNum: batch.BatchNumber - 1, + BatchL2Data: batchL2Data, + OldStateRoot: pBatch.StateRoot.Bytes(), + GlobalExitRoot: batch.GlobalExitRoot.Bytes(), + OldAccInputHash: pBatch.AccInputHash.Bytes(), + EthTimestamp: uint64(batch.Timestamp.Unix()), + Coinbase: batch.Coinbase.String(), + UpdateMerkleTree: cFalse, + ChainId: s.cfg.ChainID, + ForkId: forkId, + TraceConfig: traceConfigRequest, } // Send Batch to the Executor @@ -926,6 +942,17 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has } endTime := time.Now() + // //save process batch response file + // b, err := json.Marshal(processBatchResponse) + // if err != nil { + // return nil, err + // } + // filePath := "./processBatchResponse.json" + // err = os.WriteFile(filePath, b, 0644) + // if err != nil { + // return nil, err + // } + for _, response := range processBatchResponse.Responses { log.Debugf(string(response.TxHash)) } @@ -966,12 +993,12 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has result.StateRoot = response.StateRoot.Bytes() result.StructLogs = response.ExecutionTrace - if tracer == "" { + if traceConfig.Tracer == nil || *traceConfig.Tracer == "" { return result, nil } // Parse the executor-like trace using the FakeEVM - jsTracer, err := js.NewJsTracer(tracer, new(tracers.Context)) + jsTracer, err := js.NewJsTracer(*traceConfig.Tracer, new(tracers.Context)) if err != nil { log.Errorf("debug transaction: failed to create jsTracer, err: %v", err) return nil, fmt.Errorf("failed to create jsTracer, err: %v", err) @@ -1256,7 +1283,6 @@ func (s *State) internalProcessUnsignedTransaction(ctx context.Context, tx *type } log.Debugf("internalProcessUnsignedTransaction[processBatchRequest.OldBatchNum]: %v", processBatchRequest.OldBatchNum) - // log.Debugf("ProcessUnsignedTransaction[processBatchRequest.BatchL2Data]: %v", hex.EncodeToHex(processBatchRequest.BatchL2Data)) log.Debugf("internalProcessUnsignedTransaction[processBatchRequest.From]: %v", processBatchRequest.From) log.Debugf("internalProcessUnsignedTransaction[processBatchRequest.OldStateRoot]: %v", hex.EncodeToHex(processBatchRequest.OldStateRoot)) log.Debugf("internalProcessUnsignedTransaction[processBatchRequest.globalExitRoot]: %v", hex.EncodeToHex(processBatchRequest.GlobalExitRoot)) diff --git a/state/types.go b/state/types.go index 71203c9606..bbf9cf0dcb 100644 --- a/state/types.go +++ b/state/types.go @@ -153,6 +153,15 @@ type DebugInfo struct { Payload string } +// TraceConfig sets the debug configuration for the executor +type TraceConfig struct { + DisableStorage bool + DisableStack bool + EnableMemory bool + EnableReturnData bool + Tracer *string +} + // TrustedReorg represents a trusted reorg type TrustedReorg struct { BatchNumber uint64 diff --git a/synchronizer/mock_dbtx.go b/synchronizer/mock_dbtx.go index a4f35b1305..d022a95582 100644 --- a/synchronizer/mock_dbtx.go +++ b/synchronizer/mock_dbtx.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package synchronizer diff --git a/synchronizer/mock_etherman.go b/synchronizer/mock_etherman.go index 74e1f82609..90ea1eff4d 100644 --- a/synchronizer/mock_etherman.go +++ b/synchronizer/mock_etherman.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package synchronizer diff --git a/synchronizer/mock_ethtxmanager.go b/synchronizer/mock_ethtxmanager.go index 9935a8c543..83adfaa984 100644 --- a/synchronizer/mock_ethtxmanager.go +++ b/synchronizer/mock_ethtxmanager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package synchronizer diff --git a/synchronizer/mock_pool.go b/synchronizer/mock_pool.go index a461a47273..161e718cd5 100644 --- a/synchronizer/mock_pool.go +++ b/synchronizer/mock_pool.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package synchronizer diff --git a/synchronizer/mock_state.go b/synchronizer/mock_state.go index 0229c00c9d..eab3bd299d 100644 --- a/synchronizer/mock_state.go +++ b/synchronizer/mock_state.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.14.0. DO NOT EDIT. +// Code generated by mockery v2.15.0. DO NOT EDIT. package synchronizer diff --git a/test/Makefile b/test/Makefile index f21f88e86a..38f18b09bd 100644 --- a/test/Makefile +++ b/test/Makefile @@ -67,7 +67,7 @@ STOPEXPLORERL1 := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL1) && $(DOCKERCO STOPEXPLORERL1DB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL1DB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL1DB) STOPEXPLORERL2 := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL2) STOPEXPLORERL2DB := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERL2DB) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERL2DB) -STOPEXPLORERRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERRPC) +STOPEXPLORERJSONRPC := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEEXPLORERRPC) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEEXPLORERRPC) STOPZKPROVER := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVER) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEZKPROVER) STOPZKPROVERMOCK := $(DOCKERCOMPOSE) stop $(DOCKERCOMPOSEZKPROVERMOCK) && $(DOCKERCOMPOSE) rm -f $(DOCKERCOMPOSEZKPROVERMOCK) @@ -99,7 +99,6 @@ test-e2e-group-1: stop ## Runs group 1 e2e tests checking race conditions $(RUNPOOLDB) sleep 5 $(RUNZKPROVER) - $(RUNETHTXMANAGER) docker ps -a docker logs $(DOCKERCOMPOSEZKPROVER) trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 600s ../ci/e2e-group1/... @@ -110,7 +109,6 @@ test-e2e-group-2: stop ## Runs group 2 e2e tests checking race conditions $(RUNPOOLDB) sleep 5 $(RUNZKPROVER) - $(RUNETHTXMANAGER) docker ps -a docker logs $(DOCKERCOMPOSEZKPROVER) trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 600s ../ci/e2e-group2/... @@ -121,7 +119,6 @@ test-e2e-group-3: stop ## Runs group 3 e2e tests checking race conditions $(RUNPOOLDB) sleep 5 $(RUNZKPROVER) - $(RUNETHTXMANAGER) docker ps -a docker logs $(DOCKERCOMPOSEZKPROVER) trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 600s ../ci/e2e-group3/... @@ -132,11 +129,20 @@ test-e2e-group-4: stop ## Runs group 4 e2e tests checking race conditions $(RUNPOOLDB) sleep 5 $(RUNZKPROVER) - $(RUNETHTXMANAGER) docker ps -a docker logs $(DOCKERCOMPOSEZKPROVER) trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 600s ../ci/e2e-group4/... +.PHONY: test-e2e-group-5 +test-e2e-group-5: stop ## Runs group 5 e2e tests checking race conditions + $(RUNSTATEDB) + $(RUNPOOLDB) + sleep 5 + $(RUNZKPROVER) + docker ps -a + docker logs $(DOCKERCOMPOSEZKPROVER) + trap '$(STOP)' EXIT; MallocNanoZone=0 go test -count=1 -race -v -p 1 -timeout 600s ../ci/e2e-group5/... + .PHONY: benchmark-sequencer-eth-transfers benchmark-sequencer-eth-transfers: stop $(RUNL1NETWORK) @@ -200,6 +206,7 @@ stop-node: ## Stops the node $(STOPL2GASPRICER) $(STOPAGGREGATOR) $(STOPSYNC) + $(STOPETHTXMANAGER) .PHONY: run-network run-network: ## Runs the l1 network @@ -236,6 +243,14 @@ run-l2-explorer: ## Runs L2 blockscan explorer $(RUNEXPLORERJSONRPC) $(RUNEXPLORERL2) +.PHONY: run-l2-explorer-json-rpc +run-l2-explorer-json-rpc: ## Runs L2 explorer json rpc + $(RUNEXPLORERJSONRPC) + +.PHONY: stop-l2-explorer-json-rpc +stop-l2-explorer-json-rpc: ## Stops L2 explorer json rpc + $(STOPEXPLORERJSONRPC) + .PHONY: run-explorer run-explorer: run-l1-explorer run-l2-explorer ## Runs both L1 and L2 explorers @@ -243,7 +258,7 @@ run-explorer: run-l1-explorer run-l2-explorer ## Runs both L1 and L2 explorers stop-explorer: ## Stops the explorer $(STOPEXPLORERL2) $(STOPEXPLORERL1) - $(STOPEXPLORERRPC) + $(STOPEXPLORERJSONRPC) $(STOPEXPLORERL2DB) $(STOPEXPLORERL1DB) diff --git a/test/config/test.node.config.toml b/test/config/test.node.config.toml index 4151d7067a..54a6ef1aaf 100644 --- a/test/config/test.node.config.toml +++ b/test/config/test.node.config.toml @@ -136,7 +136,3 @@ Enabled = true ProfilingHost = "0.0.0.0" ProfilingPort = 6060 ProfilingEnabled = true - - - - diff --git a/test/docker-compose.yml b/test/docker-compose.yml index b826c5f700..9f1db1570d 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -301,7 +301,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:798d9e0 + image: hermeznetwork/zkevm-prover:1d31dc6 ports: # - 50051:50051 # Prover - 50052:50052 # Mock prover diff --git a/test/e2e/debug_test.go b/test/e2e/debug_test.go index 4268e3a40d..fdd56c16e2 100644 --- a/test/e2e/debug_test.go +++ b/test/e2e/debug_test.go @@ -1,7 +1,611 @@ package e2e -import "testing" +import ( + "context" + "encoding/json" + "fmt" + "math/big" + "strings" + "testing" + + "github.com/0xPolygonHermez/zkevm-node/hex" + "github.com/0xPolygonHermez/zkevm-node/jsonrpc" + "github.com/0xPolygonHermez/zkevm-node/log" + "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/ERC20" + "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/EmitLog" + "github.com/0xPolygonHermez/zkevm-node/test/contracts/bin/Revert2" + "github.com/0xPolygonHermez/zkevm-node/test/operations" + "github.com/0xPolygonHermez/zkevm-node/test/testutils" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "github.com/stretchr/testify/require" +) + +const fixedTxGasLimit uint64 = 100000 func TestDebugTraceTransaction(t *testing.T) { + if testing.Short() { + t.Skip() + } + + const l2NetworkURL = "http://localhost:8124" + const l2ExplorerRPCComponentName = "l2-explorer-json-rpc" + + var err error + err = operations.Teardown() + require.NoError(t, err) + + defer func() { + require.NoError(t, operations.Teardown()) + require.NoError(t, operations.StopComponent(l2ExplorerRPCComponentName)) + }() + + ctx := context.Background() + opsCfg := operations.GetDefaultOperationsConfig() + opsMan, err := operations.NewManager(ctx, opsCfg) + require.NoError(t, err) + err = opsMan.Setup() + require.NoError(t, err) + + err = operations.StartComponent(l2ExplorerRPCComponentName, func() (bool, error) { return operations.NodeUpCondition(l2NetworkURL) }) + require.NoError(t, err) + + const l1NetworkName, l2NetworkName = "Local L1", "Local L2" + + networks := []struct { + Name string + URL string + WebSocketURL string + ChainID uint64 + PrivateKey string + }{ + { + Name: l1NetworkName, + URL: operations.DefaultL1NetworkURL, + ChainID: operations.DefaultL1ChainID, + PrivateKey: operations.DefaultSequencerPrivateKey, + }, + { + Name: l2NetworkName, + URL: l2NetworkURL, + ChainID: operations.DefaultL2ChainID, + PrivateKey: operations.DefaultSequencerPrivateKey, + }, + } + + results := map[string]json.RawMessage{} + + type testCase struct { + name string + prepare func(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) + createSignedTx func(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) + } + testCases := []testCase{ + // successful transactions + {name: "eth transfer", createSignedTx: createEthTransferSignedTx}, + {name: "sc deployment", createSignedTx: createScDeploySignedTx}, + {name: "sc call", prepare: prepareScCall, createSignedTx: createScCallSignedTx}, + {name: "erc20 transfer", prepare: prepareERC20Transfer, createSignedTx: createERC20TransferSignedTx}, + // failed transactions + {name: "sc deployment reverted", createSignedTx: createScDeployRevertedSignedTx}, + {name: "sc call reverted", prepare: prepareScCallReverted, createSignedTx: createScCallRevertedSignedTx}, + {name: "erc20 transfer reverted", prepare: prepareERC20TransferReverted, createSignedTx: createERC20TransferRevertedSignedTx}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + log.Debugf(tc.name) + for _, network := range networks { + log.Debugf(network.Name) + client := operations.MustGetClient(network.URL) + auth := operations.MustGetAuth(network.PrivateKey, network.ChainID) + + var customData map[string]interface{} + if tc.prepare != nil { + customData, err = tc.prepare(t, ctx, auth, client) + require.NoError(t, err) + } + + signedTx, err := tc.createSignedTx(t, ctx, auth, client, customData) + require.NoError(t, err) + + err = client.SendTransaction(ctx, signedTx) + require.NoError(t, err) + + log.Debugf("tx sent: %v", signedTx.Hash().String()) + + err = operations.WaitTxToBeMined(ctx, client, signedTx, operations.DefaultTimeoutTxToBeMined) + if err != nil && !strings.HasPrefix(err.Error(), "transaction has failed, reason:") { + require.NoError(t, err) + } + + debugOptions := map[string]interface{}{ + "disableStorage": false, + "disableStack": false, + "enableMemory": true, + "enableReturnData": true, + } + + response, err := jsonrpc.JSONRPCCall(network.URL, "debug_traceTransaction", signedTx.Hash().String(), debugOptions) + require.NoError(t, err) + require.Nil(t, response.Error) + require.NotNil(t, response.Result) + + results[network.Name] = response.Result + + // // save result in a file + // sanitizedNetworkName := strings.ReplaceAll(network.Name+"_"+tc.name, " ", "_") + // filePath := fmt.Sprintf("/home/tclemos/github.com/0xPolygonHermez/zkevm-node/dist/%v.json", sanitizedNetworkName) + // b, _ := signedTx.MarshalBinary() + // fileContent := struct { + // Tx *types.Transaction + // RLP string + // Trace json.RawMessage + // }{ + // Tx: signedTx, + // RLP: hex.EncodeToHex(b), + // Trace: response.Result, + // } + // c, err := json.MarshalIndent(fileContent, "", " ") + // require.NoError(t, err) + // err = os.WriteFile(filePath, c, 0644) + // require.NoError(t, err) + } + + referenceValueMap := map[string]interface{}{} + err = json.Unmarshal(results[l1NetworkName], &referenceValueMap) + require.NoError(t, err) + + referenceStructLogsMap := referenceValueMap["structLogs"].([]interface{}) + + for networkName, result := range results { + if networkName == l1NetworkName { + continue + } + + resultMap := map[string]interface{}{} + err = json.Unmarshal(result, &resultMap) + require.NoError(t, err) + + resultStructLogsMap := resultMap["structLogs"].([]interface{}) + require.Equal(t, len(referenceStructLogsMap), len(resultStructLogsMap)) + + for structLogIndex := range referenceStructLogsMap { + referenceStructLogMap := referenceStructLogsMap[structLogIndex].(map[string]interface{}) + resultStructLogMap := resultStructLogsMap[structLogIndex].(map[string]interface{}) + + require.Equal(t, referenceStructLogMap["pc"], resultStructLogMap["pc"], fmt.Sprintf("invalid struct log pc for network %s", networkName)) + require.Equal(t, referenceStructLogMap["op"], resultStructLogMap["op"], fmt.Sprintf("invalid struct log op for network %s", networkName)) + require.Equal(t, referenceStructLogMap["depth"], resultStructLogMap["depth"], fmt.Sprintf("invalid struct log depth for network %s", networkName)) + + pc := referenceStructLogMap["pc"] + op := referenceStructLogMap["op"] + + referenceStack, found := referenceStructLogMap["stack"].([]interface{}) + if found { + resultStack := resultStructLogMap["stack"].([]interface{}) + + require.Equal(t, len(referenceStack), len(resultStack), fmt.Sprintf("stack size doesn't match for pc %v op %v", pc, op)) + for stackIndex := range referenceStack { + require.Equal(t, referenceStack[stackIndex], resultStack[stackIndex], fmt.Sprintf("stack index %v doesn't match for pc %v op %v", stackIndex, pc, op)) + } + } + + referenceMemory, found := referenceStructLogMap["memory"].([]interface{}) + if found { + resultMemory := resultStructLogMap["memory"].([]interface{}) + + require.Equal(t, len(referenceMemory), len(resultMemory), fmt.Sprintf("memory size doesn't match for pc %v op %v", pc, op)) + for memoryIndex := range referenceMemory { + require.Equal(t, referenceMemory[memoryIndex], resultMemory[memoryIndex], fmt.Sprintf("memory index %v doesn't match for pc %v op %v", memoryIndex, pc, op)) + } + } + + referenceStorage, found := referenceStructLogMap["storage"].(map[string]interface{}) + if found { + resultStorage := resultStructLogMap["storage"].(map[string]interface{}) + + require.Equal(t, len(referenceStorage), len(resultStorage), fmt.Sprintf("storage size doesn't match for pc %v op %v", pc, op)) + for storageKey, referenceStorageValue := range referenceStorage { + resultStorageValue, found := resultStorage[storageKey] + require.True(t, found, "storage address not found") + require.Equal(t, referenceStorageValue, resultStorageValue, fmt.Sprintf("storage value doesn't match for address %v for pc %v op %v", storageKey, pc, op)) + } + } + } + } + }) + } +} + +func TestDebugTraceBlock(t *testing.T) { + if testing.Short() { + t.Skip() + } + + const l2NetworkURL = "http://localhost:8124" + const l2ExplorerRPCComponentName = "l2-explorer-json-rpc" + + var err error + err = operations.Teardown() + require.NoError(t, err) + + defer func() { + require.NoError(t, operations.Teardown()) + require.NoError(t, operations.StopComponent(l2ExplorerRPCComponentName)) + }() + + ctx := context.Background() + opsCfg := operations.GetDefaultOperationsConfig() + opsMan, err := operations.NewManager(ctx, opsCfg) + require.NoError(t, err) + err = opsMan.Setup() + require.NoError(t, err) + + err = operations.StartComponent(l2ExplorerRPCComponentName, func() (bool, error) { return operations.NodeUpCondition(l2NetworkURL) }) + require.NoError(t, err) + + const l1NetworkName, l2NetworkName = "Local L1", "Local L2" + + networks := []struct { + Name string + URL string + WebSocketURL string + ChainID uint64 + PrivateKey string + }{ + { + Name: l1NetworkName, + URL: operations.DefaultL1NetworkURL, + ChainID: operations.DefaultL1ChainID, + PrivateKey: operations.DefaultSequencerPrivateKey, + }, + { + Name: l2NetworkName, + URL: l2NetworkURL, + ChainID: operations.DefaultL2ChainID, + PrivateKey: operations.DefaultSequencerPrivateKey, + }, + } + + results := map[string]json.RawMessage{} + + type testCase struct { + name string + blockNumberOrHash string + prepare func(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) + createSignedTx func(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) + } + testCases := []testCase{ + // successful transactions + {name: "eth transfer by number", blockNumberOrHash: "number", createSignedTx: createEthTransferSignedTx}, + {name: "sc deployment by number", blockNumberOrHash: "number", createSignedTx: createScDeploySignedTx}, + {name: "sc call by number", blockNumberOrHash: "number", prepare: prepareScCall, createSignedTx: createScCallSignedTx}, + {name: "erc20 transfer by number", blockNumberOrHash: "number", prepare: prepareERC20Transfer, createSignedTx: createERC20TransferSignedTx}, + + {name: "eth transfer by hash", blockNumberOrHash: "hash", createSignedTx: createEthTransferSignedTx}, + {name: "sc deployment by hash", blockNumberOrHash: "hash", createSignedTx: createScDeploySignedTx}, + {name: "sc call by hash", blockNumberOrHash: "hash", prepare: prepareScCall, createSignedTx: createScCallSignedTx}, + {name: "erc20 transfer by hash", blockNumberOrHash: "hash", prepare: prepareERC20Transfer, createSignedTx: createERC20TransferSignedTx}, + // failed transactions + {name: "sc deployment reverted by number", blockNumberOrHash: "number", createSignedTx: createScDeployRevertedSignedTx}, + {name: "sc call reverted by number", blockNumberOrHash: "number", prepare: prepareScCallReverted, createSignedTx: createScCallRevertedSignedTx}, + {name: "erc20 transfer reverted by number", blockNumberOrHash: "number", prepare: prepareERC20TransferReverted, createSignedTx: createERC20TransferRevertedSignedTx}, + + {name: "sc deployment reverted by hash", blockNumberOrHash: "hash", createSignedTx: createScDeployRevertedSignedTx}, + {name: "sc call reverted by hash", blockNumberOrHash: "hash", prepare: prepareScCallReverted, createSignedTx: createScCallRevertedSignedTx}, + {name: "erc20 transfer reverted by hash", blockNumberOrHash: "hash", prepare: prepareERC20TransferReverted, createSignedTx: createERC20TransferRevertedSignedTx}, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + for _, network := range networks { + log.Debugf(network.Name) + client := operations.MustGetClient(network.URL) + auth := operations.MustGetAuth(network.PrivateKey, network.ChainID) + + var customData map[string]interface{} + if tc.prepare != nil { + customData, err = tc.prepare(t, ctx, auth, client) + require.NoError(t, err) + } + + signedTx, err := tc.createSignedTx(t, ctx, auth, client, customData) + require.NoError(t, err) + + err = client.SendTransaction(ctx, signedTx) + require.NoError(t, err) + + log.Debugf("tx sent: %v", signedTx.Hash().String()) + + err = operations.WaitTxToBeMined(ctx, client, signedTx, operations.DefaultTimeoutTxToBeMined) + if err != nil && !strings.HasPrefix(err.Error(), "transaction has failed, reason:") { + require.NoError(t, err) + } + + receipt, err := client.TransactionReceipt(ctx, signedTx.Hash()) + require.NoError(t, err) + + debugOptions := map[string]interface{}{ + "disableStorage": false, + "disableStack": false, + "enableMemory": true, + "enableReturnData": true, + } + + var response jsonrpc.Response + if tc.blockNumberOrHash == "number" { + response, err = jsonrpc.JSONRPCCall(network.URL, "debug_traceBlockByNumber", hex.EncodeBig(receipt.BlockNumber), debugOptions) + } else { + response, err = jsonrpc.JSONRPCCall(network.URL, "debug_traceBlockByHash", receipt.BlockHash.String(), debugOptions) + } + require.NoError(t, err) + require.Nil(t, response.Error) + require.NotNil(t, response.Result) + + results[network.Name] = response.Result + } + + referenceTransactions := []interface{}{} + err = json.Unmarshal(results[l1NetworkName], &referenceTransactions) + require.NoError(t, err) + + for networkName, result := range results { + if networkName == l1NetworkName { + continue + } + + resultTransactions := []interface{}{} + err = json.Unmarshal(result, &resultTransactions) + require.NoError(t, err) + + for transactionIndex := range referenceTransactions { + referenceTransactionMap := referenceTransactions[transactionIndex].(map[string]interface{}) + referenceResultMap := referenceTransactionMap["result"].(map[string]interface{}) + referenceStructLogsMap := referenceResultMap["structLogs"].([]interface{}) + + resultTransactionMap := resultTransactions[transactionIndex].(map[string]interface{}) + resultResultMap := resultTransactionMap["result"].(map[string]interface{}) + resultStructLogsMap := resultResultMap["structLogs"].([]interface{}) + + require.Equal(t, len(referenceStructLogsMap), len(resultStructLogsMap)) + + for structLogIndex := range referenceStructLogsMap { + referenceStructLogMap := referenceStructLogsMap[structLogIndex].(map[string]interface{}) + resultStructLogMap := resultStructLogsMap[structLogIndex].(map[string]interface{}) + + require.Equal(t, referenceStructLogMap["pc"], resultStructLogMap["pc"], fmt.Sprintf("invalid struct log pc for network %s", networkName)) + require.Equal(t, referenceStructLogMap["op"], resultStructLogMap["op"], fmt.Sprintf("invalid struct log op for network %s", networkName)) + require.Equal(t, referenceStructLogMap["depth"], resultStructLogMap["depth"], fmt.Sprintf("invalid struct log depth for network %s", networkName)) + + pc := referenceStructLogMap["pc"] + op := referenceStructLogMap["op"] + + referenceStack, found := referenceStructLogMap["stack"].([]interface{}) + if found { + resultStack := resultStructLogMap["stack"].([]interface{}) + + require.Equal(t, len(referenceStack), len(resultStack), fmt.Sprintf("stack size doesn't match for pc %v op %v", pc, op)) + for stackIndex := range referenceStack { + require.Equal(t, referenceStack[stackIndex], resultStack[stackIndex], fmt.Sprintf("stack index %v doesn't match for pc %v op %v", stackIndex, pc, op)) + } + } + + referenceMemory, found := referenceStructLogMap["memory"].([]interface{}) + if found { + resultMemory := resultStructLogMap["memory"].([]interface{}) + + require.Equal(t, len(referenceMemory), len(resultMemory), fmt.Sprintf("memory size doesn't match for pc %v op %v", pc, op)) + for memoryIndex := range referenceMemory { + require.Equal(t, referenceMemory[memoryIndex], resultMemory[memoryIndex], fmt.Sprintf("memory index %v doesn't match for pc %v op %v", memoryIndex, pc, op)) + } + } + + referenceStorage, found := referenceStructLogMap["storage"].(map[string]interface{}) + if found { + resultStorage := resultStructLogMap["storage"].(map[string]interface{}) + + require.Equal(t, len(referenceStorage), len(resultStorage), fmt.Sprintf("storage size doesn't match for pc %v op %v", pc, op)) + for storageKey, referenceStorageValue := range referenceStorage { + resultStorageValue, found := resultStorage[storageKey] + require.True(t, found, "storage address not found") + require.Equal(t, referenceStorageValue, resultStorageValue, fmt.Sprintf("storage value doesn't match for address %v for pc %v op %v", storageKey, pc, op)) + } + } + } + } + } + }) + } +} + +func createEthTransferSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + nonce, err := client.PendingNonceAt(ctx, auth.From) + require.NoError(t, err) + + gasPrice, err := client.SuggestGasPrice(ctx) + require.NoError(t, err) + + to := common.HexToAddress("0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98") + + gas, err := client.EstimateGas(ctx, ethereum.CallMsg{ + From: auth.From, + To: &to, + }) + require.NoError(t, err) + + tx := types.NewTx(&types.LegacyTx{ + Nonce: nonce, + To: &to, + GasPrice: gasPrice, + Gas: gas, + }) + + return auth.Signer(auth.From, tx) +} + +func createScDeploySignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + nonce, err := client.PendingNonceAt(ctx, auth.From) + require.NoError(t, err) + + gasPrice, err := client.SuggestGasPrice(ctx) + require.NoError(t, err) + + scByteCode, err := testutils.ReadBytecode("Counter/Counter.bin") + require.NoError(t, err) + data := common.Hex2Bytes(scByteCode) + + gas, err := client.EstimateGas(ctx, ethereum.CallMsg{ + From: auth.From, + Data: data, + }) + require.NoError(t, err) + + tx := types.NewTx(&types.LegacyTx{ + Nonce: nonce, + GasPrice: gasPrice, + Gas: gas, + Data: data, + }) + + return auth.Signer(auth.From, tx) +} + +func prepareScCall(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) { + _, tx, sc, err := EmitLog.DeployEmitLog(auth, client) + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + return map[string]interface{}{ + "sc": sc, + }, nil +} + +func createScCallSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + scInterface := customData["sc"] + sc := scInterface.(*EmitLog.EmitLog) + + opts := *auth + opts.NoSend = true + + tx, err := sc.EmitLogs(&opts) + require.NoError(t, err) + + return tx, nil +} + +func prepareERC20Transfer(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) { + _, tx, sc, err := ERC20.DeployERC20(auth, client, "MyToken", "MT") + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + tx, err = sc.Mint(auth, big.NewInt(1000000000)) + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + return map[string]interface{}{ + "sc": sc, + }, nil +} + +func createERC20TransferSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + scInterface := customData["sc"] + sc := scInterface.(*ERC20.ERC20) + + opts := *auth + opts.NoSend = true + + to := common.HexToAddress("0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98") + + tx, err := sc.Transfer(&opts, to, big.NewInt(123456)) + require.NoError(t, err) + + return tx, nil +} + +func createScDeployRevertedSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + nonce, err := client.PendingNonceAt(ctx, auth.From) + require.NoError(t, err) + + gasPrice, err := client.SuggestGasPrice(ctx) + require.NoError(t, err) + + scByteCode, err := testutils.ReadBytecode("Revert/Revert.bin") + require.NoError(t, err) + data := common.Hex2Bytes(scByteCode) + + tx := types.NewTx(&types.LegacyTx{ + Nonce: nonce, + GasPrice: gasPrice, + Gas: fixedTxGasLimit, + Data: data, + }) + + return auth.Signer(auth.From, tx) +} + +func prepareScCallReverted(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) { + _, tx, sc, err := Revert2.DeployRevert2(auth, client) + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + return map[string]interface{}{ + "sc": sc, + }, nil +} + +func createScCallRevertedSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + scInterface := customData["sc"] + sc := scInterface.(*Revert2.Revert2) + + opts := *auth + opts.NoSend = true + opts.GasLimit = fixedTxGasLimit + + tx, err := sc.GenerateError(&opts) + require.NoError(t, err) + + return tx, nil +} + +func prepareERC20TransferReverted(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client) (map[string]interface{}, error) { + _, tx, sc, err := ERC20.DeployERC20(auth, client, "MyToken2", "MT2") + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + err = operations.WaitTxToBeMined(ctx, client, tx, operations.DefaultTimeoutTxToBeMined) + require.NoError(t, err) + + return map[string]interface{}{ + "sc": sc, + }, nil +} + +func createERC20TransferRevertedSignedTx(t *testing.T, ctx context.Context, auth *bind.TransactOpts, client *ethclient.Client, customData map[string]interface{}) (*types.Transaction, error) { + scInterface := customData["sc"] + sc := scInterface.(*ERC20.ERC20) + + opts := *auth + opts.NoSend = true + opts.GasLimit = fixedTxGasLimit + + to := common.HexToAddress("0x1275fbb540c8efc58b812ba83b0d0b8b9917ae98") + + tx, err := sc.Transfer(&opts, to, big.NewInt(123456)) + require.NoError(t, err) + return tx, nil } diff --git a/test/operations/manager.go b/test/operations/manager.go index 5e0b34a823..13d9b2b060 100644 --- a/test/operations/manager.go +++ b/test/operations/manager.go @@ -299,8 +299,13 @@ func (m *Manager) Setup() error { return err } + err = m.StartNode() + if err != nil { + return err + } + // Run node container - return m.StartNode() + return nil } // Teardown stops all the components. diff --git a/test/operations/wait.go b/test/operations/wait.go index 9f10e867f9..4d6eb05e01 100644 --- a/test/operations/wait.go +++ b/test/operations/wait.go @@ -201,7 +201,9 @@ func NodeUpCondition(target string) (bool, error) { r := struct { Result bool - }{} + }{ + Result: true, + } err = json.Unmarshal(body, &r) if err != nil { return false, err