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

fix: count SECP256 precompile to account validation gas limit as well #2859

Merged
merged 1 commit into from
Sep 12, 2024
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
5 changes: 5 additions & 0 deletions core/lib/constants/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ pub const SHA256_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x02,
]);

pub const SECP256R1_VERIFY_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00,
]);

pub const EC_ADD_PRECOMPILE_ADDRESS: Address = H160([
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x06,
Expand Down
4 changes: 3 additions & 1 deletion core/lib/multivm/src/versions/vm_latest/tracers/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use zk_evm_1_5_0::{
},
};
use zksync_system_constants::{
ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS,
ECRECOVER_PRECOMPILE_ADDRESS, KECCAK256_PRECOMPILE_ADDRESS,
SECP256R1_VERIFY_PRECOMPILE_ADDRESS, SHA256_PRECOMPILE_ADDRESS,
};
use zksync_types::U256;
use zksync_utils::u256_to_h256;
Expand Down Expand Up @@ -187,6 +188,7 @@ pub(crate) fn computational_gas_price(
if address == KECCAK256_PRECOMPILE_ADDRESS
|| address == SHA256_PRECOMPILE_ADDRESS
|| address == ECRECOVER_PRECOMPILE_ADDRESS
|| address == SECP256R1_VERIFY_PRECOMPILE_ADDRESS
{
data.src1_value.value.low_u32()
} else {
Expand Down
1 change: 1 addition & 0 deletions prover/crates/lib/keystore/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub fn calculate_snark_vk_hash(keystore: &Keystore) -> anyhow::Result<H256> {
#[cfg(test)]
mod tests {
use std::str::FromStr;

use zksync_utils::env::Workspace;

use super::*;
Expand Down
4 changes: 2 additions & 2 deletions zk_toolbox/crates/zk_supervisor/src/commands/test/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use crate::{
dals::{Dal, CORE_DAL_PATH, PROVER_DAL_PATH},
defaults::{TEST_DATABASE_PROVER_URL, TEST_DATABASE_SERVER_URL},
messages::{
MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR,
MSG_RESETTING_TEST_DATABASES, MSG_UNIT_TESTS_RUN_SUCCESS, MSG_USING_CARGO_NEXTEST,
MSG_CHAIN_NOT_FOUND_ERR, MSG_POSTGRES_CONFIG_NOT_FOUND_ERR, MSG_RESETTING_TEST_DATABASES,
MSG_UNIT_TESTS_RUN_SUCCESS, MSG_USING_CARGO_NEXTEST,
},
};

Expand Down
Loading