Skip to content

Commit

Permalink
chore: bump wasm-opt to 119
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksuss committed Oct 10, 2024
1 parent 9207a53 commit 8e8571f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
15 changes: 6 additions & 9 deletions engine-tests/src/tests/repro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn repro_GdASJ3KESs() {
block_timestamp: 1_645_717_564_644_206_730,
input_path: "src/tests/res/input_GdASJ3KESs.hex",
evm_gas_used: 706_713,
near_gas_used: 115,
near_gas_used: 112,
});
}

Expand All @@ -51,7 +51,7 @@ fn repro_8ru7VEA() {
block_timestamp: 1_648_829_935_343_349_589,
input_path: "src/tests/res/input_8ru7VEA.hex",
evm_gas_used: 1_732_181,
near_gas_used: 206,
near_gas_used: 201,
});
}

Expand All @@ -71,10 +71,7 @@ fn repro_FRcorNv() {
block_timestamp: 1_650_960_438_774_745_116,
input_path: "src/tests/res/input_FRcorNv.hex",
evm_gas_used: 1_239_721,
#[cfg(not(feature = "ext-connector"))]
near_gas_used: 168,
#[cfg(feature = "ext-connector")]
near_gas_used: 167,
near_gas_used: 163,
});
}

Expand All @@ -91,7 +88,7 @@ fn repro_5bEgfRQ() {
block_timestamp: 1_651_073_772_931_594_646,
input_path: "src/tests/res/input_5bEgfRQ.hex",
evm_gas_used: 6_414_105,
near_gas_used: 604,
near_gas_used: 602,
});
}

Expand All @@ -109,7 +106,7 @@ fn repro_D98vwmi() {
block_timestamp: 1_651_753_443_421_003_245,
input_path: "src/tests/res/input_D98vwmi.hex",
evm_gas_used: 1_035_348,
near_gas_used: 169,
near_gas_used: 164,
});
}

Expand All @@ -128,7 +125,7 @@ fn repro_Emufid2() {
block_timestamp: 1_662_118_048_636_713_538,
input_path: "src/tests/res/input_Emufid2.hex",
evm_gas_used: 1_156_364,
near_gas_used: 277,
near_gas_used: 292,
});
}

Expand Down
10 changes: 5 additions & 5 deletions engine-tests/src/tests/uniswap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn test_uniswap_input_multihop() {

let (_amount_out, _evm_gas, profile) = context.exact_input(&tokens, INPUT_AMOUNT.into());

assert_eq!(108, profile.all_gas() / 1_000_000_000_000);
assert_eq!(106, profile.all_gas() / 1_000_000_000_000);
}

#[test]
Expand All @@ -53,17 +53,17 @@ fn test_uniswap_exact_output() {
utils::assert_gas_bound(profile.all_gas(), 32);
let wasm_fraction = 100 * profile.wasm_gas() / profile.all_gas();
assert!(
(40..=50).contains(&wasm_fraction),
"{wasm_fraction}% is not between 40% and 50%",
(30..=40).contains(&wasm_fraction),
"{wasm_fraction}% is not between 30% and 40%",
);

let (_amount_in, profile) =
context.exact_output_single(&token_a, &token_b, OUTPUT_AMOUNT.into());
utils::assert_gas_bound(profile.all_gas(), 17);
let wasm_fraction = 100 * profile.wasm_gas() / profile.all_gas();
assert!(
(40..=50).contains(&wasm_fraction),
"{wasm_fraction}% is not between 40% and 50%",
(30..=40).contains(&wasm_fraction),
"{wasm_fraction}% is not between 30% and 40%",
);
}

Expand Down
6 changes: 4 additions & 2 deletions scripts/ci/install-wasm-opt.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/usr/bin/env bash

VERSION=119

if [[ ! -f wasm-opt ]]; then
mkdir binaryen
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_110/binaryen-version_110-x86_64-linux.tar.gz | tar -xz -C binaryen
cp binaryen/binaryen-version_110/bin/* /usr/local/bin
curl -sL https://github.com/WebAssembly/binaryen/releases/download/version_$VERSION/binaryen-version_$VERSION-x86_64-linux.tar.gz | tar -xz -C binaryen
cp binaryen/binaryen-version_$VERSION/bin/* /usr/local/bin
rm -rf binaryen
fi

0 comments on commit 8e8571f

Please sign in to comment.