Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.
Closed
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
5 changes: 5 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ panic = "abort"
codegen-units = 1
lto = "fat"

[patch.crates-io]
revm = { git = "https://github.com/bluealloy/revm", branch = "main" }

[workspace.dependencies]
# Workspace Binaries
kona-host = { path = "bin/host", version = "0.1.0", default-features = false }
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_g1_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@

use crate::precompiles::utils::precompile_run;
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::g1_add::PRECOMPILE, Error as PrecompileError, Precompile, PrecompileResult,
PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

/// The address of the BLS12-381 g1 addition check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_G1_ADD_CHECK: Address = address!("0x000000000000000000000000000000000000000b");
const BLS12_G1_ADD_CHECK: Address = PRECOMPILE.0;

/// Input length of G1 Addition operation.
const INPUT_LENGTH: usize = 256;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_g1_msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

use crate::precompiles::utils::{msm_required_gas, precompile_run};
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::g1_msm::PRECOMPILE, Error as PrecompileError, Precompile, PrecompileResult,
PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

Expand All @@ -22,7 +25,7 @@ const BLS12_MAX_G1_MSM_SIZE_ISTHMUS: usize = 513760;
/// The address of the BLS12-381 g1 msm check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_G1_MSM_CHECK: Address = address!("0x000000000000000000000000000000000000000c");
const BLS12_G1_MSM_CHECK: Address = PRECOMPILE.0;

/// Input length of g1 msm operation.
const INPUT_LENGTH: usize = 160;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_g2_add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@

use crate::precompiles::utils::precompile_run;
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::g2_add::PRECOMPILE, Error as PrecompileError, Precompile, PrecompileResult,
PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

/// The address of the BLS12-381 g2 addition check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_G2_ADD_CHECK: Address = address!("0x000000000000000000000000000000000000000d");
const BLS12_G2_ADD_CHECK: Address = PRECOMPILE.0;

/// Input length of g2 addition operation.
const INPUT_LENGTH: usize = 512;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_g2_msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@

use crate::precompiles::utils::{msm_required_gas, precompile_run};
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::g2_msm::PRECOMPILE, Error as PrecompileError, Precompile, PrecompileResult,
PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

Expand All @@ -22,7 +25,7 @@ const BLS12_MAX_G2_MSM_SIZE_ISTHMUS: usize = 488448;
/// The address of the BLS12-381 g2 msm check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_G2_MSM_CHECK: Address = address!("0x000000000000000000000000000000000000000e");
const BLS12_G2_MSM_CHECK: Address = PRECOMPILE.0;

/// Input length of g2 msm operation.
const INPUT_LENGTH: usize = 288;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_map_fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@

use crate::precompiles::utils::precompile_run;
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::map_fp_to_g1::PRECOMPILE, Error as PrecompileError, Precompile,
PrecompileResult, PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

/// The address of the BLS12-381 map fp to g1 check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_MAP_FP_CHECK: Address = address!("0x0000000000000000000000000000000000000010");
const BLS12_MAP_FP_CHECK: Address = PRECOMPILE.0;

/// Base gas fee for the BLS12-381 map fp to g1 operation.
const MAP_FP_BASE_FEE: u64 = 5500;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_map_fp2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@

use crate::precompiles::utils::precompile_run;
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::map_fp2_to_g2::PRECOMPILE, Error as PrecompileError, Precompile,
PrecompileResult, PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

/// The address of the BLS12-381 map fp2 to g2 check precompile.
///
/// See: <https://eips.ethereum.org/EIPS/eip-2537#constants>
const BLS12_MAP_FP2_CHECK: Address = address!("0x0000000000000000000000000000000000000011");
const BLS12_MAP_FP2_CHECK: Address = PRECOMPILE.0;

/// Base gas fee for the BLS12-381 map fp2 to g2 operation.
const MAP_FP2_BASE_FEE: u64 = 23800;
Expand Down
9 changes: 6 additions & 3 deletions bin/client/src/precompiles/bls12_pairing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@

use crate::precompiles::utils::precompile_run;
use alloc::{string::ToString, vec::Vec};
use alloy_primitives::{address, keccak256, Address, Bytes};
use alloy_primitives::{keccak256, Address, Bytes};
use revm::{
precompile::{Error as PrecompileError, Precompile, PrecompileResult, PrecompileWithAddress},
precompile::{
bls12_381::pairing::PRECOMPILE, Error as PrecompileError, Precompile, PrecompileResult,
PrecompileWithAddress,
},
primitives::PrecompileOutput,
};

/// The max pairing size for BLS12-381 input given a 20M gas limit.
const BLS12_MAX_PAIRING_SIZE_ISTHMUS: usize = 235_008;

/// The address of the BLS12-381 pairing check precompile.
const BLS12_PAIRING_CHECK: Address = address!("0x000000000000000000000000000000000000000f");
const BLS12_PAIRING_CHECK: Address = PRECOMPILE.0;

/// Input length of pairing operation.
const INPUT_LENGTH: usize = 384;
Expand Down