Skip to content

Commit

Permalink
Merge pull request #680 from 0xPolygonHermez/fractasy_full_tracer_diet
Browse files Browse the repository at this point in the history
Implement FullTracer full_trace
  • Loading branch information
fractasy authored Nov 8, 2023
2 parents b8a3378 + 83c6275 commit c0b8c4e
Show file tree
Hide file tree
Showing 21 changed files with 3,365 additions and 5,455 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build docker image and run node tests

on:
push:
branches: [ develop, main, fractasy_state_root_map ]
branches: [ develop, main, fractasy_full_tracer_diet ]

jobs:
build-docker:
Expand Down
1,535 changes: 452 additions & 1,083 deletions src/grpc/gen/executor.pb.cc

Large diffs are not rendered by default.

5,575 changes: 2,300 additions & 3,275 deletions src/grpc/gen/executor.pb.h

Large diffs are not rendered by default.

47 changes: 8 additions & 39 deletions src/grpc/proto/executor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ message ProcessBatchRequest {
map<string, string> contracts_bytecode = 14; // For debug/testing purpposes only. Don't fill this on production
TraceConfig trace_config = 15;
string context_id = 16;
uint32 get_keys = 17; // if 1, the keys used to read or write storage values will be returned
uint32 get_keys = 17; // if 1, the keys used to read or write storage values will be returned
}

message ProcessBatchResponse {
Expand All @@ -54,7 +54,7 @@ message ProcessBatchResponse {
uint64 flush_id = 16;
uint64 stored_flush_id = 17;
string prover_id = 18;
repeated bytes nodes_keys = 19;
repeated bytes nodes_keys = 19;
repeated bytes program_keys = 20;
}

Expand Down Expand Up @@ -90,10 +90,8 @@ message TraceConfig {
uint32 enable_memory = 3;
// Enables return data (default=false)
uint32 enable_return_data = 4;
// Hash of tx in batch to retrieve the execution trace
bytes tx_hash_to_generate_execute_trace = 5;
// Hash of tx in batch to retrieve the call trace
bytes tx_hash_to_generate_call_trace = 6;
// Hash of tx in batch to retrieve the trace
bytes tx_hash_to_generate_full_trace = 5;
}
message InfoReadWrite {
// If nonce="" then it has not been set; if set, string is in decimal (base 10)
Expand All @@ -102,7 +100,7 @@ message InfoReadWrite {
string balance = 2;
}

message CallTrace {
message FullTrace {
TransactionContext context = 1;
repeated TransactionStep steps = 2;
}
Expand Down Expand Up @@ -163,6 +161,8 @@ message TransactionStep {
Contract contract = 13;
// Error
RomError error = 14;
// Content of the storage
map<string, string> storage = 15;
}

message Contract {
Expand Down Expand Up @@ -200,9 +200,7 @@ message ProcessTransactionResponse {
bytes state_root = 10;
// Logs emited by LOG opcode
repeated Log logs = 11;
// Trace
repeated ExecutionTraceStep execution_trace = 13;
CallTrace call_trace = 14;
FullTrace full_trace = 14;
// Efective Gas Price
string effective_gas_price = 15;
uint32 effective_percentage = 16;
Expand Down Expand Up @@ -231,35 +229,6 @@ message Log {
uint32 index = 8;
}

message ExecutionTraceStep {
// Program Counter
uint64 pc = 1;
// OpCode
string op = 2;
// Remaining gas
uint64 remaining_gas = 3;
// Gas cost of the operation
uint64 gas_cost = 4;
// Content of memory, starting at memory_offset, showing only changes vs. previous step
bytes memory = 5;
// Total size of memory
uint32 memory_size = 6;
// Offset of memory changes
uint32 memory_offset = 7;
// Content of the stack
repeated string stack = 8;
// Returned data
bytes return_data = 9;
// Content of the storage
map<string, string> storage = 10;
// Call depth
uint32 depth = 11;
// Gas refund
uint64 gas_refund = 12;
// Error
RomError error = 13;
}

enum RomError {
ROM_ERROR_UNSPECIFIED = 0;
// ROM_ERROR_NO_ERROR indicates the execution ended successfully
Expand Down
Loading

0 comments on commit c0b8c4e

Please sign in to comment.