Skip to content

Commit

Permalink
Block init added
Browse files Browse the repository at this point in the history
  • Loading branch information
dhyaniarun1993 committed Mar 28, 2024
1 parent 76296f4 commit 92f25fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
logger: logger,
}

if tracer.Hooks != nil && tracer.Hooks.OnBlockchainInit != nil {
tracer.Hooks.OnBlockchainInit(config.Genesis.Config)
}

var chainConfig *chain.Config
var genesis *types.Block
if err := backend.chainDB.Update(context.Background(), func(tx kv.RwTx) error {
Expand Down
3 changes: 3 additions & 0 deletions turbo/app/init_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func initGenesis(cliCtx *cli.Context) error {
var tracingHooks *tracing.Hooks
if tracer != nil {
tracingHooks = tracer.Hooks
if tracer.Hooks != nil && tracer.Hooks.OnBlockchainInit != nil {
tracer.Hooks.OnBlockchainInit(genesis.Config)
}
}
_, hash, err := core.CommitGenesisBlock(chaindb, genesis, "", logger, tracingHooks)
if err != nil {
Expand Down

0 comments on commit 92f25fc

Please sign in to comment.