mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
move down beacn root processing
This commit is contained in:
parent
f7e87d1a89
commit
c3951c3e1d
1 changed files with 12 additions and 15 deletions
|
|
@ -524,11 +524,6 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config
|
|||
return nil, err
|
||||
}
|
||||
defer release()
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
context := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
|
||||
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
var (
|
||||
roots []common.Hash
|
||||
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
|
||||
|
|
@ -536,6 +531,10 @@ func (api *API) IntermediateRoots(ctx context.Context, hash common.Hash, config
|
|||
vmctx = core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
|
||||
deleteEmptyObjects = chainConfig.IsEIP158(block.Number())
|
||||
)
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
vmenv := vm.NewEVM(vmctx, vm.TxContext{}, statedb, chainConfig, vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
for i, tx := range block.Transactions() {
|
||||
if err := ctx.Err(); err != nil {
|
||||
return nil, err
|
||||
|
|
@ -595,11 +594,6 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
|
|||
return nil, err
|
||||
}
|
||||
defer release()
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
context := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
|
||||
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
// 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.
|
||||
|
|
@ -616,6 +610,10 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
|
|||
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
|
||||
results = make([]*txTraceResult, len(txs))
|
||||
)
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
vmenv := vm.NewEVM(blockCtx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
for i, tx := range txs {
|
||||
// Generate the next state snapshot fast without tracing
|
||||
msg, _ := core.TransactionToMessage(tx, signer, block.BaseFee())
|
||||
|
|
@ -742,11 +740,6 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
|
|||
return nil, err
|
||||
}
|
||||
defer release()
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
context := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
|
||||
vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
// Retrieve the tracing configurations, or use default values
|
||||
var (
|
||||
logConfig logger.Config
|
||||
|
|
@ -775,6 +768,10 @@ func (api *API) standardTraceBlockToFile(ctx context.Context, block *types.Block
|
|||
// Note: This copies the config, to not screw up the main config
|
||||
chainConfig, canon = overrideConfig(chainConfig, config.Overrides)
|
||||
}
|
||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
||||
vmenv := vm.NewEVM(vmctx, vm.TxContext{}, statedb, chainConfig, vm.Config{})
|
||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
||||
}
|
||||
for i, tx := range block.Transactions() {
|
||||
// Prepare the transaction for un-traced execution
|
||||
var (
|
||||
|
|
|
|||
Loading…
Reference in a new issue