Skip to content

Commit 3042d18

Browse files
committed
Fix block gas metric (#846)
1 parent b08c563 commit 3042d18

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

blockchain/blockchain.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ func (bc *blockchain) MintNewBlock(
554554
}
555555

556556
blockMtc.WithLabelValues("numActions").Set(float64(len(actions)))
557-
blockMtc.WithLabelValues("gasConsumed").Set(float64(bc.config.Genesis.BlockGasLimit - gasLimitForContext))
558557

559558
sk := bc.config.ProducerPrivateKey()
560559
ra := block.NewRunnableActionsBuilder().
@@ -1070,6 +1069,8 @@ func (bc *blockchain) pickAndRunActions(ctx context.Context, actionMap map[strin
10701069
executedActions = append(executedActions, grant)
10711070
}
10721071

1072+
blockMtc.WithLabelValues("gasConsumed").Set(float64(bc.config.Genesis.BlockGasLimit - raCtx.GasLimit))
1073+
10731074
return ws.UpdateBlockLevelInfo(raCtx.BlockHeight), receipts, executedActions, nil
10741075
}
10751076

0 commit comments

Comments
 (0)