Skip to content

Commit e23be46

Browse files
authored
Merge pull request bnb-chain#217 from welkin22/feature/TxDAG-PEVM-fixut
pevm: try to fix UT
2 parents 65bef51 + a4868a1 commit e23be46

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

.github/workflows/unit-test.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ jobs:
1919
go-version-file: go.mod
2020
- run: |
2121
git apply tests/0001-diff-go-ethereum.patch
22+
git apply tests/fix_unit_test.patch
2223
make test

core/pevm_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ func (p *PEVMProcessor) confirmTxResult(statedb *state.StateDB, gp *GasPool, res
173173
log.Error("merge slotDB failed", "err", err)
174174
return err
175175
}
176-
result.slotDB.Finalise(isByzantium || isEIP158)
177176

178177
delayGasFee := result.result.delayFees
179178
// add delayed gas fee
@@ -188,6 +187,7 @@ func (p *PEVMProcessor) confirmTxResult(statedb *state.StateDB, gp *GasPool, res
188187
statedb.AddBalance(params.OptimismL1FeeRecipient, delayGasFee.L1Fee)
189188
}
190189
}
190+
result.slotDB.Finalise(isByzantium || isEIP158)
191191

192192
// Do IntermediateRoot after mergeSlotDB.
193193
if !isByzantium {

tests/fix_unit_test.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Subject: [PATCH] fix unit test
2+
---
3+
Index: core/txpool/legacypool/legacypool.go
4+
IDEA additional info:
5+
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
6+
<+>UTF-8
7+
===================================================================
8+
diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go
9+
--- a/core/txpool/legacypool/legacypool.go (revision 1233f69823ec26df160575add475f1e949cde211)
10+
+++ b/core/txpool/legacypool/legacypool.go (date 1730875125704)
11+
@@ -391,7 +391,7 @@
12+
}
13+
14+
func (pool *LegacyPool) loopOfSync() {
15+
- ticker := time.NewTicker(200 * time.Second)
16+
+ ticker := time.NewTicker(200 * time.Millisecond)
17+
for {
18+
select {
19+
case <-pool.reorgShutdownCh:

0 commit comments

Comments
 (0)