@@ -38,14 +38,16 @@ where
38
38
Host : FullNodeComponents ,
39
39
Signet : Pnt ,
40
40
{
41
+ let opts = response_tri ! ( opts. ok_or( DebugError :: from( EthApiError :: InvalidTracerConfig ) ) ) ;
42
+
41
43
let _permit = response_tri ! (
42
44
ctx. acquire_tracing_permit( )
43
45
. await
44
46
. map_err( |_| DebugError :: rpc_error( "Failed to acquire tracing permit" . into( ) ) )
45
47
) ;
46
48
47
49
let id = id. into ( ) ;
48
- let span = tracing:: debug_span!( "traceBlock" , ?id, tracer = ?opts. as_ref ( ) . and_then ( |o| o . tracer. as_ref( ) ) ) ;
50
+ let span = tracing:: debug_span!( "traceBlock" , ?id, tracer = ?opts. tracer. as_ref( ) ) ;
49
51
50
52
let fut = async move {
51
53
// Fetch the block by ID
64
66
let mut trevm = response_tri ! ( ctx. trevm( crate :: LoadState :: Before , block. header( ) ) ) ;
65
67
66
68
// Apply all transactions in the block up, tracing each one
67
- let opts = opts. unwrap_or_default ( ) ;
68
-
69
69
tracing:: trace!( ?opts, "Tracing block transactions" ) ;
70
70
71
71
let mut txns = block. body ( ) . transactions ( ) . enumerate ( ) . peekable ( ) ;
@@ -107,13 +107,15 @@ where
107
107
Host : FullNodeComponents ,
108
108
Signet : Pnt ,
109
109
{
110
+ let opts = response_tri ! ( opts. ok_or( DebugError :: from( EthApiError :: InvalidTracerConfig ) ) ) ;
111
+
110
112
let _permit = response_tri ! (
111
113
ctx. acquire_tracing_permit( )
112
114
. await
113
115
. map_err( |_| DebugError :: rpc_error( "Failed to acquire tracing permit" . into( ) ) )
114
116
) ;
115
117
116
- let span = tracing:: debug_span!( "traceTransaction" , %tx_hash, tracer = ?opts. as_ref ( ) . and_then ( |o| o . tracer. as_ref( ) ) ) ;
118
+ let span = tracing:: debug_span!( "traceTransaction" , %tx_hash, tracer = ?opts. tracer. as_ref( ) ) ;
117
119
118
120
let fut = async move {
119
121
// Load the transaction by hash
@@ -159,8 +161,7 @@ where
159
161
base_fee : block. header ( ) . base_fee_per_gas ( ) ,
160
162
} ;
161
163
162
- let res =
163
- response_tri ! ( crate :: debug:: tracer:: trace( trevm, & opts. unwrap_or_default( ) , tx_info) ) . 0 ;
164
+ let res = response_tri ! ( crate :: debug:: tracer:: trace( trevm, & opts, tx_info) ) . 0 ;
164
165
165
166
ResponsePayload :: Success ( res)
166
167
}
0 commit comments