diff --git a/op-e2e/actions/proofs/holocene_activation_test.go b/op-e2e/actions/proofs/holocene_activation_test.go index 96ddda59891..c2e5e3ab6a7 100644 --- a/op-e2e/actions/proofs/holocene_activation_test.go +++ b/op-e2e/actions/proofs/holocene_activation_test.go @@ -6,9 +6,7 @@ import ( "github.com/ethereum-optimism/optimism/op-chain-ops/genesis" actionsHelpers "github.com/ethereum-optimism/optimism/op-e2e/actions/helpers" "github.com/ethereum-optimism/optimism/op-e2e/actions/proofs/helpers" - "github.com/ethereum-optimism/optimism/op-program/client/claim" "github.com/ethereum-optimism/optimism/op-service/testlog" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/stretchr/testify/require" ) @@ -17,11 +15,11 @@ func Test_ProgramAction_HoloceneActivation(gt *testing.T) { runHoloceneDerivationTest := func(gt *testing.T, testCfg *helpers.TestCfg[any]) { t := actionsHelpers.NewDefaultTesting(gt) + const holoceneOffset = 14 // Define override to activate Holocene 14 seconds after genesis var setHoloceneTime = func(dc *genesis.DeployConfig) { - fourteen := hexutil.Uint64(14) - dc.L2GenesisHoloceneTimeOffset = &fourteen + dc.L2GenesisHoloceneTimeOffset = ptr(hexutil.Uint64(holoceneOffset)) } env := helpers.NewL2FaultProofEnv(t, testCfg, helpers.NewTestParams(), helpers.NewBatcherCfg(), setHoloceneTime) @@ -89,11 +87,9 @@ func Test_ProgramAction_HoloceneActivation(gt *testing.T) { env.Sequencer.ActL2PipelineFull(t) l2SafeHead := env.Sequencer.L2Safe() - t.Log(l2SafeHead.Time) + t.Log("Safe head", "time", l2SafeHead.Time) require.EqualValues(t, uint64(0), l2SafeHead.Number) // channel should be dropped, so no safe head progression - if uint64(0) == l2SafeHead.Number { - t.Log("Safe head progressed as expected", "l2SafeHeadNumber", l2SafeHead.Number) - } + t.Log("Safe head progressed as expected", "number", l2SafeHead.Number) // Log assertions filters := []string{ @@ -106,25 +102,21 @@ func Test_ProgramAction_HoloceneActivation(gt *testing.T) { recs := env.Logs.FindLogs(testlog.NewMessageContainsFilter(filter), testlog.NewAttributesFilter("role", "sequencer")) require.Len(t, recs, 1, "searching for %d instances of '%s' in logs from role %s", 1, filter, "sequencer") } - env.RunFaultProofProgramFromGenesis(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + + // Now make sure the safe head progresses over the activation boundary so proofs tests aren't trivial over the genesis block. + env.BatchMineAndSync(t) + l2SafeHead = env.Sequencer.L2Safe() + t.Log("Safe head", "time", l2SafeHead.Time) + require.EqualValues(t, uint64(holoceneOffset), l2SafeHead.Number) + t.Log("Safe head progressed as expected", "number", l2SafeHead.Number) + env.RunFaultProofProgram(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) } matrix := helpers.NewMatrix[any]() - defer matrix.Run(gt) - - matrix.AddTestCase( - "HonestClaim-HoloceneActivation", - nil, - helpers.NewForkMatrix(helpers.Granite), - runHoloceneDerivationTest, - helpers.ExpectNoError(), - ) - matrix.AddTestCase( - "JunkClaim-HoloceneActivation", + matrix.AddDefaultTestCases( nil, helpers.NewForkMatrix(helpers.Granite), runHoloceneDerivationTest, - helpers.ExpectError(claim.ErrClaimNotValid), - helpers.WithL2Claim(common.HexToHash("0xdeadbeef")), ) + matrix.Run(gt) } diff --git a/op-e2e/actions/proofs/holocene_batches_test.go b/op-e2e/actions/proofs/holocene_batches_test.go index 778e2b62527..273372d8b44 100644 --- a/op-e2e/actions/proofs/holocene_batches_test.go +++ b/op-e2e/actions/proofs/holocene_batches_test.go @@ -130,7 +130,15 @@ func Test_ProgramAction_HoloceneBatches(gt *testing.T) { testCfg.Custom.RequireExpectedProgressAndLogs(t, l2SafeHead, isHolocene, env.Engine, env.Logs) t.Log("Safe head progressed as expected", "l2SafeHeadNumber", l2SafeHead.Number) - env.RunFaultProofProgramFromGenesis(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + // Run the fault proof program on a non-trivial block. When safe head is 0 because + // the derivation pipeline correctly dropped disordered batches, we skip the proof — + // rebatching would gloss over the problematic range and not test the drop behavior. + // TODO(#20050): run FPP over the genesis range and assert derivation produces no new blocks. + if l2SafeHead.Number > 0 { + env.RunFaultProofProgramFromGenesis(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + } else { + t.Log("Skipping fault proof program: safe head is at genesis due to dropped batches") + } } matrix := helpers.NewMatrix[testCase]() diff --git a/op-e2e/actions/proofs/holocene_frame_test.go b/op-e2e/actions/proofs/holocene_frame_test.go index b643ff79eb6..ea537e93c48 100644 --- a/op-e2e/actions/proofs/holocene_frame_test.go +++ b/op-e2e/actions/proofs/holocene_frame_test.go @@ -113,7 +113,15 @@ func Test_ProgramAction_HoloceneFrames(gt *testing.T) { testCfg.Custom.RequireExpectedProgressAndLogs(t, l2SafeHead, isHolocene, env.Engine, env.Logs) t.Log("Safe head progressed as expected", "l2SafeHeadNumber", l2SafeHead.Number) - env.RunFaultProofProgramFromGenesis(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + // Run the fault proof program on a non-trivial block. When safe head is 0 because + // the derivation pipeline correctly dropped disordered frames, we skip the proof — + // rebatching would gloss over the problematic range and not test the drop behavior. + // TODO(#20050): run FPP over the genesis range and assert derivation produces no new blocks. + if l2SafeHead.Number > 0 { + env.RunFaultProofProgramFromGenesis(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + } else { + t.Log("Skipping fault proof program: safe head is at genesis due to dropped frames") + } } matrix := helpers.NewMatrix[testCase]() diff --git a/op-e2e/actions/proofs/holocene_invalid_batch_test.go b/op-e2e/actions/proofs/holocene_invalid_batch_test.go index 1cfee05271e..894fe4bc180 100644 --- a/op-e2e/actions/proofs/holocene_invalid_batch_test.go +++ b/op-e2e/actions/proofs/holocene_invalid_batch_test.go @@ -239,8 +239,14 @@ func Test_ProgramAction_HoloceneInvalidBatch(gt *testing.T) { testCfg.Custom.RequireExpectedProgressAndLogs(t, l2SafeHead, isHolocene, env.Engine, env.Logs) t.Log("Safe head progressed as expected", "l2SafeHeadNumber", l2SafeHead.Number) - if safeHeadNumber := l2SafeHead.Number; safeHeadNumber > 0 { - env.RunFaultProofProgram(t, safeHeadNumber, testCfg.CheckResult, testCfg.InputParams...) + // Run the fault proof program on a non-trivial block. When safe head is 0 due to + // intentionally invalid block contents (e.g. over-advanced L1 origin, sequencer drift breach), + // rebatching produces the same invalid result, so skip the proof in those cases. + // The Holocene variants of these tests DO advance the safe head and run the proof. + if l2SafeHead.Number > 0 { + env.RunFaultProofProgram(t, l2SafeHead.Number, testCfg.CheckResult, testCfg.InputParams...) + } else { + t.Log("Skipping fault proof program: safe head is at genesis due to intentionally invalid block contents") } }