From efcc6537e2ef37ff32233e047b1225ec5ee61d24 Mon Sep 17 00:00:00 2001 From: andyzhang2023 <147463846+andyzhang2023@users.noreply.github.com> Date: Fri, 25 Oct 2024 19:49:05 +0800 Subject: [PATCH] =?UTF-8?q?increase=20the=20conflict=20counter=20only=20if?= =?UTF-8?q?=20the=20state=20of=20uncommitted=20db=20con=E2=80=A6=20(#207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: andyzhang2023 --- core/pevm_processor.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/pevm_processor.go b/core/pevm_processor.go index 83edcb56e..83c5ef65c 100644 --- a/core/pevm_processor.go +++ b/core/pevm_processor.go @@ -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 } @@ -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 { @@ -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)