Skip to content

Commit 0588001

Browse files
committed
kiss
1 parent 9101f11 commit 0588001

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

test/e2e/evm_full_node_e2e_test.go

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func verifyTransactionSync(t *testing.T, sequencerClient, fullNodeClient *ethcli
146146
}
147147
}
148148
return false
149-
}, 45*time.Second, 1*time.Second, "Full node should sync the block containing the transaction")
149+
}, 60*time.Second, 500*time.Millisecond, "Full node should sync the block containing the transaction")
150150

151151
// Final verification - both nodes should have the transaction in the same block
152152
sequencerReceipt, err := sequencerClient.TransactionReceipt(ctx, txHash)
@@ -341,7 +341,6 @@ func TestEvmSequencerWithFullNodeE2E(t *testing.T) {
341341

342342
// Wait for all transactions to be processed
343343
time.Sleep(500 * time.Millisecond)
344-
345344
t.Logf("Total transactions submitted: %d across blocks %v", len(txHashes), txBlockNumbers)
346345

347346
t.Log("Waiting for full node to sync all transaction blocks...")
@@ -1233,7 +1232,7 @@ func testSequencerFullNodeRestart(t *testing.T, initialLazyMode, restartLazyMode
12331232
fnHeight := fnHeader.Number.Uint64()
12341233
t.Logf("Full node re-sync progress: current=%d, target=%d", fnHeight, preRestartFnHeight)
12351234
return fnHeight >= preRestartFnHeight
1236-
}, 60*time.Second, 1*time.Second, "Full node should re-sync to pre-restart height via P2P")
1235+
}, DefaultTestTimeout, 500*time.Millisecond, "Full node should re-sync to pre-restart height via P2P")
12371236
t.Log("Full node re-synced to pre-restart height")
12381237

12391238
postRestartSeqHeader, err := sequencerClient.HeaderByNumber(ctx, nil)
@@ -1284,31 +1283,6 @@ func testSequencerFullNodeRestart(t *testing.T, initialLazyMode, restartLazyMode
12841283

12851284
t.Log("Phase 5: Verifying post-restart functionality and P2P sync...")
12861285

1287-
// After restart, the full node needs to re-fetch blocks via P2P from the sequencer.
1288-
// Wait for the full node to fully sync with the sequencer before submitting new transactions.
1289-
t.Log("Waiting for full node to fully sync with sequencer after restart...")
1290-
require.Eventually(t, func() bool {
1291-
seqHeader, seqErr := sequencerClient.HeaderByNumber(ctx, nil)
1292-
fnHeader, fnErr := fullNodeClient.HeaderByNumber(ctx, nil)
1293-
1294-
if seqErr != nil || fnErr != nil {
1295-
return false
1296-
}
1297-
1298-
seqHeight := seqHeader.Number.Uint64()
1299-
fnHeight := fnHeader.Number.Uint64()
1300-
1301-
// Full node should be within 2 blocks of sequencer to be considered fully synced
1302-
heightDiff := int64(seqHeight) - int64(fnHeight)
1303-
if heightDiff < 0 {
1304-
heightDiff = -heightDiff
1305-
}
1306-
1307-
t.Logf("Sync progress: sequencer=%d, full_node=%d, diff=%d", seqHeight, fnHeight, heightDiff)
1308-
return heightDiff <= 2
1309-
}, 60*time.Second, 1*time.Second, "Full node should fully sync with sequencer after restart")
1310-
t.Log("Full node fully synced with sequencer")
1311-
13121286
// Submit new transactions after restart to verify functionality
13131287
const numPostRestartTxs = 3
13141288
var postRestartTxHashes []common.Hash
@@ -1322,11 +1296,8 @@ func testSequencerFullNodeRestart(t *testing.T, initialLazyMode, restartLazyMode
13221296
t.Logf("Post-restart transaction %d included in sequencer block %d", i+1, txBlockNumber)
13231297

13241298
// Verify transaction syncs to full node (testing P2P sync functionality)
1325-
// Use longer timeout after restart since P2P sync pipeline may need time to stabilize
13261299
verifyTransactionSync(t, sequencerClient, fullNodeClient, txHash, txBlockNumber)
1327-
t.Logf("✅ Post-restart transaction %d synced to full node via P2P", i+1)
1328-
1329-
time.Sleep(5 * time.Millisecond)
1300+
t.Logf("✅Post-restart transaction %d synced to full node via P2P", i+1)
13301301
}
13311302

13321303
// === LAZY MODE POST-TRANSACTION VERIFICATION (if applicable) ===

0 commit comments

Comments
 (0)