You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
op-acceptance-tests: make the SafeDB resync tests fail when history is lost #24105
Follow-up to the review of #23827, which makes these tests run on op-reth.
Problem
TestTruncateDatabaseOnELResync ends with VerifySafeHeadDatabaseMatches(sys.L2CL) and no lower bound. checkSafeHeadConsistent walks the verifier's entries backward and stops silently at the first "not found", so the test passes whether the safe head database was kept, truncated and rebuilt, or cleared and only refilled with entries from after the resync. It cannot fail for the behaviour it is named after.
TestPreserveDatabaseOnCLResync has a floor, the verifier's live safe head at the start of the test, which is looser than the database's own floor.
What the clients do
An experiment on #23827's head recorded the verifier's entries before the wipe and after the resync, with op-node and with kona-node as the verifier CL:
Both truncate the database to genesis and rebuild it by re-deriving from L1. Every answer served before the wipe is served again afterwards.
On op-node the EL-sync completion policy keeps the database, because its tip is on the synced chain. The truncation comes from the engine reset that follows: after the wipe finalized is genesis and the devnet chain is shorter than the sequencer window, so the reset resumes from genesis.
So "truncate" and "preserve" both describe the mechanism loosely. The observable outcome in both tests is that history is served again.
Work
Read the database floor just before the wipe and require it afterwards, in both tests. SafeHeadDBFloor() and WithMinRequiredL2Block exist; the restart test in the same file already uses them:
The floor must be read, not hard-coded: after its initial EL sync an op-node verifier has no entries below the block it synced to, while a kona-node verifier re-derives from genesis.
Activity