diff --git a/ethcore/src/executive.rs b/ethcore/src/executive.rs index 5d08a430187..7504afb7f21 100644 --- a/ethcore/src/executive.rs +++ b/ethcore/src/executive.rs @@ -410,7 +410,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { let default = []; let data = if let Some(ref d) = params.data { d as &[u8] } else { &default as &[u8] }; - let mut trace_info = tracer.prepare_trace_call(¶ms); + let mut trace_info = tracer.prepare_trace_call(¶ms, self.depth == 0); let cost = builtin.cost(data); if cost <= params.gas { @@ -435,10 +435,6 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { } trace_output } else { - // Disable recording input and output to avoid possible attacks. - if let Some(trace_info) = trace_info.as_mut() { - trace_info.input = None; - } None }; @@ -465,7 +461,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> { Err(vm::Error::OutOfGas) } } else { - let trace_info = tracer.prepare_trace_call(¶ms); + let trace_info = tracer.prepare_trace_call(¶ms, true); let mut trace_output = tracer.prepare_trace_output(); let mut subtracer = tracer.subtracer(); diff --git a/ethcore/src/trace/executive_tracer.rs b/ethcore/src/trace/executive_tracer.rs index 77bc2f17387..a4b7170d286 100644 --- a/ethcore/src/trace/executive_tracer.rs +++ b/ethcore/src/trace/executive_tracer.rs @@ -84,8 +84,8 @@ fn should_prefix_address_properly() { impl Tracer for ExecutiveTracer { type Output = FlatTrace; - fn prepare_trace_call(&self, params: &ActionParams) -> Option { - Some(Call::from_action_params(params, true)) + fn prepare_trace_call(&self, params: &ActionParams, record_input: bool) -> Option { + Some(Call::from_action_params(params, record_input)) } fn prepare_trace_create(&self, params: &ActionParams) -> Option { diff --git a/ethcore/src/trace/mod.rs b/ethcore/src/trace/mod.rs index 381dcd9f0d1..a4b5d013132 100644 --- a/ethcore/src/trace/mod.rs +++ b/ethcore/src/trace/mod.rs @@ -49,7 +49,7 @@ pub trait Tracer: Send { type Output; /// Prepares call trace for given params. Noop tracer should return None. - fn prepare_trace_call(&self, params: &ActionParams) -> Option; + fn prepare_trace_call(&self, params: &ActionParams, record_input: bool) -> Option; /// Prepares create trace for given params. Noop tracer should return None. fn prepare_trace_create(&self, params: &ActionParams) -> Option; diff --git a/ethcore/src/trace/noop_tracer.rs b/ethcore/src/trace/noop_tracer.rs index ab0bf77ff1c..3843ca9cc5d 100644 --- a/ethcore/src/trace/noop_tracer.rs +++ b/ethcore/src/trace/noop_tracer.rs @@ -28,7 +28,7 @@ pub struct NoopTracer; impl Tracer for NoopTracer { type Output = FlatTrace; - fn prepare_trace_call(&self, _: &ActionParams) -> Option { + fn prepare_trace_call(&self, _: &ActionParams, _: bool) -> Option { None }