mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-16 11:51:35 +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,
|
// Finalize the state transition by applying operations such as withdrawals,
|
||||||
// uncle rewards, and related processing.
|
// uncle rewards, and related processing.
|
||||||
|
_, _, finalizeSpanEnd := telemetry.StartSpan(ctx, "miner.Finalize")
|
||||||
miner.engine.Finalize(miner.chain, work.header, work.state, &body)
|
miner.engine.Finalize(miner.chain, work.header, work.state, &body)
|
||||||
|
finalizeSpanEnd(nil)
|
||||||
|
|
||||||
// Calculate the state root after applying all mutations.
|
// 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))
|
work.header.Root = work.state.IntermediateRoot(miner.chain.Config().IsEIP158(work.header.Number))
|
||||||
|
rootSpanEnd(nil)
|
||||||
|
|
||||||
// Assemble the block for delivery.
|
// Assemble the block for delivery.
|
||||||
|
_, _, blockSpanEnd := telemetry.StartSpan(ctx, "miner.NewBlock")
|
||||||
block := types.NewBlock(work.header, &body, work.receipts, trie.NewStackTrie(nil))
|
block := types.NewBlock(work.header, &body, work.receipts, trie.NewStackTrie(nil))
|
||||||
|
blockSpanEnd(nil)
|
||||||
|
|
||||||
return &newPayloadResult{
|
return &newPayloadResult{
|
||||||
block: block,
|
block: block,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue