Set gas to 1
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
cd2595da67
commit
ca7e5f5e16
@ -281,16 +281,24 @@ func (s1 *stats) Combine(s2 *stats) {
|
|||||||
func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) {
|
func tallyGasCharges(charges map[string]*stats, et types.ExecutionTrace) {
|
||||||
for _, gc := range et.GasCharges {
|
for _, gc := range et.GasCharges {
|
||||||
|
|
||||||
compGas := gc.ComputeGas
|
compGas := gc.VirtualComputeGas
|
||||||
if compGas == 0 {
|
if compGas == 0 {
|
||||||
compGas = 1
|
compGas = 1
|
||||||
}
|
}
|
||||||
|
compGas = 1
|
||||||
|
|
||||||
ratio := float64(compGas) / float64(gc.TimeTaken.Nanoseconds())
|
ratio := float64(compGas) / float64(gc.TimeTaken.Nanoseconds())
|
||||||
ratio = 1 / ratio
|
ratio = 1 / ratio
|
||||||
if math.IsNaN(ratio) {
|
if math.IsNaN(ratio) {
|
||||||
log.Errorf("NaN: comGas: %f, taken: %d", compGas, gc.TimeTaken.Nanoseconds())
|
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]
|
s := charges[gc.Name]
|
||||||
if s == nil {
|
if s == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user