Skip to content
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
219 changes: 128 additions & 91 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,97 +11,97 @@ name: ci
- '**.sol'
- '**.yml'
jobs:
tests-stable:
name: Forge Testing
runs-on: ubuntu-latest
strategy:
matrix:
profile: [post-osaka,post-osaka-via-ir,solc-past-versions-0,solc-past-versions-1,via-ir,min-solc,min-solc-via-ir,intense]
steps:
- uses: actions/checkout@v5
- name: Install Foundry Stable
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- name: Install Dependencies
run: forge install
# NOTE: skipping solc 0.8.32 due to compiler bug
# https://github.com/argotorg/solidity/issues/16360
- name: Run Tests with ${{ matrix.profile }}
run: >
( [ "${{ matrix.profile }}" = "post-osaka" ] &&
FOUNDRY_PROFILE=post_osaka forge test --use 0.8.33 &&
FOUNDRY_PROFILE=zksync forge test --use 0.8.33
) ||
( [ "${{ matrix.profile }}" = "post-osaka-via-ir" ] &&
FOUNDRY_PROFILE=post_osaka forge test --use 0.8.33 --via-ir &&
FOUNDRY_PROFILE=zksync forge test --use 0.8.33 --via-ir
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.5 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.6 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.7 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.8 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.9 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.10 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.11 --fuzz-runs 16 &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.12 --fuzz-runs 16
) ||
( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
forge test --use 0.8.13 --fuzz-runs 16 &&
forge test --use 0.8.14 --fuzz-runs 16 &&
forge test --use 0.8.15 --fuzz-runs 16 &&
forge test --use 0.8.16 --fuzz-runs 16 &&
forge test --use 0.8.17 --fuzz-runs 16 &&
forge test --use 0.8.18 --fuzz-runs 16 &&
forge test --use 0.8.19 --fuzz-runs 16 &&
forge test --use 0.8.20 --fuzz-runs 16 &&
forge test --use 0.8.21 --fuzz-runs 16 &&
forge test --use 0.8.22 --fuzz-runs 16 &&
forge test --use 0.8.23 --fuzz-runs 16 &&
forge test --use 0.8.24 --fuzz-runs 16 &&
forge test --use 0.8.25 --fuzz-runs 16 &&
forge test --use 0.8.26 --fuzz-runs 16 &&
forge test --use 0.8.27 --fuzz-runs 16 &&
forge test --use 0.8.28 --fuzz-runs 16 &&
forge test --use 0.8.29 --fuzz-runs 16 &&
forge test --use 0.8.30 --fuzz-runs 16 &&
forge test --use 0.8.31 --fuzz-runs 16
) ||
( [ "${{ matrix.profile }}" = "via-ir" ] &&
forge test --via-ir
) ||
( [ "${{ matrix.profile }}" = "min-solc" ] &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.4
) ||
( [ "${{ matrix.profile }}" = "min-solc-via-ir" ] &&
FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.4 --via-ir
) ||
( [ "${{ matrix.profile }}" = "intense" ] &&
forge test --fuzz-runs 5000
)
# tests-stable:
# name: Forge Testing
# runs-on: ubuntu-latest
# strategy:
# matrix:
# profile: [post-osaka,post-osaka-via-ir,solc-past-versions-0,solc-past-versions-1,via-ir,min-solc,min-solc-via-ir,intense]
# steps:
# - uses: actions/checkout@v5
# - name: Install Foundry Stable
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: stable
# - name: Install Dependencies
# run: forge install
# # NOTE: skipping solc 0.8.32 due to compiler bug
# # https://github.com/argotorg/solidity/issues/16360
# - name: Run Tests with ${{ matrix.profile }}
# run: >
# ( [ "${{ matrix.profile }}" = "post-osaka" ] &&
# FOUNDRY_PROFILE=post_osaka forge test --use 0.8.33 &&
# FOUNDRY_PROFILE=zksync forge test --use 0.8.33
# ) ||
# ( [ "${{ matrix.profile }}" = "post-osaka-via-ir" ] &&
# FOUNDRY_PROFILE=post_osaka forge test --use 0.8.33 --via-ir &&
# FOUNDRY_PROFILE=zksync forge test --use 0.8.33 --via-ir
# ) ||
# ( [ "${{ matrix.profile }}" = "solc-past-versions-0" ] &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.5 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.6 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.7 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.8 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.9 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.10 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.11 --fuzz-runs 16 &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.12 --fuzz-runs 16
# ) ||
# ( [ "${{ matrix.profile }}" = "solc-past-versions-1" ] &&
# forge test --use 0.8.13 --fuzz-runs 16 &&
# forge test --use 0.8.14 --fuzz-runs 16 &&
# forge test --use 0.8.15 --fuzz-runs 16 &&
# forge test --use 0.8.16 --fuzz-runs 16 &&
# forge test --use 0.8.17 --fuzz-runs 16 &&
# forge test --use 0.8.18 --fuzz-runs 16 &&
# forge test --use 0.8.19 --fuzz-runs 16 &&
# forge test --use 0.8.20 --fuzz-runs 16 &&
# forge test --use 0.8.21 --fuzz-runs 16 &&
# forge test --use 0.8.22 --fuzz-runs 16 &&
# forge test --use 0.8.23 --fuzz-runs 16 &&
# forge test --use 0.8.24 --fuzz-runs 16 &&
# forge test --use 0.8.25 --fuzz-runs 16 &&
# forge test --use 0.8.26 --fuzz-runs 16 &&
# forge test --use 0.8.27 --fuzz-runs 16 &&
# forge test --use 0.8.28 --fuzz-runs 16 &&
# forge test --use 0.8.29 --fuzz-runs 16 &&
# forge test --use 0.8.30 --fuzz-runs 16 &&
# forge test --use 0.8.31 --fuzz-runs 16
# ) ||
# ( [ "${{ matrix.profile }}" = "via-ir" ] &&
# forge test --via-ir
# ) ||
# ( [ "${{ matrix.profile }}" = "min-solc" ] &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.4
# ) ||
# ( [ "${{ matrix.profile }}" = "min-solc-via-ir" ] &&
# FOUNDRY_PROFILE=pre_global_structs forge test --use 0.8.4 --via-ir
# ) ||
# ( [ "${{ matrix.profile }}" = "intense" ] &&
# forge test --fuzz-runs 5000
# )

