mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
remove unused error return from core.PreExecution
This commit is contained in:
parent
3bfba9bc2a
commit
22adcf749c
5 changed files with 15 additions and 28 deletions
|
|
@ -86,9 +86,7 @@ func (p *StateProcessor) Process(ctx context.Context, block *types.Block, stated
|
|||
)
|
||||
defer evm.Release()
|
||||
// Run the pre-execution system calls
|
||||
if err := PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), config, evm, block.Number(), block.Time()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), config, evm, block.Number(), block.Time())
|
||||
// Iterate over and process the individual transactions
|
||||
for i, tx := range block.Transactions() {
|
||||
msg, err := TransactionToMessage(tx, signer, header.BaseFee)
|
||||
|
|
@ -127,7 +125,7 @@ func (p *StateProcessor) Process(ctx context.Context, block *types.Block, stated
|
|||
}
|
||||
|
||||
// PreExecution processes pre-execution system calls.
|
||||
func PreExecution(ctx context.Context, beaconRoot *common.Hash, parent common.Hash, config *params.ChainConfig, evm *vm.EVM, number *big.Int, time uint64) error {
|
||||
func PreExecution(ctx context.Context, beaconRoot *common.Hash, parent common.Hash, config *params.ChainConfig, evm *vm.EVM, number *big.Int, time uint64) {
|
||||
_, _, spanEnd := telemetry.StartSpan(ctx, "core.preExecution")
|
||||
defer spanEnd(nil)
|
||||
|
||||
|
|
@ -139,7 +137,6 @@ func PreExecution(ctx context.Context, beaconRoot *common.Hash, parent common.Ha
|
|||
if config.IsPrague(number, time) || config.IsUBT(number, time) {
|
||||
ProcessParentBlockHash(parent, evm)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// PostExecution processes post-execution system calls when Prague is enabled.
|
||||
|
|
|
|||
|
|
@ -250,9 +250,8 @@ func (eth *Ethereum) stateAtTransaction(ctx context.Context, block *types.Block,
|
|||
defer evm.Release()
|
||||
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), eth.blockchain.Config(), evm, block.Number(), block.Time()); err != nil {
|
||||
return nil, vm.BlockContext{}, nil, nil, err
|
||||
}
|
||||
core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), eth.blockchain.Config(), evm, block.Number(), block.Time())
|
||||
|
||||
if txIndex == 0 && len(block.Transactions()) == 0 {
|
||||
return nil, context, statedb, release, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -372,12 +372,9 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed
|
|||
// as per EIP-4788.
|
||||
context := core.NewEVMBlockContext(next.Header(), api.chainContext(ctx), nil)
|
||||
evm := vm.NewEVM(context, statedb, api.backend.ChainConfig(), vm.Config{})
|
||||
defer evm.Release()
|
||||
|
||||
if err := core.PreExecution(ctx, next.BeaconRoot(), next.ParentHash(), api.backend.ChainConfig(), evm, next.Number(), next.Time()); err != nil {
|
||||
failed = err
|
||||
break
|
||||
}
|
||||
evm.Release()
|
||||
core.PreExecution(ctx, next.BeaconRoot(), next.ParentHash(), api.backend.ChainConfig(), evm, next.Number(), next.Time())
|
||||
// Clean out any pending release functions of trace state. Note this
|
||||
// step must be done after constructing tracing state, because the
|
||||
// tracing state of block next depends on the parent state and construction
|
||||
|
|
@ -527,9 +524,8 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config
|
|||
)
|
||||
defer evm.Release()
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), chainConfig, evm, block.Number(), block.Time()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), chainConfig, evm, block.Number(), block.Time())
|
||||
|
||||
for i, tx := range block.Transactions() {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
|
|
@ -588,9 +584,8 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
|
|||
defer evm.Release()
|
||||
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), api.backend.ChainConfig(), evm, block.Number(), block.Time()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), api.backend.ChainConfig(), evm, block.Number(), block.Time())
|
||||
|
||||
// JS tracers have high overhead. In this case run a parallel
|
||||
// process that generates states in one thread and traces txes
|
||||
// in separate worker threads.
|
||||
|
|
@ -761,9 +756,8 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
|
|||
defer evm.Release()
|
||||
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), chainConfig, evm, block.Number(), block.Time()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
core.PreExecution(ctx, block.BeaconRoot(), block.ParentHash(), chainConfig, evm, block.Number(), block.Time())
|
||||
|
||||
for i, tx := range block.Transactions() {
|
||||
// Prepare the transaction for un-traced execution
|
||||
msg, _ := core.TransactionToMessage(tx, signer, block.BaseFee())
|
||||
|
|
|
|||
|
|
@ -319,9 +319,8 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
|
|||
evm.SetPrecompiles(precompiles)
|
||||
}
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, header.ParentBeaconRoot, header.ParentHash, sim.chainConfig, evm, header.Number, header.Time); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
core.PreExecution(ctx, header.ParentBeaconRoot, header.ParentHash, sim.chainConfig, evm, header.Number, header.Time)
|
||||
|
||||
var allLogs []*types.Log
|
||||
for i, call := range block.Calls {
|
||||
// Terminate if the context is cancelled
|
||||
|
|
|
|||
|
|
@ -318,9 +318,7 @@ func (miner *Miner) prepareWork(ctx context.Context, genParams *generateParams,
|
|||
return nil, err
|
||||
}
|
||||
// Run pre-execution system calls
|
||||
if err := core.PreExecution(ctx, header.ParentBeaconRoot, header.ParentHash, miner.chainConfig, env.evm, header.Number, header.Time); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
core.PreExecution(ctx, header.ParentBeaconRoot, header.ParentHash, miner.chainConfig, env.evm, header.Number, header.Time)
|
||||
return env, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue