Skip to content

Commit

Permalink
increase the conflict counter only if the state of uncommitted db con… (
Browse files Browse the repository at this point in the history
#207)

Co-authored-by: andyzhang2023 <andyzhang2023@gmail.com>
  • Loading branch information
andyzhang2023 and andyzhang2023 authored Oct 25, 2024
1 parent d58b8e0 commit efcc653
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions core/pevm_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func (p *PEVMProcessor) hasConflict(txResult *PEVMTxResult) error {
}
// check whether the slot db reads during execution are correct.
if err := slotDB.ConflictsToMaindb(); err != nil {
atomic.AddUint64(&p.debugConflictRedoNum, 1)
log.Debug("executed result conflicts", "err", err)
return err
}
Expand Down Expand Up @@ -267,9 +268,6 @@ func (p *PEVMProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
err, txIndex := txLevels.Run(func(pr *PEVMTxRequest) (res *PEVMTxResult) {
defer func(t0 time.Time) {
atomic.AddInt64(&executeDurations, time.Since(t0).Nanoseconds())
if res.err != nil {
atomic.AddUint64(&p.debugConflictRedoNum, 1)
}
}(time.Now())

if err := buildMessage(pr, signer, header); err != nil {
Expand All @@ -279,9 +277,6 @@ func (p *PEVMProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
}, func(pr *PEVMTxResult) (err error) {
defer func(t0 time.Time) {
atomic.AddInt64(&confirmDurations, time.Since(t0).Nanoseconds())
if err != nil {
atomic.AddUint64(&p.debugConflictRedoNum, 1)
}
}(time.Now())
log.Debug("pevm confirm", "txIndex", pr.txReq.txIndex)
return p.confirmTxResult(statedb, gp, pr)
Expand Down

0 comments on commit efcc653

Please sign in to comment.