diff --git a/Cargo.lock b/Cargo.lock index 89780448d..9a9bebab8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2004,6 +2004,8 @@ dependencies = [ "compare_fields", "compare_fields_derive", "derivative", + "eth2_network_config", + "eth2_serde_utils", "eth2_ssz", "eth2_ssz_derive", "ethereum-types 0.14.1", @@ -2011,9 +2013,11 @@ dependencies = [ "fork_choice", "fs2", "hex", + "kzg", "rayon", "serde", "serde_derive", + "serde_json", "serde_repr", "serde_yaml", "snap", diff --git a/beacon_node/beacon_chain/src/kzg_utils.rs b/beacon_node/beacon_chain/src/kzg_utils.rs index 19788a1b4..7091b06fb 100644 --- a/beacon_node/beacon_chain/src/kzg_utils.rs +++ b/beacon_node/beacon_chain/src/kzg_utils.rs @@ -1,5 +1,5 @@ use kzg::{Error as KzgError, Kzg, BYTES_PER_BLOB}; -use types::{Blob, EthSpec, KzgCommitment, KzgProof}; +use types::{Blob, EthSpec, Hash256, KzgCommitment, KzgProof}; /// Converts a blob ssz List object to an array to be used with the kzg /// crypto library. @@ -56,3 +56,25 @@ pub fn blob_to_kzg_commitment( ) -> Result { kzg.blob_to_kzg_commitment(ssz_blob_to_crypto_blob::(blob)) } + +/// Compute the kzg proof for a given blob and an evaluation point z. +pub fn compute_kzg_proof( + kzg: &Kzg, + blob: Blob, + z: Hash256, +) -> Result<(KzgProof, Hash256), KzgError> { + let z = z.0.into(); + kzg.compute_kzg_proof(ssz_blob_to_crypto_blob::(blob), z) + .map(|(proof, z)| (proof, Hash256::from_slice(&z.to_vec()))) +} + +/// Verify a `kzg_proof` for a `kzg_commitment` that evaluating a polynomial at `z` results in `y` +pub fn verify_kzg_proof( + kzg: &Kzg, + kzg_commitment: KzgCommitment, + kzg_proof: KzgProof, + z: Hash256, + y: Hash256, +) -> Result { + kzg.verify_kzg_proof(kzg_commitment, z.0.into(), y.0.into(), kzg_proof) +} diff --git a/crypto/kzg/src/lib.rs b/crypto/kzg/src/lib.rs index b300e2d3b..d0ed6728d 100644 --- a/crypto/kzg/src/lib.rs +++ b/crypto/kzg/src/lib.rs @@ -3,11 +3,11 @@ mod kzg_proof; mod trusted_setup; pub use crate::{kzg_commitment::KzgCommitment, kzg_proof::KzgProof, trusted_setup::TrustedSetup}; -use c_kzg::Bytes48; pub use c_kzg::{ Blob, Error as CKzgError, KzgSettings, BYTES_PER_BLOB, BYTES_PER_FIELD_ELEMENT, FIELD_ELEMENTS_PER_BLOB, }; +use c_kzg::{Bytes32, Bytes48}; use std::path::PathBuf; #[derive(Debug)] @@ -116,4 +116,29 @@ impl Kzg { .map_err(Error::InvalidBlob) .map(|com| KzgCommitment(com.to_bytes().into_inner())) } + + /// Computes the kzg proof for a given `blob` and an evaluation point `z` + pub fn compute_kzg_proof(&self, blob: Blob, z: Bytes32) -> Result<(KzgProof, Bytes32), Error> { + c_kzg::KzgProof::compute_kzg_proof(blob, z, &self.trusted_setup) + .map_err(Error::KzgProofComputationFailed) + .map(|(proof, y)| (KzgProof(proof.to_bytes().into_inner()), y)) + } + + /// Verifies a `kzg_proof` for a `kzg_commitment` that evaluating a polynomial at `z` results in `y` + pub fn verify_kzg_proof( + &self, + kzg_commitment: KzgCommitment, + z: Bytes32, + y: Bytes32, + kzg_proof: KzgProof, + ) -> Result { + c_kzg::KzgProof::verify_kzg_proof( + kzg_commitment.into(), + z, + y, + kzg_proof.into(), + &self.trusted_setup, + ) + .map_err(Error::InvalidKzgProof) + } } diff --git a/testing/ef_tests/Cargo.toml b/testing/ef_tests/Cargo.toml index 79664a262..be34446d9 100644 --- a/testing/ef_tests/Cargo.toml +++ b/testing/ef_tests/Cargo.toml @@ -17,11 +17,15 @@ compare_fields_derive = { path = "../../common/compare_fields_derive" } derivative = "2.1.1" ethereum-types = "0.14.1" hex = "0.4.2" +kzg = { path = "../../crypto/kzg" } rayon = "1.4.1" serde = "1.0.116" serde_derive = "1.0.116" +serde_json = "1.0.58" serde_repr = "0.1.6" serde_yaml = "0.8.13" +eth2_network_config = { path = "../../common/eth2_network_config" } +eth2_serde_utils = { path = "../../consensus/serde_utils" } eth2_ssz = "0.4.1" eth2_ssz_derive = "0.3.1" tree_hash = "0.4.1" diff --git a/testing/ef_tests/src/cases.rs b/testing/ef_tests/src/cases.rs index 216912a4f..f328fa640 100644 --- a/testing/ef_tests/src/cases.rs +++ b/testing/ef_tests/src/cases.rs @@ -18,6 +18,12 @@ mod fork; mod fork_choice; mod genesis_initialization; mod genesis_validity; +mod kzg_blob_to_kzg_commitment; +mod kzg_compute_blob_kzg_proof; +mod kzg_compute_kzg_proof; +mod kzg_verify_blob_kzg_proof; +mod kzg_verify_blob_kzg_proof_batch; +mod kzg_verify_kzg_proof; mod merkle_proof_validity; mod operations; mod rewards; @@ -42,6 +48,12 @@ pub use epoch_processing::*; pub use fork::ForkTest; pub use genesis_initialization::*; pub use genesis_validity::*; +pub use kzg_blob_to_kzg_commitment::*; +pub use kzg_compute_blob_kzg_proof::*; +pub use kzg_compute_kzg_proof::*; +pub use kzg_verify_blob_kzg_proof::*; +pub use kzg_verify_blob_kzg_proof_batch::*; +pub use kzg_verify_kzg_proof::*; pub use merkle_proof_validity::*; pub use operations::*; pub use rewards::RewardsTest; diff --git a/testing/ef_tests/src/cases/kzg_blob_to_kzg_commitment.rs b/testing/ef_tests/src/cases/kzg_blob_to_kzg_commitment.rs index e69de29bb..f160b8b23 100644 --- a/testing/ef_tests/src/cases/kzg_blob_to_kzg_commitment.rs +++ b/testing/ef_tests/src/cases/kzg_blob_to_kzg_commitment.rs @@ -0,0 +1,46 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::blob_to_kzg_commitment; +use kzg::KzgCommitment; +use serde_derive::Deserialize; +use std::marker::PhantomData; + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGBlobToKZGCommitmentInput { + pub blob: String, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGBlobToKZGCommitment { + pub input: KZGBlobToKZGCommitmentInput, + pub output: Option, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGBlobToKZGCommitment { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGBlobToKZGCommitment { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let kzg = get_kzg()?; + + let commitment = parse_blob::(&self.input.blob).and_then(|blob| { + blob_to_kzg_commitment::(&kzg, blob).map_err(|e| { + Error::InternalError(format!("Failed to compute kzg commitment: {:?}", e)) + }) + }); + + let expected = self.output.as_ref().and_then(|s| parse_commitment(s).ok()); + + compare_result::(&commitment, &expected) + } +} diff --git a/testing/ef_tests/src/cases/kzg_compute_blob_kzg_proof.rs b/testing/ef_tests/src/cases/kzg_compute_blob_kzg_proof.rs index e69de29bb..30187f91c 100644 --- a/testing/ef_tests/src/cases/kzg_compute_blob_kzg_proof.rs +++ b/testing/ef_tests/src/cases/kzg_compute_blob_kzg_proof.rs @@ -0,0 +1,51 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::compute_blob_kzg_proof; +use kzg::KzgProof; +use serde_derive::Deserialize; +use std::marker::PhantomData; + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGComputeBlobKZGProofInput { + pub blob: String, + pub commitment: String, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGComputeBlobKZGProof { + pub input: KZGComputeBlobKZGProofInput, + pub output: Option, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGComputeBlobKZGProof { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGComputeBlobKZGProof { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let parse_input = |input: &KZGComputeBlobKZGProofInput| -> Result<_, Error> { + let blob = parse_blob::(&input.blob)?; + let commitment = parse_commitment(&input.commitment)?; + Ok((blob, commitment)) + }; + + let kzg = get_kzg()?; + let proof = parse_input(&self.input).and_then(|(blob, commitment)| { + compute_blob_kzg_proof::(&kzg, &blob, commitment) + .map_err(|e| Error::InternalError(format!("Failed to compute kzg proof: {:?}", e))) + }); + + let expected = self.output.as_ref().and_then(|s| parse_proof(s).ok()); + + compare_result::(&proof, &expected) + } +} diff --git a/testing/ef_tests/src/cases/kzg_compute_kzg_proof.rs b/testing/ef_tests/src/cases/kzg_compute_kzg_proof.rs index e69de29bb..f851947d9 100644 --- a/testing/ef_tests/src/cases/kzg_compute_kzg_proof.rs +++ b/testing/ef_tests/src/cases/kzg_compute_kzg_proof.rs @@ -0,0 +1,61 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::compute_kzg_proof; +use kzg::KzgProof; +use serde_derive::Deserialize; +use std::marker::PhantomData; +use std::str::FromStr; +use types::Hash256; + +pub fn parse_point(point: &str) -> Result { + Hash256::from_str(&point[2..]) + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse point: {:?}", e))) +} + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGComputeKZGProofInput { + pub blob: String, + pub z: String, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGComputeKZGProof { + pub input: KZGComputeKZGProofInput, + pub output: Option<(String, Hash256)>, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGComputeKZGProof { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGComputeKZGProof { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let parse_input = |input: &KZGComputeKZGProofInput| -> Result<_, Error> { + let blob = parse_blob::(&input.blob)?; + let z = parse_point(&input.z)?; + Ok((blob, z)) + }; + + let kzg = get_kzg()?; + let proof = parse_input(&self.input).and_then(|(blob, z)| { + compute_kzg_proof::(&kzg, blob, z) + .map_err(|e| Error::InternalError(format!("Failed to compute kzg proof: {:?}", e))) + }); + + let expected = self + .output + .as_ref() + .and_then(|(s, z)| parse_proof(s).ok().map(|proof| (proof, *z))); + + compare_result::<(KzgProof, Hash256), _>(&proof, &expected) + } +} diff --git a/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof.rs b/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof.rs index e69de29bb..fdc68a592 100644 --- a/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof.rs +++ b/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof.rs @@ -0,0 +1,92 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::validate_blob; +use eth2_network_config::TRUSTED_SETUP; +use kzg::{Kzg, KzgCommitment, KzgProof, TrustedSetup}; +use serde_derive::Deserialize; +use std::convert::TryInto; +use std::marker::PhantomData; +use types::Blob; + +pub fn get_kzg() -> Result { + let trusted_setup: TrustedSetup = serde_json::from_reader(TRUSTED_SETUP) + .map_err(|e| Error::InternalError(format!("Failed to initialize kzg: {:?}", e)))?; + Kzg::new_from_trusted_setup(trusted_setup) + .map_err(|e| Error::InternalError(format!("Failed to initialize kzg: {:?}", e))) +} + +pub fn parse_proof(proof: &str) -> Result { + hex::decode(&proof[2..]) + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse proof: {:?}", e))) + .and_then(|bytes| { + bytes + .try_into() + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse proof: {:?}", e))) + }) + .map(KzgProof) +} + +pub fn parse_commitment(commitment: &str) -> Result { + hex::decode(&commitment[2..]) + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse commitment: {:?}", e))) + .and_then(|bytes| { + bytes.try_into().map_err(|e| { + Error::FailedToParseTest(format!("Failed to parse commitment: {:?}", e)) + }) + }) + .map(KzgCommitment) +} + +pub fn parse_blob(blob: &str) -> Result, Error> { + hex::decode(&blob[2..]) + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse blob: {:?}", e))) + .and_then(|bytes| { + Blob::::new(bytes) + .map_err(|e| Error::FailedToParseTest(format!("Failed to parse blob: {:?}", e))) + }) +} + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGVerifyBlobKZGProofInput { + pub blob: String, + pub commitment: String, + pub proof: String, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGVerifyBlobKZGProof { + pub input: KZGVerifyBlobKZGProofInput, + pub output: Option, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGVerifyBlobKZGProof { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGVerifyBlobKZGProof { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let parse_input = |input: &KZGVerifyBlobKZGProofInput| -> Result<(Blob, KzgCommitment, KzgProof), Error> { + let blob = parse_blob::(&input.blob)?; + let commitment = parse_commitment(&input.commitment)?; + let proof = parse_proof(&input.proof)?; + Ok((blob, commitment, proof)) + }; + + let kzg = get_kzg()?; + let result = parse_input(&self.input).and_then(|(blob, commitment, proof)| { + validate_blob::(&kzg, blob, commitment, proof) + .map_err(|e| Error::InternalError(format!("Failed to validate blob: {:?}", e))) + }); + + compare_result::(&result, &self.output) + } +} diff --git a/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof_batch.rs b/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof_batch.rs index e69de29bb..960ad4e4f 100644 --- a/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof_batch.rs +++ b/testing/ef_tests/src/cases/kzg_verify_blob_kzg_proof_batch.rs @@ -0,0 +1,62 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::validate_blobs; +use serde_derive::Deserialize; +use std::marker::PhantomData; + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGVerifyBlobKZGProofBatchInput { + pub blobs: Vec, + pub commitments: Vec, + pub proofs: Vec, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGVerifyBlobKZGProofBatch { + pub input: KZGVerifyBlobKZGProofBatchInput, + pub output: Option, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGVerifyBlobKZGProofBatch { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGVerifyBlobKZGProofBatch { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let parse_input = |input: &KZGVerifyBlobKZGProofBatchInput| -> Result<_, Error> { + let blobs = input + .blobs + .iter() + .map(|s| parse_blob::(s)) + .collect::, _>>()?; + let commitments = input + .commitments + .iter() + .map(|s| parse_commitment(s)) + .collect::, _>>()?; + let proofs = input + .proofs + .iter() + .map(|s| parse_proof(s)) + .collect::, _>>()?; + Ok((commitments, blobs, proofs)) + }; + + let kzg = get_kzg()?; + let result = parse_input(&self.input).and_then(|(commitments, blobs, proofs)| { + validate_blobs::(&kzg, &commitments, &blobs, &proofs) + .map_err(|e| Error::InternalError(format!("Failed to validate blobs: {:?}", e))) + }); + + compare_result::(&result, &self.output) + } +} diff --git a/testing/ef_tests/src/cases/kzg_verify_kzg_proof.rs b/testing/ef_tests/src/cases/kzg_verify_kzg_proof.rs index e69de29bb..638c3b283 100644 --- a/testing/ef_tests/src/cases/kzg_verify_kzg_proof.rs +++ b/testing/ef_tests/src/cases/kzg_verify_kzg_proof.rs @@ -0,0 +1,52 @@ +use super::*; +use crate::case_result::compare_result; +use beacon_chain::kzg_utils::verify_kzg_proof; +use serde_derive::Deserialize; +use std::marker::PhantomData; + +#[derive(Debug, Clone, Deserialize)] +pub struct KZGVerifyKZGProofInput { + pub commitment: String, + pub z: String, + pub y: String, + pub proof: String, +} + +#[derive(Debug, Clone, Deserialize)] +#[serde(bound = "E: EthSpec")] +pub struct KZGVerifyKZGProof { + pub input: KZGVerifyKZGProofInput, + pub output: Option, + #[serde(skip)] + _phantom: PhantomData, +} + +impl LoadCase for KZGVerifyKZGProof { + fn load_from_dir(path: &Path, _fork_name: ForkName) -> Result { + decode::yaml_decode_file(path.join("data.yaml").as_path()) + } +} + +impl Case for KZGVerifyKZGProof { + fn is_enabled_for_fork(fork_name: ForkName) -> bool { + fork_name == ForkName::Deneb + } + + fn result(&self, _case_index: usize, _fork_name: ForkName) -> Result<(), Error> { + let parse_input = |input: &KZGVerifyKZGProofInput| -> Result<_, Error> { + let commitment = parse_commitment(&input.commitment)?; + let z = parse_point(&input.z)?; + let y = parse_point(&input.y)?; + let proof = parse_proof(&input.proof)?; + Ok((commitment, z, y, proof)) + }; + + let kzg = get_kzg()?; + let result = parse_input(&self.input).and_then(|(commitment, z, y, proof)| { + verify_kzg_proof::(&kzg, commitment, proof, z, y) + .map_err(|e| Error::InternalError(format!("Failed to validate proof: {:?}", e))) + }); + + compare_result::(&result, &self.output) + } +} diff --git a/testing/ef_tests/src/handler.rs b/testing/ef_tests/src/handler.rs index e6ca6aeaa..6dec93462 100644 --- a/testing/ef_tests/src/handler.rs +++ b/testing/ef_tests/src/handler.rs @@ -637,6 +637,126 @@ impl Handler for GenesisInitializationHandler { } } +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGBlobToKZGCommitmentHandler(PhantomData); + +impl Handler for KZGBlobToKZGCommitmentHandler { + type Case = cases::KZGBlobToKZGCommitment; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "blob_to_kzg_commitment".into() + } +} + +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGComputeBlobKZGProofHandler(PhantomData); + +impl Handler for KZGComputeBlobKZGProofHandler { + type Case = cases::KZGComputeBlobKZGProof; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "compute_blob_kzg_proof".into() + } +} + +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGComputeKZGProofHandler(PhantomData); + +impl Handler for KZGComputeKZGProofHandler { + type Case = cases::KZGComputeKZGProof; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "compute_kzg_proof".into() + } +} + +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGVerifyBlobKZGProofHandler(PhantomData); + +impl Handler for KZGVerifyBlobKZGProofHandler { + type Case = cases::KZGVerifyBlobKZGProof; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "verify_blob_kzg_proof".into() + } +} + +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGVerifyBlobKZGProofBatchHandler(PhantomData); + +impl Handler for KZGVerifyBlobKZGProofBatchHandler { + type Case = cases::KZGVerifyBlobKZGProofBatch; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "verify_blob_kzg_proof_batch".into() + } +} + +#[derive(Derivative)] +#[derivative(Default(bound = ""))] +pub struct KZGVerifyKZGProofHandler(PhantomData); + +impl Handler for KZGVerifyKZGProofHandler { + type Case = cases::KZGVerifyKZGProof; + + fn config_name() -> &'static str { + "general" + } + + fn runner_name() -> &'static str { + "kzg" + } + + fn handler_name(&self) -> String { + "verify_kzg_proof".into() + } +} + #[derive(Derivative)] #[derivative(Default(bound = ""))] pub struct MerkleProofValidityHandler(PhantomData); diff --git a/testing/ef_tests/tests/tests.rs b/testing/ef_tests/tests/tests.rs index 2bd8580bf..7d9d8d908 100644 --- a/testing/ef_tests/tests/tests.rs +++ b/testing/ef_tests/tests/tests.rs @@ -563,6 +563,36 @@ fn genesis_validity() { // Note: there are no genesis validity tests for mainnet } +#[test] +fn kzg_blob_to_kzg_commitment() { + KZGBlobToKZGCommitmentHandler::::default().run(); +} + +#[test] +fn kzg_compute_blob_kzg_proof() { + KZGComputeBlobKZGProofHandler::::default().run(); +} + +#[test] +fn kzg_compute_kzg_proof() { + KZGComputeKZGProofHandler::::default().run(); +} + +#[test] +fn kzg_verify_blob_kzg_proof() { + KZGVerifyBlobKZGProofHandler::::default().run(); +} + +#[test] +fn kzg_verify_blob_kzg_proof_batch() { + KZGVerifyBlobKZGProofBatchHandler::::default().run(); +} + +#[test] +fn kzg_verify_kzg_proof() { + KZGVerifyKZGProofHandler::::default().run(); +} + #[test] fn merkle_proof_validity() { MerkleProofValidityHandler::::default().run();