Skip to content

Commit

Permalink
exec3.go: fix bad log of mags
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Aug 20, 2024
1 parent 0a954fd commit bc943cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func NewProgress(prevOutputBlockNum, commitThreshold uint64, workersCount int, u
type Progress struct {
prevTime time.Time
prevTxCount uint64
prevGasUsed uint64
prevOutputBlockNum uint64
prevRepeatCount uint64
commitThreshold uint64
Expand Down Expand Up @@ -112,7 +113,7 @@ func (p *Progress) Log(suffix string, rs *state.StateV3, in *state.QueueWithRetr
suffix += " Commit every block"
}

gasUsedMgas := float64(gas) / 1e6
gasUsedMgas := float64(gas-p.prevGasUsed) / 1e6
mgasPerSec := gasUsedMgas / interval.Seconds()
//avgMgasSec = ((e.avgMgasSec * (float64(e.recordedMgasSec))) + mgasPerSec) / float64(e.recordedMgasSec+1)

Expand Down Expand Up @@ -140,6 +141,7 @@ func (p *Progress) Log(suffix string, rs *state.StateV3, in *state.QueueWithRetr

p.prevTime = currentTime
p.prevTxCount = txCount
p.prevGasUsed = gas
p.prevOutputBlockNum = outputBlockNum
p.prevRepeatCount = repeatCount
}
Expand Down Expand Up @@ -782,7 +784,7 @@ Loop:
HistoryExecution: offsetFromBlockBeginning > 0 && txIndex < int(offsetFromBlockBeginning),

BlockReceipts: receipts,
Config: chainConfig,
Config: chainConfig,
}

if txIndex >= 0 && !txTask.Final && isPoSa {
Expand Down

0 comments on commit bc943cb

Please sign in to comment.