pub async fn get_contract_code_unchecked(
        &mut self,
        address: Address,
        block_number: L2BlockNumber,
    ) -> DalResult<Option<RawBytecode>> {
        let hashed_key = get_code_key(&address).hashed_key();
        let row = sqlx::query!(
            r#"
            SELECT
                bytecode_hash,
                bytecode
            FROM
                (
                    SELECT
                        value
                    FROM
                        storage_logs
                    WHERE
                        storage_logs.hashed_key = $1
                        AND storage_logs.miniblock_number <= $2
                    ORDER BY
                        storage_logs.miniblock_number DESC,
                        storage_logs.operation_number DESC
                    LIMIT
                        1
                ) deploy_log
            JOIN factory_deps ON value = factory_deps.bytecode_hash
            WHERE
                value != $3
            "#,
            hashed_key.as_bytes(),
            i64::from(block_number.0),
            FAILED_CONTRACT_DEPLOYMENT_BYTECODE_HASH.as_bytes(),
        )
        .instrument("get_contract_code_unchecked")
        .with_arg("address", &address)
        .with_arg("block_number", &block_number)
        .fetch_optional(self.storage)
        .await?;

        Ok(row.map(|row| RawBytecode {
            bytecode_hash: H256::from_slice(&row.bytecode_hash),
            bytecode: row.bytecode,
        }))
    }
This method doesn't check if block with number equals to `block_number`
is present in the database. For such blocks `None` will be returned.
core/lib/dal/src/storage_web3_dal.rs