mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 04:26:37 +00:00
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.
This commit is contained in:
parent
aa1de05720
commit
663fa7b496
1 changed files with 4 additions and 5 deletions
|
|
@ -221,9 +221,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
vmConfig = vm.Config{
|
|
||||||
EnablePreimageRecording: config.EnablePreimageRecording,
|
|
||||||
}
|
|
||||||
options = &core.BlockChainConfig{
|
options = &core.BlockChainConfig{
|
||||||
TrieCleanLimit: config.TrieCleanCache,
|
TrieCleanLimit: config.TrieCleanCache,
|
||||||
NoPrefetch: config.NoPrefetch,
|
NoPrefetch: config.NoPrefetch,
|
||||||
|
|
@ -236,7 +233,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
StateScheme: scheme,
|
StateScheme: scheme,
|
||||||
ChainHistoryMode: config.HistoryMode,
|
ChainHistoryMode: config.HistoryMode,
|
||||||
TxLookupLimit: int64(min(config.TransactionHistory, math.MaxInt64)),
|
TxLookupLimit: int64(min(config.TransactionHistory, math.MaxInt64)),
|
||||||
VmConfig: vmConfig,
|
VmConfig: vm.Config{
|
||||||
|
EnablePreimageRecording: config.EnablePreimageRecording,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -249,7 +248,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to create tracer %s: %v", config.VMTrace, err)
|
return nil, fmt.Errorf("failed to create tracer %s: %v", config.VMTrace, err)
|
||||||
}
|
}
|
||||||
vmConfig.Tracer = t
|
options.VmConfig.Tracer = t
|
||||||
}
|
}
|
||||||
// Override the chain config with provided settings.
|
// Override the chain config with provided settings.
|
||||||
var overrides core.ChainOverrides
|
var overrides core.ChainOverrides
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue