From 938805aab59cca069ce99ca88edcbbbfc8c63f61 Mon Sep 17 00:00:00 2001 From: clabby Date: Fri, 25 Oct 2024 16:02:12 -0400 Subject: [PATCH] fix(derive): Holocene action tests / fixes (#733) * fix(derive): Support modern action tests + holocene fixes * update commit --- .monorepo | 2 +- bin/client/src/l1/driver.rs | 12 ++++++++++-- crates/derive/src/stages/batch/batch_validator.rs | 5 +++-- justfile | 6 +++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.monorepo b/.monorepo index 336a7ad57..3aa0bdf6e 100644 --- a/.monorepo +++ b/.monorepo @@ -1 +1 @@ -cl/actions-fix +02d5832349a1f469adb00191459333e2032b09b4 diff --git a/bin/client/src/l1/driver.rs b/bin/client/src/l1/driver.rs index 73dffd3d8..431e8d0b6 100644 --- a/bin/client/src/l1/driver.rs +++ b/bin/client/src/l1/driver.rs @@ -259,6 +259,14 @@ where match e { PipelineErrorKind::Temporary(_) => { /* continue */ } PipelineErrorKind::Reset(e) => { + let system_config = self + .pipeline + .l2_chain_provider + .system_config_by_number( + self.l2_safe_head.block_info.number, + self.pipeline.rollup_config.clone(), + ) + .await?; if matches!(e, ResetError::HoloceneActivation) { self.pipeline .signal( @@ -268,7 +276,7 @@ where .pipeline .origin() .ok_or_else(|| anyhow!("Missing L1 origin"))?, - system_config: None, + system_config: Some(system_config), } .signal(), ) @@ -284,7 +292,7 @@ where .pipeline .origin() .ok_or_else(|| anyhow!("Missing L1 origin"))?, - system_config: None, + system_config: Some(system_config), } .signal(), ) diff --git a/crates/derive/src/stages/batch/batch_validator.rs b/crates/derive/src/stages/batch/batch_validator.rs index 5b05fc376..180fd5e37 100644 --- a/crates/derive/src/stages/batch/batch_validator.rs +++ b/crates/derive/src/stages/batch/batch_validator.rs @@ -137,7 +137,7 @@ where let expiry_epoch = epoch.number + self.cfg.seq_window_size; let force_empty_batches = expiry_epoch <= stage_origin.number; let first_of_epoch = epoch.number == parent.l1_origin.number + 1; - let next_timestamp = epoch.timestamp + self.cfg.block_time; + let next_timestamp = parent.block_info.timestamp + self.cfg.block_time; // If the sequencer window did not expire, // there is still room to receive batches for the current epoch. @@ -224,13 +224,14 @@ where }; // The batch must be a single batch - this stage does not support span batches. - let Batch::Single(next_batch) = next_batch else { + let Batch::Single(mut next_batch) = next_batch else { error!( target: "batch-validator", "BatchValidator received a batch that is not a SingleBatch" ); return Err(PipelineError::InvalidBatchType.crit()); }; + next_batch.parent_hash = parent.block_info.hash; // Check the validity of the single batch before forwarding it. match next_batch.check_batch( diff --git a/justfile b/justfile index 3f2fce054..14c420a6e 100644 --- a/justfile +++ b/justfile @@ -30,7 +30,7 @@ action-tests test_name='Test_ProgramAction': if [ ! -d "monorepo/.devnet" ]; then echo "Building devnet allocs for the monorepo" - (cd monorepo && make devnet-allocs-tests) + (cd monorepo && make devnet-allocs) fi echo "Building client and host programs for the native target" @@ -42,7 +42,7 @@ action-tests test_name='Test_ProgramAction': export KONA_CLIENT_PATH="{{justfile_directory()}}/target/release-client-lto/kona" cd monorepo/op-e2e/actions/proofs && \ - go test -run "{{test_name}}" -v ./... + go test -run "{{test_name}}" -v -count=1 ./... # Clean the action tests directory clean-actions: @@ -151,7 +151,7 @@ build-client-prestate-asterisc-image kona_tag asterisc_tag out='./prestate-artif # Clones and checks out the monorepo at the commit present in `.monorepo` monorepo: - [ ! -d monorepo ] && git clone https://github.com/ethereum-optimism/monorepo + ([ ! -d monorepo ] && git clone https://github.com/ethereum-optimism/monorepo) || exit 0 cd monorepo && git checkout $(cat ../.monorepo) # Updates the pinned version of the monorepo