From 35b02a5c7d8e7b51c5a544262ae8c66fb7a072b0 Mon Sep 17 00:00:00 2001 From: dropbigfish Date: Sun, 20 Apr 2025 12:20:57 +0800 Subject: [PATCH] chore: fix some comments Signed-off-by: dropbigfish --- core/state_processor.go | 2 +- eth/state_accessor.go | 4 ++-- eth/tracers/api.go | 18 +++++++++--------- miner/worker.go | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/core/state_processor.go b/core/state_processor.go index 849055a16c..6fefbb3be1 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -77,7 +77,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg if lastBlock == nil { return nil, errors.New("could not get parent block") } - // Handle upgrade build-in system contract code + // Handle upgrade built-in system contract code systemcontracts.TryUpdateBuildInSystemContract(p.config, blockNumber, lastBlock.Time, block.Time(), statedb, true) var ( diff --git a/eth/state_accessor.go b/eth/state_accessor.go index e9fefce391..eca90d44b0 100644 --- a/eth/state_accessor.go +++ b/eth/state_accessor.go @@ -241,7 +241,7 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block, if err != nil { return nil, vm.BlockContext{}, nil, nil, err } - // upgrade build-in system contract before normal txs if Feynman is not enabled + // upgrade built-in system contract before normal txs if Feynman is not enabled systemcontracts.TryUpdateBuildInSystemContract(eth.blockchain.Config(), block.Number(), parent.Time(), block.Time(), statedb, true) // Insert parent beacon block root in the state as per EIP-4788. context := core.NewEVMBlockContext(block.Header(), eth.blockchain, nil) @@ -262,7 +262,7 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block, beforeSystemTx = true ) for idx, tx := range block.Transactions() { - // upgrade build-in system contract before system txs if Feynman is enabled + // upgrade built-in system contract before system txs if Feynman is enabled if beforeSystemTx { if posa, ok := eth.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, block.Header()); isSystem { diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 0405d08e1c..0327bf266e 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -279,7 +279,7 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed ) // Trace all the transactions contained within for i, tx := range task.block.Transactions() { - // upgrade build-in system contract before system txs if Feynman is enabled + // upgrade built-in system contract before system txs if Feynman is enabled if beforeSystemTx { if posa, ok := api.backend.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, task.block.Header()); isSystem { @@ -402,7 +402,7 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed break } - // upgrade build-in system contract before normal txs if Feynman is not enabled + // upgrade built-in system contract before normal txs if Feynman is not enabled systemcontracts.TryUpdateBuildInSystemContract(api.backend.ChainConfig(), next.Number(), block.Time(), next.Time(), statedb, true) // Insert block's parent beacon block root in the state @@ -558,7 +558,7 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config } defer release() - // upgrade build-in system contract before normal txs if Feynman is not enabled + // upgrade built-in system contract before normal txs if Feynman is not enabled systemcontracts.TryUpdateBuildInSystemContract(api.backend.ChainConfig(), block.Number(), parent.Time(), block.Time(), statedb, true) var ( @@ -649,7 +649,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac } defer release() - // upgrade build-in system contract before normal txs if Feynman is not enabled + // upgrade built-in system contract before normal txs if Feynman is not enabled systemcontracts.TryUpdateBuildInSystemContract(api.backend.ChainConfig(), block.Number(), parent.Time(), block.Time(), statedb, true) blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) evm := vm.NewEVM(blockCtx, statedb, api.backend.ChainConfig(), vm.Config{}) @@ -678,7 +678,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac beforeSystemTx = true ) for i, tx := range txs { - // upgrade build-in system contract before system txs if Feynman is enabled + // upgrade built-in system contract before system txs if Feynman is enabled if beforeSystemTx { if posa, ok := api.backend.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, block.Header()); isSystem { @@ -771,7 +771,7 @@ func (api *API) traceBlockParallel(ctx context.Context, block *types.Block, stat txloop: for i, tx := range txs { - // upgrade build-in system contract before system txs if Feynman is enabled + // upgrade built-in system contract before system txs if Feynman is enabled if beforeSystemTx { if posa, ok := api.backend.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, block.Header()); isSystem { @@ -845,7 +845,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block } defer release() - // upgrade build-in system contract before normal txs if Feynman is not enabled + // upgrade built-in system contract before normal txs if Feynman is not enabled systemcontracts.TryUpdateBuildInSystemContract(api.backend.ChainConfig(), block.Number(), parent.Time(), block.Time(), statedb, true) // Retrieve the tracing configurations, or use default values @@ -884,7 +884,7 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block core.ProcessParentBlockHash(block.ParentHash(), evm) } for i, tx := range block.Transactions() { - // upgrade build-in system contract before system txs if Feynman is enabled + // upgrade built-in system contract before system txs if Feynman is enabled if beforeSystemTx { if posa, ok := api.backend.Engine().(consensus.PoSA); ok { if isSystem, _ := posa.IsSystemTransaction(tx, block.Header()); isSystem { @@ -1068,7 +1068,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc } defer release() - // upgrade build-in system contract before tracing if Feynman is not enabled + // upgrade built-in system contract before tracing if Feynman is not enabled if block.NumberU64() > 0 { parent, err := api.blockByNumberAndHash(ctx, rpc.BlockNumber(block.NumberU64()-1), block.ParentHash()) if err != nil { diff --git a/miner/worker.go b/miner/worker.go index 8a5bb0ebe1..ae8281aaab 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1080,7 +1080,7 @@ func (w *worker) prepareWork(genParams *generateParams, witness bool) (*environm return nil, err } - // Handle upgrade build-in system contract code + // Handle upgrade built-in system contract code systemcontracts.TryUpdateBuildInSystemContract(w.chainConfig, header.Number, parent.Time, header.Time, env.state, true) if header.ParentBeaconRoot != nil {