@@ -3538,7 +3538,7 @@ impl RpcMethod<1> for EthTraceBlock {
35383538 let ts = resolver
35393539 . tipset_by_block_number_or_hash ( block_param, ResolveNullTipset :: Fail )
35403540 . await ?;
3541- eth_trace_block ( & ctx. state_manager , & ts)
3541+ eth_trace_block ( & ctx. state_manager , & ts, CallSource :: External )
35423542 . await
35433543 . map ( NotNullVec )
35443544 }
@@ -3548,8 +3548,9 @@ impl RpcMethod<1> for EthTraceBlock {
35483548async fn execute_tipset_traces (
35493549 state_manager : & StateManager ,
35503550 ts : & Tipset ,
3551+ source : CallSource ,
35513552) -> Result < ( StateTree < DbImpl > , Vec < trace:: TipsetTraceEntry > ) , ServerError > {
3552- let ( state_root, raw_traces) = state_manager. execution_trace ( ts) . await ?;
3553+ let ( state_root, raw_traces) = state_manager. execution_trace ( ts, source ) . await ?;
35533554 let state = state_manager. get_state_tree ( & state_root) ?;
35543555
35553556 // Resolve every non-system message's tx hash in parallel. Each lookup is
@@ -3604,6 +3605,7 @@ fn non_system_traces_with_positions(
36043605pub ( crate ) async fn eth_trace_block (
36053606 state_manager : & StateManager ,
36063607 ts : & Tipset ,
3608+ source : CallSource ,
36073609) -> Result < Vec < EthBlockTrace > , ServerError > {
36083610 // 64 most-recent blocks; bounded by count, not bytes (a few MiB on mainnet,
36093611 // see the `cache_eth_trace_block_size` metric).
@@ -3616,7 +3618,7 @@ pub(crate) async fn eth_trace_block(
36163618 let block_cid = ts. key ( ) . cid ( ) ?;
36173619 let traces = ETH_TRACE_BLOCK_CACHE
36183620 . get_or_insert_async ( & CidWrapper :: from ( block_cid) , async move {
3619- let ( state, entries) = execute_tipset_traces ( state_manager, ts) . await ?;
3621+ let ( state, entries) = execute_tipset_traces ( state_manager, ts, source ) . await ?;
36203622 let block_hash: EthHash = block_cid. into ( ) ;
36213623 let mut all_traces = vec ! [ ] ;
36223624
@@ -3665,6 +3667,7 @@ impl RpcMethod<2> for EthDebugTraceTransaction {
36653667 tx_hash,
36663668 opts,
36673669 & cancellation_token,
3670+ CallSource :: External ,
36683671 )
36693672 . await
36703673 }
@@ -3676,6 +3679,7 @@ async fn debug_trace_transaction(
36763679 tx_hash : String ,
36773680 opts : GethDebugTracingOptions ,
36783681 cancellation_token : & CancellationToken ,
3682+ source : CallSource ,
36793683) -> Result < GethTrace , ServerError > {
36803684 let tracer = match & opts. tracer {
36813685 Some ( t) => t. clone ( ) ,
@@ -3752,7 +3756,7 @@ async fn debug_trace_transaction(
37523756 return Ok ( GethTrace :: PreState ( frame) ) ;
37533757 }
37543758
3755- let ( state, entries) = execute_tipset_traces ( & ctx. state_manager , & ts) . await ?;
3759+ let ( state, entries) = execute_tipset_traces ( & ctx. state_manager , & ts, source ) . await ?;
37563760 let entry = entries
37573761 . into_iter ( )
37583762 . find ( |e| e. tx_hash == eth_hash)
@@ -3956,7 +3960,7 @@ impl RpcMethod<1> for EthTraceTransaction {
39563960 . tipset_by_block_number_or_hash ( eth_txn. block_number , ResolveNullTipset :: TakeOlder )
39573961 . await ?;
39583962
3959- let traces = eth_trace_block ( & ctx. state_manager , & ts)
3963+ let traces = eth_trace_block ( & ctx. state_manager , & ts, CallSource :: External )
39603964 . await ?
39613965 . into_iter ( )
39623966 . filter ( |trace| trace. transaction_hash == eth_hash)
@@ -3996,7 +4000,7 @@ impl RpcMethod<2> for EthTraceReplayBlockTransactions {
39964000 . tipset_by_block_number_or_hash ( block_param, ResolveNullTipset :: Fail )
39974001 . await ?;
39984002
3999- eth_trace_replay_block_transactions ( & ctx, & ts)
4003+ eth_trace_replay_block_transactions ( & ctx, & ts, CallSource :: External )
40004004 . await
40014005 . map ( NotNullVec )
40024006 }
@@ -4005,8 +4009,9 @@ impl RpcMethod<2> for EthTraceReplayBlockTransactions {
40054009async fn eth_trace_replay_block_transactions (
40064010 ctx : & Ctx ,
40074011 ts : & Tipset ,
4012+ source : CallSource ,
40084013) -> Result < Vec < EthReplayBlockTransactionTrace > , ServerError > {
4009- let ( state, entries) = execute_tipset_traces ( & ctx. state_manager , ts) . await ?;
4014+ let ( state, entries) = execute_tipset_traces ( & ctx. state_manager , ts, source ) . await ?;
40104015
40114016 let mut all_traces = vec ! [ ] ;
40124017 for entry in entries {
0 commit comments