Skip to content

Commit

Permalink
ci: better solc warnings check (#11231)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tynes authored Aug 8, 2024
1 parent 0c8d7c8 commit bf4693e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/contracts-bedrock/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit bf4693e

Please sign in to comment.