Skip to content

Commit

Permalink
chore(eips): make sha2 optional under kzg
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Jun 20, 2024
1 parent 1ee31cf commit f8b6eb2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/eips/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ alloy-primitives = { workspace = true, features = ["rlp"] }
alloy-rlp = { workspace = true, features = ["derive"] }
alloy-serde.workspace = true

sha2.workspace = true

# serde
serde = { workspace = true, optional = true }

# kzg
derive_more = { workspace = true, optional = true }
c-kzg = { workspace = true, optional = true }
derive_more = { workspace = true, optional = true }
once_cell = { workspace = true, features = ["race", "alloc"], optional = true }
sha2 = { workspace = true, optional = true }

# ssz
ethereum_ssz_derive = { workspace = true, optional = true }
Expand Down Expand Up @@ -63,7 +62,8 @@ std = [
"once_cell?/std",
]
serde = ["dep:serde", "alloy-primitives/serde", "c-kzg?/serde"]
kzg = ["dep:derive_more", "dep:c-kzg", "dep:once_cell"]
kzg = ["sha2", "dep:derive_more", "dep:c-kzg", "dep:once_cell"]
sha2 = ["dep:sha2"]
ssz = [
"std",
"dep:ethereum_ssz",
Expand Down
1 change: 1 addition & 0 deletions crates/eips/src/eip4844/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub type Bytes48 = FixedBytes<48>;
/// # Panics
///
/// If the given commitment is not 48 bytes long.
#[cfg(feature = "kzg")]
pub fn kzg_to_versioned_hash(commitment: &[u8]) -> B256 {
use sha2::Digest;

Expand Down
1 change: 1 addition & 0 deletions crates/eips/src/eip4844/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! [`SidecarCoder`].
//!
//! [`SidecarCoder`]: crate::eip4844::builder::SidecarCoder

use crate::eip4844::USABLE_BITS_PER_FIELD_ELEMENT;

/// Determine whether a slice of bytes can be contained in a field element.
Expand Down

0 comments on commit f8b6eb2

Please sign in to comment.