Skip to content

Commit 5bc1b0e

Browse files
austinabellwillpotecaposseleec2zeroecco
authored
Backport changes for 0.13.2 (#1008)
Co-authored-by: pote.eth <81638931+willpote@users.noreply.github.com> Co-authored-by: Angelo Capossele <angelocapossele@gmail.com> Co-authored-by: Eric Tu <tu.eric@hotmail.com> Co-authored-by: Eric Tu <6364934+ec2@users.noreply.github.com> Co-authored-by: Richard Howard <rich@risczero.com>
1 parent bab5ea7 commit 5bc1b0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+10304
-840
lines changed

.github/workflows/contracts.yml

Lines changed: 163 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ permissions:
1515

1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
FOUNDRY_VERSION: v1.2.2
18+
FOUNDRY_VERSION: v1.2.3
19+
RISC0_TOOLCHAIN_VERSION: 1.88.0
20+
RISC0_CRATE_VERSION: "2.3.0"
1921

2022
jobs:
2123
contracts-changed:
@@ -37,6 +39,8 @@ jobs:
3739
- 'foundry.toml'
3840
test:
3941
- 'contracts/test/**'
42+
scripts:
43+
- 'contracts/scripts/**'
4044
4145
gas-snapshots-check:
4246
runs-on: ubuntu-latest
@@ -80,7 +84,7 @@ jobs:
8084
- name: install foundry
8185
uses: foundry-rs/foundry-toolchain@v1
8286
with:
83-
version: "v1.0.0"
87+
version: ${{ env.FOUNDRY_VERSION }}
8488

8589
- name: checkout main code
8690
uses: actions/checkout@v4
@@ -116,3 +120,160 @@ jobs:
116120
env:
117121
FOUNDRY_PROFILE: reference-contract
118122
FOUNDRY_OUT: contracts/reference-contract/out
123+
124+
deployment-scripts:
125+
runs-on: [ self-hosted, prod, "${{ matrix.os }}", "${{ matrix.device }}" ]
126+
needs: contracts-changed
127+
if: ${{ needs.contracts-changed.outputs.src == 'true' || needs.contracts-changed.outputs.foundry == 'true' || needs.contracts-changed.outputs.scripts == 'true'}}
128+
strategy:
129+
# Run only on Linux with CPU.
130+
matrix:
131+
include:
132+
- os: Linux
133+
feature: default
134+
device: cpu
135+
steps:
136+
- name: checkout code
137+
uses: actions/checkout@v4
138+
139+
- name: install npm
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: 20
143+
144+
- name: Install yq (GitHub binary)
145+
run: |
146+
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.46.1/yq_linux_amd64
147+
sudo chmod +x /usr/local/bin/yq
148+
149+
- name: Set up Python
150+
uses: actions/setup-python@v4
151+
with:
152+
python-version: "3.10"
153+
154+
- name: Install tomlkit
155+
run: pip install tomlkit
156+
157+
- name: Install Foundry
158+
uses: foundry-rs/foundry-toolchain@v1
159+
with:
160+
version: v1.0.0
161+
162+
- uses: risc0/risc0/.github/actions/rustup@352dea62857ba57331053cd0986a12c1a4708732
163+
164+
- uses: risc0/risc0/.github/actions/sccache@352dea62857ba57331053cd0986a12c1a4708732
165+
with:
166+
key: ${{ matrix.os }}-${{ matrix.feature }}
167+
168+
- name: install cargo risczero
169+
uses: ./.github/actions/bininstall-risc0
170+
with:
171+
risczero-version: ${{ env.RISC0_CRATE_VERSION }}
172+
toolchain-version: ${{ env.RISC0_TOOLCHAIN_VERSION }}
173+
174+
- name: checkout main code
175+
uses: actions/checkout@v4
176+
with:
177+
ref: main
178+
submodules: recursive
179+
180+
- name: Forge build on main branch
181+
run: forge build
182+
env:
183+
FOUNDRY_PROFILE: reference-contract
184+
FOUNDRY_OUT: contracts/out
185+
186+
- name: Upload build-info artifact
187+
uses: actions/upload-artifact@v4
188+
with:
189+
name: build-info-deployment
190+
path: contracts/out/build-info/
191+
192+
- name: checkout code
193+
uses: actions/checkout@v4
194+
with:
195+
submodules: recursive
196+
197+
- name: Download build-info artifact
198+
uses: actions/download-artifact@v4
199+
with:
200+
name: build-info-deployment
201+
path: contracts/build-info-reference
202+
203+
- name: forge build
204+
run: forge build
205+
206+
- name: cargo install boundless-cli
207+
run: cargo install boundless-cli --path crates/boundless-cli --locked
208+
209+
- name: cargo install just
210+
run: cargo install just
211+
212+
- name: cargo build
213+
run: cargo build --locked
214+
215+
- name: spin up local network
216+
run: just localnet up
217+
env:
218+
CI: 1
219+
RISC0_DEV_MODE: 1
220+
REPO_ROOT: ${{ github.workspace }}
221+
222+
- name: deploy script
223+
run: ./contracts/scripts/manage DeployBoundlessMarket --broadcast
224+
env:
225+
CHAIN_KEY: anvil
226+
# This key is a prefunded address for the anvil test configuration (index 0)
227+
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
228+
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
229+
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
230+
231+
- name: forge test after new deployment
232+
env:
233+
CHAIN_KEY: anvil
234+
RISC0_DEV_MODE: 1
235+
run: ./contracts/scripts/test
236+
237+
- name: forge clean
238+
run: forge clean
239+
env:
240+
FOUNDRY_OUT: contracts/out
241+
242+
- name: upgrade script
243+
run: ./contracts/scripts/manage UpgradeBoundlessMarket --broadcast
244+
env:
245+
CHAIN_KEY: anvil
246+
# This key is a prefunded address for the anvil test configuration (index 0)
247+
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
248+
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
249+
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
250+
251+
- name: forge test after upgrade
252+
env:
253+
CHAIN_KEY: anvil
254+
RISC0_DEV_MODE: 1
255+
run: ./contracts/scripts/test
256+
257+
- name: rollback script
258+
run: ./contracts/scripts/manage RollbackBoundlessMarket --broadcast
259+
env:
260+
CHAIN_KEY: anvil
261+
# This key is a prefunded address for the anvil test configuration (index 0)
262+
DEPLOYER_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
263+
PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
264+
ADMIN_ADDRESS: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
265+
266+
- name: forge test after rollback
267+
env:
268+
CHAIN_KEY: anvil
269+
RISC0_DEV_MODE: 1
270+
run: ./contracts/scripts/test
271+
272+
- name: Cleanup
273+
if: always()
274+
run: just localnet down
275+
env:
276+
CI: 1
277+
278+
- name: sccache stats
279+
run: sccache --show-stats

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ jobs:
488488
- name: Run build for changed packages
489489
run: |
490490
for file in $(git diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} | grep "^infra/"); do
491-
# Get the package directory (the directory containing package.json)
492-
package_dir=$(dirname "$file")
491+
# Get the package directory (infra/<dir> where package.json is located)
492+
package_dir=$(echo "$file" | cut -d'/' -f1-2)
493493
if [ -f "$package_dir/package.json" ]; then
494494
echo "Building package in $package_dir"
495495
cd "$package_dir"

.github/workflows/release.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
cache/
33
out/
44
build-info-reference/
5+
**/node_modules/
56

67
# Ignores development broadcast logs
78
/broadcast

0 commit comments

Comments
 (0)