Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Weaken solc version test to only check lowest and highest versions #50

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/solc-version-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ jobs:
with:
version: nightly

- name: Run Forge tests for each supported solc version
- name: Run Forge tests against lowest and highest supported solc version
run: >
forge test --use 0.8.16 --nmt "FuzzDifferentialOracleSuite" &&
forge test --use 0.8.17 --nmt "FuzzDifferentialOracleSuite" &&
forge test --use 0.8.18 --nmt "FuzzDifferentialOracleSuite" &&
forge test --use 0.8.19 --nmt "FuzzDifferentialOracleSuite" &&
forge test --use 0.8.20 --nmt "FuzzDifferentialOracleSuite"
forge test --use 0.8.27 --nmt "FuzzDifferentialOracleSuite"
13 changes: 9 additions & 4 deletions test/IScribeTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,17 @@ abstract contract IScribeTest is Test {
// Note to stay reasonable in favor of runtime.
vm.assume(pokeDatas.length < 50);

// Note to manually track timestamp instead of using the block.timestamp
// builtin as solc may remove block.timestamp calls inside the loop
// assuming the timestamp does not change during a tx's execution.
uint32 lastPokeTimestamp = 0;
uint32 blockTimestamp = uint32(block.timestamp);
IScribe.SchnorrData memory schnorrData;
for (uint i; i < pokeDatas.length; i++) {
pokeDatas[i].val =
uint128(_bound(pokeDatas[i].val, 1, type(uint128).max));
pokeDatas[i].age = uint32(
_bound(pokeDatas[i].age, lastPokeTimestamp + 1, block.timestamp)
_bound(pokeDatas[i].age, lastPokeTimestamp + 1, blockTimestamp)
);

schnorrData =
Expand All @@ -337,10 +341,11 @@ abstract contract IScribeTest is Test {

scribe.poke(pokeDatas[i], schnorrData);

_checkReadFunctions(pokeDatas[i].val, block.timestamp);
_checkReadFunctions(pokeDatas[i].val, blockTimestamp);

lastPokeTimestamp = uint32(block.timestamp);
vm.warp(block.timestamp + 10 minutes);
lastPokeTimestamp = blockTimestamp;
blockTimestamp += 10 minutes;
vm.warp(blockTimestamp);
}
}

Expand Down
Loading