Skip to content

Commit dbfc9b5

Browse files
Merge pull request matter-labs#1419 from matter-labs/draft-v29
feat: v29
2 parents ea1884e + c56f7a6 commit dbfc9b5

File tree

427 files changed

+24273
-6414
lines changed

Some content is hidden

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

427 files changed

+24273
-6414
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## What ❔
1+
# What ❔
22

33
<!-- What are the changes this PR brings about? -->
44
<!-- Example: This PR adds a PR template to the repo. -->

.github/workflows/build-release.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ on:
1212
- "v*" # for main releases
1313
- "zkos*" # for zk releases
1414

15-
permissions:
16-
contents: write
17-
1815
jobs:
1916
build-contracts:
2017
runs-on: ubuntu-latest

.github/workflows/codespell.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ name: Codespell
1111

1212
on: pull_request
1313

14-
permissions:
15-
contents: read
16-
1714
jobs:
1815
# TODO: fix codespell CI
1916
# codespell:

.github/workflows/dead-links.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Find and check markdown files
2020
run: |
2121
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
22-
find . -type f -name "*.md" ! -path "*/node_modules/*" ! -path "*/openzeppelin*" ! -path "*/murky/*" -exec lychee --max-concurrency 1 --cache --retry-wait-time 10 --exclude-path .lycheeignore --github-token $GITHUB_TOKEN {} +
22+
find . -type f -name "*.md" ! -path "*/node_modules/*" ! -path "*/openzeppelin*" ! -path "*/murky/*" -exec lychee --accept 200,201,301,302,403,429 --max-retries 5 --max-concurrency 1 --cache --retry-wait-time 30 --exclude-path .lycheeignore --github-token "$GITHUB_TOKEN" {} +

.github/workflows/invariant-tests.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
- cron: "00 01 * * *"
66
workflow_dispatch:
77

8-
permissions:
9-
contents: read
8+
permissions: read-all
109

1110
jobs:
1211
define-matrix:

.github/workflows/l1-contracts-ci.yaml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: L1 contracts CI
33
on:
44
pull_request:
55

6+
# We need this permissions for this CI to work with external contributions
67
permissions:
78
contents: read
9+
pull-requests: write
810

911
jobs:
1012
build:
@@ -19,7 +21,7 @@ jobs:
1921
- name: Install foundry-zksync
2022
run: |
2123
mkdir ./foundry-zksync
22-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
24+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
2325
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
2426
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
2527
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -55,7 +57,7 @@ jobs:
5557
yarn build:foundry
5658
5759
- name: Create cache
58-
uses: actions/cache/save@v3
60+
uses: actions/cache/save@v4
5961
with:
6062
key: artifacts-l1-${{ github.sha }}
6163
path: |
@@ -147,7 +149,7 @@ jobs:
147149
- name: Install foundry-zksync
148150
run: |
149151
mkdir ./foundry-zksync
150-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
152+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
151153
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
152154
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
153155
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -171,7 +173,12 @@ jobs:
171173
172174
- name: Run tests
173175
working-directory: ./l1-contracts
174-
run: FOUNDRY_PROFILE=default yarn test:foundry
176+
run: yarn test:foundry
177+
178+
# TODO: restore once we can get back to latest foundry
179+
# - name: Check gas snapshots
180+
# working-directory: ./l1-contracts
181+
# run: forge test --match-test MeasureGas --gas-snapshot-check=true
175182

176183
test-foundry-zksync:
177184
needs: [build, lint]
@@ -192,7 +199,7 @@ jobs:
192199
- name: Install foundry-zksync
193200
run: |
194201
mkdir ./foundry-zksync
195-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
202+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
196203
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
197204
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
198205
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -219,7 +226,7 @@ jobs:
219226
220227
- name: Run tests
221228
working-directory: ./l1-contracts
222-
run: FOUNDRY_PROFILE=default yarn test:zkfoundry
229+
run: yarn test:zkfoundry
223230

224231
check-verifier-generator-l1:
225232
runs-on: ubuntu-latest
@@ -278,15 +285,11 @@ jobs:
278285
run: diff tools/data/VerifierFflonk.sol l1-contracts/contracts/state-transition/verifiers/L2VerifierFflonk.sol
279286

280287
coverage:
281-
if: false # FIXME: coverage disabled due to stack-too-deep in VerifierFflonk.sol
282288
defaults:
283289
run:
284290
working-directory: l1-contracts
285291
needs: [build, lint]
286292
runs-on: ubuntu-latest
287-
permissions:
288-
contents: read
289-
pull-requests: write
290293

291294
steps:
292295
- name: Checkout the repository
@@ -303,7 +306,7 @@ jobs:
303306
- name: Install foundry-zksync
304307
run: |
305308
mkdir ./foundry-zksync
306-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
309+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
307310
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
308311
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
309312
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -326,7 +329,7 @@ jobs:
326329
system-contracts/zkout
327330
328331
- name: Run coverage
329-
run: FOUNDRY_PROFILE=default yarn test:foundry && FOUNDRY_PROFILE=default yarn coverage:foundry --report summary --report lcov
332+
run: yarn test:foundry && yarn coverage:foundry --report summary --report lcov
330333

331334
# Installing the specific version of `lcov` because of
332335
# the `genhtml: ERROR: line ... of ... has branchcov but no linecov data` error.
@@ -337,15 +340,15 @@ jobs:
337340
ref: v1.16
338341

