Skip to content

Commit 663fa7b

Browse files
authored
eth: correct tracer initialization in BlockchainConfig (#32107)
core.BlockChainConfig.VmConfig is not a pointer, so setting the Tracer on the `vmConfig` object after it was passed to options does *not* apply it to options.VmConfig This fixes the issue by setting the value directly inside the `options` object and removing the confusing `vmConfig` variable to prevent further mistakes.
1 parent aa1de05 commit 663fa7b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

eth/backend.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
221221
}
222222
}
223223
var (
224-
vmConfig = vm.Config{
225-
EnablePreimageRecording: config.EnablePreimageRecording,
226-
}
227224
options = &core.BlockChainConfig{
228225
TrieCleanLimit: config.TrieCleanCache,
229226
NoPrefetch: config.NoPrefetch,
@@ -236,7 +233,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
236233
StateScheme: scheme,
237234
ChainHistoryMode: config.HistoryMode,
238235
TxLookupLimit: int64(min(config.TransactionHistory, math.MaxInt64)),
239-
VmConfig: vmConfig,
236+
VmConfig: vm.Config{
237+
EnablePreimageRecording: config.EnablePreimageRecording,
238+
},
240239
}
241240
)
242241

@@ -249,7 +248,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
249248
if err != nil {
250249
return nil, fmt.Errorf("failed to create tracer %s: %v", config.VMTrace, err)
251250
}
252-
vmConfig.Tracer = t
251+
options.VmConfig.Tracer = t
253252
}
254253
// Override the chain config with provided settings.
255254
var overrides core.ChainOverrides

0 commit comments

Comments
 (0)