Skip to content

Commit

Permalink
update gas meter
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 authored and boundless-forest committed Nov 23, 2023
1 parent d2c8dcf commit 59be8cb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions frame/evm/precompile/bls12381/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ pub struct Bls12381G1Add;

impl Bls12381G1Add {
/// https://eips.ethereum.org/EIPS/eip-2537#g1-addition
const GAS_COST: u64 = 500;
const GAS_COST: u64 = 600;
}

impl Precompile for Bls12381G1Add {
Expand Down Expand Up @@ -369,7 +369,7 @@ pub struct Bls12381G2Add;

impl Bls12381G2Add {
/// https://eips.ethereum.org/EIPS/eip-2537#g2-addition
const GAS_COST: u64 = 800;
const GAS_COST: u64 = 4500;
}

impl Precompile for Bls12381G2Add {
Expand Down Expand Up @@ -407,7 +407,7 @@ pub struct Bls12381G2Mul;

impl Bls12381G2Mul {
// https://eips.ethereum.org/EIPS/eip-2537#g2-multiplication
const GAS_COST: u64 = 45_000;
const GAS_COST: u64 = 55_000;
}

impl Precompile for Bls12381G2Mul {
Expand Down Expand Up @@ -516,8 +516,8 @@ pub struct Bls12381Pairing;

impl Bls12381Pairing {
/// https://eips.ethereum.org/EIPS/eip-2537#pairing-operation
const BASE_GAS: u64 = 65_000;
const PER_PAIR_GAS: u64 = 43_000;
const BASE_GAS: u64 = 115000;
const PER_PAIR_GAS: u64 = 23000;
}

impl Precompile for Bls12381Pairing {
Expand Down Expand Up @@ -624,7 +624,7 @@ impl Precompile for Bls12381MapG1 {
pub struct Bls12381MapG2;

impl Bls12381MapG2 {
const GAS_COST: u64 = 75_000;
const GAS_COST: u64 = 110000;
}

impl Precompile for Bls12381MapG2 {
Expand Down

0 comments on commit 59be8cb

Please sign in to comment.