339342
# To ignore coverage for certain directories modify the paths in this step as needed. The
340-
# below default ignores coverage results for the test and script directories. Alternatively,
341-
# to include coverage in all directories, comment out this step. Note that because this
342-
# filtering applies to the lcov file, the summary table generated in the previous step will
343-
# still include all files and directories.
344-
# The `--rc branch_coverage=1` part keeps branch info in the filtered report, since lcov
345-
# defaults to removing branch info.
343+
# below default ignores coverage results for the test and script directories. It also ignores
344+
# the ChainRegistrar contract since it is unused. Alternatively, to include coverage in all
345+
# directories, comment out this step. Note that because this filtering applies to the lcov
346+
# file, the summary table generated in the previous step will still include all files and
347+
# directories. The `--rc branch_coverage=1` part keeps branch info in the filtered report,
348+
# since lcov defaults to removing branch info.
346349
- name: Filter directories
347350
run: |
348-
lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' --output-file lcov.info --rc branch_coverage=1
351+
lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' 'contracts/chain-registrar/ChainRegistrar.sol' --output-file lcov.info --rc branch_coverage=1
349352
350353
# This step posts a detailed coverage report as a comment and deletes previous comments on
351354
# each push. The below step is used to fail coverage if the specified coverage threshold is

.github/workflows/l1-contracts-foundry-ci.yaml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install foundry-zksync
2020
run: |
2121
mkdir ./foundry-zksync
22-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
22+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
2323
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
2424
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
2525
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -46,7 +46,7 @@ jobs:
4646
run: yarn da build:foundry
4747

4848
- name: Create cache
49-
uses: actions/cache/save@v3
49+
uses: actions/cache/save@v4
5050
with:
5151
key: artifacts-l1-contracts-foudry-${{ github.sha }}
5252
path: |
@@ -109,11 +109,40 @@ jobs:
109109
exit 1
110110
fi
111111
112-
- name: Run DeployL1 script
112+
- name: Run DeployL1CoreContracts script
113113
working-directory: ./l1-contracts
114-
# l1-contracts are skipped because we don't want to recompile Bridgehub with a high optimizer-runs value.
115-
# Otherwise, the Bridgehub contract size would be too large.
116-
run: forge script ./deploy-scripts/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY --skip '*/l1-contracts/contracts/*'
114+
# First we need to deploy the ecosystem contracts
115+
run: forge script ./deploy-scripts/DeployL1CoreContracts.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY --skip '*/l1-contracts/contracts/*'
116+
117+
- name: Read bridgehub proxy address
118+
id: read-bridgehub
119+
working-directory: ./l1-contracts
120+
run: |
121+
# Extract bridgehub_proxy_addr allowing leading whitespace
122+
BRIDGEHUB=$(
123+
sed -nE 's/^[[:space:]]*bridgehub_proxy_addr[[:space:]]*=[[:space:]]*"([^"]+)".*/\1/p' \
124+
./script-out/output-deploy-l1.toml | head -n1
125+
)
126+
127+
echo "Parsed bridgehub_proxy_addr: $BRIDGEHUB"
128+
129+
if [[ -z "$BRIDGEHUB" || ! "$BRIDGEHUB" =~ ^0x[0-9a-fA-F]{40}$ ]]; then
130+
echo "❌ Failed to parse a valid bridgehub address"
131+
exit 1
132+
fi
133+
134+
echo "BRIDGEHUB=$BRIDGEHUB" >> $GITHUB_ENV
135+
136+
- name: Run DeployCTM script with bridgehub
137+
working-directory: ./l1-contracts
138+
run: |
139+
forge script ./deploy-scripts/DeployCTM.s.sol \
140+
--ffi \
141+
--rpc-url $ANVIL_RPC_URL \
142+
--broadcast \
143+
--private-key $ANVIL_PRIVATE_KEY \
144+
--sig "runWithBridgehub(address,bool)" $BRIDGEHUB "false" \
145+
--skip '*/l1-contracts/contracts/*'
117146
118147
- name: Run DeployErc20 script
119148
working-directory: ./l1-contracts

.github/workflows/l2-contracts-ci.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: L2 contracts CI
33
on:
44
pull_request:
55

6-
permissions:
7-
contents: read
8-
96
jobs:
107
build:
118
runs-on: ubuntu-latest
@@ -19,7 +16,7 @@ jobs:
1916
- name: Install foundry-zksync
2017
run: |
2118
mkdir ./foundry-zksync
22-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
19+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
2320
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
2421
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
2522
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -48,7 +45,7 @@ jobs:
4845
run: yarn sc build:foundry
4946

5047
- name: Create cache
51-
uses: actions/cache/save@v3
48+
uses: actions/cache/save@v4
5249
with:
5350
key: artifacts-l2-${{ github.sha }}
5451
path: |
@@ -113,7 +110,7 @@ jobs:
113110
- name: Install foundry-zksync
114111
run: |
115112
mkdir ./foundry-zksync
116-
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b/foundry_nightly_linux_amd64.tar.gz
113+
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4/foundry_nightly_linux_amd64.tar.gz
117114
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
118115
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
119116
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

.github/workflows/nodejs-license.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ env:
2323
# It has to be one line, there must be no space between packages.
2424
2525

26-
permissions:
27-
contents: read
28-
2926
jobs:
3027
generate-matrix:
3128
name: Lists modules

.github/workflows/secrets_scanner.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Leaked Secrets Scan
22
on: [pull_request]
3-
4-
permissions:
5-
contents: read
6-
73
jobs:
84
TruffleHog:
95
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)