pub async fn new(
        pool: ConnectionPool<Core>,
        l2_legacy_shared_bridge_addr: Option<Address>,
        mut command_capacity: usize,
    ) -> anyhow::Result<(Self, L2BlockSealerTask)> {
        Self::validate_l2_legacy_shared_bridge_addr(&pool, l2_legacy_shared_bridge_addr).await?;

        let is_sync = command_capacity == 0;
        command_capacity = command_capacity.max(1);

        let (commands_sender, commands_receiver) = mpsc::channel(command_capacity);
        let sealer = L2BlockSealerTask {
            pool: pool.clone(),
            is_sync,
            commands_sender: commands_sender.downgrade(),
            commands_receiver,
        };
        let this = Self {
            pool,
            l2_legacy_shared_bridge_addr,
            pre_insert_txs: false,
            insert_protective_reads: true,
            commands_sender,
            latest_completion_receiver: None,
            is_sync,
        };
        Ok((this, sealer))
    }
Creates a sealer that will use the provided Postgres connection and will have the specified
`command_capacity` for unprocessed sealing commands.
core/node/state_keeper/src/io/persistence.rs