From 1f0ba321d3680b3df888c0d2ee061e48ee88923c Mon Sep 17 00:00:00 2001 From: zhoujunma Date: Tue, 12 Dec 2023 13:08:21 -0800 Subject: [PATCH] gas version 13 -> 12 (#11304) --- .../src/gas_schedule/aptos_framework.rs | 144 +++++++++--------- aptos-move/aptos-gas-schedule/src/ver.rs | 3 +- .../update_bn254_algebra_gas_params.py | 2 +- 3 files changed, 74 insertions(+), 75 deletions(-) diff --git a/aptos-move/aptos-gas-schedule/src/gas_schedule/aptos_framework.rs b/aptos-move/aptos-gas-schedule/src/gas_schedule/aptos_framework.rs index c31c2b81bc2b1..63a6396ed5c4f 100644 --- a/aptos-move/aptos-gas-schedule/src/gas_schedule/aptos_framework.rs +++ b/aptos-move/aptos-gas-schedule/src/gas_schedule/aptos_framework.rs @@ -18,78 +18,78 @@ crate::gas_schedule::macros::define_gas_parameters!( // BN254 algebra gas parameters begin. // Generated at time 1701559125.5498126 by `scripts/algebra-gas/update_bn254_algebra_gas_params.py` with gas_per_ns=209.10511688369482. - [algebra_ark_bn254_fq12_add: InternalGas, { 13.. => "algebra.ark_bn254_fq12_add" }, 4_406], - [algebra_ark_bn254_fq12_clone: InternalGas, { 13.. => "algebra.ark_bn254_fq12_clone" }, 4_392], - [algebra_ark_bn254_fq12_deser: InternalGas, { 13.. => "algebra.ark_bn254_fq12_deser" }, 129_063], - [algebra_ark_bn254_fq12_div: InternalGas, { 13.. => "algebra.ark_bn254_fq12_div" }, 2_813_602], - [algebra_ark_bn254_fq12_eq: InternalGas, { 13.. => "algebra.ark_bn254_fq12_eq" }, 12_142], - [algebra_ark_bn254_fq12_from_u64: InternalGas, { 13.. => "algebra.ark_bn254_fq12_from_u64" }, 14_463], - [algebra_ark_bn254_fq12_inv: InternalGas, { 13.. => "algebra.ark_bn254_fq12_inv" }, 2_168_418], - [algebra_ark_bn254_fq12_mul: InternalGas, { 13.. => "algebra.ark_bn254_fq12_mul" }, 643_914], - [algebra_ark_bn254_fq12_neg: InternalGas, { 13.. => "algebra.ark_bn254_fq12_neg" }, 13_311], - [algebra_ark_bn254_fq12_one: InternalGas, { 13.. => "algebra.ark_bn254_fq12_one" }, 209], - [algebra_ark_bn254_fq12_pow_u256: InternalGas, { 13.. => "algebra.ark_bn254_fq12_pow_u256" }, 192_871_746], - [algebra_ark_bn254_fq12_serialize: InternalGas, { 13.. => "algebra.ark_bn254_fq12_serialize" }, 117_336], - [algebra_ark_bn254_fq12_square: InternalGas, { 13.. => "algebra.ark_bn254_fq12_square" }, 468_955], - [algebra_ark_bn254_fq12_sub: InternalGas, { 13.. => "algebra.ark_bn254_fq12_sub" }, 30_497], - [algebra_ark_bn254_fq12_zero: InternalGas, { 13.. => "algebra.ark_bn254_fq12_zero" }, 209], - [algebra_ark_bn254_fq_add: InternalGas, { 13.. => "algebra.ark_bn254_fq_add" }, 4_373], - [algebra_ark_bn254_fq_clone: InternalGas, { 13.. => "algebra.ark_bn254_fq_clone" }, 4_313], - [algebra_ark_bn254_fq_deser: InternalGas, { 13.. => "algebra.ark_bn254_fq_deser" }, 17_588], - [algebra_ark_bn254_fq_div: InternalGas, { 13.. => "algebra.ark_bn254_fq_div" }, 1_140_544], - [algebra_ark_bn254_fq_eq: InternalGas, { 13.. => "algebra.ark_bn254_fq_eq" }, 4_373], - [algebra_ark_bn254_fq_from_u64: InternalGas, { 13.. => "algebra.ark_bn254_fq_from_u64" }, 14_137], - [algebra_ark_bn254_fq_inv: InternalGas, { 13.. => "algebra.ark_bn254_fq_inv" }, 1_136_577], - [algebra_ark_bn254_fq_mul: InternalGas, { 13.. => "algebra.ark_bn254_fq_mul" }, 10_050], - [algebra_ark_bn254_fq_neg: InternalGas, { 13.. => "algebra.ark_bn254_fq_neg" }, 4_314], - [algebra_ark_bn254_fq_one: InternalGas, { 13.. => "algebra.ark_bn254_fq_one" }, 209], - [algebra_ark_bn254_fq_pow_u256: InternalGas, { 13.. => "algebra.ark_bn254_fq_pow_u256" }, 2_081_451], - [algebra_ark_bn254_fq_serialize: InternalGas, { 13.. => "algebra.ark_bn254_fq_serialize" }, 25_938], - [algebra_ark_bn254_fq_square: InternalGas, { 13.. => "algebra.ark_bn254_fq_square" }, 4_314], - [algebra_ark_bn254_fq_sub: InternalGas, { 13.. => "algebra.ark_bn254_fq_sub" }, 6_148], - [algebra_ark_bn254_fq_zero: InternalGas, { 13.. => "algebra.ark_bn254_fq_zero" }, 209], - [algebra_ark_bn254_fr_add: InternalGas, { 13.. => "algebra.ark_bn254_fr_add" }, 4_377], - [algebra_ark_bn254_fr_deser: InternalGas, { 13.. => "algebra.ark_bn254_fr_deser" }, 16_722], - [algebra_ark_bn254_fr_div: InternalGas, { 13.. => "algebra.ark_bn254_fr_div" }, 1_217_943], - [algebra_ark_bn254_fr_eq: InternalGas, { 13.. => "algebra.ark_bn254_fr_eq" }, 4_396], - [algebra_ark_bn254_fr_from_u64: InternalGas, { 13.. => "algebra.ark_bn254_fr_from_u64" }, 13_485], - [algebra_ark_bn254_fr_inv: InternalGas, { 13.. => "algebra.ark_bn254_fr_inv" }, 1_209_015], - [algebra_ark_bn254_fr_mul: InternalGas, { 13.. => "algebra.ark_bn254_fr_mul" }, 9_867], - [algebra_ark_bn254_fr_neg: InternalGas, { 13.. => "algebra.ark_bn254_fr_neg" }, 4_314], - [algebra_ark_bn254_fr_one: InternalGas, { 13.. => "algebra.ark_bn254_fr_one" }, 0], - [algebra_ark_bn254_fr_serialize: InternalGas, { 13.. => "algebra.ark_bn254_fr_serialize" }, 25_749], - [algebra_ark_bn254_fr_square: InternalGas, { 13.. => "algebra.ark_bn254_fr_square" }, 4_311], - [algebra_ark_bn254_fr_sub: InternalGas, { 13.. => "algebra.ark_bn254_fr_sub" }, 10_370], - [algebra_ark_bn254_fr_zero: InternalGas, { 13.. => "algebra.ark_bn254_fr_zero" }, 209], - [algebra_ark_bn254_g1_affine_deser_comp: InternalGas, { 13.. => "algebra.ark_bn254_g1_affine_deser_comp" }, 23_497_333], - [algebra_ark_bn254_g1_affine_deser_uncomp: InternalGas, { 13.. => "algebra.ark_bn254_g1_affine_deser_uncomp" }, 21_528_706], - [algebra_ark_bn254_g1_affine_serialize_comp: InternalGas, { 13.. => "algebra.ark_bn254_g1_affine_serialize_comp" }, 44_924], - [algebra_ark_bn254_g1_affine_serialize_uncomp: InternalGas, { 13.. => "algebra.ark_bn254_g1_affine_serialize_uncomp" }, 58_820], - [algebra_ark_bn254_g1_proj_add: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_add" }, 106_501], - [algebra_ark_bn254_g1_proj_double: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_double" }, 63_682], - [algebra_ark_bn254_g1_proj_eq: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_eq" }, 53_021], - [algebra_ark_bn254_g1_proj_generator: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_generator" }, 209], - [algebra_ark_bn254_g1_proj_infinity: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_infinity" }, 209], - [algebra_ark_bn254_g1_proj_neg: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_neg" }, 209], - [algebra_ark_bn254_g1_proj_scalar_mul: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_scalar_mul" }, 26_456_386], - [algebra_ark_bn254_g1_proj_sub: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_sub" }, 106_903], - [algebra_ark_bn254_g1_proj_to_affine: InternalGas, { 13.. => "algebra.ark_bn254_g1_proj_to_affine" }, 6_340], - [algebra_ark_bn254_g2_affine_deser_comp: InternalGas, { 13.. => "algebra.ark_bn254_g2_affine_deser_comp" }, 67_710_223], - [algebra_ark_bn254_g2_affine_deser_uncomp: InternalGas, { 13.. => "algebra.ark_bn254_g2_affine_deser_uncomp" }, 60_677_591], - [algebra_ark_bn254_g2_affine_serialize_comp: InternalGas, { 13.. => "algebra.ark_bn254_g2_affine_serialize_comp" }, 69_214], - [algebra_ark_bn254_g2_affine_serialize_uncomp: InternalGas, { 13.. => "algebra.ark_bn254_g2_affine_serialize_uncomp" }, 98_505], - [algebra_ark_bn254_g2_proj_add: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_add" }, 318_234], - [algebra_ark_bn254_g2_proj_double: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_double" }, 158_874], - [algebra_ark_bn254_g2_proj_eq: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_eq" }, 141_359], - [algebra_ark_bn254_g2_proj_generator: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_generator" }, 209], - [algebra_ark_bn254_g2_proj_infinity: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_infinity" }, 209], - [algebra_ark_bn254_g2_proj_neg: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_neg" }, 209], - [algebra_ark_bn254_g2_proj_scalar_mul: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_scalar_mul" }, 76_395_801], - [algebra_ark_bn254_g2_proj_sub: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_sub" }, 321_727], - [algebra_ark_bn254_g2_proj_to_affine: InternalGas, { 13.. => "algebra.ark_bn254_g2_proj_to_affine" }, 1_251_909], - [algebra_ark_bn254_multi_pairing_base: InternalGas, { 13.. => "algebra.ark_bn254_multi_pairing_base" }, 127_794_596], - [algebra_ark_bn254_multi_pairing_per_pair: InternalGasPerArg, { 13.. => "algebra.ark_bn254_multi_pairing_per_pair" }, 67_624_587], - [algebra_ark_bn254_pairing: InternalGas, { 13.. => "algebra.ark_bn254_pairing" }, 209_703_839], + [algebra_ark_bn254_fq12_add: InternalGas, { 12.. => "algebra.ark_bn254_fq12_add" }, 4_406], + [algebra_ark_bn254_fq12_clone: InternalGas, { 12.. => "algebra.ark_bn254_fq12_clone" }, 4_392], + [algebra_ark_bn254_fq12_deser: InternalGas, { 12.. => "algebra.ark_bn254_fq12_deser" }, 129_063], + [algebra_ark_bn254_fq12_div: InternalGas, { 12.. => "algebra.ark_bn254_fq12_div" }, 2_813_602], + [algebra_ark_bn254_fq12_eq: InternalGas, { 12.. => "algebra.ark_bn254_fq12_eq" }, 12_142], + [algebra_ark_bn254_fq12_from_u64: InternalGas, { 12.. => "algebra.ark_bn254_fq12_from_u64" }, 14_463], + [algebra_ark_bn254_fq12_inv: InternalGas, { 12.. => "algebra.ark_bn254_fq12_inv" }, 2_168_418], + [algebra_ark_bn254_fq12_mul: InternalGas, { 12.. => "algebra.ark_bn254_fq12_mul" }, 643_914], + [algebra_ark_bn254_fq12_neg: InternalGas, { 12.. => "algebra.ark_bn254_fq12_neg" }, 13_311], + [algebra_ark_bn254_fq12_one: InternalGas, { 12.. => "algebra.ark_bn254_fq12_one" }, 209], + [algebra_ark_bn254_fq12_pow_u256: InternalGas, { 12.. => "algebra.ark_bn254_fq12_pow_u256" }, 192_871_746], + [algebra_ark_bn254_fq12_serialize: InternalGas, { 12.. => "algebra.ark_bn254_fq12_serialize" }, 117_336], + [algebra_ark_bn254_fq12_square: InternalGas, { 12.. => "algebra.ark_bn254_fq12_square" }, 468_955], + [algebra_ark_bn254_fq12_sub: InternalGas, { 12.. => "algebra.ark_bn254_fq12_sub" }, 30_497], + [algebra_ark_bn254_fq12_zero: InternalGas, { 12.. => "algebra.ark_bn254_fq12_zero" }, 209], + [algebra_ark_bn254_fq_add: InternalGas, { 12.. => "algebra.ark_bn254_fq_add" }, 4_373], + [algebra_ark_bn254_fq_clone: InternalGas, { 12.. => "algebra.ark_bn254_fq_clone" }, 4_313], + [algebra_ark_bn254_fq_deser: InternalGas, { 12.. => "algebra.ark_bn254_fq_deser" }, 17_588], + [algebra_ark_bn254_fq_div: InternalGas, { 12.. => "algebra.ark_bn254_fq_div" }, 1_140_544], + [algebra_ark_bn254_fq_eq: InternalGas, { 12.. => "algebra.ark_bn254_fq_eq" }, 4_373], + [algebra_ark_bn254_fq_from_u64: InternalGas, { 12.. => "algebra.ark_bn254_fq_from_u64" }, 14_137], + [algebra_ark_bn254_fq_inv: InternalGas, { 12.. => "algebra.ark_bn254_fq_inv" }, 1_136_577], + [algebra_ark_bn254_fq_mul: InternalGas, { 12.. => "algebra.ark_bn254_fq_mul" }, 10_050], + [algebra_ark_bn254_fq_neg: InternalGas, { 12.. => "algebra.ark_bn254_fq_neg" }, 4_314], + [algebra_ark_bn254_fq_one: InternalGas, { 12.. => "algebra.ark_bn254_fq_one" }, 209], + [algebra_ark_bn254_fq_pow_u256: InternalGas, { 12.. => "algebra.ark_bn254_fq_pow_u256" }, 2_081_451], + [algebra_ark_bn254_fq_serialize: InternalGas, { 12.. => "algebra.ark_bn254_fq_serialize" }, 25_938], + [algebra_ark_bn254_fq_square: InternalGas, { 12.. => "algebra.ark_bn254_fq_square" }, 4_314], + [algebra_ark_bn254_fq_sub: InternalGas, { 12.. => "algebra.ark_bn254_fq_sub" }, 6_148], + [algebra_ark_bn254_fq_zero: InternalGas, { 12.. => "algebra.ark_bn254_fq_zero" }, 209], + [algebra_ark_bn254_fr_add: InternalGas, { 12.. => "algebra.ark_bn254_fr_add" }, 4_377], + [algebra_ark_bn254_fr_deser: InternalGas, { 12.. => "algebra.ark_bn254_fr_deser" }, 16_722], + [algebra_ark_bn254_fr_div: InternalGas, { 12.. => "algebra.ark_bn254_fr_div" }, 1_217_943], + [algebra_ark_bn254_fr_eq: InternalGas, { 12.. => "algebra.ark_bn254_fr_eq" }, 4_396], + [algebra_ark_bn254_fr_from_u64: InternalGas, { 12.. => "algebra.ark_bn254_fr_from_u64" }, 13_485], + [algebra_ark_bn254_fr_inv: InternalGas, { 12.. => "algebra.ark_bn254_fr_inv" }, 1_209_015], + [algebra_ark_bn254_fr_mul: InternalGas, { 12.. => "algebra.ark_bn254_fr_mul" }, 9_867], + [algebra_ark_bn254_fr_neg: InternalGas, { 12.. => "algebra.ark_bn254_fr_neg" }, 4_314], + [algebra_ark_bn254_fr_one: InternalGas, { 12.. => "algebra.ark_bn254_fr_one" }, 0], + [algebra_ark_bn254_fr_serialize: InternalGas, { 12.. => "algebra.ark_bn254_fr_serialize" }, 25_749], + [algebra_ark_bn254_fr_square: InternalGas, { 12.. => "algebra.ark_bn254_fr_square" }, 4_311], + [algebra_ark_bn254_fr_sub: InternalGas, { 12.. => "algebra.ark_bn254_fr_sub" }, 10_370], + [algebra_ark_bn254_fr_zero: InternalGas, { 12.. => "algebra.ark_bn254_fr_zero" }, 209], + [algebra_ark_bn254_g1_affine_deser_comp: InternalGas, { 12.. => "algebra.ark_bn254_g1_affine_deser_comp" }, 23_497_333], + [algebra_ark_bn254_g1_affine_deser_uncomp: InternalGas, { 12.. => "algebra.ark_bn254_g1_affine_deser_uncomp" }, 21_528_706], + [algebra_ark_bn254_g1_affine_serialize_comp: InternalGas, { 12.. => "algebra.ark_bn254_g1_affine_serialize_comp" }, 44_924], + [algebra_ark_bn254_g1_affine_serialize_uncomp: InternalGas, { 12.. => "algebra.ark_bn254_g1_affine_serialize_uncomp" }, 58_820], + [algebra_ark_bn254_g1_proj_add: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_add" }, 106_501], + [algebra_ark_bn254_g1_proj_double: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_double" }, 63_682], + [algebra_ark_bn254_g1_proj_eq: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_eq" }, 53_021], + [algebra_ark_bn254_g1_proj_generator: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_generator" }, 209], + [algebra_ark_bn254_g1_proj_infinity: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_infinity" }, 209], + [algebra_ark_bn254_g1_proj_neg: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_neg" }, 209], + [algebra_ark_bn254_g1_proj_scalar_mul: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_scalar_mul" }, 26_456_386], + [algebra_ark_bn254_g1_proj_sub: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_sub" }, 106_903], + [algebra_ark_bn254_g1_proj_to_affine: InternalGas, { 12.. => "algebra.ark_bn254_g1_proj_to_affine" }, 6_340], + [algebra_ark_bn254_g2_affine_deser_comp: InternalGas, { 12.. => "algebra.ark_bn254_g2_affine_deser_comp" }, 67_710_223], + [algebra_ark_bn254_g2_affine_deser_uncomp: InternalGas, { 12.. => "algebra.ark_bn254_g2_affine_deser_uncomp" }, 60_677_591], + [algebra_ark_bn254_g2_affine_serialize_comp: InternalGas, { 12.. => "algebra.ark_bn254_g2_affine_serialize_comp" }, 69_214], + [algebra_ark_bn254_g2_affine_serialize_uncomp: InternalGas, { 12.. => "algebra.ark_bn254_g2_affine_serialize_uncomp" }, 98_505], + [algebra_ark_bn254_g2_proj_add: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_add" }, 318_234], + [algebra_ark_bn254_g2_proj_double: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_double" }, 158_874], + [algebra_ark_bn254_g2_proj_eq: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_eq" }, 141_359], + [algebra_ark_bn254_g2_proj_generator: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_generator" }, 209], + [algebra_ark_bn254_g2_proj_infinity: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_infinity" }, 209], + [algebra_ark_bn254_g2_proj_neg: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_neg" }, 209], + [algebra_ark_bn254_g2_proj_scalar_mul: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_scalar_mul" }, 76_395_801], + [algebra_ark_bn254_g2_proj_sub: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_sub" }, 321_727], + [algebra_ark_bn254_g2_proj_to_affine: InternalGas, { 12.. => "algebra.ark_bn254_g2_proj_to_affine" }, 1_251_909], + [algebra_ark_bn254_multi_pairing_base: InternalGas, { 12.. => "algebra.ark_bn254_multi_pairing_base" }, 127_794_596], + [algebra_ark_bn254_multi_pairing_per_pair: InternalGasPerArg, { 12.. => "algebra.ark_bn254_multi_pairing_per_pair" }, 67_624_587], + [algebra_ark_bn254_pairing: InternalGas, { 12.. => "algebra.ark_bn254_pairing" }, 209_703_839], // BN254 algebra gas parameters end. // BLS12-381 algebra gas parameters begin. diff --git a/aptos-move/aptos-gas-schedule/src/ver.rs b/aptos-move/aptos-gas-schedule/src/ver.rs index a4eb546261f77..1937d8acb8edd 100644 --- a/aptos-move/aptos-gas-schedule/src/ver.rs +++ b/aptos-move/aptos-gas-schedule/src/ver.rs @@ -8,10 +8,9 @@ /// - Changing how gas is calculated in any way /// /// Change log: -/// - V13 -/// - Added BN254 operations. /// - V12 /// - Making resource group charge on first read independent of BTreeMap serialization. +/// - Added BN254 operations. /// - V11 /// - Ristretto255 natives (point cloning & double-scalar multiplication) and Bulletproofs natives /// - Hard limit on the number of write ops per transaction diff --git a/scripts/algebra-gas/update_bn254_algebra_gas_params.py b/scripts/algebra-gas/update_bn254_algebra_gas_params.py index 69bc488cf6854..3bafa05900f77 100755 --- a/scripts/algebra-gas/update_bn254_algebra_gas_params.py +++ b/scripts/algebra-gas/update_bn254_algebra_gas_params.py @@ -17,7 +17,7 @@ # Typically you are making a new version of gas schedule, # so this should be larger than `LATEST_GAS_FEATURE_VERSION` in `aptos-move/aptos-gas/src/gas_meter.rs`. -TARGET_GAS_VERSION = 13 +TARGET_GAS_VERSION = 12 def get_bench_ns_linear(bench_path): datapoints = load_bench_datapoints.main(bench_path)