mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-29 16:13:47 +00:00
Added logging for state-sync total gas usage
This commit is contained in:
parent
e01a0f2619
commit
c8f8465edb
1 changed files with 6 additions and 5 deletions
|
|
@ -1174,7 +1174,7 @@ func (c *Bor) CommitStates(
|
|||
}
|
||||
}
|
||||
|
||||
totalGas := 10000000 /// limit on gas for state sync per block
|
||||
totalGas := 0 /// limit on gas for state sync per block
|
||||
|
||||
chainID := c.chainConfig.ChainID.String()
|
||||
for _, eventRecord := range eventRecords {
|
||||
|
|
@ -1198,13 +1198,14 @@ func (c *Bor) CommitStates(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
totalGas -= int(gasUsed)
|
||||
if totalGas < 0 {
|
||||
break
|
||||
}
|
||||
totalGas += int(gasUsed)
|
||||
// if totalGas < 0 {
|
||||
// break
|
||||
// }
|
||||
|
||||
lastStateID++
|
||||
}
|
||||
log.Info("StateSyncGas", "gas", totalGas, "Block-number", number, "FromStateID", lastStateID+1)
|
||||
return stateSyncs, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue