From eb26323e195f62adba233f7667c4bd3f805bf497 Mon Sep 17 00:00:00 2001 From: Michael Birch Date: Thu, 3 Nov 2022 18:30:59 +0100 Subject: [PATCH] Fix gas costs --- engine-precompiles/src/promise_result.rs | 2 +- engine-tests/src/tests/repro.rs | 10 +++++----- engine-tests/src/tests/uniswap.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engine-precompiles/src/promise_result.rs b/engine-precompiles/src/promise_result.rs index 1899f66a6..223536c65 100644 --- a/engine-precompiles/src/promise_result.rs +++ b/engine-precompiles/src/promise_result.rs @@ -16,7 +16,7 @@ pub mod costs { use crate::prelude::types::EthGas; /// This cost is always charged for calling this precompile. - pub const PROMISE_RESULT_BASE_COST: EthGas = EthGas::new(125); + pub const PROMISE_RESULT_BASE_COST: EthGas = EthGas::new(105); /// This is the cost per byte of promise result data. pub const PROMISE_RESULT_BYTE_COST: EthGas = EthGas::new(1); } diff --git a/engine-tests/src/tests/repro.rs b/engine-tests/src/tests/repro.rs index eab9301d6..fc4be898f 100644 --- a/engine-tests/src/tests/repro.rs +++ b/engine-tests/src/tests/repro.rs @@ -27,7 +27,7 @@ fn repro_GdASJ3KESs() { block_timestamp: 1645717564644206730, input_path: "src/tests/res/input_GdASJ3KESs.hex", evm_gas_used: 706713, - near_gas_used: 130, + near_gas_used: 131, }); } @@ -52,7 +52,7 @@ fn repro_8ru7VEA() { block_timestamp: 1648829935343349589, input_path: "src/tests/res/input_8ru7VEA.hex", evm_gas_used: 1732181, - near_gas_used: 237, + near_gas_used: 239, }); } @@ -72,7 +72,7 @@ fn repro_FRcorNv() { block_timestamp: 1650960438774745116, input_path: "src/tests/res/input_FRcorNv.hex", evm_gas_used: 1239721, - near_gas_used: 192, + near_gas_used: 194, }); } @@ -89,7 +89,7 @@ fn repro_5bEgfRQ() { block_timestamp: 1651073772931594646, input_path: "src/tests/res/input_5bEgfRQ.hex", evm_gas_used: 6_414_105, - near_gas_used: 698, + near_gas_used: 701, }); } @@ -107,7 +107,7 @@ fn repro_D98vwmi() { block_timestamp: 1651753443421003245, input_path: "src/tests/res/input_D98vwmi.hex", evm_gas_used: 1_035_348, - near_gas_used: 193, + near_gas_used: 195, }); } diff --git a/engine-tests/src/tests/uniswap.rs b/engine-tests/src/tests/uniswap.rs index 777b4b661..c200b416c 100644 --- a/engine-tests/src/tests/uniswap.rs +++ b/engine-tests/src/tests/uniswap.rs @@ -38,7 +38,7 @@ fn test_uniswap_input_multihop() { let (_amount_out, _evm_gas, profile) = context.exact_input(&tokens, INPUT_AMOUNT.into()); - assert_eq!(121, profile.all_gas() / 1_000_000_000_000); + assert_eq!(122, profile.all_gas() / 1_000_000_000_000); } #[test]