@@ -47,7 +47,7 @@ func NewTracerWrapper() *TracerWrapper {
47
47
48
48
// CreateTraceEnvAndGetBlockTrace wraps the whole block tracing logic for a block
49
49
func (tw * TracerWrapper ) CreateTraceEnvAndGetBlockTrace (chainConfig * params.ChainConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , l1Client vm.L1Client , parent * types.Block , block * types.Block , commitAfterApply bool ) (* types.BlockTrace , error ) {
50
- traceEnv , err := CreateTraceEnv (chainConfig , chainContext , engine , chaindb , statedb , l1Client , parent , block , commitAfterApply )
50
+ traceEnv , err := CreateTraceEnv (chainConfig , chainContext , engine , chaindb , statedb , l1Client , vm . CallerTypeNonWorker , parent , block , commitAfterApply )
51
51
if err != nil {
52
52
return nil , err
53
53
}
@@ -60,6 +60,7 @@ type TraceEnv struct {
60
60
commitAfterApply bool
61
61
chainConfig * params.ChainConfig
62
62
l1Client vm.L1Client
63
+ callerType vm.CallerType
63
64
64
65
coinbase common.Address
65
66
@@ -99,13 +100,14 @@ type txTraceTask struct {
99
100
index int
100
101
}
101
102
102
- func CreateTraceEnvHelper (chainConfig * params.ChainConfig , logConfig * vm.LogConfig , l1Client vm.L1Client , blockCtx vm.BlockContext , startL1QueueIndex uint64 , coinbase common.Address , statedb * state.StateDB , rootBefore common.Hash , block * types.Block , commitAfterApply bool ) * TraceEnv {
103
+ func CreateTraceEnvHelper (chainConfig * params.ChainConfig , logConfig * vm.LogConfig , l1Client vm.L1Client , callerType vm. CallerType , blockCtx vm.BlockContext , startL1QueueIndex uint64 , coinbase common.Address , statedb * state.StateDB , rootBefore common.Hash , block * types.Block , commitAfterApply bool ) * TraceEnv {
103
104
return & TraceEnv {
104
105
logConfig : logConfig ,
105
106
commitAfterApply : commitAfterApply ,
106
107
chainConfig : chainConfig ,
107
108
coinbase : coinbase ,
108
109
l1Client : l1Client ,
110
+ callerType : callerType ,
109
111
signer : types .MakeSigner (chainConfig , block .Number ()),
110
112
state : statedb ,
111
113
blockCtx : blockCtx ,
@@ -122,7 +124,7 @@ func CreateTraceEnvHelper(chainConfig *params.ChainConfig, logConfig *vm.LogConf
122
124
}
123
125
}
124
126
125
- func CreateTraceEnv (chainConfig * params.ChainConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , l1Client vm.L1Client , parent * types.Block , block * types.Block , commitAfterApply bool ) (* TraceEnv , error ) {
127
+ func CreateTraceEnv (chainConfig * params.ChainConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , l1Client vm.L1Client , callerType vm. CallerType , parent * types.Block , block * types.Block , commitAfterApply bool ) (* TraceEnv , error ) {
126
128
var coinbase common.Address
127
129
128
130
var err error
@@ -160,6 +162,7 @@ func CreateTraceEnv(chainConfig *params.ChainConfig, chainContext core.ChainCont
160
162
EnableReturnData : true ,
161
163
},
162
164
l1Client ,
165
+ callerType ,
163
166
core .NewEVMBlockContext (block .Header (), chainContext , chainConfig , nil ),
164
167
* startL1QueueIndex ,
165
168
coinbase ,
@@ -231,7 +234,7 @@ func (env *TraceEnv) GetBlockTrace(block *types.Block) (*types.BlockTrace, error
231
234
// Generate the next state snapshot fast without tracing
232
235
msg , _ := tx .AsMessage (env .signer , block .BaseFee ())
233
236
env .state .SetTxContext (tx .Hash (), i )
234
- vmenv := vm .NewEVM (env .blockCtx , core .NewEVMTxContext (msg ), env .state , env .chainConfig , vm.Config {L1Client : env .l1Client })
237
+ vmenv := vm .NewEVM (env .blockCtx , core .NewEVMTxContext (msg ), env .state , env .chainConfig , vm.Config {L1Client : env .l1Client , CallerType : env . callerType })
235
238
l1DataFee , err := fees .CalculateL1DataFee (tx , env .state )
236
239
if err != nil {
237
240
failed = err
@@ -332,7 +335,7 @@ func (env *TraceEnv) getTxResult(state *state.StateDB, index int, block *types.B
332
335
structLogger := vm .NewStructLogger (env .logConfig )
333
336
tracer := NewMuxTracer (structLogger , callTracer , prestateTracer )
334
337
// Run the transaction with tracing enabled.
335
- vmenv := vm .NewEVM (env .blockCtx , txContext , state , env .chainConfig , vm.Config {L1Client : env .l1Client , Debug : true , Tracer : tracer , NoBaseFee : true })
338
+ vmenv := vm .NewEVM (env .blockCtx , txContext , state , env .chainConfig , vm.Config {L1Client : env .l1Client , Debug : true , Tracer : tracer , NoBaseFee : true , CallerType : env . callerType })
336
339
337
340
// Call Prepare to clear out the statedb access list
338
341
state .SetTxContext (txctx .TxHash , txctx .TxIndex )
0 commit comments