pub async fn mark_l1_batch_as_sealed(
        &mut self,
        header: &L1BatchHeader,
        initial_bootloader_contents: &[(usize, U256)],
        storage_refunds: &[u32],
        pubdata_costs: &[i32],
        predicted_circuits_by_type: CircuitStatistic, // predicted number of circuits for each circuit type
    ) -> anyhow::Result<()> {
        let initial_bootloader_contents_len = initial_bootloader_contents.len();
        let instrumentation = Instrumented::new("mark_l1_batch_as_sealed")
            .with_arg("number", &header.number)
            .with_arg(
                "initial_bootloader_contents.len",
                &initial_bootloader_contents_len,
            );

        let priority_onchain_data: Vec<Vec<u8>> = header
            .priority_ops_onchain_data
            .iter()
            .map(|data| data.clone().into())
            .collect();
        let system_logs = header
            .system_logs
            .iter()
            .map(|log| log.0.to_bytes().to_vec())
            .collect::<Vec<Vec<u8>>>();
        let pubdata_input = header.pubdata_input.clone();
        let initial_bootloader_contents = serde_json::to_value(initial_bootloader_contents)
            .map_err(|err| instrumentation.arg_error("initial_bootloader_contents", err))?;
        let used_contract_hashes = serde_json::to_value(&header.used_contract_hashes)
            .map_err(|err| instrumentation.arg_error("header.used_contract_hashes", err))?;
        let storage_refunds: Vec<_> = storage_refunds.iter().copied().map(i64::from).collect();
        let pubdata_costs: Vec<_> = pubdata_costs.iter().copied().map(i64::from).collect();

        let query = sqlx::query!(
            r#"
            UPDATE l1_batches
            SET
                l1_tx_count = $2,
                l2_tx_count = $3,
                l2_to_l1_messages = $4,
                bloom = $5,
                priority_ops_onchain_data = $6,
                initial_bootloader_heap_content = $7,
                used_contract_hashes = $8,
                bootloader_code_hash = $9,
                default_aa_code_hash = $10,
                evm_emulator_code_hash = $11,
                protocol_version = $12,
                system_logs = $13,
                storage_refunds = $14,
                pubdata_costs = $15,
                pubdata_input = $16,
                predicted_circuits_by_type = $17,
                updated_at = NOW(),
                sealed_at = NOW(),
                is_sealed = TRUE
            WHERE
                number = $1
            "#,
            i64::from(header.number.0),
            i32::from(header.l1_tx_count),
            i32::from(header.l2_tx_count),
            &header.l2_to_l1_messages,
            header.bloom.as_bytes(),
            &priority_onchain_data,
            initial_bootloader_contents,
            used_contract_hashes,
            header.base_system_contracts_hashes.bootloader.as_bytes(),
            header.base_system_contracts_hashes.default_aa.as_bytes(),
            header
                .base_system_contracts_hashes
                .evm_emulator
                .as_ref()
                .map(H256::as_bytes),
            header.protocol_version.map(|v| v as i32),
            &system_logs,
            &storage_refunds,
            &pubdata_costs,
            pubdata_input,
            serde_json::to_value(predicted_circuits_by_type).unwrap(),
        );
        let update_result = instrumentation.with(query).execute(self.storage).await?;

        if update_result.rows_affected() == 0 {
            anyhow::bail!(
                "L1 batch sealing failed: batch #{} was not found",
                header.number
            );
        }

        Ok(())
    }
Marks provided L1 batch as sealed and populates it with all the runtime information.

Errors if the batch does not exist.
core/lib/dal/src/blocks_dal.rs