From 77c4c343b2af6932839557bf54aa9e357896abaa Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Wed, 19 Jun 2024 13:45:24 +0800 Subject: [PATCH] improve logs --- eth/tracers/api_blocktrace.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eth/tracers/api_blocktrace.go b/eth/tracers/api_blocktrace.go index ba4e897497d5..194bf59b1b1c 100644 --- a/eth/tracers/api_blocktrace.go +++ b/eth/tracers/api_blocktrace.go @@ -3,7 +3,6 @@ package tracers import ( "context" "errors" - "fmt" "github.com/scroll-tech/go-ethereum/consensus" "github.com/scroll-tech/go-ethereum/consensus/misc" @@ -111,17 +110,18 @@ func (api *API) createTraceEnvAndGetBlockTrace(ctx context.Context, config *Trac } chaindb := api.backend.ChainDb() + // create a copy of api.backend.ChainConfig to modify chainConfig := new(params.ChainConfig) *chainConfig = *api.backend.ChainConfig() if config != nil && config.Overrides != nil { // the merge.Merge seems not work well - // mergo.Merge(&chainConfig, config.Overrides, mergo.WithOverride) + // mergo.Merge(chainConfig, config.Overrides, mergo.WithOverride) if curie := config.Overrides.CurieBlock; curie != nil { chainConfig.CurieBlock = curie misc.ApplyCurieHardFork(statedb) statedb.Commit(true) } - fmt.Printf("trace config overrided: %v, config.Overrides: %v", chainConfig, config.Overrides) + log.Info("chainConfig overrided by traceConfig.Overrides", "chainConfig", chainConfig, "config.Overrides", config.Overrides) } return api.scrollTracerWrapper.CreateTraceEnvAndGetBlockTrace(chainConfig, api.chainContext(ctx), api.backend.Engine(), chaindb, statedb, parent, block, true) }