Skip to content

Commit

Permalink
fix(derive): Holocene action tests / fixes (#733)
Browse files Browse the repository at this point in the history
* fix(derive): Support modern action tests + holocene fixes

* update commit
  • Loading branch information
clabby authored Oct 25, 2024
1 parent 1663497 commit 938805a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .monorepo
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cl/actions-fix
02d5832349a1f469adb00191459333e2032b09b4
12 changes: 10 additions & 2 deletions bin/client/src/l1/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -268,7 +276,7 @@ where
.pipeline
.origin()
.ok_or_else(|| anyhow!("Missing L1 origin"))?,
system_config: None,
system_config: Some(system_config),
}
.signal(),
)
Expand All @@ -284,7 +292,7 @@ where
.pipeline
.origin()
.ok_or_else(|| anyhow!("Missing L1 origin"))?,
system_config: None,
system_config: Some(system_config),
}
.signal(),
)
Expand Down
5 changes: 3 additions & 2 deletions crates/derive/src/stages/batch/batch_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 938805a

Please sign in to comment.