-
Notifications
You must be signed in to change notification settings - Fork 562
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: c-kzg bump, cleanup on kzgsetting (#1719)
* chore: bump c-kzg v2.0.0 * feat: cleanup c-kzg kzgsetting * rm kzg-rs from no_std check
- Loading branch information
Showing
11 changed files
with
38 additions
and
4,433 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
mod env_settings; | ||
mod trusted_setup_points; | ||
|
||
cfg_if::cfg_if! { | ||
if #[cfg(feature = "c-kzg")] { | ||
pub use c_kzg::KzgSettings; | ||
/// KZG Settings that allow us to specify a custom trusted setup. | ||
/// or use hardcoded default settings. | ||
#[derive(Debug, Clone, Default, PartialEq, Eq )] | ||
pub enum EnvKzgSettings { | ||
/// Default mainnet trusted setup | ||
#[default] | ||
Default, | ||
/// Custom trusted setup. | ||
Custom(std::sync::Arc<c_kzg::KzgSettings>), | ||
} | ||
|
||
impl EnvKzgSettings { | ||
/// Return set KZG settings. | ||
/// | ||
/// In will initialize the default settings if it is not already loaded. | ||
pub fn get(&self) -> &c_kzg::KzgSettings { | ||
match self { | ||
Self::Default => { | ||
c_kzg::ethereum_kzg_settings() | ||
} | ||
Self::Custom(settings) => settings, | ||
} | ||
} | ||
} | ||
} else if #[cfg(feature = "kzg-rs")] { | ||
pub use kzg_rs::KzgSettings; | ||
pub use kzg_rs::{KzgSettings,EnvKzgSettings}; | ||
} | ||
} | ||
|
||
pub use env_settings::EnvKzgSettings; | ||
pub use trusted_setup_points::{ | ||
parse_kzg_trusted_setup, G1Points, G2Points, KzgErrors, BYTES_PER_G1_POINT, BYTES_PER_G2_POINT, | ||
G1_POINTS, G2_POINTS, NUM_G1_POINTS, NUM_G2_POINTS, | ||
}; |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.