tests-ithaca:
name: Forge Ithaca Testing
runs-on: ubuntu-latest
strategy:
matrix:
profile: [post-cancun,post-cancun-via-ir]
steps:
- uses: actions/checkout@v5
- name: Install Foundry Stable
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
- name: Install Dependencies
run: forge install
- name: Run Tests with ${{ matrix.profile }}
run: |
if [[ "${{ matrix.profile }}" == "post-cancun" ]]; then
FOUNDRY_PROFILE=ithaca forge test --use 0.8.28
elif [[ "${{ matrix.profile }}" == "post-cancun-via-ir" ]]; then
FOUNDRY_PROFILE=ithaca forge test --use 0.8.28 --via-ir
fi
# tests-ithaca:
# name: Forge Ithaca Testing
# runs-on: ubuntu-latest
# strategy:
# matrix:
# profile: [post-cancun,post-cancun-via-ir]
# steps:
# - uses: actions/checkout@v5
# - name: Install Foundry Stable
# uses: foundry-rs/foundry-toolchain@v1
# with:
# version: stable
# - name: Install Dependencies
# run: forge install
# - name: Run Tests with ${{ matrix.profile }}
# run: |
# if [[ "${{ matrix.profile }}" == "post-cancun" ]]; then
# FOUNDRY_PROFILE=ithaca forge test --use 0.8.28
# elif [[ "${{ matrix.profile }}" == "post-cancun-via-ir" ]]; then
# FOUNDRY_PROFILE=ithaca forge test --use 0.8.28 --via-ir
# fi

codespell:
runs-on: ${{ matrix.os }}
Expand All @@ -121,7 +121,11 @@ jobs:

gas-diff:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
Expand All @@ -146,6 +150,39 @@ jobs:
with:
name: gas-diff
path: gas-diff/

post-gas-diff-comment:
if: github.event_name == 'pull_request'
needs: gas-diff
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
permissions:
pull-requests: write
actions: read
steps:
- name: Download gas diff artifact
uses: dawidd6/action-download-artifact@v12
with:
name: gas-diff
run_id: ${{ github.run_id }}

- name: Read gas diff
id: gas_diff
run: |
if [ -f comment.md ]; then
echo "markdown<<EOF" >> $GITHUB_OUTPUT
cat comment.md >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
fi

- name: Add gas diff to sticky comment
if: steps.gas_diff.outputs.markdown
uses: marocchino/sticky-pull-request-comment@v2
with:
message: ${{ steps.gas_diff.outputs.markdown }}

prep-checker:
runs-on: ${{ matrix.os }}
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/gas-diff-comment.yml

This file was deleted.

3 changes: 3 additions & 0 deletions test/FixedPointMathLib.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,9 @@ contract FixedPointMathLibTest is SoladyTest {
assertEq(FixedPointMathLib.log2(0), 0);
assertEq(FixedPointMathLib.log2(2), 1);
assertEq(FixedPointMathLib.log2(4), 2);
assertEq(FixedPointMathLib.log2(10), 3);
assertEq(FixedPointMathLib.log2(20), 4);
assertEq(FixedPointMathLib.log2(30), 4);
assertEq(FixedPointMathLib.log2(1024), 10);
assertEq(FixedPointMathLib.log2(1048576), 20);
assertEq(FixedPointMathLib.log2(1073741824), 30);
Expand Down