Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: support ecrecover oog case
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiWu123 committed Jan 4, 2024
1 parent ecd6a25 commit de1790e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion bus-mapping/src/circuit_input_builder/input_state_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,6 @@ impl<'a> CircuitInputStateRef<'a> {
PrecompileCalls::Sha256
| PrecompileCalls::Ripemd160
| PrecompileCalls::Blake2F
| PrecompileCalls::Ecrecover
| PrecompileCalls::Bn128Add
| PrecompileCalls::Bn128Mul
| PrecompileCalls::Bn128Pairing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGPrecompileGadget<F> {

// calculate required gas for precompile
let precompiles_required_gas = vec![
// (
// addr_bits.value_equals(PrecompileCalls::Ecrecover),
// GasCost::PRECOMPILE_ECRECOVER_BASE.expr(),
// ),
(
addr_bits.value_equals(PrecompileCalls::Ecrecover),
GasCost::PRECOMPILE_ECRECOVER_BASE.expr(),
),
// addr_bits.value_equals(PrecompileCalls::Sha256),
// addr_bits.value_equals(PrecompileCalls::Ripemd160),
// addr_bits.value_equals(PrecompileCalls::Blake2F),
Expand Down Expand Up @@ -182,6 +182,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorOOGPrecompileGadget<F> {
// required_gas
let precompile_call: PrecompileCalls = precompile_addr.to_fixed_bytes()[19].into();
let required_gas = match precompile_call {
PrecompileCalls::Ecrecover => precompile_call.base_gas_cost(),
// PrecompileCalls::Bn128Pairing => {
// precompile_call.base_gas_cost()
// + n_pairs * GasCost::PRECOMPILE_BN256PAIRING_PER_PAIR
Expand Down

0 comments on commit de1790e

Please sign in to comment.