Fix Foundry blockhash handling and clear compiler cache in CI#3862
Open
MontrealAI wants to merge 1 commit into
Open
Fix Foundry blockhash handling and clear compiler cache in CI#3862MontrealAI wants to merge 1 commit into
MontrealAI wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
vm.setBlockhashwas being called for blocks in the future, producing "block number must be less than or equal to the current block number" errors.forge_versionkeys infoundry.tomlthat should not be declared in profiles.foundry_compilers::cachedeserialization error suggested a stale/corrupted incremental compiler cache file was being restored in CI./root/.foundry/bin) that break in different runner/home environments.Description
_rollPastAndSetBlockhash(uint256, bytes32)helper totest/v2/ValidatorStakeLock.t.soland replaced the directvm.setBlockhashcall so the test always rolls past the target block before setting the blockhash.forge_versionentries fromfoundry.tomlto eliminate the Foundry profile warnings.rm -f cache/solidity-files-cache.json || truesteps to the Foundry CI jobs (.github/workflows/ci.yml,contracts.yml, andfuzz.yml) so stale compiler cache files are removed before runningforge test.Testing
forge test --match-path test/v2/ValidatorStakeLock.t.sol -vvvvandforge test -vvvv --ffi --fuzz-runs 256 --match-contract 'CommitReveal|Stake|Fee|Slashing'.testSlashingSucceedsWithShortUnbondingPeriod,testValidatorCannotFinalizeWithdrawalWhileAssigned, andtestValidatorWithdrawStakeRevertsDuringActiveJob) are expected to pass when running the above Foundry commands.foundry_compilers::cachedeserialization noise once workflows run on the branch.Codex Task