From b18b23daf6c4d812211ff9ef329ae8c44999fb17 Mon Sep 17 00:00:00 2001 From: r0qs Date: Tue, 12 Mar 2024 15:18:39 +0100 Subject: [PATCH 1/3] Add missing hardhat networks settings to external tests --- scripts/externalTests/common.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/externalTests/common.sh b/scripts/externalTests/common.sh index bab5890aa400..de9b8da96d8c 100644 --- a/scripts/externalTests/common.sh +++ b/scripts/externalTests/common.sh @@ -332,12 +332,16 @@ function force_hardhat_compiler_settings echo "require('hardhat-gas-reporter');" echo "module.exports.gasReporter = ${gas_reporter_settings};" echo "module.exports.solidity = ${compiler_settings};" + echo "module.exports.networks.hardhat = module.exports.networks.hardhat || { hardfork: '${evm_version}' }" + echo "module.exports.networks.hardhat.hardfork = '${evm_version}'" else [[ $config_file == *\.ts ]] || assertFail [[ $config_var_name != "" ]] || assertFail echo 'import "hardhat-gas-reporter";' echo "${config_var_name}.gasReporter = ${gas_reporter_settings};" echo "${config_var_name}.solidity = {compilers: [${compiler_settings}]};" + echo "${config_var_name}.networks!.hardhat = ${config_var_name}.networks!.hardhat ?? { hardfork: '${evm_version}' };" + echo "${config_var_name}.networks!.hardhat!.hardfork = '${evm_version}'" fi >> "$config_file" } From c82707cae6a085585421f6952eedffccffb7cb56 Mon Sep 17 00:00:00 2001 From: r0qs Date: Tue, 12 Mar 2024 16:50:51 +0100 Subject: [PATCH 2/3] Fix hardhat version to version that supports cancun hardfork --- test/externalTests/brink.sh | 1 + test/externalTests/elementfi.sh | 4 +--- test/externalTests/gnosis.sh | 1 + test/externalTests/pool-together.sh | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/externalTests/brink.sh b/test/externalTests/brink.sh index 48cc4028f3d7..d8ad001ac014 100755 --- a/test/externalTests/brink.sh +++ b/test/externalTests/brink.sh @@ -64,6 +64,7 @@ function brink_test # TODO: Remove this when Brink merges https://github.com/brinktrade/brink-core/pull/52 sed -i "s|\(function isValidSignature(bytes \)calldata\( _data, bytes \)calldata\( _signature)\)|\1memory\2memory\3|g" src/Test/MockEIP1271Validator.sol + neutralize_package_lock neutralize_package_json_hooks force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH" force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var" "$CURRENT_EVM_VERSION" "$extra_settings" "$extra_optimizer_settings" diff --git a/test/externalTests/elementfi.sh b/test/externalTests/elementfi.sh index f3ecbb14170f..f34a169e9512 100755 --- a/test/externalTests/elementfi.sh +++ b/test/externalTests/elementfi.sh @@ -99,9 +99,7 @@ function elementfi_test # "ProviderError: Too Many Requests error received from eth-mainnet.alchemyapi.io" rm test/mockERC20YearnVaultTest.ts - # Several tests fail unless we use the exact versions hard-coded in package-lock.json - #neutralize_package_lock - + neutralize_package_lock neutralize_package_json_hooks force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH" force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var" diff --git a/test/externalTests/gnosis.sh b/test/externalTests/gnosis.sh index 218a5a7504b5..416d36153623 100755 --- a/test/externalTests/gnosis.sh +++ b/test/externalTests/gnosis.sh @@ -76,6 +76,7 @@ function gnosis_safe_test sed -i "s|\(it\)\((\"can be used only via DELEGATECALL opcode\"\)|\1.skip\2|g" test/libraries/SignMessageLib.spec.ts sed -i "s|it\((\"can only be called from Safe itself\"\)|it.skip\1|g" test/libraries/Migration.spec.ts + neutralize_package_lock neutralize_package_json_hooks force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH" force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var" diff --git a/test/externalTests/pool-together.sh b/test/externalTests/pool-together.sh index f841206ef2a9..0fc8aafbd69d 100755 --- a/test/externalTests/pool-together.sh +++ b/test/externalTests/pool-together.sh @@ -66,6 +66,9 @@ function pool_together_test force_hardhat_compiler_binary "$config_file" "$BINARY_TYPE" "$BINARY_PATH" force_hardhat_compiler_settings "$config_file" "$(first_word "$SELECTED_PRESETS")" "$config_var" yarn install + # Hardhat 2.20.0 is the last version that works. Newer versions throw this error: + # Unexpected config HardhatConfig.networks.hardhat.initialBaseFeePerGas found - This field is only valid for networks with EIP-1559. Try a newer hardfork or remove it. + yarn add hardhat@2.20.0 # These come with already compiled artifacts. We want them recompiled with latest compiler. rm -r node_modules/@pooltogether/yield-source-interface/artifacts/ From 6b3ca241105fd9298a3ff7f9dcb62bf1d58f952b Mon Sep 17 00:00:00 2001 From: r0qs Date: Tue, 12 Mar 2024 18:51:24 +0100 Subject: [PATCH 3/3] Disable trident, chainlink and bleeps external tests --- .circleci/config.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index af5ddef21be1..e437e1d38759 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1919,11 +1919,13 @@ workflows: - t_ext: *job_native_test_ext_elementfi - t_ext: *job_native_test_ext_brink - t_ext: *job_native_compile_ext_gp2 - - t_ext: *job_native_compile_ext_trident - t_ext: *job_native_compile_ext_euler - - t_ext: *job_native_compile_ext_bleeps - t_ext: *job_native_compile_ext_pool_together - - t_ext: *job_native_compile_ext_chainlink + # TODO: Dropping the external tests below since they are based on old forks and + # fail after update the default evm version to cancun. + #- t_ext: *job_native_compile_ext_trident + #- t_ext: *job_native_compile_ext_chainlink + #- t_ext: *job_native_compile_ext_bleeps - c_ext_benchmarks: <<: *requires_nothing @@ -1941,11 +1943,13 @@ workflows: # TODO: Dropping prb-math from the benchmarks since it is not implemented yet # in the new Foundry external testing infrastructure. # - t_native_test_ext_prb_math - - t_native_compile_ext_trident - t_native_compile_ext_euler - - t_native_compile_ext_bleeps - t_native_compile_ext_pool_together - - t_native_compile_ext_chainlink + # TODO: Dropping the external tests below since they are based on old forks and + # fail after update the default evm version to cancun. + #- t_native_compile_ext_trident + #- t_native_compile_ext_chainlink + #- t_native_compile_ext_bleeps # Windows build and tests - b_win: *requires_nothing