From e4ead97e4c0911f752f716947dbebce654b51731 Mon Sep 17 00:00:00 2001 From: Timepunk <45543880+0xTimepunk@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:15:46 +0100 Subject: [PATCH 1/4] chore: upgrade to latest solady and use 0.8.21 in foundry.toml --- README.md | 2 +- foundry.toml | 5 ++++- lib/forge-std | 2 +- lib/solady | 2 +- lib/solmate | 1 + remappings.txt | 3 --- script/Script.s.sol | 7 ------- src/layerzero/lib/LZPacket.sol | 2 +- 8 files changed, 9 insertions(+), 15 deletions(-) create mode 160000 lib/solmate delete mode 100644 remappings.txt delete mode 100644 script/Script.s.sol diff --git a/README.md b/README.md index e33b681..d27f214 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# pigeon • [![tests](https://github.com/exp-table/pigeon/actions/workflows/ci.yml/badge.svg?label=tests)](https://github.com/exp-table/pigeon/actions/workflows/ci.yml) ![license](https://img.shields.io/github/license/refcell/femplate?label=license) ![solidity](https://img.shields.io/badge/solidity-^0.8.17-lightgrey) +# pigeon • [![tests](https://github.com/exp-table/pigeon/actions/workflows/ci.yml/badge.svg?label=tests)](https://github.com/exp-table/pigeon/actions/workflows/ci.yml) ![license](https://img.shields.io/github/license/refcell/femplate?label=license) ![solidity](https://img.shields.io/badge/solidity-%5E0.8.21-lightgrey) **Pigeon** is an open-source modular testing toolkit for cross-chain application development using Arbitray Message Bridges (AMBs). diff --git a/foundry.toml b/foundry.toml index 3a11caf..27e37a4 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,4 +3,7 @@ # See more config options at: https://github.com/gakonst/foundry/tree/master/config [profile.default] -solc_version = '0.8.19' +solc_version = "0.8.21" # Override for the solc version (setting this ignores `auto_detect_solc`) +evm_version = "paris" # to prevent usage of PUSH0, which is not supported on all chains + +remappings = ["ds-test/=lib/forge-std/lib/ds-test/src/","forge-std/=lib/forge-std/src/","solady/=lib/solady/"] diff --git a/lib/forge-std b/lib/forge-std index 75f1746..705263c 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 75f1746c949ae56377611e5f2128aa93d381431f +Subproject commit 705263c95892a906d7af65f0f73ce8a4a0c80b80 diff --git a/lib/solady b/lib/solady index 30558f5..b8428c8 160000 --- a/lib/solady +++ b/lib/solady @@ -1 +1 @@ -Subproject commit 30558f5402f02351b96eeb6eaf32bcea29773841 +Subproject commit b8428c89d01cb13c9b602160130130d5754f3095 diff --git a/lib/solmate b/lib/solmate new file mode 160000 index 0000000..3998897 --- /dev/null +++ b/lib/solmate @@ -0,0 +1 @@ +Subproject commit 3998897acb502fa7b480f505138a6ae1842e8d10 diff --git a/remappings.txt b/remappings.txt deleted file mode 100644 index 577c9f3..0000000 --- a/remappings.txt +++ /dev/null @@ -1,3 +0,0 @@ -ds-test/=lib/forge-std/lib/ds-test/src/ -forge-std/=lib/forge-std/src/ -solady/=lib/solady/ \ No newline at end of file diff --git a/script/Script.s.sol b/script/Script.s.sol deleted file mode 100644 index 05fb98c..0000000 --- a/script/Script.s.sol +++ /dev/null @@ -1,7 +0,0 @@ -pragma solidity ^0.8.15; - -import {Script} from "forge-std/Script.sol"; - -contract SomeScript is Script { - function run() external {} -} diff --git a/src/layerzero/lib/LZPacket.sol b/src/layerzero/lib/LZPacket.sol index df8eeb6..1643a50 100644 --- a/src/layerzero/lib/LZPacket.sol +++ b/src/layerzero/lib/LZPacket.sol @@ -45,7 +45,7 @@ library LayerZeroPacket { assembly { toAdd := mload(add(data, i)) } - payloadBuffer.append(abi.encode(toAdd)); + payloadBuffer.p(abi.encode(toAdd)); i += 32; } packet.nonce = nonce; From 134ec2351d958d3c9eb70828f4a1c1a94b784748 Mon Sep 17 00:00:00 2001 From: Timepunk <45543880+0xTimepunk@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:18:31 +0100 Subject: [PATCH 2/4] fix: remove solmate from lib --- lib/solmate | 1 - 1 file changed, 1 deletion(-) delete mode 160000 lib/solmate diff --git a/lib/solmate b/lib/solmate deleted file mode 160000 index 3998897..0000000 --- a/lib/solmate +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3998897acb502fa7b480f505138a6ae1842e8d10 From 5948613d6727a57cfc305087cde07b14e51c9a61 Mon Sep 17 00:00:00 2001 From: Timepunk <45543880+0xTimepunk@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:21:15 +0100 Subject: [PATCH 3/4] ci: add snapshot and remove template script run from ci --- .gas-snapshot | 60 ++++++++++++++++++++-------------------- .github/workflows/ci.yml | 34 +---------------------- 2 files changed, 31 insertions(+), 63 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index f0ffec6..4f324b1 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -1,31 +1,31 @@ -AxelarHelperTest:testCustomOrderingAxelar() (gas: 341231) -AxelarHelperTest:testFancyAxelar() (gas: 234946) +AxelarHelperTest:testCustomOrderingAxelar() (gas: 341240) +AxelarHelperTest:testFancyAxelar() (gas: 234955) AxelarHelperTest:testMultiDstAxelar() (gas: 390512) -AxelarHelperTest:testSimpleAxelar() (gas: 189522) -CelerHelperTest:testCustomOrderingCeler() (gas: 108322) -CelerHelperTest:testFancyCeler() (gas: 117841) -CelerHelperTest:testMultiDstCeler() (gas: 151149) -CelerHelperTest:testSimpleCeler() (gas: 71938) -CelerHelperTest:testSimpleCelerWithEstimates() (gas: 72328) -HyperlaneHelperTest:testCustomOrderingHL() (gas: 145179) -HyperlaneHelperTest:testFancyHL() (gas: 146237) -HyperlaneHelperTest:testMultiDstHL() (gas: 193359) -HyperlaneHelperTest:testSimpleHL() (gas: 98351) -HyperlaneHelperTest:testSimpleHLWithEstimates() (gas: 98836) -LayerZeroHelperTest:testCustomOrderingLZ() (gas: 339820) -LayerZeroHelperTest:testFancyLZ() (gas: 295097) -LayerZeroHelperTest:testMultiDstLZ() (gas: 475776) -LayerZeroHelperTest:testSimpleLZ() (gas: 245549) -LayerZeroHelperTest:testSimpleLZWithEstimates() (gas: 246017) -StargateHelperTest:testCustomOrderingSG() (gas: 797976) -StargateHelperTest:testFancySG() (gas: 589535) -StargateHelperTest:testSimpleSG() (gas: 537570) -StargateHelperTest:testSimpleSGWithEstimates() (gas: 538082) -WormholeAutomaticRelayerHelperTest:testCustomOrderingWormhole() (gas: 287323) -WormholeAutomaticRelayerHelperTest:testFancyWormhole() (gas: 226022) -WormholeAutomaticRelayerHelperTest:testMultiDstWormhole() (gas: 349780) -WormholeAutomaticRelayerHelperTest:testSimpleWormhole() (gas: 179638) -WormholeSpecializedRelayerHelperTest:testCustomOrderingWormhole() (gas: 595375) -WormholeSpecializedRelayerHelperTest:testFancyWormhole() (gas: 330260) -WormholeSpecializedRelayerHelperTest:testMultiDstWormhole() (gas: 631627) -WormholeSpecializedRelayerHelperTest:testSimpleWormhole() (gas: 333052) \ No newline at end of file +AxelarHelperTest:testSimpleAxelar() (gas: 189531) +CelerHelperTest:testCustomOrderingCeler() (gas: 108266) +CelerHelperTest:testFancyCeler() (gas: 122536) +CelerHelperTest:testMultiDstCeler() (gas: 151193) +CelerHelperTest:testSimpleCeler() (gas: 71872) +CelerHelperTest:testSimpleCelerWithEstimates() (gas: 76878) +HyperlaneHelperTest:testCustomOrderingHL() (gas: 145211) +HyperlaneHelperTest:testFancyHL() (gas: 146259) +HyperlaneHelperTest:testMultiDstHL() (gas: 193293) +HyperlaneHelperTest:testSimpleHL() (gas: 98262) +HyperlaneHelperTest:testSimpleHLWithEstimates() (gas: 98880) +LayerZeroHelperTest:testCustomOrderingLZ() (gas: 339755) +LayerZeroHelperTest:testFancyLZ() (gas: 295099) +LayerZeroHelperTest:testMultiDstLZ() (gas: 475768) +LayerZeroHelperTest:testSimpleLZ() (gas: 245432) +LayerZeroHelperTest:testSimpleLZWithEstimates() (gas: 309937) +StargateHelperTest:testCustomOrderingSG() (gas: 798098) +StargateHelperTest:testFancySG() (gas: 589613) +StargateHelperTest:testSimpleSG() (gas: 537621) +StargateHelperTest:testSimpleSGWithEstimates() (gas: 603301) +WormholeAutomaticRelayerHelperTest:testCustomOrderingWormhole() (gas: 287327) +WormholeAutomaticRelayerHelperTest:testFancyWormhole() (gas: 226030) +WormholeAutomaticRelayerHelperTest:testMultiDstWormhole() (gas: 349810) +WormholeAutomaticRelayerHelperTest:testSimpleWormhole() (gas: 179646) +WormholeSpecializedRelayerHelperTest:testCustomOrderingWormhole() (gas: 595327) +WormholeSpecializedRelayerHelperTest:testFancyWormhole() (gas: 330251) +WormholeSpecializedRelayerHelperTest:testMultiDstWormhole() (gas: 631640) +WormholeSpecializedRelayerHelperTest:testSimpleWormhole() (gas: 333043) \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d921085..e947972 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,36 +40,4 @@ jobs: env: ETH_MAINNET_RPC_URL: ${{ secrets.ETH_MAINNET_RPC_URL }} POLYGON_MAINNET_RPC_URL: ${{ secrets.POLYGON_MAINNET_RPC_URL }} - ARBITRUM_MAINNET_RPC_URL: ${{ secrets.ARBITRUM_MAINNET_RPC_URL }} - - # slither: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - # - name: slither - # uses: crytic/slither-action@v0.2.0 - - scripts: - strategy: - fail-fast: true - name: Run Unix Scripts - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - name: dependencies - run: forge build --sizes - continue-on-error: true - - name: Run scripts - run: | - ls -lsa - ls script/ - for file in script/*; do - forge script $file - done + ARBITRUM_MAINNET_RPC_URL: ${{ secrets.ARBITRUM_MAINNET_RPC_URL }} \ No newline at end of file From 5e0a5d2e0254a47ced8e7b27f36ca9ce31cce10a Mon Sep 17 00:00:00 2001 From: Timepunk <45543880+0xTimepunk@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:24:40 +0100 Subject: [PATCH 4/4] ci: fix snapshot --- .gas-snapshot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 4f324b1..400d553 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -3,10 +3,10 @@ AxelarHelperTest:testFancyAxelar() (gas: 234955) AxelarHelperTest:testMultiDstAxelar() (gas: 390512) AxelarHelperTest:testSimpleAxelar() (gas: 189531) CelerHelperTest:testCustomOrderingCeler() (gas: 108266) -CelerHelperTest:testFancyCeler() (gas: 122536) +CelerHelperTest:testFancyCeler() (gas: 117863) CelerHelperTest:testMultiDstCeler() (gas: 151193) CelerHelperTest:testSimpleCeler() (gas: 71872) -CelerHelperTest:testSimpleCelerWithEstimates() (gas: 76878) +CelerHelperTest:testSimpleCelerWithEstimates() (gas: 72350) HyperlaneHelperTest:testCustomOrderingHL() (gas: 145211) HyperlaneHelperTest:testFancyHL() (gas: 146259) HyperlaneHelperTest:testMultiDstHL() (gas: 193293) @@ -16,11 +16,11 @@ LayerZeroHelperTest:testCustomOrderingLZ() (gas: 339755) LayerZeroHelperTest:testFancyLZ() (gas: 295099) LayerZeroHelperTest:testMultiDstLZ() (gas: 475768) LayerZeroHelperTest:testSimpleLZ() (gas: 245432) -LayerZeroHelperTest:testSimpleLZWithEstimates() (gas: 309937) +LayerZeroHelperTest:testSimpleLZWithEstimates() (gas: 246032) StargateHelperTest:testCustomOrderingSG() (gas: 798098) StargateHelperTest:testFancySG() (gas: 589613) StargateHelperTest:testSimpleSG() (gas: 537621) -StargateHelperTest:testSimpleSGWithEstimates() (gas: 603301) +StargateHelperTest:testSimpleSGWithEstimates() (gas: 538154) WormholeAutomaticRelayerHelperTest:testCustomOrderingWormhole() (gas: 287327) WormholeAutomaticRelayerHelperTest:testFancyWormhole() (gas: 226030) WormholeAutomaticRelayerHelperTest:testMultiDstWormhole() (gas: 349810)