Skip to content

Commit

Permalink
improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Jun 19, 2024
1 parent 52f3de7 commit 77c4c34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eth/tracers/api_blocktrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

0 comments on commit 77c4c34

Please sign in to comment.