Skip to content

Commit 658df1f

Browse files
committed
fix(op-acceptance-tests): TestWithdrawal nonce synchronization
Use fresh EOA instance for withdrawal initiation to prevent nonce conflicts when shared L1/L2 keys encounter retry logic.
1 parent edb6d18 commit 658df1f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

op-acceptance-tests/tests/base/withdrawal/withdrawal_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ func TestWithdrawal(gt *testing.T) {
3333
expectedL2UserBalance := depositAmount
3434
l2User.VerifyBalanceExact(expectedL2UserBalance)
3535

36-
withdrawal := bridge.InitiateWithdrawal(withdrawalAmount, l2User)
36+
// Force a fresh EOA instance to avoid stale nonce state from shared L1/L2 key usage
37+
// This prevents "nonce too low" errors in the retry logic during withdrawal initiation
38+
freshL2User := l1User.Key().User(sys.L2EL)
39+
40+
withdrawal := bridge.InitiateWithdrawal(withdrawalAmount, freshL2User)
3741
expectedL2UserBalance = expectedL2UserBalance.Sub(withdrawalAmount).Sub(withdrawal.InitiateGasCost())
38-
l2User.VerifyBalanceExact(expectedL2UserBalance)
42+
freshL2User.VerifyBalanceExact(expectedL2UserBalance)
3943

4044
withdrawal.Prove(l1User)
4145
expectedL1UserBalance = expectedL1UserBalance.Sub(withdrawal.ProveGasCost())

0 commit comments

Comments
 (0)