From bf4693e76db85148121aea35904755672a153449 Mon Sep 17 00:00:00 2001 From: Mark Tyneway Date: Thu, 8 Aug 2024 23:19:00 +0300 Subject: [PATCH] ci: better solc warnings check (#11231) * 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 * 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 * foundry: add ignored error code --- .circleci/config.yml | 5 +---- packages/contracts-bedrock/foundry.toml | 3 ++- .../contracts-bedrock/test/dispute/FaultDisputeGame.t.sol | 1 - 3 files changed, 3 insertions(+), 6 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 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`. 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);