Skip to content

Commit

Permalink
Update proto files (0xPolygonHermez#999)
Browse files Browse the repository at this point in the history
* Update protos

* Update prover image

* typo
  • Loading branch information
ToniRamirezM authored Aug 4, 2022
1 parent 43d34da commit c29f342
Show file tree
Hide file tree
Showing 8 changed files with 436 additions and 373 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ generate-mocks: ## Generates mocks for the tests, using mockery tool
.PHONY: generate-code-from-proto
generate-code-from-proto: ## Generates code from proto files
cd proto/src/proto/statedb/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../merkletree/pb --go-grpc_out=../../../../../merkletree/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative statedb.proto
cd proto/src/proto/zkprover/v1 && protoc --proto_path=. --go_out=../../../../../proverclient/pb --go-grpc_out=../../../../../proverclient/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative zk-prover.proto
cd proto/src/proto/zkprover/v1 && protoc --proto_path=. --go_out=../../../../../proverclient/pb --go-grpc_out=../../../../../proverclient/pb --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative zk_prover.proto
cd proto/src/proto/executor/v1 && protoc --proto_path=. --go_out=../../../../../state/runtime/executor/pb --go-grpc_out=../../../../../state/runtime/executor/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative executor.proto
cd proto/src/proto/broadcast/v1 && protoc --proto_path=. --proto_path=../../../../include --go_out=../../../../../sequencer/broadcast/pb --go-grpc_out=../../../../../sequencer/broadcast/pb --go-grpc_opt=paths=source_relative --go_opt=paths=source_relative broadcast.proto

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ services:

zkevm-prover:
container_name: zkevm-prover
image: hermeznetwork/zkprover-local@sha256:9adf1bb1e11e4063da4cfc9059f770506ccfd56b184c3f5e918a6f9d1571fd8e
image: hermeznetwork/zkprover-local@sha256:6d81ddcf31fcb5d2db65cc59ca4df78047f5cda734c3f5067125be8b15a02276
ports:
# - 50051:50051 # Prover
- 50052:50052 # Mock prover
Expand Down
64 changes: 35 additions & 29 deletions proto/src/proto/executor/v1/executor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ message ProcessBatchRequest {
bytes tx_hash_to_generate_execute_trace = 10;
bytes tx_hash_to_generate_call_trace = 11;
// For testing purposes only
map<string, string> db = 12;
map<string, string> db = 12;
map<string, string> contracts_bytecode = 13; // For debug/testing purpposes only. Don't fill this on production
}

message ProcessBatchResponse {
Expand All @@ -41,8 +42,8 @@ message ProcessBatchResponse {
}

message CallTrace {
TransactionContext context = 2;
repeated TransactionStep steps = 3;
TransactionContext context = 1;
repeated TransactionStep steps = 2;
}

message TransactionContext {
Expand Down Expand Up @@ -109,30 +110,33 @@ message Contract {
message ProcessTransactionResponse {
// Hash of the transaction
bytes tx_hash = 1;
// RLP encoded transaction
// [nonce, gasPrice, gasLimit, to, value, data, v, r, s]
bytes rlp_tx = 2;
// Type indicates legacy transaction
// It will be always 0 (legacy) in the executor
uint32 type = 2;
uint32 type = 3;
// Returned data from the runtime (function result or data supplied with revert opcode)
bytes return_value = 3;
bytes return_value = 4;
// Total gas left as result of execution
uint64 gas_left = 4;
uint64 gas_left = 5;
// Total gas used as result of execution or gas estimation
uint64 gas_used = 5;
uint64 gas_used = 6;
// Total gas refunded as result of execution
uint64 gas_refunded = 6;
uint64 gas_refunded = 7;
// Any error encountered during the execution
Error error = 7;
Error error = 8;
// New SC Address in case of SC creation
string create_address = 8;
string create_address = 9;
// State Root
bytes state_root = 9;
bytes state_root = 10;
// Logs emited by LOG opcode
repeated Log logs = 10;
// Indicates if this tx didn't fit into the batch
uint32 unprocessed_transaction = 11;
repeated Log logs = 11;
// Indicates if this tx didn't fit into the batch
uint32 unprocessed_transaction = 12;
// Trace
repeated ExecutionTraceStep execution_trace = 12;
CallTrace call_trace = 13;
repeated ExecutionTraceStep execution_trace = 13;
CallTrace call_trace = 14;
}

message Log {
Expand Down Expand Up @@ -183,30 +187,32 @@ message ExecutionTraceStep {

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 = 1;
ERROR_OUT_OF_GAS = 2;
// ERROR_STACK_OVERFLOW indicates a stack overflow has happened
ERROR_STACK_OVERFLOW = 2;
ERROR_STACK_OVERFLOW = 3;
// ERROR_STACK_UNDERFLOW indicates a stack overflow has happened
ERROR_STACK_UNDERFLOW = 3;
ERROR_STACK_UNDERFLOW = 4;
// ERROR_NOT_ENOUGH_FUNDS indicates there is not enough funds to continue the execution
ERROR_NOT_ENOUGH_FUNDS = 4;
ERROR_NOT_ENOUGH_FUNDS = 5;
// ERROR_INSUFFICIENT_BALANCE indicates there is not enough balance to continue the execution
ERROR_INSUFFICIENT_BALANCE = 5;
ERROR_INSUFFICIENT_BALANCE = 6;
// ERROR_CODE_NOT_FOUND indicates the code was not found
ERROR_CODE_NOT_FOUND = 6;
ERROR_CODE_NOT_FOUND = 7;
// ERROR_MAX_CODE_SIZE_EXCEEDED indicates the code size is beyond the maximum
ERROR_MAX_CODE_SIZE_EXCEEDED = 7;
ERROR_MAX_CODE_SIZE_EXCEEDED = 8;
// ERROR_CONTRACT_ADDRESS_COLLISION there is a collision regarding contract addresses
ERROR_CONTRACT_ADDRESS_COLLISION = 8;
ERROR_CONTRACT_ADDRESS_COLLISION = 9;
// ERROR_DEPTH indicates the maximun call depth has been passed
ERROR_DEPTH= 9;
ERROR_DEPTH= 10;
// ERROR_EXECUTION_REVERTED indicates the execution has been reverted
ERROR_EXECUTION_REVERTED = 10;
ERROR_EXECUTION_REVERTED = 11;
// ERROR_CODE_STORE_OUT_OF_GAS indicates there is not enough gas for the storage
ERROR_CODE_STORE_OUT_OF_GAS = 11;
ERROR_CODE_STORE_OUT_OF_GAS = 12;
// ERROR_OUT_OF_COUNTERS indicates there is not enough counters to continue the execution
ERROR_OUT_OF_COUNTERS = 12;
ERROR_OUT_OF_COUNTERS = 13;
// ERROR_INVALID_TX indicates the transaction is invalid
ERROR_INVALID_TX = 13;
ERROR_INVALID_TX = 14;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package zkprover.v1;

option go_package = "./pb";
option go_package = "github.com/0xPolygonHermez/zkevm-node/proverclient/pb";

message Version {
string v0_0_1 = 1;
Expand Down Expand Up @@ -45,7 +45,7 @@ message GenProofRequest {
* @dev CancelRequest
* @param {id} - proof identifier
*/
message CancelRequest {
message CancelRequest {
string id = 1;
}

Expand Down Expand Up @@ -208,15 +208,17 @@ message Proof {
* @param {public_inputs} - public inputs
* @param {global_exit_root} - bridge global exit root
* @param {batch_l2_data} - contract calldata
* @param {address_aggregator} - ethereum address aggregator
* @param {db} - database containing all key-values in smt matching the old state root
* @param {contracts_bytecode} - key is the hash(contractBytecode), value is the bytecode itself
*/
message InputProver {
PublicInputs public_inputs = 1;
string global_exit_root = 2;
string batch_l2_data = 3;
map<string, string> db = 4; // For debug/testing purpposes only. Don't fill this on production
map<string, string> contracts_bytecode = 5; // For debug/testing purpposes only. Don't fill this on production
string address_aggregator = 4;
map<string, string> db = 5; // For debug/testing purpposes only. Don't fill this on production
map<string, string> contracts_bytecode = 6; // For debug/testing purpposes only. Don't fill this on production
}

/**
Expand All @@ -227,4 +229,4 @@ message InputProver {
message PublicInputsExtended {
PublicInputs public_inputs = 1;
string input_hash = 2;
}
}
Loading

0 comments on commit c29f342

Please sign in to comment.