diff --git a/.github/workflows/solc-version-tests.yml b/.github/workflows/solc-version-tests.yml index 6fc3bf4..2fec1b0 100644 --- a/.github/workflows/solc-version-tests.yml +++ b/.github/workflows/solc-version-tests.yml @@ -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" diff --git a/test/IScribeTest.sol b/test/IScribeTest.sol index 60e4768..ac62902 100644 --- a/test/IScribeTest.sol +++ b/test/IScribeTest.sol @@ -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 = @@ -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); } }