From 14faf8a9db354db5ee08a3c0767553c5ad5c6a30 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Wed, 24 Jul 2024 19:06:27 -0600 Subject: [PATCH 1/3] ci: better solc warnings check Use `forge build --force` to force a build so that the warning check can be observed. CI should fail on this commit --- .circleci/config.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c6e073c99657..b839cd9779e3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -599,12 +599,9 @@ jobs: name: forge version command: forge --version - run: - # The solc warnings check must be the first step to build the contracts, that way the - # warnings are output here. On subsequent runs, forge will read artifacts from the cache - # so warnings would not occur. name: solc warnings check command: | - forge build --deny-warnings || echo "export SOLC_WARNINGS_CHECK=1" >> "$BASH_ENV" + forge build --force --deny-warnings || echo "export SOLC_WARNINGS_CHECK=1" >> "$BASH_ENV" environment: FOUNDRY_PROFILE: ci working_directory: packages/contracts-bedrock From 230bfdad9313f07758f7b4f46f93a7d9d16b1e09 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Wed, 24 Jul 2024 19:46:22 -0600 Subject: [PATCH 2/3] contracts-bedrock: fix warnings Fix the failed solc build See the failed workflow here: https://app.circleci.com/pipelines/github/ethereum-optimism/optimism/59631/workflows/b93bc600-e772-4ba9-98ed-a0b6f48683c7/jobs/2512271 --- packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol index ccf6bce1a1de..2aae76b2dbbe 100644 --- a/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol +++ b/packages/contracts-bedrock/test/dispute/FaultDisputeGame.t.sol @@ -870,7 +870,6 @@ contract FaultDisputeGame_Test is FaultDisputeGame_Init { (,,,, disputed,,) = gameProxy.claimData(5); gameProxy.attack{ value: _getRequiredBond(5) }(disputed, 5, _dummyClaim()); (,,,, disputed,,) = gameProxy.claimData(6); - bytes memory _dummyClaimData = abi.encode(gasleft(), gasleft()); gameProxy.defend{ value: _getRequiredBond(6) }(disputed, 6, postState_); (,,,, disputed,,) = gameProxy.claimData(7); From ae774cc9e26fe10ae2973348aa732e01a8f910c0 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Tue, 6 Aug 2024 18:47:42 -0600 Subject: [PATCH 3/3] foundry: add ignored error code --- packages/contracts-bedrock/foundry.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/contracts-bedrock/foundry.toml b/packages/contracts-bedrock/foundry.toml index e5d8513f254a..a373761b8f5a 100644 --- a/packages/contracts-bedrock/foundry.toml +++ b/packages/contracts-bedrock/foundry.toml @@ -27,7 +27,8 @@ bytecode_hash = 'none' build_info_path = 'artifacts/build-info' ast = true evm_version = "cancun" -ignored_error_codes = ["transient-storage", "code-size", "init-code-size"] +# 5159 error code is selfdestruct error code +ignored_error_codes = ["transient-storage", "code-size", "init-code-size", 5159] # We set the gas limit to max int64 to avoid running out of gas during testing, since the default # gas limit is 1B and some of our tests require more gas than that, such as `test_callWithMinGas_noLeakageLow_succeeds`.