Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exec3.go: fix bad log of mags #485

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading