mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 01:41:36 +00:00
miner: add opentelemetry tracing
This commit is contained in:
parent
afaa572600
commit
1db7f94df0
1 changed files with 6 additions and 0 deletions
|
|
@ -228,13 +228,19 @@ func (miner *Miner) generateWork(ctx context.Context, genParam *generateParams,
|
|||
}
|
||||
// Finalize the state transition by applying operations such as withdrawals,
|
||||
// uncle rewards, and related processing.
|
||||
_, _, finalizeSpanEnd := telemetry.StartSpan(ctx, "miner.Finalize")
|
||||
miner.engine.Finalize(miner.chain, work.header, work.state, &body)
|
||||
finalizeSpanEnd(nil)
|
||||
|
||||
// Calculate the state root after applying all mutations.
|
||||
_, _, rootSpanEnd := telemetry.StartSpan(ctx, "miner.IntermediateRoot")
|
||||
work.header.Root = work.state.IntermediateRoot(miner.chain.Config().IsEIP158(work.header.Number))
|
||||
rootSpanEnd(nil)
|
||||
|
||||
// Assemble the block for delivery.
|
||||
_, _, blockSpanEnd := telemetry.StartSpan(ctx, "miner.NewBlock")
|
||||
block := types.NewBlock(work.header, &body, work.receipts, trie.NewStackTrie(nil))
|
||||
blockSpanEnd(nil)
|
||||
|
||||
return &newPayloadResult{
|
||||
block: block,
|
||||
|
|
|
|||
Loading…
Reference in a new issue