Skip to content

Commit

Permalink
Merge branch 'matias/separate-chain-init' of github.com:matter-labs/z…
Browse files Browse the repository at this point in the history
…ksync-era into matias/pre-load-ecosystem-and-chain
  • Loading branch information
matias-gonz committed Nov 25, 2024
2 parents ef841d4 + 8344568 commit a385610
Show file tree
Hide file tree
Showing 62 changed files with 2,070 additions and 202 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/new-build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,8 @@ jobs:
shell: bash
run: |
echo PLATFORM=$(echo ${{ matrix.platforms }} | tr '/' '-') >> $GITHUB_ENV
echo IMAGE_TAG_SHA=$(git rev-parse --short HEAD) >> $GITHUB_ENV
# Support for custom tag suffix
if [ -n "${{ inputs.image_tag_suffix }}" ]; then
echo IMAGE_TAG_SHA_TS="${{ inputs.image_tag_suffix }}" >> $GITHUB_ENV
echo IMAGE_TAG_SHA_TS="${{ env.IMAGE_TAG_SUFFIX }}" >> $GITHUB_ENV
else
echo IMAGE_TAG_SHA_TS=$(git rev-parse --short HEAD)-$(date +%s) >> $GITHUB_ENV
fi
Expand Down
127 changes: 118 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ ethabi = "18.0.0"
flate2 = "1.0.28"
fraction = "0.15.3"
futures = "0.3"
futures-util = "0.3"
glob = "0.3"
google-cloud-auth = "0.16.0"
google-cloud-storage = "0.20.0"
Expand All @@ -142,6 +143,7 @@ mini-moka = "0.10.0"
num = "0.4.0"
num_cpus = "1.13"
num_enum = "0.7.2"
octocrab = "0.41"
once_cell = "1"
opentelemetry = "0.24.0"
opentelemetry_sdk = "0.24.0"
Expand Down
2 changes: 2 additions & 0 deletions core/bin/contract-verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ async fn main() -> anyhow::Result<()> {
let contract_verifier = ContractVerifier::new(verifier_config.compilation_timeout(), pool)
.await
.context("failed initializing contract verifier")?;
let update_task = contract_verifier.sync_compiler_versions_task();
let tasks = vec![
tokio::spawn(update_task),
tokio::spawn(contract_verifier.run(stop_receiver.clone(), opt.jobs_number)),
tokio::spawn(
PrometheusExporterConfig::pull(prometheus_config.listener_port).run(stop_receiver),
Expand Down
19 changes: 16 additions & 3 deletions core/lib/config/src/configs/proof_data_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ pub struct TeeConfig {
pub tee_support: bool,
/// All batches before this one are considered to be processed.
pub first_tee_processed_batch: L1BatchNumber,
/// Timeout in seconds for retrying TEE proof generation if it fails. Retries continue
/// indefinitely until successful.
/// Timeout in seconds for retrying the preparation of input for TEE proof generation if it
/// previously failed (e.g., due to a transient network issue) or if it was picked by a TEE
/// prover but the TEE proof was not submitted within that time.
pub tee_proof_generation_timeout_in_secs: u16,
/// Timeout in hours after which a batch will be permanently ignored if repeated retries failed.
pub tee_batch_permanently_ignored_timeout_in_hours: u16,
}

impl Default for TeeConfig {
Expand All @@ -21,6 +24,8 @@ impl Default for TeeConfig {
first_tee_processed_batch: Self::default_first_tee_processed_batch(),
tee_proof_generation_timeout_in_secs:
Self::default_tee_proof_generation_timeout_in_secs(),
tee_batch_permanently_ignored_timeout_in_hours:
Self::default_tee_batch_permanently_ignored_timeout_in_hours(),
}
}
}
Expand All @@ -35,12 +40,20 @@ impl TeeConfig {
}

pub fn default_tee_proof_generation_timeout_in_secs() -> u16 {
600
60
}

pub fn default_tee_batch_permanently_ignored_timeout_in_hours() -> u16 {
10 * 24
}

pub fn tee_proof_generation_timeout(&self) -> Duration {
Duration::from_secs(self.tee_proof_generation_timeout_in_secs.into())
}

pub fn tee_batch_permanently_ignored_timeout(&self) -> Duration {
Duration::from_secs(3600 * u64::from(self.tee_batch_permanently_ignored_timeout_in_hours))
}
}

#[derive(Debug, Deserialize, Clone, PartialEq)]
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ impl Distribution<configs::ProofDataHandlerConfig> for EncodeDist {
tee_support: self.sample(rng),
first_tee_processed_batch: L1BatchNumber(rng.gen()),
tee_proof_generation_timeout_in_secs: self.sample(rng),
tee_batch_permanently_ignored_timeout_in_hours: self.sample(rng),
},
}
}
Expand Down
4 changes: 4 additions & 0 deletions core/lib/contract_verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ hex.workspace = true
serde = { workspace = true, features = ["derive"] }
tempfile.workspace = true
regex.workspace = true
reqwest.workspace = true
tracing.workspace = true
semver.workspace = true
octocrab = { workspace = true, features = ["stream"] }
futures-util.workspace = true
rustls.workspace = true

[dev-dependencies]
zksync_node_test_utils.workspace = true
Expand Down
Loading

0 comments on commit a385610

Please sign in to comment.