From ca7e5f5e16d6acccd21a501a322a9e49d3c5d8dc Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Mon, 29 Jun 2020 18:56:27 +0200 Subject: [PATCH] Set gas to 1 Signed-off-by: Jakub Sztandera --- cmd/lotus-bench/import.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/lotus-bench/import.go b/cmd/lotus-bench/import.go index f6b85b557..3d994f3b6 100644 --- a/cmd/lotus-bench/import.go +++ b/cmd/lotus-bench/import.go @@ -281,16 +281,24 @@ func (s1 *stats) Combine(s2 *stats) { func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) { for _, gc := range et.GasCharges { - compGas := gc.ComputeGas + compGas := gc.VirtualComputeGas if compGas == 0 { compGas = 1 } + compGas = 1 ratio := float64(compGas) / float64(gc.TimeTaken.Nanoseconds()) ratio = 1 / ratio if math.IsNaN(ratio) { log.Errorf("NaN: comGas: %f, taken: %d", compGas, gc.TimeTaken.Nanoseconds()) } + name := gc.Name + if eString, ok := gc.Extra.(string); ok { + name += "-" + eString + } else if eInt, ok := gc.Extra.(float64); ok { + // handle scaling + _ = eInt + } s := charges[gc.Name] if s == nil {