pub async fn new(
        config: MetadataCalculatorConfig,
        object_store: Option<Arc<dyn ObjectStore>>,
        pool: ConnectionPool<Core>,
    ) -> anyhow::Result<Self> {
        if let Err(err) = METRICS.info.set(config.as_labels()) {
            tracing::warn!(
                "Cannot set config {:?}; it's already set to {:?}",
                err.into_inner(),
                METRICS.info.get()
            );
        }

        anyhow::ensure!(
            config.max_l1_batches_per_iter > 0,
            "Maximum L1 batches per iteration is misconfigured to be 0; please update it to positive value"
        );
        if matches!(config.mode, MerkleTreeMode::Lightweight) && object_store.is_some() {
            anyhow::bail!(
                "Cannot run lightweight tree with an object store; the tree won't produce information to be stored in the store"
            );
        }

        let (_, health_updater) = ReactiveHealthCheck::new("tree");
        Ok(Self {
            tree_reader: watch::channel(None).0,
            pruning_handles_sender: oneshot::channel().0,
            object_store,
            recovery_pool: pool.clone(),
            pool,
            delayer: Delayer::new(config.delay_interval),
            health_updater,
            max_l1_batches_per_iter: config.max_l1_batches_per_iter,
            config,
        })
    }
Creates a calculator with the specified `config`.

# Arguments

- `pool` can have a single connection (but then you should set a separate recovery pool).
core/node/metadata_calculator/src/lib.rs