Skip to content

Commit

Permalink
feat: Port boojum eth-sender changes (#293)
Browse files Browse the repository at this point in the history
# What ❔

- `MetadataCalculatorModeConfig::Full` changed so it optionally saves
artifacts for witness to GCS, EN runs metadata calculator in full mode,
so it has all commitments
- Circuit breaker for facet selectors removed -- it won't be possible to
perform an upgrade with it running.
- Eth-sender, block-reverter, consistency-checker use L1 contract
function that corresponds to the protocol version of L1 batch it's used
for.

## Why ❔

Preparation for boojum upgrade

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [x] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
perekopskiy authored Oct 31, 2023
1 parent b880e07 commit 8027326
Show file tree
Hide file tree
Showing 18 changed files with 608 additions and 581 deletions.
4 changes: 3 additions & 1 deletion core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ async fn init_tasks(

let metadata_calculator = MetadataCalculator::new(&MetadataCalculatorConfig {
db_path: &config.required.merkle_tree_path,
mode: MetadataCalculatorModeConfig::Lightweight,
mode: MetadataCalculatorModeConfig::Full {
store_factory: None,
},
delay_interval: config.optional.metadata_calculator_delay(),
max_l1_batches_per_iter: config.optional.max_l1_batches_per_tree_iter,
multi_get_chunk_size: config.optional.merkle_tree_multi_get_chunk_size,
Expand Down
158 changes: 0 additions & 158 deletions core/lib/circuit_breaker/src/facet_selectors.rs

This file was deleted.

8 changes: 0 additions & 8 deletions core/lib/circuit_breaker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,14 @@ use tokio::sync::watch;

use zksync_config::configs::chain::CircuitBreakerConfig;

use crate::facet_selectors::MismatchedFacetSelectorsError;

pub mod facet_selectors;
pub mod l1_txs;
pub mod replication_lag;
pub mod utils;

#[cfg(test)]
mod tests;

#[derive(Debug, Error)]
pub enum CircuitBreakerError {
#[error("System has failed L1 transaction")]
FailedL1Transaction,
#[error("Mismatched facet selectors: {0}")]
MismatchedFacetSelectors(MismatchedFacetSelectorsError),
#[error("Replication lag ({0:?}) is above the threshold ({1:?})")]
ReplicationLag(u32, u32),
}
Expand Down
Loading

0 comments on commit 8027326

Please sign in to comment.