diff --git a/db/migrations/state/0003.sql b/db/migrations/state/0003.sql new file mode 100644 index 0000000000..32950cadaf --- /dev/null +++ b/db/migrations/state/0003.sql @@ -0,0 +1,10 @@ +-- +migrate Up +CREATE TABLE state.debug +( + error_type VARCHAR, + timestamp timestamp, + payload VARCHAR +); + +-- +migrate Down +DROP TABLE state.debug; diff --git a/docker-compose.yml b/docker-compose.yml index 12ddfd19de..709ec5c31a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -90,7 +90,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:e3a5baf + image: hermeznetwork/zkevm-prover:9c4a1fe ports: - 50061:50061 # MT - 50071:50071 # Executor diff --git a/proto/src/proto/executor/v1/executor.proto b/proto/src/proto/executor/v1/executor.proto index 930e6c636f..9ba880915b 100644 --- a/proto/src/proto/executor/v1/executor.proto +++ b/proto/src/proto/executor/v1/executor.proto @@ -44,7 +44,15 @@ message ProcessBatchResponse { uint32 cnt_steps = 11; uint64 cumulative_gas_used = 12; repeated ProcessTransactionResponse responses = 13; - Error error = 14; + ExecutorError error = 14; + map read_write_addresses = 15; +} + +message InfoReadWrite { + // If nonce="" then it has not been set; if set, string is in decimal (base 10) + string nonce = 1; + // If balance="" then it has not been set; if set, string is in decimal (base 10) + string balance = 2; } message CallTrace { @@ -102,7 +110,7 @@ message TransactionStep { // Contract information Contract contract = 11; // Error - Error error = 12; + RomError error = 12; } message Contract { @@ -131,7 +139,7 @@ message ProcessTransactionResponse { // Total gas refunded as result of execution uint64 gas_refunded = 7; // Any error encountered during the execution - Error error = 8; + RomError error = 8; // New SC Address in case of SC creation string create_address = 9; // State Root @@ -186,63 +194,81 @@ message ExecutionTraceStep { // Gas refund uint64 gas_refund = 11; // Error - Error error = 12; + RomError error = 12; } -enum Error { - ERROR_UNSPECIFIED = 0; - // ERROR_NO_ERROR indicates the execution ended successfully - ERROR_NO_ERROR = 1; - // ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution - ERROR_OUT_OF_GAS = 2; - // ERROR_STACK_OVERFLOW indicates a stack overflow has happened - ERROR_STACK_OVERFLOW = 3; - // ERROR_STACK_UNDERFLOW indicates a stack overflow has happened - ERROR_STACK_UNDERFLOW = 4; - // ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum - ERROR_MAX_CODE_SIZE_EXCEEDED = 5; - // ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses - ERROR_CONTRACT_ADDRESS_COLLISION = 6; - // ERROR_EXECUTION_REVERTED indicates the execution has been reverted - ERROR_EXECUTION_REVERTED = 7; - // ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution - ERROR_OUT_OF_COUNTERS_STEP = 8; - // ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution - ERROR_OUT_OF_COUNTERS_KECCAK = 9; - // ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution - ERROR_OUT_OF_COUNTERS_BINARY = 10; - // ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution - ERROR_OUT_OF_COUNTERS_MEM = 11; - // ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution - ERROR_OUT_OF_COUNTERS_ARITH = 12; - // ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution - ERROR_OUT_OF_COUNTERS_PADDING = 13; - // ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution - ERROR_OUT_OF_COUNTERS_POSEIDON = 14; - // ERROR_INVALID_JUMP indicates there is an invalid jump opcode - ERROR_INVALID_JUMP = 15; - // ERROR_INVALID_OPCODE indicates there is an invalid opcode - ERROR_INVALID_OPCODE = 16; - // ERROR_INVALID_STATIC indicates there is an invalid static call - ERROR_INVALID_STATIC = 17; - // ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF - ERROR_INVALID_BYTECODE_STARTS_EF = 18; - // ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check - ERROR_INTRINSIC_INVALID_SIGNATURE = 19; - // ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check - ERROR_INTRINSIC_INVALID_CHAIN_ID = 20; - // ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check - ERROR_INTRINSIC_INVALID_NONCE = 21; - // ERROR_INTRINSIC_INVALID_GAS indicates the transaction is failing at the gas limit intrinsic check - ERROR_INTRINSIC_INVALID_GAS_LIMIT = 22; - // ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check - ERROR_INTRINSIC_INVALID_BALANCE = 23; - // ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit - ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT = 24; - // ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the transaction sender is invalid - ERROR_INTRINSIC_INVALID_SENDER_CODE = 25; - // ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 - ERROR_INTRINSIC_TX_GAS_OVERFLOW = 26; - // ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed - ERROR_BATCH_DATA_TOO_BIG = 27; -} \ No newline at end of file +enum RomError { + ROM_ERROR_UNSPECIFIED = 0; + // ROM_ERROR_NO_ERROR indicates the execution ended successfully + ROM_ERROR_NO_ERROR = 1; + // ROM_ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution + ROM_ERROR_OUT_OF_GAS = 2; + // ROM_ERROR_STACK_OVERFLOW indicates a stack overflow has happened + ROM_ERROR_STACK_OVERFLOW = 3; + // ROM_ERROR_STACK_UNDERFLOW indicates a stack overflow has happened + ROM_ERROR_STACK_UNDERFLOW = 4; + // ROM_ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum + ROM_ERROR_MAX_CODE_SIZE_EXCEEDED = 5; + // ROM_ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses + ROM_ERROR_CONTRACT_ADDRESS_COLLISION = 6; + // ROM_ERROR_EXECUTION_REVERTED indicates the execution has been reverted + ROM_ERROR_EXECUTION_REVERTED = 7; + // ROM_ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_STEP = 8; + // ROM_ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_KECCAK = 9; + // ROM_ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_BINARY = 10; + // ROM_ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_MEM = 11; + // ROM_ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_ARITH = 12; + // ROM_ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_PADDING = 13; + // ROM_ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_POSEIDON = 14; + // ROM_ERROR_INVALID_JUMP indicates there is an invalid jump opcode + ROM_ERROR_INVALID_JUMP = 15; + // ROM_ERROR_INVALID_OPCODE indicates there is an invalid opcode + ROM_ERROR_INVALID_OPCODE = 16; + // ROM_ERROR_INVALID_STATIC indicates there is an invalid static call + ROM_ERROR_INVALID_STATIC = 17; + // ROM_ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF + ROM_ERROR_INVALID_BYTECODE_STARTS_EF = 18; + // ROM_ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check + ROM_ERROR_INTRINSIC_INVALID_SIGNATURE = 19; + // ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check + ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID = 20; + // ROM_ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check + ROM_ERROR_INTRINSIC_INVALID_NONCE = 21; + // ROM_ERROR_INTRINSIC_INVALID_GAS indicates the transaction is failing at the gas limit intrinsic check + ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT = 22; + // ROM_ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check + ROM_ERROR_INTRINSIC_INVALID_BALANCE = 23; + // ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit + ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT = 24; + // ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the transaction sender is invalid + ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE = 25; + // ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 + ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW = 26; + // ROM_ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed + ROM_ERROR_BATCH_DATA_TOO_BIG = 27; +} + +enum ExecutorError { + EXECUTOR_ERROR_UNSPECIFIED = 0; + // EXECUTOR_ERROR_NO_ERROR indicates there was no error + EXECUTOR_ERROR_NO_ERROR = 1; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK indicates that the keccak counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK = 2; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY indicates that the binary counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY = 3; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM indicates that the memory align counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM = 4; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH indicates that the arith counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH = 5; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING indicates that the padding counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING = 6; + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON indicates that the poseidon counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON = 7; +} diff --git a/sequencer/sequencer_internal_test.go b/sequencer/sequencer_internal_test.go index 7657aab449..d0b615dc20 100644 --- a/sequencer/sequencer_internal_test.go +++ b/sequencer/sequencer_internal_test.go @@ -207,11 +207,11 @@ func TestProcessBatch(t *testing.T) { } processBatchResponse := &state.ProcessBatchResponse{ - CumulativeGasUsed: 100000, - IsBatchProcessed: true, - Responses: txsBatch1, - NewStateRoot: common.HexToHash("0x123"), - NewLocalExitRoot: common.HexToHash("0x123"), + UsedZkCounters: state.ZKCounters{CumulativeGasUsed: 100000}, + IsBatchProcessed: true, + Responses: txsBatch1, + NewStateRoot: common.HexToHash("0x123"), + NewLocalExitRoot: common.HexToHash("0x123"), } st.On("GetLastBatchNumber", ctx, dbTx).Return(lastBatchNumber, nil) st.On("ProcessSequencerBatch", ctx, lastBatchNumber, s.sequenceInProgress.Txs, dbTx).Return(processBatchResponse, nil) @@ -248,11 +248,11 @@ func TestReprocessBatch(t *testing.T) { } processBatchResponse := &state.ProcessBatchResponse{ - CumulativeGasUsed: 100000, - IsBatchProcessed: true, - Responses: txsBatch1, - NewStateRoot: common.HexToHash("0x123"), - NewLocalExitRoot: common.HexToHash("0x123"), + UsedZkCounters: state.ZKCounters{CumulativeGasUsed: 100000}, + IsBatchProcessed: true, + Responses: txsBatch1, + NewStateRoot: common.HexToHash("0x123"), + NewLocalExitRoot: common.HexToHash("0x123"), } processedTxs, processedTxsHashes, unprocessedTxs, unprocessedTxsHashes := state.DetermineProcessedTransactions(processBatchResponse.Responses) @@ -310,11 +310,11 @@ func TestUpdateTxsInPool(t *testing.T) { } processBatchResponse := &state.ProcessBatchResponse{ - CumulativeGasUsed: 100000, - IsBatchProcessed: true, - Responses: txsBatch1, - NewStateRoot: common.HexToHash("0x123"), - NewLocalExitRoot: common.HexToHash("0x123"), + UsedZkCounters: state.ZKCounters{CumulativeGasUsed: 100000}, + IsBatchProcessed: true, + Responses: txsBatch1, + NewStateRoot: common.HexToHash("0x123"), + NewLocalExitRoot: common.HexToHash("0x123"), } processedTxs, processedTxsHashes, unprocessedTxs, unprocessedTxsHashes := state.DetermineProcessedTransactions(processBatchResponse.Responses) @@ -412,11 +412,11 @@ func TestTryToProcessTxs(t *testing.T) { } processBatchResponse := &state.ProcessBatchResponse{ - CumulativeGasUsed: 100000, - IsBatchProcessed: true, - Responses: txsBatch1, - NewStateRoot: common.HexToHash("0x123"), - NewLocalExitRoot: common.HexToHash("0x123"), + UsedZkCounters: state.ZKCounters{CumulativeGasUsed: 100000}, + IsBatchProcessed: true, + Responses: txsBatch1, + NewStateRoot: common.HexToHash("0x123"), + NewLocalExitRoot: common.HexToHash("0x123"), } var txs = s.sequenceInProgress.Txs txs = append(txs, poolTxs[0].Transaction) diff --git a/state/converters.go b/state/converters.go index 539ab8829e..bbb34d1d5b 100644 --- a/state/converters.go +++ b/state/converters.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" + "github.com/0xPolygonHermez/zkevm-node/encoding" "github.com/0xPolygonHermez/zkevm-node/hex" "github.com/0xPolygonHermez/zkevm-node/log" "github.com/0xPolygonHermez/zkevm-node/state/runtime/executor" @@ -25,34 +26,68 @@ func convertToProcessBatchResponse(txs []types.Transaction, response *pb.Process return nil, err } - isBatchProcessed := true - if len(response.Responses) > 0 { + readWriteAddresses, err := convertToReadWriteAddresses(response.ReadWriteAddresses) + if err != nil { + return nil, err + } + + isBatchProcessed := response.Error == executor.EXECUTOR_ERROR_NO_ERROR + if isBatchProcessed && len(response.Responses) > 0 { // Check out of counters errorToCheck := response.Responses[len(response.Responses)-1].Error - isBatchProcessed = !executor.IsOutOfCountersError(errorToCheck) + isBatchProcessed = !executor.IsROMOutOfCountersError(errorToCheck) } return &ProcessBatchResponse{ - NewStateRoot: common.BytesToHash(response.NewStateRoot), - NewAccInputHash: common.BytesToHash(response.NewAccInputHash), - NewLocalExitRoot: common.BytesToHash(response.NewLocalExitRoot), - NewBatchNumber: response.NewBatchNum, - CntKeccakHashes: response.CntKeccakHashes, - CntPoseidonHashes: response.CntPoseidonHashes, - CntPoseidonPaddings: response.CntPoseidonPaddings, - CntMemAligns: response.CntMemAligns, - CntArithmetics: response.CntArithmetics, - CntBinaries: response.CntBinaries, - CntSteps: response.CntSteps, - CumulativeGasUsed: response.CumulativeGasUsed, - Responses: responses, - Error: executor.Err(response.Error), - IsBatchProcessed: isBatchProcessed, + NewStateRoot: common.BytesToHash(response.NewStateRoot), + NewAccInputHash: common.BytesToHash(response.NewAccInputHash), + NewLocalExitRoot: common.BytesToHash(response.NewLocalExitRoot), + NewBatchNumber: response.NewBatchNum, + UsedZkCounters: convertToCounters(response), + Responses: responses, + ExecutorError: executor.ExecutorErr(response.Error), + IsBatchProcessed: isBatchProcessed, + ReadWriteAddresses: readWriteAddresses, }, nil } -func isProcessed(err pb.Error) bool { - return !executor.IsIntrinsicError(err) && !executor.IsOutOfCountersError(err) +func isProcessed(err pb.RomError) bool { + return !executor.IsIntrinsicError(err) && !executor.IsROMOutOfCountersError(err) +} + +func convertToReadWriteAddresses(addresses map[string]*pb.InfoReadWrite) ([]*InfoReadWrite, error) { + results := make([]*InfoReadWrite, 0, len(addresses)) + + for addr, addrInfo := range addresses { + var nonce *uint64 = nil + var balance *big.Int = nil + var ok bool + + address := common.HexToAddress(addr) + + if addrInfo.Nonce != "" { + bigNonce, ok := new(big.Int).SetString(addrInfo.Nonce, encoding.Base10) + if !ok { + log.Debugf("received nonce as string: %v", addrInfo.Nonce) + return nil, fmt.Errorf("error while parsing address nonce") + } + nonceNp := bigNonce.Uint64() + nonce = &nonceNp + } + + if addrInfo.Balance != "" { + balance, ok = new(big.Int).SetString(addrInfo.Balance, encoding.Base10) + if !ok { + log.Debugf("received balance as string: %v", addrInfo.Balance) + return nil, fmt.Errorf("error while parsing address balance") + } + } + + result := &InfoReadWrite{Address: address, Nonce: nonce, Balance: balance} + results = append(results, result) + } + + return results, nil } func convertToProcessTransactionResponse(txs []types.Transaction, responses []*pb.ProcessTransactionResponse) ([]*ProcessTransactionResponse, error) { @@ -70,20 +105,27 @@ func convertToProcessTransactionResponse(txs []types.Transaction, responses []*p result.GasLeft = response.GasLeft result.GasUsed = response.GasUsed result.GasRefunded = response.GasRefunded - result.Error = executor.Err(response.Error) + result.RomError = executor.RomErr(response.Error) result.CreateAddress = common.HexToAddress(response.CreateAddress) result.StateRoot = common.BytesToHash(response.StateRoot) result.Logs = convertToLog(response.Logs) result.IsProcessed = isProcessed(response.Error) result.ExecutionTrace = *trace result.CallTrace = convertToExecutorTrace(response.CallTrace) - result.Tx = txs[i] + + tx, err := DecodeTx(common.Bytes2Hex(response.GetRlpTx())) + if err != nil { + return nil, err + } + + result.Tx = *tx + results = append(results, result) log.Debugf("ProcessTransactionResponse[TxHash]: %v", txs[i].Hash().String()) log.Debugf("ProcessTransactionResponse[Nonce]: %v", txs[i].Nonce()) log.Debugf("ProcessTransactionResponse[StateRoot]: %v", result.StateRoot.String()) - log.Debugf("ProcessTransactionResponse[Error]: %v", result.Error) + log.Debugf("ProcessTransactionResponse[Error]: %v", result.RomError) log.Debugf("ProcessTransactionResponse[GasUsed]: %v", result.GasUsed) log.Debugf("ProcessTransactionResponse[GasLeft]: %v", result.GasLeft) log.Debugf("ProcessTransactionResponse[GasRefunded]: %v", result.GasRefunded) @@ -141,7 +183,7 @@ func convertToStructLogArray(responses []*pb.ExecutionTraceStep) (*[]instrumenta result.Storage = convertToProperMap(response.Storage) result.Depth = int(response.Depth) result.RefundCounter = response.GasRefund - result.Err = executor.Err(response.Error) + result.Err = executor.RomErr(response.Error) results = append(results, *result) } @@ -156,7 +198,7 @@ func convertToBigIntArray(responses []string) ([]*big.Int, error) { if ok { results = append(results, result) } else { - return nil, fmt.Errorf("String %s is not valid", response) + return nil, fmt.Errorf("string %s is not valid", response) } } return results, nil @@ -207,7 +249,7 @@ func convertToInstrumentationSteps(responses []*pb.TransactionStep) []instrument step.OpCode = fakevm.OpCode(response.Op).String() step.Refund = fmt.Sprint(response.GasRefund) step.Op = fmt.Sprint(response.Op) - err := executor.Err(response.Error) + err := executor.RomErr(response.Error) if err != nil { step.Error = err.Error() } @@ -239,3 +281,16 @@ func convertByteArrayToStringArray(responses []byte) []string { } return results } + +func convertToCounters(resp *pb.ProcessBatchResponse) ZKCounters { + return ZKCounters{ + CumulativeGasUsed: resp.CumulativeGasUsed, + UsedKeccakHashes: resp.CntKeccakHashes, + UsedPoseidonHashes: resp.CntPoseidonHashes, + UsedPoseidonPaddings: resp.CntPoseidonPaddings, + UsedMemAligns: resp.CntMemAligns, + UsedArithmetics: resp.CntArithmetics, + UsedBinaries: resp.CntBinaries, + UsedSteps: resp.CntSteps, + } +} diff --git a/state/helper.go b/state/helper.go index ea7ea20e99..58b54765f9 100644 --- a/state/helper.go +++ b/state/helper.go @@ -192,7 +192,7 @@ func generateReceipt(blockNumber *big.Int, processedTx *ProcessTransactionRespon for i := 0; i < len(receipt.Logs); i++ { receipt.Logs[i].TxHash = processedTx.Tx.Hash() } - if processedTx.Error == nil { + if processedTx.RomError == nil { receipt.Status = types.ReceiptStatusSuccessful } else { receipt.Status = types.ReceiptStatusFailed diff --git a/state/pgstatestorage.go b/state/pgstatestorage.go index 3867671207..1997c32a29 100644 --- a/state/pgstatestorage.go +++ b/state/pgstatestorage.go @@ -1966,3 +1966,12 @@ func (p *PostgresStorage) DeleteUngeneratedProofs(ctx context.Context, dbTx pgx. _, err := e.Exec(ctx, deleteUngeneratedProofsSQL) return err } + +// AddDebugInfo is used to store debug info useful during runtime +func (p *PostgresStorage) AddDebugInfo(ctx context.Context, info *DebugInfo, dbTx pgx.Tx) error { + const insertDebugInfoSQL = "INSERT INTO state.debug (error_type, timestamp, payload) VALUES ($1, $2, $3)" + + e := p.getExecQuerier(dbTx) + _, err := e.Exec(ctx, insertDebugInfoSQL, info.ErrorType, info.Timestamp, info.Payload) + return err +} diff --git a/state/runtime/executor/errors.go b/state/runtime/executor/errors.go index 42fa4f821b..fd0761d634 100644 --- a/state/runtime/executor/errors.go +++ b/state/runtime/executor/errors.go @@ -9,191 +9,259 @@ import ( ) const ( - // ERROR_UNSPECIFIED indicates the execution ended successfully - ERROR_UNSPECIFIED int32 = iota - // ERROR_NO_ERROR indicates the execution ended successfully - ERROR_NO_ERROR - // ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution - ERROR_OUT_OF_GAS - // ERROR_STACK_OVERFLOW indicates a stack overflow has happened - ERROR_STACK_OVERFLOW - // ERROR_STACK_UNDERFLOW indicates a stack overflow has happened - ERROR_STACK_UNDERFLOW - // ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum - ERROR_MAX_CODE_SIZE_EXCEEDED - // ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses - ERROR_CONTRACT_ADDRESS_COLLISION - // ERROR_EXECUTION_REVERTED indicates the execution has been reverted - ERROR_EXECUTION_REVERTED - // ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution - ERROR_OUT_OF_COUNTERS_STEP - // ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution - ERROR_OUT_OF_COUNTERS_KECCAK - // ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution - ERROR_OUT_OF_COUNTERS_BINARY - // ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution - ERROR_OUT_OF_COUNTERS_MEM - // ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution - ERROR_OUT_OF_COUNTERS_ARITH - // ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution - ERROR_OUT_OF_COUNTERS_PADDING - // ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution - ERROR_OUT_OF_COUNTERS_POSEIDON - // ERROR_INVALID_JUMP indicates there is an invalid jump opcode - ERROR_INVALID_JUMP - // ERROR_INVALID_OPCODE indicates there is an invalid opcode - ERROR_INVALID_OPCODE - // ERROR_INVALID_STATIC indicates there is an invalid static call - ERROR_INVALID_STATIC - // ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF - ERROR_INVALID_BYTECODE_STARTS_EF - // ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check - ERROR_INTRINSIC_INVALID_SIGNATURE - // ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check - ERROR_INTRINSIC_INVALID_CHAIN_ID - // ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check - ERROR_INTRINSIC_INVALID_NONCE - // ERROR_INTRINSIC_INVALID_GAS_LIMIT indicates the transaction is failing at the gas limit intrinsic check - ERROR_INTRINSIC_INVALID_GAS_LIMIT - // ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check - ERROR_INTRINSIC_INVALID_BALANCE - // ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit - ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT - // ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the batch is exceeding the batch gas limit - ERROR_INTRINSIC_INVALID_SENDER_CODE - // ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 - ERROR_INTRINSIC_TX_GAS_OVERFLOW - // ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed - ERROR_BATCH_DATA_TOO_BIG + // ROM_ERROR_UNSPECIFIED indicates the execution ended successfully + ROM_ERROR_UNSPECIFIED int32 = iota + // ROM_ERROR_NO_ERROR indicates the execution ended successfully + ROM_ERROR_NO_ERROR + // ROM_ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution + ROM_ERROR_OUT_OF_GAS + // ROM_ERROR_STACK_OVERFLOW indicates a stack overflow has happened + ROM_ERROR_STACK_OVERFLOW + // ROM_ERROR_STACK_UNDERFLOW indicates a stack overflow has happened + ROM_ERROR_STACK_UNDERFLOW + // ROM_ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum + ROM_ERROR_MAX_CODE_SIZE_EXCEEDED + // ROM_ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses + ROM_ERROR_CONTRACT_ADDRESS_COLLISION + // ROM_ERROR_EXECUTION_REVERTED indicates the execution has been reverted + ROM_ERROR_EXECUTION_REVERTED + // ROM_ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_STEP + // ROM_ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_KECCAK + // ROM_ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_BINARY + // ROM_ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_MEM + // ROM_ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_ARITH + // ROM_ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_PADDING + // ROM_ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution + ROM_ERROR_OUT_OF_COUNTERS_POSEIDON + // ROM_ERROR_INVALID_JUMP indicates there is an invalid jump opcode + ROM_ERROR_INVALID_JUMP + // ROM_ERROR_INVALID_OPCODE indicates there is an invalid opcode + ROM_ERROR_INVALID_OPCODE + // ROM_ERROR_INVALID_STATIC indicates there is an invalid static call + ROM_ERROR_INVALID_STATIC + // ROM_ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF + ROM_ERROR_INVALID_BYTECODE_STARTS_EF + // ROM_ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check + ROM_ERROR_INTRINSIC_INVALID_SIGNATURE + // ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check + ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID + // ROM_ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check + ROM_ERROR_INTRINSIC_INVALID_NONCE + // ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT indicates the transaction is failing at the gas limit intrinsic check + ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT + // ROM_ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check + ROM_ERROR_INTRINSIC_INVALID_BALANCE + // ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit + ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT + // ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the batch is exceeding the batch gas limit + ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE + // ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 + ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW + // ROM_ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed + ROM_ERROR_BATCH_DATA_TOO_BIG + // EXECUTOR_ERROR_UNSPECIFIED indicates the execution ended successfully + EXECUTOR_ERROR_UNSPECIFIED = 0 + // EXECUTOR_ERROR_NO_ERROR indicates there was no error + EXECUTOR_ERROR_NO_ERROR = 1 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK indicates that the keccak counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK = 2 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY indicates that the binary counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY = 3 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM indicates that the memory align counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM = 4 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH indicates that the arith counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH = 5 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING indicates that the padding counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING = 6 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON indicates that the poseidon counter exceeded the maximum + EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON = 7 ) -// Err returns an instance of error related to the ExecutorError -func Err(errorCode pb.Error) error { +// RomErr returns an instance of error related to the ExecutorError +func RomErr(errorCode pb.RomError) error { e := int32(errorCode) switch e { - case ERROR_NO_ERROR, ERROR_UNSPECIFIED: + case ROM_ERROR_UNSPECIFIED: + return fmt.Errorf("unspecified ROM error") + case ROM_ERROR_NO_ERROR: return nil - case ERROR_OUT_OF_GAS: + case ROM_ERROR_OUT_OF_GAS: return runtime.ErrOutOfGas - case ERROR_STACK_OVERFLOW: + case ROM_ERROR_STACK_OVERFLOW: return runtime.ErrStackOverflow - case ERROR_STACK_UNDERFLOW: + case ROM_ERROR_STACK_UNDERFLOW: return runtime.ErrStackUnderflow - case ERROR_MAX_CODE_SIZE_EXCEEDED: + case ROM_ERROR_MAX_CODE_SIZE_EXCEEDED: return runtime.ErrMaxCodeSizeExceeded - case ERROR_CONTRACT_ADDRESS_COLLISION: + case ROM_ERROR_CONTRACT_ADDRESS_COLLISION: return runtime.ErrContractAddressCollision - case ERROR_EXECUTION_REVERTED: + case ROM_ERROR_EXECUTION_REVERTED: return runtime.ErrExecutionReverted - case ERROR_OUT_OF_COUNTERS_STEP: + case ROM_ERROR_OUT_OF_COUNTERS_STEP: return runtime.ErrOutOfCountersKeccak - case ERROR_OUT_OF_COUNTERS_KECCAK: + case ROM_ERROR_OUT_OF_COUNTERS_KECCAK: return runtime.ErrOutOfCountersKeccak - case ERROR_OUT_OF_COUNTERS_BINARY: + case ROM_ERROR_OUT_OF_COUNTERS_BINARY: return runtime.ErrOutOfCountersBinary - case ERROR_OUT_OF_COUNTERS_MEM: + case ROM_ERROR_OUT_OF_COUNTERS_MEM: return runtime.ErrOutOfCountersMemory - case ERROR_OUT_OF_COUNTERS_ARITH: + case ROM_ERROR_OUT_OF_COUNTERS_ARITH: return runtime.ErrOutOfCountersArith - case ERROR_OUT_OF_COUNTERS_PADDING: + case ROM_ERROR_OUT_OF_COUNTERS_PADDING: return runtime.ErrOutOfCountersPadding - case ERROR_OUT_OF_COUNTERS_POSEIDON: + case ROM_ERROR_OUT_OF_COUNTERS_POSEIDON: return runtime.ErrOutOfCountersPoseidon - case ERROR_INVALID_JUMP: + case ROM_ERROR_INVALID_JUMP: return runtime.ErrInvalidJump - case ERROR_INVALID_OPCODE: + case ROM_ERROR_INVALID_OPCODE: return runtime.ErrInvalidOpCode - case ERROR_INVALID_STATIC: + case ROM_ERROR_INVALID_STATIC: return runtime.ErrInvalidStatic - case ERROR_INVALID_BYTECODE_STARTS_EF: + case ROM_ERROR_INVALID_BYTECODE_STARTS_EF: return runtime.ErrInvalidByteCodeStartsEF - case ERROR_INTRINSIC_INVALID_SIGNATURE: + case ROM_ERROR_INTRINSIC_INVALID_SIGNATURE: return runtime.ErrIntrinsicInvalidSignature - case ERROR_INTRINSIC_INVALID_CHAIN_ID: + case ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID: return runtime.ErrIntrinsicInvalidChainID - case ERROR_INTRINSIC_INVALID_NONCE: + case ROM_ERROR_INTRINSIC_INVALID_NONCE: return runtime.ErrIntrinsicInvalidNonce - case ERROR_INTRINSIC_INVALID_GAS_LIMIT: + case ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT: return runtime.ErrIntrinsicInvalidGasLimit - case ERROR_INTRINSIC_INVALID_BALANCE: + case ROM_ERROR_INTRINSIC_INVALID_BALANCE: return runtime.ErrIntrinsicInvalidBalance - case ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT: + case ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT: return runtime.ErrIntrinsicInvalidGasLimit - case ERROR_INTRINSIC_INVALID_SENDER_CODE: + case ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE: return runtime.ErrIntrinsicInvalidSenderCode - case ERROR_INTRINSIC_TX_GAS_OVERFLOW: + case ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW: return runtime.ErrIntrinsicInvalidTxGasOverflow - case ERROR_BATCH_DATA_TOO_BIG: + case ROM_ERROR_BATCH_DATA_TOO_BIG: return runtime.ErrBatchDataTooBig } return fmt.Errorf("unknown error") } -// ErrorCode returns the error code for a given error -func ErrorCode(err error) pb.Error { +// RomErrorCode returns the error code for a given error +func RomErrorCode(err error) pb.RomError { switch err { case nil: - return pb.Error(ERROR_NO_ERROR) + return pb.RomError(ROM_ERROR_NO_ERROR) case runtime.ErrOutOfGas: - return pb.Error(ERROR_OUT_OF_GAS) + return pb.RomError(ROM_ERROR_OUT_OF_GAS) case runtime.ErrStackOverflow: - return pb.Error(ERROR_STACK_OVERFLOW) + return pb.RomError(ROM_ERROR_STACK_OVERFLOW) case runtime.ErrStackUnderflow: - return pb.Error(ERROR_STACK_UNDERFLOW) + return pb.RomError(ROM_ERROR_STACK_UNDERFLOW) case runtime.ErrMaxCodeSizeExceeded: - return pb.Error(ERROR_MAX_CODE_SIZE_EXCEEDED) + return pb.RomError(ROM_ERROR_MAX_CODE_SIZE_EXCEEDED) case runtime.ErrContractAddressCollision: - return pb.Error(ERROR_CONTRACT_ADDRESS_COLLISION) + return pb.RomError(ROM_ERROR_CONTRACT_ADDRESS_COLLISION) case runtime.ErrExecutionReverted: - return pb.Error(ERROR_EXECUTION_REVERTED) + return pb.RomError(ROM_ERROR_EXECUTION_REVERTED) case runtime.ErrOutOfCountersKeccak: - return pb.Error(ERROR_OUT_OF_COUNTERS_KECCAK) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_KECCAK) case runtime.ErrOutOfCountersBinary: - return pb.Error(ERROR_OUT_OF_COUNTERS_BINARY) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_BINARY) case runtime.ErrOutOfCountersMemory: - return pb.Error(ERROR_OUT_OF_COUNTERS_MEM) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_MEM) case runtime.ErrOutOfCountersArith: - return pb.Error(ERROR_OUT_OF_COUNTERS_ARITH) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_ARITH) case runtime.ErrOutOfCountersPadding: - return pb.Error(ERROR_OUT_OF_COUNTERS_PADDING) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_PADDING) case runtime.ErrOutOfCountersPoseidon: - return pb.Error(ERROR_OUT_OF_COUNTERS_POSEIDON) + return pb.RomError(ROM_ERROR_OUT_OF_COUNTERS_POSEIDON) case runtime.ErrInvalidJump: - return pb.Error(ERROR_INVALID_JUMP) + return pb.RomError(ROM_ERROR_INVALID_JUMP) case runtime.ErrInvalidOpCode: - return pb.Error(ERROR_INVALID_OPCODE) + return pb.RomError(ROM_ERROR_INVALID_OPCODE) case runtime.ErrInvalidStatic: - return pb.Error(ERROR_INVALID_STATIC) + return pb.RomError(ROM_ERROR_INVALID_STATIC) case runtime.ErrInvalidByteCodeStartsEF: - return pb.Error(ERROR_INVALID_BYTECODE_STARTS_EF) + return pb.RomError(ROM_ERROR_INVALID_BYTECODE_STARTS_EF) case runtime.ErrIntrinsicInvalidSignature: - return pb.Error(ERROR_INTRINSIC_INVALID_SIGNATURE) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_SIGNATURE) case runtime.ErrIntrinsicInvalidChainID: - return pb.Error(ERROR_INTRINSIC_INVALID_CHAIN_ID) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID) case runtime.ErrIntrinsicInvalidNonce: - return pb.Error(ERROR_INTRINSIC_INVALID_NONCE) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_NONCE) case runtime.ErrIntrinsicInvalidGasLimit: - return pb.Error(ERROR_INTRINSIC_INVALID_GAS_LIMIT) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT) case runtime.ErrIntrinsicInvalidBalance: - return pb.Error(ERROR_INTRINSIC_INVALID_BALANCE) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_BALANCE) case runtime.ErrIntrinsicInvalidGasLimit: - return pb.Error(ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT) case runtime.ErrIntrinsicInvalidSenderCode: - return pb.Error(ERROR_INTRINSIC_INVALID_SENDER_CODE) + return pb.RomError(ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE) case runtime.ErrIntrinsicInvalidTxGasOverflow: - return pb.Error(ERROR_INTRINSIC_TX_GAS_OVERFLOW) + return pb.RomError(ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW) case runtime.ErrBatchDataTooBig: - return pb.Error(ERROR_BATCH_DATA_TOO_BIG) + return pb.RomError(ROM_ERROR_BATCH_DATA_TOO_BIG) } return math.MaxInt32 } -// IsOutOfCountersError indicates if the error is an OOC -func IsOutOfCountersError(error pb.Error) bool { - return int32(error) >= ERROR_OUT_OF_COUNTERS_STEP && int32(error) <= ERROR_OUT_OF_COUNTERS_POSEIDON +// IsROMOutOfCountersError indicates if the error is an ROM OOC +func IsROMOutOfCountersError(error pb.RomError) bool { + return int32(error) >= ROM_ERROR_OUT_OF_COUNTERS_STEP && int32(error) <= ROM_ERROR_OUT_OF_COUNTERS_POSEIDON +} + +// IsExecutorOutOfCountersError indicates if the error is an ROM OOC +func IsExecutorOutOfCountersError(error pb.ExecutorError) bool { + return int32(error) >= EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK && int32(error) <= ROM_ERROR_OUT_OF_COUNTERS_POSEIDON } // IsIntrinsicError indicates if the error is due to a intrinsic check -func IsIntrinsicError(error pb.Error) bool { - return int32(error) >= ERROR_INTRINSIC_INVALID_SIGNATURE && int32(error) <= ERROR_INTRINSIC_TX_GAS_OVERFLOW +func IsIntrinsicError(error pb.RomError) bool { + return int32(error) >= ROM_ERROR_INTRINSIC_INVALID_SIGNATURE && int32(error) <= ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW +} + +// ExecutorErr returns an instance of error related to the ExecutorError +func ExecutorErr(errorCode pb.ExecutorError) error { + e := int32(errorCode) + switch e { + case EXECUTOR_ERROR_UNSPECIFIED: + return fmt.Errorf("unspecified executor error") + case EXECUTOR_ERROR_NO_ERROR: + return nil + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK: + return runtime.ErrOutOfCountersKeccak + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY: + return runtime.ErrOutOfCountersBinary + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM: + return runtime.ErrOutOfCountersMemory + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH: + return runtime.ErrOutOfCountersArith + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING: + return runtime.ErrOutOfCountersPadding + case EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON: + return runtime.ErrOutOfCountersPoseidon + } + return fmt.Errorf("unknown error") +} + +// ExecutorErrorCode returns the error code for a given error +func ExecutorErrorCode(err error) pb.ExecutorError { + switch err { + case nil: + return pb.ExecutorError(EXECUTOR_ERROR_NO_ERROR) + case runtime.ErrOutOfCountersKeccak: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK) + case runtime.ErrOutOfCountersBinary: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY) + case runtime.ErrOutOfCountersMemory: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM) + case runtime.ErrOutOfCountersArith: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH) + case runtime.ErrOutOfCountersPadding: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING) + case runtime.ErrOutOfCountersPoseidon: + return pb.ExecutorError(EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON) + } + return math.MaxInt32 } diff --git a/state/runtime/executor/pb/executor.pb.go b/state/runtime/executor/pb/executor.pb.go index cc5c3e968b..fab0f40dd0 100644 --- a/state/runtime/executor/pb/executor.pb.go +++ b/state/runtime/executor/pb/executor.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: executor.proto package pb @@ -20,157 +20,228 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type Error int32 +type RomError int32 const ( - Error_ERROR_UNSPECIFIED Error = 0 - // ERROR_NO_ERROR indicates the execution ended successfully - Error_ERROR_NO_ERROR Error = 1 - // ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution - Error_ERROR_OUT_OF_GAS Error = 2 - // ERROR_STACK_OVERFLOW indicates a stack overflow has happened - Error_ERROR_STACK_OVERFLOW Error = 3 - // ERROR_STACK_UNDERFLOW indicates a stack overflow has happened - Error_ERROR_STACK_UNDERFLOW Error = 4 - // ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum - Error_ERROR_MAX_CODE_SIZE_EXCEEDED Error = 5 - // ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses - Error_ERROR_CONTRACT_ADDRESS_COLLISION Error = 6 - // ERROR_EXECUTION_REVERTED indicates the execution has been reverted - Error_ERROR_EXECUTION_REVERTED Error = 7 - // ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_STEP Error = 8 - // ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_KECCAK Error = 9 - // ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_BINARY Error = 10 - // ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_MEM Error = 11 - // ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_ARITH Error = 12 - // ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_PADDING Error = 13 - // ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution - Error_ERROR_OUT_OF_COUNTERS_POSEIDON Error = 14 - // ERROR_INVALID_JUMP indicates there is an invalid jump opcode - Error_ERROR_INVALID_JUMP Error = 15 - // ERROR_INVALID_OPCODE indicates there is an invalid opcode - Error_ERROR_INVALID_OPCODE Error = 16 - // ERROR_INVALID_STATIC indicates there is an invalid static call - Error_ERROR_INVALID_STATIC Error = 17 - // ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF - Error_ERROR_INVALID_BYTECODE_STARTS_EF Error = 18 - // ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check - Error_ERROR_INTRINSIC_INVALID_SIGNATURE Error = 19 - // ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check - Error_ERROR_INTRINSIC_INVALID_CHAIN_ID Error = 20 - // ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check - Error_ERROR_INTRINSIC_INVALID_NONCE Error = 21 - // ERROR_INTRINSIC_INVALID_GAS indicates the transaction is failing at the gas limit intrinsic check - Error_ERROR_INTRINSIC_INVALID_GAS_LIMIT Error = 22 - // ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check - Error_ERROR_INTRINSIC_INVALID_BALANCE Error = 23 - // ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit - Error_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT Error = 24 - // ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the transaction sender is invalid - Error_ERROR_INTRINSIC_INVALID_SENDER_CODE Error = 25 - // ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 - Error_ERROR_INTRINSIC_TX_GAS_OVERFLOW Error = 26 - // ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed - Error_ERROR_BATCH_DATA_TOO_BIG Error = 27 + RomError_ROM_ERROR_UNSPECIFIED RomError = 0 + // ROM_ERROR_NO_ERROR indicates the execution ended successfully + RomError_ROM_ERROR_NO_ERROR RomError = 1 + // ROM_ERROR_OUT_OF_GAS indicates there is not enough balance to continue the execution + RomError_ROM_ERROR_OUT_OF_GAS RomError = 2 + // ROM_ERROR_STACK_OVERFLOW indicates a stack overflow has happened + RomError_ROM_ERROR_STACK_OVERFLOW RomError = 3 + // ROM_ERROR_STACK_UNDERFLOW indicates a stack overflow has happened + RomError_ROM_ERROR_STACK_UNDERFLOW RomError = 4 + // ROM_ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum + RomError_ROM_ERROR_MAX_CODE_SIZE_EXCEEDED RomError = 5 + // ROM_ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses + RomError_ROM_ERROR_CONTRACT_ADDRESS_COLLISION RomError = 6 + // ROM_ERROR_EXECUTION_REVERTED indicates the execution has been reverted + RomError_ROM_ERROR_EXECUTION_REVERTED RomError = 7 + // ROM_ERROR_OUT_OF_COUNTERS_STEP indicates there is not enough step counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_STEP RomError = 8 + // ROM_ERROR_OUT_OF_COUNTERS_KECCAK indicates there is not enough keccak counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_KECCAK RomError = 9 + // ROM_ERROR_OUT_OF_COUNTERS_BINARY indicates there is not enough binary counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_BINARY RomError = 10 + // ROM_ERROR_OUT_OF_COUNTERS_MEM indicates there is not enough memory aligncounters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_MEM RomError = 11 + // ROM_ERROR_OUT_OF_COUNTERS_ARITH indicates there is not enough arith counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_ARITH RomError = 12 + // ROM_ERROR_OUT_OF_COUNTERS_PADDING indicates there is not enough padding counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_PADDING RomError = 13 + // ROM_ERROR_OUT_OF_COUNTERS_POSEIDON indicates there is not enough poseidon counters to continue the execution + RomError_ROM_ERROR_OUT_OF_COUNTERS_POSEIDON RomError = 14 + // ROM_ERROR_INVALID_JUMP indicates there is an invalid jump opcode + RomError_ROM_ERROR_INVALID_JUMP RomError = 15 + // ROM_ERROR_INVALID_OPCODE indicates there is an invalid opcode + RomError_ROM_ERROR_INVALID_OPCODE RomError = 16 + // ROM_ERROR_INVALID_STATIC indicates there is an invalid static call + RomError_ROM_ERROR_INVALID_STATIC RomError = 17 + // ROM_ERROR_INVALID_BYTECODE_STARTS_EF indicates there is a bytecode starting with 0xEF + RomError_ROM_ERROR_INVALID_BYTECODE_STARTS_EF RomError = 18 + // ROM_ERROR_INTRINSIC_INVALID_SIGNATURE indicates the transaction is failing at the signature intrinsic check + RomError_ROM_ERROR_INTRINSIC_INVALID_SIGNATURE RomError = 19 + // ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID indicates the transaction is failing at the chain id intrinsic check + RomError_ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID RomError = 20 + // ROM_ERROR_INTRINSIC_INVALID_NONCE indicates the transaction is failing at the nonce intrinsic check + RomError_ROM_ERROR_INTRINSIC_INVALID_NONCE RomError = 21 + // ROM_ERROR_INTRINSIC_INVALID_GAS indicates the transaction is failing at the gas limit intrinsic check + RomError_ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT RomError = 22 + // ROM_ERROR_INTRINSIC_INVALID_BALANCE indicates the transaction is failing at balance intrinsic check + RomError_ROM_ERROR_INTRINSIC_INVALID_BALANCE RomError = 23 + // ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT indicates the batch is exceeding the batch gas limit + RomError_ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT RomError = 24 + // ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE indicates the transaction sender is invalid + RomError_ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE RomError = 25 + // ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW indicates the transaction gasLimit*gasPrice > MAX_UINT_256 - 1 + RomError_ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW RomError = 26 + // ROM_ERROR_BATCH_DATA_TOO_BIG indicates the batch_l2_data is too big to be processed + RomError_ROM_ERROR_BATCH_DATA_TOO_BIG RomError = 27 ) -// Enum value maps for Error. +// Enum value maps for RomError. var ( - Error_name = map[int32]string{ - 0: "ERROR_UNSPECIFIED", - 1: "ERROR_NO_ERROR", - 2: "ERROR_OUT_OF_GAS", - 3: "ERROR_STACK_OVERFLOW", - 4: "ERROR_STACK_UNDERFLOW", - 5: "ERROR_MAX_CODE_SIZE_EXCEEDED", - 6: "ERROR_CONTRACT_ADDRESS_COLLISION", - 7: "ERROR_EXECUTION_REVERTED", - 8: "ERROR_OUT_OF_COUNTERS_STEP", - 9: "ERROR_OUT_OF_COUNTERS_KECCAK", - 10: "ERROR_OUT_OF_COUNTERS_BINARY", - 11: "ERROR_OUT_OF_COUNTERS_MEM", - 12: "ERROR_OUT_OF_COUNTERS_ARITH", - 13: "ERROR_OUT_OF_COUNTERS_PADDING", - 14: "ERROR_OUT_OF_COUNTERS_POSEIDON", - 15: "ERROR_INVALID_JUMP", - 16: "ERROR_INVALID_OPCODE", - 17: "ERROR_INVALID_STATIC", - 18: "ERROR_INVALID_BYTECODE_STARTS_EF", - 19: "ERROR_INTRINSIC_INVALID_SIGNATURE", - 20: "ERROR_INTRINSIC_INVALID_CHAIN_ID", - 21: "ERROR_INTRINSIC_INVALID_NONCE", - 22: "ERROR_INTRINSIC_INVALID_GAS_LIMIT", - 23: "ERROR_INTRINSIC_INVALID_BALANCE", - 24: "ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT", - 25: "ERROR_INTRINSIC_INVALID_SENDER_CODE", - 26: "ERROR_INTRINSIC_TX_GAS_OVERFLOW", - 27: "ERROR_BATCH_DATA_TOO_BIG", - } - Error_value = map[string]int32{ - "ERROR_UNSPECIFIED": 0, - "ERROR_NO_ERROR": 1, - "ERROR_OUT_OF_GAS": 2, - "ERROR_STACK_OVERFLOW": 3, - "ERROR_STACK_UNDERFLOW": 4, - "ERROR_MAX_CODE_SIZE_EXCEEDED": 5, - "ERROR_CONTRACT_ADDRESS_COLLISION": 6, - "ERROR_EXECUTION_REVERTED": 7, - "ERROR_OUT_OF_COUNTERS_STEP": 8, - "ERROR_OUT_OF_COUNTERS_KECCAK": 9, - "ERROR_OUT_OF_COUNTERS_BINARY": 10, - "ERROR_OUT_OF_COUNTERS_MEM": 11, - "ERROR_OUT_OF_COUNTERS_ARITH": 12, - "ERROR_OUT_OF_COUNTERS_PADDING": 13, - "ERROR_OUT_OF_COUNTERS_POSEIDON": 14, - "ERROR_INVALID_JUMP": 15, - "ERROR_INVALID_OPCODE": 16, - "ERROR_INVALID_STATIC": 17, - "ERROR_INVALID_BYTECODE_STARTS_EF": 18, - "ERROR_INTRINSIC_INVALID_SIGNATURE": 19, - "ERROR_INTRINSIC_INVALID_CHAIN_ID": 20, - "ERROR_INTRINSIC_INVALID_NONCE": 21, - "ERROR_INTRINSIC_INVALID_GAS_LIMIT": 22, - "ERROR_INTRINSIC_INVALID_BALANCE": 23, - "ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT": 24, - "ERROR_INTRINSIC_INVALID_SENDER_CODE": 25, - "ERROR_INTRINSIC_TX_GAS_OVERFLOW": 26, - "ERROR_BATCH_DATA_TOO_BIG": 27, + RomError_name = map[int32]string{ + 0: "ROM_ERROR_UNSPECIFIED", + 1: "ROM_ERROR_NO_ERROR", + 2: "ROM_ERROR_OUT_OF_GAS", + 3: "ROM_ERROR_STACK_OVERFLOW", + 4: "ROM_ERROR_STACK_UNDERFLOW", + 5: "ROM_ERROR_MAX_CODE_SIZE_EXCEEDED", + 6: "ROM_ERROR_CONTRACT_ADDRESS_COLLISION", + 7: "ROM_ERROR_EXECUTION_REVERTED", + 8: "ROM_ERROR_OUT_OF_COUNTERS_STEP", + 9: "ROM_ERROR_OUT_OF_COUNTERS_KECCAK", + 10: "ROM_ERROR_OUT_OF_COUNTERS_BINARY", + 11: "ROM_ERROR_OUT_OF_COUNTERS_MEM", + 12: "ROM_ERROR_OUT_OF_COUNTERS_ARITH", + 13: "ROM_ERROR_OUT_OF_COUNTERS_PADDING", + 14: "ROM_ERROR_OUT_OF_COUNTERS_POSEIDON", + 15: "ROM_ERROR_INVALID_JUMP", + 16: "ROM_ERROR_INVALID_OPCODE", + 17: "ROM_ERROR_INVALID_STATIC", + 18: "ROM_ERROR_INVALID_BYTECODE_STARTS_EF", + 19: "ROM_ERROR_INTRINSIC_INVALID_SIGNATURE", + 20: "ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID", + 21: "ROM_ERROR_INTRINSIC_INVALID_NONCE", + 22: "ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT", + 23: "ROM_ERROR_INTRINSIC_INVALID_BALANCE", + 24: "ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT", + 25: "ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE", + 26: "ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW", + 27: "ROM_ERROR_BATCH_DATA_TOO_BIG", + } + RomError_value = map[string]int32{ + "ROM_ERROR_UNSPECIFIED": 0, + "ROM_ERROR_NO_ERROR": 1, + "ROM_ERROR_OUT_OF_GAS": 2, + "ROM_ERROR_STACK_OVERFLOW": 3, + "ROM_ERROR_STACK_UNDERFLOW": 4, + "ROM_ERROR_MAX_CODE_SIZE_EXCEEDED": 5, + "ROM_ERROR_CONTRACT_ADDRESS_COLLISION": 6, + "ROM_ERROR_EXECUTION_REVERTED": 7, + "ROM_ERROR_OUT_OF_COUNTERS_STEP": 8, + "ROM_ERROR_OUT_OF_COUNTERS_KECCAK": 9, + "ROM_ERROR_OUT_OF_COUNTERS_BINARY": 10, + "ROM_ERROR_OUT_OF_COUNTERS_MEM": 11, + "ROM_ERROR_OUT_OF_COUNTERS_ARITH": 12, + "ROM_ERROR_OUT_OF_COUNTERS_PADDING": 13, + "ROM_ERROR_OUT_OF_COUNTERS_POSEIDON": 14, + "ROM_ERROR_INVALID_JUMP": 15, + "ROM_ERROR_INVALID_OPCODE": 16, + "ROM_ERROR_INVALID_STATIC": 17, + "ROM_ERROR_INVALID_BYTECODE_STARTS_EF": 18, + "ROM_ERROR_INTRINSIC_INVALID_SIGNATURE": 19, + "ROM_ERROR_INTRINSIC_INVALID_CHAIN_ID": 20, + "ROM_ERROR_INTRINSIC_INVALID_NONCE": 21, + "ROM_ERROR_INTRINSIC_INVALID_GAS_LIMIT": 22, + "ROM_ERROR_INTRINSIC_INVALID_BALANCE": 23, + "ROM_ERROR_INTRINSIC_INVALID_BATCH_GAS_LIMIT": 24, + "ROM_ERROR_INTRINSIC_INVALID_SENDER_CODE": 25, + "ROM_ERROR_INTRINSIC_TX_GAS_OVERFLOW": 26, + "ROM_ERROR_BATCH_DATA_TOO_BIG": 27, } ) -func (x Error) Enum() *Error { - p := new(Error) +func (x RomError) Enum() *RomError { + p := new(RomError) *p = x return p } -func (x Error) String() string { +func (x RomError) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (Error) Descriptor() protoreflect.EnumDescriptor { +func (RomError) Descriptor() protoreflect.EnumDescriptor { return file_executor_proto_enumTypes[0].Descriptor() } -func (Error) Type() protoreflect.EnumType { +func (RomError) Type() protoreflect.EnumType { return &file_executor_proto_enumTypes[0] } -func (x Error) Number() protoreflect.EnumNumber { +func (x RomError) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use Error.Descriptor instead. -func (Error) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use RomError.Descriptor instead. +func (RomError) EnumDescriptor() ([]byte, []int) { return file_executor_proto_rawDescGZIP(), []int{0} } +type ExecutorError int32 + +const ( + ExecutorError_EXECUTOR_ERROR_UNSPECIFIED ExecutorError = 0 + // EXECUTOR_ERROR_NO_ERROR indicates there was no error + ExecutorError_EXECUTOR_ERROR_NO_ERROR ExecutorError = 1 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK indicates that the keccak counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK ExecutorError = 2 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY indicates that the binary counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY ExecutorError = 3 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM indicates that the memory align counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM ExecutorError = 4 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH indicates that the arith counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH ExecutorError = 5 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING indicates that the padding counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING ExecutorError = 6 + // EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON indicates that the poseidon counter exceeded the maximum + ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON ExecutorError = 7 +) + +// Enum value maps for ExecutorError. +var ( + ExecutorError_name = map[int32]string{ + 0: "EXECUTOR_ERROR_UNSPECIFIED", + 1: "EXECUTOR_ERROR_NO_ERROR", + 2: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK", + 3: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY", + 4: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM", + 5: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH", + 6: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING", + 7: "EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON", + } + ExecutorError_value = map[string]int32{ + "EXECUTOR_ERROR_UNSPECIFIED": 0, + "EXECUTOR_ERROR_NO_ERROR": 1, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK": 2, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_BINARY": 3, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_MEM": 4, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_ARITH": 5, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_PADDING": 6, + "EXECUTOR_ERROR_COUNTERS_OVERFLOW_POSEIDON": 7, + } +) + +func (x ExecutorError) Enum() *ExecutorError { + p := new(ExecutorError) + *p = x + return p +} + +func (x ExecutorError) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ExecutorError) Descriptor() protoreflect.EnumDescriptor { + return file_executor_proto_enumTypes[1].Descriptor() +} + +func (ExecutorError) Type() protoreflect.EnumType { + return &file_executor_proto_enumTypes[1] +} + +func (x ExecutorError) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ExecutorError.Descriptor instead. +func (ExecutorError) EnumDescriptor() ([]byte, []int) { + return file_executor_proto_rawDescGZIP(), []int{1} +} + type ProcessBatchRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -351,7 +422,8 @@ type ProcessBatchResponse struct { CntSteps uint32 `protobuf:"varint,11,opt,name=cnt_steps,json=cntSteps,proto3" json:"cnt_steps,omitempty"` CumulativeGasUsed uint64 `protobuf:"varint,12,opt,name=cumulative_gas_used,json=cumulativeGasUsed,proto3" json:"cumulative_gas_used,omitempty"` Responses []*ProcessTransactionResponse `protobuf:"bytes,13,rep,name=responses,proto3" json:"responses,omitempty"` - Error Error `protobuf:"varint,14,opt,name=error,proto3,enum=executor.v1.Error" json:"error,omitempty"` + Error ExecutorError `protobuf:"varint,14,opt,name=error,proto3,enum=executor.v1.ExecutorError" json:"error,omitempty"` + ReadWriteAddresses map[string]*InfoReadWrite `protobuf:"bytes,15,rep,name=read_write_addresses,json=readWriteAddresses,proto3" json:"read_write_addresses,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *ProcessBatchResponse) Reset() { @@ -477,11 +549,75 @@ func (x *ProcessBatchResponse) GetResponses() []*ProcessTransactionResponse { return nil } -func (x *ProcessBatchResponse) GetError() Error { +func (x *ProcessBatchResponse) GetError() ExecutorError { if x != nil { return x.Error } - return Error_ERROR_UNSPECIFIED + return ExecutorError_EXECUTOR_ERROR_UNSPECIFIED +} + +func (x *ProcessBatchResponse) GetReadWriteAddresses() map[string]*InfoReadWrite { + if x != nil { + return x.ReadWriteAddresses + } + return nil +} + +type InfoReadWrite struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // If nonce="" then it has not been set; if set, string is in decimal (base 10) + Nonce string `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"` + // If balance="" then it has not been set; if set, string is in decimal (base 10) + Balance string `protobuf:"bytes,2,opt,name=balance,proto3" json:"balance,omitempty"` +} + +func (x *InfoReadWrite) Reset() { + *x = InfoReadWrite{} + if protoimpl.UnsafeEnabled { + mi := &file_executor_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InfoReadWrite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InfoReadWrite) ProtoMessage() {} + +func (x *InfoReadWrite) 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 InfoReadWrite.ProtoReflect.Descriptor instead. +func (*InfoReadWrite) Descriptor() ([]byte, []int) { + return file_executor_proto_rawDescGZIP(), []int{2} +} + +func (x *InfoReadWrite) GetNonce() string { + if x != nil { + return x.Nonce + } + return "" +} + +func (x *InfoReadWrite) GetBalance() string { + if x != nil { + return x.Balance + } + return "" } type CallTrace struct { @@ -496,7 +632,7 @@ type CallTrace struct { func (x *CallTrace) Reset() { *x = CallTrace{} 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) } @@ -509,7 +645,7 @@ func (x *CallTrace) String() string { func (*CallTrace) ProtoMessage() {} func (x *CallTrace) 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 { @@ -522,7 +658,7 @@ func (x *CallTrace) ProtoReflect() protoreflect.Message { // Deprecated: Use CallTrace.ProtoReflect.Descriptor instead. func (*CallTrace) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{2} + return file_executor_proto_rawDescGZIP(), []int{3} } func (x *CallTrace) GetContext() *TransactionContext { @@ -573,7 +709,7 @@ type TransactionContext struct { func (x *TransactionContext) Reset() { *x = TransactionContext{} 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) } @@ -586,7 +722,7 @@ func (x *TransactionContext) String() string { func (*TransactionContext) ProtoMessage() {} func (x *TransactionContext) 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 { @@ -599,7 +735,7 @@ func (x *TransactionContext) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionContext.ProtoReflect.Descriptor instead. func (*TransactionContext) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{3} + return file_executor_proto_rawDescGZIP(), []int{4} } func (x *TransactionContext) GetType() string { @@ -713,13 +849,13 @@ type TransactionStep struct { // Contract information Contract *Contract `protobuf:"bytes,11,opt,name=contract,proto3" json:"contract,omitempty"` // Error - Error Error `protobuf:"varint,12,opt,name=error,proto3,enum=executor.v1.Error" json:"error,omitempty"` + Error RomError `protobuf:"varint,12,opt,name=error,proto3,enum=executor.v1.RomError" json:"error,omitempty"` } func (x *TransactionStep) Reset() { *x = TransactionStep{} 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) } @@ -732,7 +868,7 @@ func (x *TransactionStep) String() string { func (*TransactionStep) ProtoMessage() {} func (x *TransactionStep) 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 { @@ -745,7 +881,7 @@ func (x *TransactionStep) ProtoReflect() protoreflect.Message { // Deprecated: Use TransactionStep.ProtoReflect.Descriptor instead. func (*TransactionStep) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{4} + return file_executor_proto_rawDescGZIP(), []int{5} } func (x *TransactionStep) GetStateRoot() []byte { @@ -825,11 +961,11 @@ func (x *TransactionStep) GetContract() *Contract { return nil } -func (x *TransactionStep) GetError() Error { +func (x *TransactionStep) GetError() RomError { if x != nil { return x.Error } - return Error_ERROR_UNSPECIFIED + return RomError_ROM_ERROR_UNSPECIFIED } type Contract struct { @@ -847,7 +983,7 @@ type Contract struct { func (x *Contract) Reset() { *x = Contract{} 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) } @@ -860,7 +996,7 @@ func (x *Contract) String() string { func (*Contract) ProtoMessage() {} func (x *Contract) 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 { @@ -873,7 +1009,7 @@ func (x *Contract) ProtoReflect() protoreflect.Message { // Deprecated: Use Contract.ProtoReflect.Descriptor instead. func (*Contract) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{5} + return file_executor_proto_rawDescGZIP(), []int{6} } func (x *Contract) GetAddress() string { @@ -933,7 +1069,7 @@ type ProcessTransactionResponse struct { // Total gas refunded as result of execution GasRefunded uint64 `protobuf:"varint,7,opt,name=gas_refunded,json=gasRefunded,proto3" json:"gas_refunded,omitempty"` // Any error encountered during the execution - Error Error `protobuf:"varint,8,opt,name=error,proto3,enum=executor.v1.Error" json:"error,omitempty"` + Error RomError `protobuf:"varint,8,opt,name=error,proto3,enum=executor.v1.RomError" json:"error,omitempty"` // New SC Address in case of SC creation CreateAddress string `protobuf:"bytes,9,opt,name=create_address,json=createAddress,proto3" json:"create_address,omitempty"` // State Root @@ -948,7 +1084,7 @@ type ProcessTransactionResponse struct { func (x *ProcessTransactionResponse) Reset() { *x = ProcessTransactionResponse{} 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) } @@ -961,7 +1097,7 @@ func (x *ProcessTransactionResponse) String() string { func (*ProcessTransactionResponse) ProtoMessage() {} func (x *ProcessTransactionResponse) 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 { @@ -974,7 +1110,7 @@ func (x *ProcessTransactionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ProcessTransactionResponse.ProtoReflect.Descriptor instead. func (*ProcessTransactionResponse) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{6} + return file_executor_proto_rawDescGZIP(), []int{7} } func (x *ProcessTransactionResponse) GetTxHash() []byte { @@ -1026,11 +1162,11 @@ func (x *ProcessTransactionResponse) GetGasRefunded() uint64 { return 0 } -func (x *ProcessTransactionResponse) GetError() Error { +func (x *ProcessTransactionResponse) GetError() RomError { if x != nil { return x.Error } - return Error_ERROR_UNSPECIFIED + return RomError_ROM_ERROR_UNSPECIFIED } func (x *ProcessTransactionResponse) GetCreateAddress() string { @@ -1094,7 +1230,7 @@ type Log struct { func (x *Log) Reset() { *x = Log{} 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) } @@ -1107,7 +1243,7 @@ func (x *Log) String() string { func (*Log) ProtoMessage() {} func (x *Log) 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 { @@ -1120,7 +1256,7 @@ func (x *Log) ProtoReflect() protoreflect.Message { // Deprecated: Use Log.ProtoReflect.Descriptor instead. func (*Log) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{7} + return file_executor_proto_rawDescGZIP(), []int{8} } func (x *Log) GetAddress() string { @@ -1207,13 +1343,13 @@ type ExecutionTraceStep struct { // Gas refund GasRefund uint64 `protobuf:"varint,11,opt,name=gas_refund,json=gasRefund,proto3" json:"gas_refund,omitempty"` // Error - Error Error `protobuf:"varint,12,opt,name=error,proto3,enum=executor.v1.Error" json:"error,omitempty"` + Error RomError `protobuf:"varint,12,opt,name=error,proto3,enum=executor.v1.RomError" json:"error,omitempty"` } func (x *ExecutionTraceStep) Reset() { *x = ExecutionTraceStep{} 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) } @@ -1226,7 +1362,7 @@ func (x *ExecutionTraceStep) String() string { func (*ExecutionTraceStep) ProtoMessage() {} func (x *ExecutionTraceStep) 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 { @@ -1239,7 +1375,7 @@ func (x *ExecutionTraceStep) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecutionTraceStep.ProtoReflect.Descriptor instead. func (*ExecutionTraceStep) Descriptor() ([]byte, []int) { - return file_executor_proto_rawDescGZIP(), []int{8} + return file_executor_proto_rawDescGZIP(), []int{9} } func (x *ExecutionTraceStep) GetPc() uint64 { @@ -1319,11 +1455,11 @@ func (x *ExecutionTraceStep) GetGasRefund() uint64 { return 0 } -func (x *ExecutionTraceStep) GetError() Error { +func (x *ExecutionTraceStep) GetError() RomError { if x != nil { return x.Error } - return Error_ERROR_UNSPECIFIED + return RomError_ROM_ERROR_UNSPECIFIED } var File_executor_proto protoreflect.FileDescriptor @@ -1383,7 +1519,7 @@ var file_executor_proto_rawDesc = []byte{ 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, 0xfc, 0x04, 0x0a, 0x14, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, + 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, @@ -1420,209 +1556,256 @@ var file_executor_proto_rawDesc = []byte{ 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, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 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, + 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, 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, + 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, 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, 0xde, 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, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 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, 0xf3, 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, 0x28, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x6f, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 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, 0xc7, 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, 0x28, 0x0a, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x65, 0x78, - 0x65, 0x63, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 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, 0x95, 0x07, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x15, 0x0a, 0x11, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x4e, 0x4f, 0x5f, - 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, 0x47, 0x41, 0x53, 0x10, 0x02, 0x12, 0x18, 0x0a, - 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x4f, 0x56, 0x45, - 0x52, 0x46, 0x4c, 0x4f, 0x57, 0x10, 0x03, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x52, 0x52, 0x4f, 0x52, - 0x5f, 0x53, 0x54, 0x41, 0x43, 0x4b, 0x5f, 0x55, 0x4e, 0x44, 0x45, 0x52, 0x46, 0x4c, 0x4f, 0x57, - 0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c, 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, 0x24, 0x0a, 0x20, 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, 0x1c, 0x0a, 0x18, 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, 0x1e, 0x0a, 0x1a, 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, 0x20, 0x0a, 0x1c, 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, 0x20, 0x0a, 0x1c, 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, 0x1d, 0x0a, 0x19, - 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, 0x1f, 0x0a, 0x1b, 0x45, + 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, 0x88, 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, 0x41, 0x52, 0x49, 0x54, 0x48, 0x10, 0x0c, 0x12, 0x21, 0x0a, 0x1d, - 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, - 0x22, 0x0a, 0x1e, 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, 0x16, 0x0a, 0x12, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, - 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4a, 0x55, 0x4d, 0x50, 0x10, 0x0f, 0x12, 0x18, 0x0a, 0x14, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x4f, 0x50, 0x43, - 0x4f, 0x44, 0x45, 0x10, 0x10, 0x12, 0x18, 0x0a, 0x14, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, - 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, 0x10, 0x11, 0x12, - 0x24, 0x0a, 0x20, 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, 0x25, 0x0a, 0x21, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x5f, 0x49, + 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, 0x53, 0x49, 0x47, 0x4e, 0x41, 0x54, 0x55, 0x52, 0x45, 0x10, 0x13, 0x12, 0x24, 0x0a, 0x20, - 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, 0x21, 0x0a, 0x1d, 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, 0x25, 0x0a, 0x21, 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, 0x23, 0x0a, 0x1f, - 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, 0x2b, 0x0a, 0x27, 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, 0x27, - 0x0a, 0x23, 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, 0x23, 0x0a, 0x1f, 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, 0x1c, 0x0a, 0x18, - 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, 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, 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, + 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, 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, 0x2a, + 0xd9, 0x02, 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, 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, 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, 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 ( @@ -1637,45 +1820,50 @@ func file_executor_proto_rawDescGZIP() []byte { return file_executor_proto_rawDescData } -var file_executor_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_executor_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_executor_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_executor_proto_goTypes = []interface{}{ - (Error)(0), // 0: executor.v1.Error - (*ProcessBatchRequest)(nil), // 1: executor.v1.ProcessBatchRequest - (*ProcessBatchResponse)(nil), // 2: executor.v1.ProcessBatchResponse - (*CallTrace)(nil), // 3: executor.v1.CallTrace - (*TransactionContext)(nil), // 4: executor.v1.TransactionContext - (*TransactionStep)(nil), // 5: executor.v1.TransactionStep - (*Contract)(nil), // 6: executor.v1.Contract - (*ProcessTransactionResponse)(nil), // 7: executor.v1.ProcessTransactionResponse - (*Log)(nil), // 8: executor.v1.Log - (*ExecutionTraceStep)(nil), // 9: executor.v1.ExecutionTraceStep - nil, // 10: executor.v1.ProcessBatchRequest.DbEntry - nil, // 11: executor.v1.ProcessBatchRequest.ContractsBytecodeEntry - nil, // 12: executor.v1.ExecutionTraceStep.StorageEntry + (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 } var file_executor_proto_depIdxs = []int32{ - 10, // 0: executor.v1.ProcessBatchRequest.db:type_name -> executor.v1.ProcessBatchRequest.DbEntry - 11, // 1: executor.v1.ProcessBatchRequest.contracts_bytecode:type_name -> executor.v1.ProcessBatchRequest.ContractsBytecodeEntry - 7, // 2: executor.v1.ProcessBatchResponse.responses:type_name -> executor.v1.ProcessTransactionResponse - 0, // 3: executor.v1.ProcessBatchResponse.error:type_name -> executor.v1.Error - 4, // 4: executor.v1.CallTrace.context:type_name -> executor.v1.TransactionContext - 5, // 5: executor.v1.CallTrace.steps:type_name -> executor.v1.TransactionStep - 6, // 6: executor.v1.TransactionStep.contract:type_name -> executor.v1.Contract - 0, // 7: executor.v1.TransactionStep.error:type_name -> executor.v1.Error - 0, // 8: executor.v1.ProcessTransactionResponse.error:type_name -> executor.v1.Error - 8, // 9: executor.v1.ProcessTransactionResponse.logs:type_name -> executor.v1.Log - 9, // 10: executor.v1.ProcessTransactionResponse.execution_trace:type_name -> executor.v1.ExecutionTraceStep - 3, // 11: executor.v1.ProcessTransactionResponse.call_trace:type_name -> executor.v1.CallTrace - 12, // 12: executor.v1.ExecutionTraceStep.storage:type_name -> executor.v1.ExecutionTraceStep.StorageEntry - 0, // 13: executor.v1.ExecutionTraceStep.error:type_name -> executor.v1.Error - 1, // 14: executor.v1.ExecutorService.ProcessBatch:input_type -> executor.v1.ProcessBatchRequest - 2, // 15: executor.v1.ExecutorService.ProcessBatch:output_type -> executor.v1.ProcessBatchResponse - 15, // [15:16] is the sub-list for method output_type - 14, // [14:15] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 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 } func init() { file_executor_proto_init() } @@ -1709,7 +1897,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallTrace); i { + switch v := v.(*InfoReadWrite); i { case 0: return &v.state case 1: @@ -1721,7 +1909,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionContext); i { + switch v := v.(*CallTrace); i { case 0: return &v.state case 1: @@ -1733,7 +1921,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionStep); i { + switch v := v.(*TransactionContext); i { case 0: return &v.state case 1: @@ -1745,7 +1933,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Contract); i { + switch v := v.(*TransactionStep); i { case 0: return &v.state case 1: @@ -1757,7 +1945,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProcessTransactionResponse); i { + switch v := v.(*Contract); i { case 0: return &v.state case 1: @@ -1769,7 +1957,7 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Log); i { + switch v := v.(*ProcessTransactionResponse); i { case 0: return &v.state case 1: @@ -1781,6 +1969,18 @@ func file_executor_proto_init() { } } file_executor_proto_msgTypes[8].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[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ExecutionTraceStep); i { case 0: return &v.state @@ -1798,8 +1998,8 @@ func file_executor_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_executor_proto_rawDesc, - NumEnums: 1, - NumMessages: 12, + NumEnums: 2, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/state/runtime/executor/pb/executor_grpc.pb.go b/state/runtime/executor/pb/executor_grpc.pb.go index d752318bce..78ac0c2df9 100644 --- a/state/runtime/executor/pb/executor_grpc.pb.go +++ b/state/runtime/executor/pb/executor_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 -// - protoc v3.21.8 +// - protoc v3.21.12 // source: executor.proto package pb diff --git a/state/state.go b/state/state.go index 54d85aa807..b795023242 100644 --- a/state/state.go +++ b/state/state.go @@ -244,13 +244,17 @@ func (s *State) EstimateGas(transaction *types.Transaction, senderAddress common gasUsed = processBatchResponse.Responses[0].GasUsed log.Debugf("executor time: %vms", time.Since(txExecutionOnExecutorTime).Milliseconds()) if err != nil { - log.Errorf("error processing unsigned transaction ", err) + log.Errorf("error estimating gas: %v", err) + return false, false, gasUsed, err + } else if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { + err = executor.ExecutorErr(processBatchResponse.Error) + s.LogExecutorError(processBatchResponse.Error, processBatchRequest) return false, false, gasUsed, err } // Check if an out of gas error happened during EVM execution - if processBatchResponse.Responses[0].Error != pb.Error(executor.ERROR_NO_ERROR) { - err := executor.Err(processBatchResponse.Responses[0].Error) + if processBatchResponse.Responses[0].Error != pb.RomError(executor.ROM_ERROR_NO_ERROR) { + err := executor.RomErr(processBatchResponse.Responses[0].Error) if (isGasEVMError(err) || isGasApplyError(err)) && shouldOmitErr { // Specifying the transaction failed, but not providing an error @@ -433,7 +437,16 @@ func (s *State) ExecuteBatch(ctx context.Context, batchNumber uint64, batchL2Dat ChainId: s.cfg.ChainID, } - return s.executorClient.ProcessBatch(ctx, processBatchRequest) + processBatchResponse, err := s.executorClient.ProcessBatch(ctx, processBatchRequest) + + if err != nil { + if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { + err = executor.ExecutorErr(processBatchResponse.Error) + s.LogExecutorError(processBatchResponse.Error, processBatchRequest) + } + } + + return processBatchResponse, err } func (s *State) processBatch(ctx context.Context, batchNumber uint64, batchL2Data []byte, dbTx pgx.Tx) (*pb.ProcessBatchResponse, error) { @@ -496,6 +509,9 @@ func (s *State) processBatch(ctx context.Context, batchNumber uint64, batchL2Dat log.Errorf("Error s.executorClient.ProcessBatch: %v", err) log.Errorf("Error s.executorClient.ProcessBatch: %s", err.Error()) log.Errorf("Error s.executorClient.ProcessBatch response: %v", res) + } else if res.Error != executor.EXECUTOR_ERROR_NO_ERROR { + err = executor.ExecutorErr(res.Error) + s.LogExecutorError(res.Error, processBatchRequest) } log.Infof("It took %v for the executor to process the request", time.Since(now)) @@ -540,7 +556,7 @@ func (s *State) StoreTransactions(ctx context.Context, batchNumber uint64, proce // if the transaction has an intrinsic invalid tx error it means // the transaction has not changed the state, so we don't store it // and just move to the next - if executor.IsIntrinsicError(executor.ErrorCode(processedTx.Error)) { + if executor.IsIntrinsicError(executor.RomErrorCode(processedTx.RomError)) { continue } @@ -708,7 +724,7 @@ func (s *State) ProcessAndStoreClosedBatch(ctx context.Context, processingCtx Pr // note that if the batch is not well encoded it will result in an empty batch (with no txs) for i := 0; i < len(processed.Responses); i++ { if !isProcessed(processed.Responses[i].Error) { - if executor.IsOutOfCountersError(processed.Responses[i].Error) { + if executor.IsROMOutOfCountersError(processed.Responses[i].Error) { processed.Responses = []*pb.ProcessTransactionResponse{} break } @@ -818,6 +834,10 @@ func (s *State) DebugTransaction(ctx context.Context, transactionHash common.Has processBatchResponse, err := s.executorClient.ProcessBatch(ctx, processBatchRequest) if err != nil { return nil, err + } else if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { + err = executor.ExecutorErr(processBatchResponse.Error) + s.LogExecutorError(processBatchResponse.Error, processBatchRequest) + return nil, err } endTime := time.Now() @@ -1117,6 +1137,11 @@ func (s *State) ProcessUnsignedTransaction(ctx context.Context, tx *types.Transa log.Errorf("error processing unsigned transaction ", err) result.Err = err return result + } else if processBatchResponse.Error != executor.EXECUTOR_ERROR_NO_ERROR { + err = executor.ExecutorErr(processBatchResponse.Error) + s.LogExecutorError(processBatchResponse.Error, processBatchRequest) + result.Err = err + return result } response, err := convertToProcessBatchResponse([]types.Transaction{*tx}, processBatchResponse) if err != nil { @@ -1130,8 +1155,8 @@ func (s *State) ProcessUnsignedTransaction(ctx context.Context, tx *types.Transa result.GasUsed = r.GasUsed result.CreateAddress = r.CreateAddress result.StateRoot = r.StateRoot.Bytes() - if processBatchResponse.Responses[0].Error != pb.Error(executor.ERROR_NO_ERROR) { - err := executor.Err(processBatchResponse.Responses[0].Error) + if processBatchResponse.Responses[0].Error != pb.RomError(executor.ROM_ERROR_NO_ERROR) { + err := executor.RomErr(processBatchResponse.Responses[0].Error) if isEVMRevertError(err) { result.Err = constructErrorFromRevert(err, processBatchResponse.Responses[0].ReturnValue) } else { @@ -1182,7 +1207,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db case int(merkletree.LeafTypeCode): code, err := hex.DecodeHex(action.Bytecode) if err != nil { - return newRoot, fmt.Errorf("Could not decode SC bytecode for address %q: %v", address, err) + return newRoot, fmt.Errorf("could not decode SC bytecode for address %q: %v", address, err) } newRoot, _, err = s.tree.SetCode(ctx, address, code, newRoot) if err != nil { @@ -1206,7 +1231,7 @@ func (s *State) SetGenesis(ctx context.Context, block Block, genesis Genesis, db case int(merkletree.LeafTypeSCLength): log.Debug("Skipped genesis action of type merkletree.LeafTypeSCLength, these actions will be handled as part of merkletree.LeafTypeCode actions") default: - return newRoot, fmt.Errorf("Unknown genesis action type %q", action.Type) + return newRoot, fmt.Errorf("unknown genesis action type %q", action.Type) } } @@ -1364,3 +1389,23 @@ func (s *State) WaitVerifiedBatchToBeSynced(parentCtx context.Context, batchNumb log.Debug("Verified batch successfully synced: ", batchNumber) return nil } + +// LogExecutorError is used to store Executor error for runtime debugging +func (s *State) LogExecutorError(responseError pb.ExecutorError, processBatchRequest *pb.ProcessBatchRequest) { + timestamp := time.Now() + log.Errorf("error found in the executor: %v at %v", responseError, timestamp) + payload, err := json.Marshal(processBatchRequest) + if err != nil { + log.Errorf("error marshaling payload: %v", err) + } else { + debugInfo := &DebugInfo{ + ErrorType: DebugInfoErrorType_EXECUTOR_ERROR, + Timestamp: timestamp, + Payload: string(payload), + } + err = s.AddDebugInfo(context.Background(), debugInfo, nil) + if err != nil { + log.Errorf("error storing payload: %v", err) + } + } +} diff --git a/state/state_test.go b/state/state_test.go index 7228ed4722..b8ba54c579 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -1616,14 +1616,14 @@ func TestExecutorUnsignedTransactions(t *testing.T) { processBatchResponse, err := testState.ProcessSequencerBatch(context.Background(), 1, signedTxs, dbTx) require.NoError(t, err) // assert signed tx do deploy sc - assert.Nil(t, processBatchResponse.Responses[0].Error) + assert.Nil(t, processBatchResponse.Responses[0].RomError) assert.Equal(t, scAddress, processBatchResponse.Responses[0].CreateAddress) // assert signed tx to increment counter - assert.Nil(t, processBatchResponse.Responses[1].Error) + assert.Nil(t, processBatchResponse.Responses[1].RomError) // assert signed tx to increment counter - assert.Nil(t, processBatchResponse.Responses[2].Error) + assert.Nil(t, processBatchResponse.Responses[2].RomError) assert.Equal(t, "0000000000000000000000000000000000000000000000000000000000000001", hex.EncodeToString(processBatchResponse.Responses[2].ReturnValue)) // Add txs to DB @@ -2371,12 +2371,12 @@ func TestExecutorGasEstimationMultisig(t *testing.T) { processBatchResponse, err := executorClient.ProcessBatch(ctx, processBatchRequest) require.NoError(t, err) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[0].Error) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[1].Error) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[2].Error) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[3].Error) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[4].Error) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[5].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[0].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[1].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[2].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[3].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[4].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[5].Error) // Check SC code // Check Smart Contracts Code @@ -2454,7 +2454,7 @@ func TestExecutorGasEstimationMultisig(t *testing.T) { processBatchResponse, err = executorClient.ProcessBatch(ctx, processBatchRequest) require.NoError(t, err) - assert.Equal(t, executorclientpb.Error_ERROR_NO_ERROR, processBatchResponse.Responses[0].Error) + assert.Equal(t, executorclientpb.RomError_ROM_ERROR_NO_ERROR, processBatchResponse.Responses[0].Error) log.Debugf("Used gas = %v", processBatchResponse.Responses[0].GasUsed) } @@ -2566,3 +2566,44 @@ func TestWaitSequencingTxToBeSyncedAndWaitVerifiedBatchToBeSynced(t *testing.T) err = testState.WaitVerifiedBatchToBeSynced(ctx, 1, 5*time.Second) require.NoError(t, err) } + +func TestStoreDebugInfo(t *testing.T) { + var debugInfo state.DebugInfo + + db := map[string]string{ + "2dc4db4293af236cb329700be43f08ace740a05088f8c7654736871709687e90": "00000000000000000000000000000000000000000000000000000000000000000d1f0da5a7b620c843fd1e18e59fd724d428d25da0cb1888e31f5542ac227c060000000000000000000000000000000000000000000000000000000000000000", + "e31f5542ac227c06d428d25da0cb188843fd1e18e59fd7240d1f0da5a7b620c8": "ed22ec7734d89ff2b2e639153607b7c542b2bd6ec2788851b7819329410847833e63658ee0db910d0b3e34316e81aa10e0dc203d93f4e3e5e10053d0ebc646020000000000000000000000000000000000000000000000000000000000000000", + "b78193294108478342b2bd6ec2788851b2e639153607b7c5ed22ec7734d89ff2": "16dde42596b907f049015d7e991a152894dd9dadd060910b60b4d5e9af514018b69b044f5e694795f57d81efba5d4445339438195426ad0a3efad1dd58c2259d0000000000000001000000000000000000000000000000000000000000000000", + "3efad1dd58c2259d339438195426ad0af57d81efba5d4445b69b044f5e694795": "00000000dea000000000000035c9adc5000000000000003600000000000000000000000000000000000000000000000000000000000000000000000000000000", + "e10053d0ebc64602e0dc203d93f4e3e50b3e34316e81aa103e63658ee0db910d": "66ee2be0687eea766926f8ca8796c78a4c2f3e938869b82d649e63bfe1247ba4b69b044f5e694795f57d81efba5d4445339438195426ad0a3efad1dd58c2259d0000000000000001000000000000000000000000000000000000000000000000", + } + + // Create Batch + processBatchRequest := &executorclientpb.ProcessBatchRequest{ + OldBatchNum: 0, + Coinbase: common.HexToAddress("0x617b3a3528F9cDd6630fd3301B9c8911F7Bf063D").String(), + BatchL2Data: common.Hex2Bytes("ee80843b9aca00830186a0944d5cf5032b2a844602278b01199ed191a86c93ff88016345785d8a0000808203e880801cee7e01dc62f69a12c3510c6d64de04ee6346d84b6a017f3e786c7d87f963e75d8cc91fa983cd6d9cf55fff80d73bd26cd333b0f098acc1e58edb1fd484ad731b"), + OldStateRoot: common.Hex2Bytes("2dc4db4293af236cb329700be43f08ace740a05088f8c7654736871709687e90"), + GlobalExitRoot: common.Hex2Bytes("090bcaf734c4f06c93954a827b45a6e8c67b8e0fd1e0a35a1c5982d6961828f9"), + OldAccInputHash: common.Hex2Bytes("17c04c3760510b48c6012742c540a81aba4bca2f78b9d14bfd2f123e2e53ea3e"), + EthTimestamp: uint64(1944498031), + UpdateMerkleTree: 0, + Db: db, + ChainId: stateCfg.ChainID, + } + + _, err := executorClient.ProcessBatch(ctx, processBatchRequest) + require.NoError(t, err) + + // Log as it failed + testState.LogExecutorError(executorclientpb.ExecutorError_EXECUTOR_ERROR_COUNTERS_OVERFLOW_KECCAK, processBatchRequest) + require.NoError(t, err) + + payload, err := json.Marshal(processBatchRequest) + require.NoError(t, err) + + err = testState.PostgresStorage.QueryRow(ctx, "SELECT * FROM state.debug").Scan(&debugInfo.ErrorType, &debugInfo.Timestamp, &debugInfo.Payload) + assert.NoError(t, err) + assert.Equal(t, state.DebugInfoErrorType_EXECUTOR_ERROR, debugInfo.ErrorType) + assert.Equal(t, string(payload), debugInfo.Payload) +} diff --git a/state/types.go b/state/types.go index 194e5fe1ce..143363a465 100644 --- a/state/types.go +++ b/state/types.go @@ -1,6 +1,9 @@ package state import ( + "math/big" + "time" + "github.com/0xPolygonHermez/zkevm-node/state/runtime/instrumentation" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" @@ -8,21 +11,15 @@ import ( // ProcessBatchResponse represents the response of a batch process. type ProcessBatchResponse struct { - NewStateRoot common.Hash - NewAccInputHash common.Hash - NewLocalExitRoot common.Hash - NewBatchNumber uint64 - CntKeccakHashes uint32 - CntPoseidonHashes uint32 - CntPoseidonPaddings uint32 - CntMemAligns uint32 - CntArithmetics uint32 - CntBinaries uint32 - CntSteps uint32 - CumulativeGasUsed uint64 - Responses []*ProcessTransactionResponse - Error error - IsBatchProcessed bool + NewStateRoot common.Hash + NewAccInputHash common.Hash + NewLocalExitRoot common.Hash + NewBatchNumber uint64 + UsedZkCounters ZKCounters + Responses []*ProcessTransactionResponse + ExecutorError error + IsBatchProcessed bool + ReadWriteAddresses []*InfoReadWrite } // ProcessTransactionResponse represents the response of a tx process. @@ -40,8 +37,8 @@ type ProcessTransactionResponse struct { GasUsed uint64 // GasRefunded is the total gas refunded as result of execution GasRefunded uint64 - // Error represents any error encountered during the execution - Error error + // RomError represents any error encountered during the execution + RomError error // CreateAddress is the new SC Address in case of SC creation CreateAddress common.Address // StateRoot is the State Root @@ -57,3 +54,34 @@ type ProcessTransactionResponse struct { // CallTrace contains the call trace. CallTrace instrumentation.ExecutorTrace } + +// ZKCounters counters for the tx +type ZKCounters struct { + CumulativeGasUsed uint64 + UsedKeccakHashes uint32 + UsedPoseidonHashes uint32 + UsedPoseidonPaddings uint32 + UsedMemAligns uint32 + UsedArithmetics uint32 + UsedBinaries uint32 + UsedSteps uint32 +} + +// InfoReadWrite has information about modified addresses during the execution +type InfoReadWrite struct { + Address common.Address + Nonce *uint64 + Balance *big.Int +} + +const ( + // DebugInfoErrorType_EXECUTOR_ERROR indicates a error happened in the executor + DebugInfoErrorType_EXECUTOR_ERROR = "EXECUTOR ERROR" +) + +// DebugInfo allows handling runtime debug info +type DebugInfo struct { + ErrorType string + Timestamp time.Time + Payload string +} diff --git a/test/docker-compose.yml b/test/docker-compose.yml index 44a6a5b649..044ce63054 100644 --- a/test/docker-compose.yml +++ b/test/docker-compose.yml @@ -243,7 +243,7 @@ services: zkevm-prover: container_name: zkevm-prover - image: hermeznetwork/zkevm-prover:e3a5baf + image: hermeznetwork/zkevm-prover:9c4a1fe ports: # - 50051:50051 # Prover - 50052:50052 # Mock prover diff --git a/tools/zkevmprovermock/server/executor.go b/tools/zkevmprovermock/server/executor.go index 31fd20dc77..8b3fa22959 100644 --- a/tools/zkevmprovermock/server/executor.go +++ b/tools/zkevmprovermock/server/executor.go @@ -372,7 +372,7 @@ func translateTransactionSteps(inputSteps []*testvector.TransactionStep) ([]*pb. Memory: memory, ReturnData: returnData, Contract: contract, - Error: pb.Error(pbErr), + Error: pb.RomError(pbErr), } steps = append(steps, newStep) }