Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump c-kzg and enable blst portable feature #1059

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 4 additions & 127 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions crates/precompile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ sha2 = { version = "0.10", default-features = false }
aurora-engine-modexp = { version = "1.0", default-features = false }

# Optional KZG point evaluation precompile
c-kzg = { version = "0.4.0", default-features = false, optional = true }
c-kzg = { version = "0.4.1", default-features = false, optional = true }

# TODO: make specific feature for this in c-kzg-4844
blst = { version = "0.3.11", default-features = false, optional = true }

# ecRecover precompile
k256 = { version = "0.13.3", default-features = false, features = ["ecdsa"] }
Expand Down Expand Up @@ -50,7 +53,9 @@ optimism = ["revm-primitives/optimism"]
# These libraries may not work on all no_std platforms as they depend on C.

# Enables the KZG point evaluation precompile.
c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg"]
# TODO: remove `blst` dep when `c-kzg` has a portable feature
c-kzg = ["dep:c-kzg", "revm-primitives/c-kzg", "dep:blst", "blst?/portable"]

# Use `secp256k1` as a faster alternative to `k256`.
# The problem that `secp256k1` has is it fails to build for `wasm` target on Windows and Mac as it is c lib.
# In Linux it passes. If you don't require to build wasm on win/mac, it is safe to use it and it is enabled by default.
Expand Down
3 changes: 3 additions & 0 deletions crates/precompile/src/kzg_point_evaluation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use c_kzg::{Bytes32, Bytes48, KzgProof, KzgSettings};
use revm_primitives::{hex_literal::hex, Env};
use sha2::{Digest, Sha256};

// TODO: remove when we have `portable` feature in `c-kzg`
use blst as _;

pub const POINT_EVALUATION: PrecompileWithAddress =
PrecompileWithAddress(ADDRESS, Precompile::Env(run));

Expand Down
7 changes: 5 additions & 2 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ bitvec = { version = "1", default-features = false, features = ["alloc"] }
bitflags = { version = "2.4.2", default-features = false }

# For setting the CfgEnv KZGSettings. Enabled by c-kzg flag.
c-kzg = { version = "0.4.0", default-features = false, optional = true }
c-kzg = { version = "0.4.1", default-features = false, optional = true }
once_cell = { version = "1.19", default-features = false, optional = true }
# TODO: make specific feature for this in c-kzg-4844
blst = { version = "0.3.11", default-features = false, optional = true }

# utility
enumn = "0.1"
Expand Down Expand Up @@ -84,4 +86,5 @@ optional_no_base_fee = []
optional_beneficiary_reward = []

# See comments in `revm-precompile`
c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more"]
# TODO: remove `blst` dep when `c-kzg` has a portable feature
c-kzg = ["dep:c-kzg", "dep:once_cell", "dep:derive_more", "dep:blst", "blst?/portable"]
3 changes: 3 additions & 0 deletions crates/primitives/src/kzg.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
mod env_settings;
mod trusted_setup_points;

// TODO: remove when we have `portable` feature in `c-kzg`
use blst as _;

pub use c_kzg::KzgSettings;
pub use env_settings::EnvKzgSettings;
pub use trusted_setup_points::{
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ethersdb = [
"futures",
"ethers-providers",
"ethers-core",
] # Negate optimism default handler
] # Negate optimism default handler

dev = [
"memory_limit",
Expand Down
Loading