mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 04:06:44 +00:00
add parent span for tx execution and a span for validate state
This commit is contained in:
parent
402d36d805
commit
0d2fc33860
1 changed files with 8 additions and 2 deletions
|
|
@ -48,6 +48,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/ethdb"
|
"github.com/ethereum/go-ethereum/ethdb"
|
||||||
"github.com/ethereum/go-ethereum/event"
|
"github.com/ethereum/go-ethereum/event"
|
||||||
"github.com/ethereum/go-ethereum/internal/syncx"
|
"github.com/ethereum/go-ethereum/internal/syncx"
|
||||||
|
"github.com/ethereum/go-ethereum/internal/telemetry"
|
||||||
"github.com/ethereum/go-ethereum/internal/version"
|
"github.com/ethereum/go-ethereum/internal/version"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/metrics"
|
"github.com/ethereum/go-ethereum/metrics"
|
||||||
|
|
@ -2160,7 +2161,9 @@ func (bc *BlockChain) ProcessBlock(ctx context.Context, parentRoot common.Hash,
|
||||||
|
|
||||||
// Process block using the parent state as reference point
|
// Process block using the parent state as reference point
|
||||||
pstart := time.Now()
|
pstart := time.Now()
|
||||||
res, err := bc.processor.Process(ctx, block, statedb, bc.cfg.VmConfig)
|
pctx, _, spanEnd := telemetry.StartSpan(ctx, "core.Process")
|
||||||
|
res, err := bc.processor.Process(pctx, block, statedb, bc.cfg.VmConfig)
|
||||||
|
spanEnd(err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
bc.reportBadBlock(block, res, err)
|
bc.reportBadBlock(block, res, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
@ -2168,7 +2171,10 @@ func (bc *BlockChain) ProcessBlock(ctx context.Context, parentRoot common.Hash,
|
||||||
ptime := time.Since(pstart)
|
ptime := time.Since(pstart)
|
||||||
|
|
||||||
vstart := time.Now()
|
vstart := time.Now()
|
||||||
if err := bc.validator.ValidateState(block, statedb, res, false); err != nil {
|
_, _, spanEnd = telemetry.StartSpan(ctx, "core.ValidateState")
|
||||||
|
err = bc.validator.ValidateState(block, statedb, res, false)
|
||||||
|
spanEnd(err)
|
||||||
|
if err != nil {
|
||||||
bc.reportBadBlock(block, res, err)
|
bc.reportBadBlock(block, res, err)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue