Skip to content

Commit 182c044

Browse files
authored
feat: add erc7562 config (#317)
add corresponding config
1 parent b878f7e commit 182c044

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/tracing/config.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use alloy_primitives::{map::HashSet, U256};
22
use alloy_rpc_types_trace::{
3-
geth::{CallConfig, FlatCallConfig, GethDefaultTracingOptions, PreStateConfig},
3+
geth::{
4+
erc7562::Erc7562Config, CallConfig, FlatCallConfig, GethDefaultTracingOptions,
5+
PreStateConfig,
6+
},
47
parity::TraceType,
58
};
69
use revm::bytecode::opcode::OpCode;
@@ -207,6 +210,20 @@ impl TracingInspectorConfig {
207210
.set_record_logs(config.with_log.unwrap_or_default())
208211
}
209212

213+
/// Returns a config for geth's
214+
/// [Erc7562Frame](alloy_rpc_types_trace::geth::erc7562::Erc7562Frame).
215+
#[inline]
216+
pub fn from_geth_erc7562_config(config: &Erc7562Config) -> Self {
217+
Self::none()
218+
// call tracer is similar parity tracer with optional support for logs
219+
.set_record_logs(config.with_log.unwrap_or_default())
220+
// need memory snapshots for keccak preimages
221+
.set_memory_snapshots(true)
222+
// need stack snapshots for keccak preimages
223+
.set_stack_snapshots(StackSnapshotType::Full)
224+
.steps()
225+
}
226+
210227
/// Returns a config for geth's
211228
/// [FlatCallTracer](alloy_rpc_types_trace::geth::call::FlatCallFrame).
212229
///

0 commit comments

Comments
 (0)