async fn get_compilation_artifacts(
        &self,
        request: &mut VerificationRequest,
        deployed_identifier: &ContractIdentifier,
    ) -> Result<CompilationArtifacts, ContractVerifierError> {
        // If compiler versions from the metadata don't match with the request,
        // we'll first try to use info from metadata.
        let alternative_request = match &deployed_identifier.detected_metadata {
            Some(DetectedMetadata::Cbor { metadata, .. })
                if !request.req.compiler_versions_match(metadata) =>
            {
                let update_request = request.req.clone().with_updated_compiler_versions(metadata);
                Some(update_request)
            }
            _ => None,
        };

        if let Some(alternative_request) = alternative_request {
            // Compile with the metadata versions
            let artifacts = self
                .compile(
                    alternative_request.clone(),
                    deployed_identifier.bytecode_marker,
                )
                .await;

            if let Ok(artifacts) = artifacts {
                let compiled_identifier = ContractIdentifier::from_bytecode(
                    deployed_identifier.bytecode_marker,
                    artifacts.deployed_bytecode(),
                );
                // Check if the compiled bytecode matches the deployed bytecode
                if matches!(
                    compiled_identifier.matches(deployed_identifier),
                    Match::Full | Match::Partial
                ) {
                    tracing::info!(
                        request_id = request.id,
                        request_compiler = request.req.compiler_versions.compiler_version(),
                        metadata_compiler =
                            alternative_request.compiler_versions.compiler_version(),
                        request_zk_compiler = request.req.compiler_versions.zk_compiler_version(),
                        metadata_zk_compiler =
                            alternative_request.compiler_versions.zk_compiler_version(),
                        "Updating request compiler versions in the DB."
                    );

                    // Since we know the version that should be used for the contract, we override one provided in
                    // the request, so that if this request is interpreted by anyone else, they can get correct
                    // compilation results
                    self.update_request_compiler_versions(
                        request.id,
                        alternative_request.compiler_versions.compiler_version(),
                        alternative_request.compiler_versions.zk_compiler_version(),
                    )
                    .await?;

                    // Update the request for downstream use
                    request.req = alternative_request;

                    return Ok(artifacts);
                }
            }
        }
        // We either have no alternative request or it didn't succeed
        self.compile(request.req.clone(), deployed_identifier.bytecode_marker)
            .await
    }
Returns compilation artifacts for the given request.
Tries to use the compiler versions from the metadata if they are different from the ones in the request.
If the metadata is not present, or the versions are the same, uses the ones from the request.
core/lib/contract_verifier/src/lib.rs