@@ -45,8 +45,8 @@ func NewTracerWrapper() *TracerWrapper {
45
45
}
46
46
47
47
// CreateTraceEnvAndGetBlockTrace wraps the whole block tracing logic for a block
48
- func (tw * TracerWrapper ) CreateTraceEnvAndGetBlockTrace (chainConfig * params.ChainConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , parent * types.Block , block * types.Block , commitAfterApply bool ) (* types.BlockTrace , error ) {
49
- traceEnv , err := CreateTraceEnv (chainConfig , chainContext , engine , chaindb , statedb , parent , block , commitAfterApply )
48
+ func (tw * TracerWrapper ) CreateTraceEnvAndGetBlockTrace (chainConfig * params.ChainConfig , logConfig * vm. LogConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , parent * types.Block , block * types.Block , commitAfterApply bool ) (* types.BlockTrace , error ) {
49
+ traceEnv , err := CreateTraceEnv (chainConfig , logConfig , chainContext , engine , chaindb , statedb , parent , block , commitAfterApply )
50
50
if err != nil {
51
51
return nil , err
52
52
}
@@ -98,6 +98,15 @@ type txTraceTask struct {
98
98
}
99
99
100
100
func CreateTraceEnvHelper (chainConfig * params.ChainConfig , logConfig * vm.LogConfig , blockCtx vm.BlockContext , startL1QueueIndex uint64 , coinbase common.Address , statedb * state.StateDB , rootBefore common.Hash , block * types.Block , commitAfterApply bool ) * TraceEnv {
101
+ if logConfig == nil {
102
+ logConfig = & vm.LogConfig {
103
+ DisableStorage : true ,
104
+ DisableStack : true ,
105
+ EnableMemory : false ,
106
+ EnableReturnData : true ,
107
+ }
108
+ }
109
+
101
110
return & TraceEnv {
102
111
logConfig : logConfig ,
103
112
commitAfterApply : commitAfterApply ,
@@ -119,7 +128,7 @@ func CreateTraceEnvHelper(chainConfig *params.ChainConfig, logConfig *vm.LogConf
119
128
}
120
129
}
121
130
122
- func CreateTraceEnv (chainConfig * params.ChainConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , parent * types.Block , block * types.Block , commitAfterApply bool ) (* TraceEnv , error ) {
131
+ func CreateTraceEnv (chainConfig * params.ChainConfig , logConfig * vm. LogConfig , chainContext core.ChainContext , engine consensus.Engine , chaindb ethdb.Database , statedb * state.StateDB , parent * types.Block , block * types.Block , commitAfterApply bool ) (* TraceEnv , error ) {
123
132
var coinbase common.Address
124
133
125
134
var err error
@@ -150,12 +159,7 @@ func CreateTraceEnv(chainConfig *params.ChainConfig, chainContext core.ChainCont
150
159
}
151
160
env := CreateTraceEnvHelper (
152
161
chainConfig ,
153
- & vm.LogConfig {
154
- DisableStorage : true ,
155
- DisableStack : true ,
156
- EnableMemory : false ,
157
- EnableReturnData : true ,
158
- },
162
+ logConfig ,
159
163
core .NewEVMBlockContext (block .Header (), chainContext , chainConfig , nil ),
160
164
* startL1QueueIndex ,
161
165
coinbase ,
0 commit comments