mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-22 03:30:38 +00:00
Update kzg to get windows going, expose blst features (#4177)
* fmt * update kzg * use commit from main repo
This commit is contained in:
parent
f6f63b18ed
commit
fca8559acc
28
Cargo.lock
generated
28
Cargo.lock
generated
@ -704,6 +704,27 @@ dependencies = [
|
||||
"shlex",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.64.0"
|
||||
source = "git+https://github.com/rust-lang/rust-bindgen?rev=0de11f0a521611ac8738b7b01d19dddaf3899e66#0de11f0a521611ac8738b7b01d19dddaf3899e66"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"log",
|
||||
"peeking_take_while",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"regex",
|
||||
"rustc-hash",
|
||||
"shlex",
|
||||
"syn 2.0.13",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.3.2"
|
||||
@ -925,8 +946,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "c-kzg"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/ethereum/c-kzg-4844?rev=549739fcb3aaec6fe5651e1912f05c604b45621b#549739fcb3aaec6fe5651e1912f05c604b45621b"
|
||||
source = "git+https://github.com/ethereum/c-kzg-4844?rev=fd24cf8e1e2f09a96b4e62a595b4e49f046ce6cf#fd24cf8e1e2f09a96b4e62a595b4e49f046ce6cf"
|
||||
dependencies = [
|
||||
"bindgen 0.64.0",
|
||||
"cc",
|
||||
"glob",
|
||||
"hex",
|
||||
"libc",
|
||||
"serde",
|
||||
@ -4816,7 +4840,7 @@ name = "mdbx-sys"
|
||||
version = "0.11.6-4"
|
||||
source = "git+https://github.com/sigp/libmdbx-rs?tag=v0.1.4#096da80a83d14343f8df833006483f48075cd135"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"bindgen 0.59.2",
|
||||
"cc",
|
||||
"cmake",
|
||||
"libc",
|
||||
|
@ -32,8 +32,8 @@ use beacon_chain::{
|
||||
pub use block_id::BlockId;
|
||||
use directory::DEFAULT_ROOT_DIR;
|
||||
use eth2::types::{
|
||||
self as api_types, EndpointVersion, SignedBlockContents, ForkChoice, ForkChoiceNode, SkipRandaoVerification,
|
||||
ValidatorId, ValidatorStatus,
|
||||
self as api_types, EndpointVersion, ForkChoice, ForkChoiceNode, SignedBlockContents,
|
||||
SkipRandaoVerification, ValidatorId, ValidatorStatus,
|
||||
};
|
||||
use lighthouse_network::{types::SyncState, EnrExt, NetworkGlobals, PeerId, PubsubMessage};
|
||||
use lighthouse_version::version_with_platform;
|
||||
|
@ -16,7 +16,7 @@ serde_derive = "1.0.116"
|
||||
eth2_serde_utils = "0.1.1"
|
||||
hex = "0.4.2"
|
||||
eth2_hashing = "0.3.0"
|
||||
c-kzg = {git = "https://github.com/ethereum/c-kzg-4844", rev = "549739fcb3aaec6fe5651e1912f05c604b45621b" }
|
||||
c-kzg = {git = "https://github.com/ethereum/c-kzg-4844", rev = "fd24cf8e1e2f09a96b4e62a595b4e49f046ce6cf" }
|
||||
arbitrary = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
||||
[features]
|
||||
|
@ -5,7 +5,7 @@ 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,
|
||||
Blob, Error as CKzgError, KzgSettings, BYTES_PER_BLOB, BYTES_PER_FIELD_ELEMENT,
|
||||
FIELD_ELEMENTS_PER_BLOB,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
@ -21,7 +21,7 @@ pub enum Error {
|
||||
|
||||
/// A wrapper over a kzg library that holds the trusted setup parameters.
|
||||
pub struct Kzg {
|
||||
trusted_setup: KZGSettings,
|
||||
trusted_setup: KzgSettings,
|
||||
}
|
||||
|
||||
impl Kzg {
|
||||
@ -32,7 +32,7 @@ impl Kzg {
|
||||
/// The number of G2 points should be equal to 65.
|
||||
pub fn new_from_trusted_setup(trusted_setup: TrustedSetup) -> Result<Self, Error> {
|
||||
Ok(Self {
|
||||
trusted_setup: KZGSettings::load_trusted_setup(
|
||||
trusted_setup: KzgSettings::load_trusted_setup(
|
||||
trusted_setup.g1_points(),
|
||||
trusted_setup.g2_points(),
|
||||
)
|
||||
@ -47,7 +47,7 @@ impl Kzg {
|
||||
#[deprecated]
|
||||
pub fn new_from_file(file_path: PathBuf) -> Result<Self, Error> {
|
||||
Ok(Self {
|
||||
trusted_setup: KZGSettings::load_trusted_setup_file(file_path)
|
||||
trusted_setup: KzgSettings::load_trusted_setup_file(file_path)
|
||||
.map_err(Error::InvalidTrustedSetup)?,
|
||||
})
|
||||
}
|
||||
@ -58,7 +58,7 @@ impl Kzg {
|
||||
blob: Blob,
|
||||
kzg_commitment: KzgCommitment,
|
||||
) -> Result<KzgProof, Error> {
|
||||
c_kzg::KZGProof::compute_blob_kzg_proof(blob, kzg_commitment.into(), &self.trusted_setup)
|
||||
c_kzg::KzgProof::compute_blob_kzg_proof(blob, kzg_commitment.into(), &self.trusted_setup)
|
||||
.map_err(Error::KzgProofComputationFailed)
|
||||
.map(|proof| KzgProof(proof.to_bytes().into_inner()))
|
||||
}
|
||||
@ -70,7 +70,7 @@ impl Kzg {
|
||||
kzg_commitment: KzgCommitment,
|
||||
kzg_proof: KzgProof,
|
||||
) -> Result<bool, Error> {
|
||||
c_kzg::KZGProof::verify_blob_kzg_proof(
|
||||
c_kzg::KzgProof::verify_blob_kzg_proof(
|
||||
blob,
|
||||
kzg_commitment.into(),
|
||||
kzg_proof.into(),
|
||||
@ -100,7 +100,7 @@ impl Kzg {
|
||||
.map(|proof| Bytes48::from_bytes(&proof.0))
|
||||
.collect::<Result<Vec<Bytes48>, _>>()
|
||||
.map_err(Error::InvalidBytes)?;
|
||||
c_kzg::KZGProof::verify_blob_kzg_proof_batch(
|
||||
c_kzg::KzgProof::verify_blob_kzg_proof_batch(
|
||||
blobs,
|
||||
&commitments_bytes,
|
||||
&proofs_bytes,
|
||||
@ -111,7 +111,7 @@ impl Kzg {
|
||||
|
||||
/// Converts a blob to a kzg commitment.
|
||||
pub fn blob_to_kzg_commitment(&self, blob: Blob) -> Result<KzgCommitment, Error> {
|
||||
c_kzg::KZGCommitment::blob_to_kzg_commitment(blob, &self.trusted_setup)
|
||||
c_kzg::KzgCommitment::blob_to_kzg_commitment(blob, &self.trusted_setup)
|
||||
.map_err(Error::InvalidBlob)
|
||||
.map(|com| KzgCommitment(com.to_bytes().into_inner()))
|
||||
}
|
||||
|
@ -24,8 +24,9 @@ use types::{
|
||||
ContributionAndProof, Domain, Epoch, EthSpec, Fork, Graffiti, Hash256, Keypair, PublicKeyBytes,
|
||||
SelectionProof, Signature, SignedAggregateAndProof, SignedBeaconBlock, SignedBlobSidecar,
|
||||
SignedBlobSidecarList, SignedContributionAndProof, SignedRoot, SignedValidatorRegistrationData,
|
||||
Slot, SyncAggregatorSelectionData, SyncCommitteeContribution, SyncCommitteeMessage,
|
||||
SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData, SignedVoluntaryExit, VoluntaryExit,
|
||||
SignedVoluntaryExit, Slot, SyncAggregatorSelectionData, SyncCommitteeContribution,
|
||||
SyncCommitteeMessage, SyncSelectionProof, SyncSubnetId, ValidatorRegistrationData,
|
||||
VoluntaryExit,
|
||||
};
|
||||
use validator_dir::ValidatorDir;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user