Skip to content

Commit c7a109d

Browse files
committed
Update secp256[kr]1_* gas cost estimations based on CI benchs
1 parent 8e96cb7 commit c7a109d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/vm/src/environment.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ impl Default for GasConfig {
5353
const GAS_PER_US: u64 = 1_000_000;
5454
Self {
5555
// ~154 us in crypto benchmarks
56-
secp256k1_verify_cost: 154 * GAS_PER_US,
56+
secp256k1_verify_cost: 119 * GAS_PER_US,
5757
// ~162 us in crypto benchmarks
58-
secp256k1_recover_pubkey_cost: 162 * GAS_PER_US,
59-
// ~154 us in crypto benchmarks
60-
secp256r1_verify_cost: 154 * GAS_PER_US,
61-
// ~162 us in crypto benchmarks
62-
secp256r1_recover_pubkey_cost: 162 * GAS_PER_US,
58+
secp256k1_recover_pubkey_cost: 233 * GAS_PER_US,
59+
// ~525 us in crypto benchmarks
60+
secp256r1_verify_cost: 374 * GAS_PER_US,
61+
// ~582 us in crypto benchmarks
62+
secp256r1_recover_pubkey_cost: 834 * GAS_PER_US,
6363
// ~63 us in crypto benchmarks
6464
ed25519_verify_cost: 63 * GAS_PER_US,
6565
// Gas cost factors, relative to ed25519_verify cost

packages/vm/src/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ mod tests {
670670
const INIT_AMOUNT: u128 = 500;
671671
const INIT_DENOM: &str = "TOKEN";
672672

673-
const TESTING_GAS_LIMIT: u64 = 500_000_000; // ~0.5ms
673+
const TESTING_GAS_LIMIT: u64 = 1_000_000_000; // ~1ms
674674
const TESTING_MEMORY_LIMIT: Option<Size> = Some(Size::mebi(16));
675675

676676
const ECDSA_P256K1_HASH_HEX: &str =

0 commit comments

Comments
 (0)