mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
eth/tracers: remove newly added code in block tracer
This commit is contained in:
parent
aa36b7dd9b
commit
8a91d39d3a
1 changed files with 0 additions and 44 deletions
|
|
@ -805,50 +805,6 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer release()
|
|
||||||
|
|
||||||
blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil)
|
|
||||||
if beaconRoot := block.BeaconRoot(); beaconRoot != nil {
|
|
||||||
vmenv := vm.NewEVM(blockCtx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
|
||||||
core.ProcessBeaconBlockRoot(*beaconRoot, vmenv, statedb)
|
|
||||||
}
|
|
||||||
if api.backend.ChainConfig().IsPrague(block.Number()) {
|
|
||||||
vmenv := vm.NewEVM(blockCtx, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})
|
|
||||||
core.ProcessParentBlockHash(block.ParentHash(), 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.
|
|
||||||
if config != nil && config.Tracer != nil && *config.Tracer != "" {
|
|
||||||
if isJS := DefaultDirectory.IsJS(*config.Tracer); isJS {
|
|
||||||
return api.traceBlockParallel(ctx, block, statedb, config)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Native tracers have low overhead
|
|
||||||
var (
|
|
||||||
txs = block.Transactions()
|
|
||||||
blockHash = block.Hash()
|
|
||||||
signer = types.MakeSigner(api.backend.ChainConfig(), block.Number(), block.Time())
|
|
||||||
results = make([]*txTraceResult, len(txs))
|
|
||||||
)
|
|
||||||
for i, tx := range txs {
|
|
||||||
// Generate the next state snapshot fast without tracing
|
|
||||||
msg, _ := core.TransactionToMessage(tx, signer, block.BaseFee())
|
|
||||||
txctx := &Context{
|
|
||||||
BlockHash: blockHash,
|
|
||||||
BlockNumber: block.Number(),
|
|
||||||
TxIndex: i,
|
|
||||||
TxHash: tx.Hash(),
|
|
||||||
}
|
|
||||||
res, err := api.traceTx(ctx, tx, msg, txctx, blockCtx, statedb, config)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
results[i] = &txTraceResult{TxHash: tx.Hash(), Result: res}
|
|
||||||
}
|
|
||||||
return results, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
defer release()
|
defer release()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue