Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Sep 13, 2022
1 parent f5cc63f commit fc40e25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion evm/src/executor/inspector/tracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ where
contract: interp.contract.address,
stack: interp.stack.clone(),
memory: interp.memory.clone(),
state_diff: None,
gas: interp.gas.remaining(),
gas_refund_counter: interp.gas.refunded() as u64,
gas_cost: 0,
state_diff: None,
error: None,
});

Expand Down
13 changes: 9 additions & 4 deletions evm/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ impl fmt::Display for RawOrDecodedReturnData {

#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct CallTraceStep {
// Fields filled in `step`
/// Call depth
pub depth: u64,
/// Program counter before step execution
pub pc: usize,
Expand All @@ -340,14 +342,16 @@ pub struct CallTraceStep {
pub stack: Stack,
/// Memory before step execution
pub memory: Memory,
/// State of the contract after step execution (effect of the SLOAD/SSTORE instructions)
pub state_diff: Option<(U256, U256)>,
/// Remaining gas before step execution
pub gas: u64,
/// Gas cost of step execution
pub gas_cost: u64,
/// Gas refund counter before step execution
pub gas_refund_counter: u64,

// Fields filled in `step_end`
/// Gas cost of step execution
pub gas_cost: u64,
/// Change of the contract state after step execution (effect of the SLOAD/SSTORE instructions)
pub state_diff: Option<(U256, U256)>,
/// Error (if any) after after step execution
pub error: Option<String>,
}
Expand All @@ -364,6 +368,7 @@ impl From<&CallTraceStep> for StructLog {
pc: step.pc as u64,
refund_counter: Some(step.gas_refund_counter),
stack: Some(step.stack.data().clone()),
// Filled in `CallTraceArena::geth_trace` as a result of compounding all slot changes
storage: None,
}
}
Expand Down

0 comments on commit fc40e25

Please sign in to comment.