Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion integration-tests/src/assert_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use alloy::rpc::types::trace::geth::{CallConfig, CallFrame, GethDebugTracingOpti
use anyhow::Context;
use std::time::Duration;

pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(180);
// Increased from 180s to 300s: the gateway finalization pipeline has multiple L1 sender
// round-trips (commit/prove/execute on both chain and gateway), and the gateway proof RPC
// needs time to assemble cross-chain Merkle proofs after execution on L1.
pub const DEFAULT_TIMEOUT: Duration = Duration::from_secs(300);
pub const POLL_INTERVAL: Duration = Duration::from_millis(100);

#[allow(async_fn_in_trait)]
Expand Down
4 changes: 3 additions & 1 deletion integration-tests/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ impl<P1: Provider, P2: Provider<Zksync>> L1Nullifier<P1, P2> {
.enumerate()
.find(|(_, log)| log.sender == L1_MESSENGER_ADDRESS)
.expect("no L2->L1 logs found in withdrawal receipt");
let proof_retry_timeout = Duration::from_secs(120);
// Use the same global timeout so this step doesn't become a bottleneck when the
// gateway proof pipeline takes longer under load (e.g., during the full test suite).
let proof_retry_timeout = crate::assert_traits::DEFAULT_TIMEOUT;
let proof_retry_delay = Duration::from_secs(1);
let proof_retry_started_at = Instant::now();
let proof = loop {
Expand Down
28 changes: 28 additions & 0 deletions integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::provider::{ZksyncApi, ZksyncTestingProvider};
use crate::utils::LockedPort;
use alloy::network::EthereumWallet;
use alloy::primitives::{Address, U256};
use alloy::providers::ext::AnvilApi;
use alloy::providers::utils::Eip1559Estimator;
use alloy::providers::{
DynProvider, Identity, PendingTransactionBuilder, Provider, ProviderBuilder, WalletProvider,
Expand Down Expand Up @@ -1140,6 +1141,21 @@ pub struct AnvilL1 {
// Temporary directory that holds uncompressed l1-state.json used to initialize Anvil's state.
// Needs to be held for the duration of test's lifetime.
_tempdir: Arc<TempDir>,
_background_miner: Arc<BackgroundMiner>,
}

struct BackgroundMiner(#[allow(dead_code)] tokio::task::JoinHandle<()>);

impl std::fmt::Debug for BackgroundMiner {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("BackgroundMiner").finish_non_exhaustive()
}
}

impl Drop for BackgroundMiner {
fn drop(&mut self) {
self.0.abort();
}
}

impl AnvilL1 {
Expand Down Expand Up @@ -1180,11 +1196,23 @@ impl AnvilL1 {

tracing::info!("L1 chain started on {}", address);

let miner_provider = provider.clone();
let background_miner = tokio::spawn(async move {
loop {
tokio::time::sleep(Duration::from_secs(1)).await;
if let Err(err) = miner_provider.anvil_mine(Some(1), None).await {
tracing::debug!(%err, "background L1 miner stopped");
break;
}
}
});

Ok(Self {
address,
provider: EthDynProvider::new(provider),
wallet,
_tempdir: Arc::new(tempdir),
_background_miner: Arc::new(BackgroundMiner(background_miner)),
})
}
}
Expand Down
8 changes: 7 additions & 1 deletion lib/l1_sender/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ pub async fn run_l1_sender<Input: SendToL1>(
// reorg happens and transaction will not be included in the new fork (very-very
// unlikely), L1 sender will crash at some point (because a consequent L1
// transactions will fail) and recover from the new L1 state after restart.
.with_required_confirmations(1)
//
// When sending to the gateway (a ZKsync L2 node), we use 1 confirmation
// because Alloy's block-number-based confirmation polling does not work
// correctly against the ZKsync RPC — mirroring the same pattern used by the
// L1 watcher (see l1_watcher/src/watcher.rs, "Gateway case, zero out
// confirmations"). For L1 (Ethereum) sends we keep the full 3 confirmations.
.with_required_confirmations(if gateway { 1 } else { 3 })
// Ensure we don't wait indefinitely and crash if the transaction is not
// included on L1 in a reasonable time.
.with_timeout(Some(config.transaction_timeout));
Expand Down
9 changes: 0 additions & 9 deletions node/bin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,15 +1094,6 @@ async fn run_main_node_pipeline(
run_fake_snark_provers(&config.prover_api_config, runtime, snark_job_manager);
}

if !config.prover_input_generator_config.enable_input_generation {
assert!(
config.prover_api_config.fake_fri_provers.enabled
&& config.prover_api_config.fake_snark_provers.enabled,
"prover_input_generator_config.enable_input_generation=false requires both \
prover_api_config.fake_fri_provers.enabled and \
prover_api_config.fake_snark_provers.enabled to be true"
);
}

let pipeline = pipeline
.pipe(ProverInputGenerator {
Expand Down
6 changes: 4 additions & 2 deletions node/bin/src/prover_api/fri_proving_pipeline_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ impl FriProvingPipelineStep {
assignment_timeout: Duration,
max_assigned_batch_range: usize,
) -> (Self, Arc<FriJobManager>) {
// Create channel for completed proofs - between FriProveManager and GaplessCommitter
// Create channel for completed proofs - between FriProveManager and GaplessCommitter.
// A larger capacity prevents backpressure when many batches complete in quick succession
// (e.g. interop tests that drive the node through 40+ batches under parallel test load).
let (batches_with_proof_sender, batches_with_proof_receiver) =
mpsc::channel::<SignedBatchEnvelope<FriProof>>(5);
mpsc::channel::<SignedBatchEnvelope<FriProof>>(50);

let fri_job_manager = Arc::new(FriJobManager::new(
batches_with_proof_sender,
Expand Down
Loading