async fn get_partial_match_verification_info(
    dal: &mut ContractVerificationDal<'_, '_>,
    address: Address,
) -> anyhow::Result<Option<VerificationInfo>> {
    let Some(deployed_contract) = dal.get_contract_info_for_verification(address).await? else {
        return Ok(None);
    };

    let bytecode_hash =
        BytecodeHash::try_from(deployed_contract.bytecode_hash).context("Invalid bytecode hash")?;
    let deployed_bytecode = trim_bytecode(bytecode_hash, &deployed_contract.bytecode)
        .context("Invalid deployed bytecode")?;

    let identifier = ContractIdentifier::from_bytecode(bytecode_hash.marker(), deployed_bytecode);
    let Some((mut info, fetched_keccak256, fetched_keccak256_without_metadata)) = dal
        .get_partial_match_verification_info(
            identifier.bytecode_keccak256,
            identifier.bytecode_without_metadata_keccak256,
        )
        .await?
    else {
        return Ok(None);
    };

    if identifier.bytecode_keccak256 != fetched_keccak256 {
        // Sanity check
        let has_metadata = identifier.detected_metadata.is_some();
        let hashes_without_metadata_match =
            identifier.bytecode_without_metadata_keccak256 == fetched_keccak256_without_metadata;

        if !has_metadata || !hashes_without_metadata_match {
            tracing::error!(
                contract_address = ?address,
                identifier = ?identifier,
                fetched_keccak256 = ?fetched_keccak256,
                fetched_keccak256_without_metadata = ?fetched_keccak256_without_metadata,
                info = ?info,
                "Bogus verification info fetched for contract",
            );
            anyhow::bail!("Internal error: bogus verification info detected");
        }

        // Mark the contract as partial match (regardless of other issues).
        info.verification_problems = vec![VerificationProblem::IncorrectMetadata];
    }

    Ok(Some(info))
}
Tries to do a lookup for partial match verification info.
Should be called only if a perfect match is not found.
core/node/contract_verification_server/src/api_impl.rs