Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Sync layer stable #672

Open
wants to merge 685 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
685 commits
Select commit Hold shift + click to select a range
70a0660
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Aug 21, 2024
2b2af24
foundry tests pass (though some were commented out)
StanislavBreadless Aug 21, 2024
d1b5149
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Aug 21, 2024
00f7d8e
partial l1 test fix
StanislavBreadless Aug 21, 2024
94b2646
chore: Kl/merge-stable (#730)
kelemeno Aug 21, 2024
5ec24e2
Kl/merge-stable2 (#731)
kelemeno Aug 21, 2024
8421abc
forceDeploymetns data
kelemeno Aug 21, 2024
095a55a
bad merge
StanislavBreadless Aug 22, 2024
4e084b7
merge kl reorg branch
StanislavBreadless Aug 22, 2024
ab605b2
foundry tests pass
StanislavBreadless Aug 22, 2024
9e0c329
make more tests pass
StanislavBreadless Aug 22, 2024
377d0aa
fmt
StanislavBreadless Aug 22, 2024
9a168a6
Merge branch 'kl/sync-layer-reorg-dev' into kl/sync-layer-reorg-foundry
StanislavBreadless Aug 22, 2024
a80a667
message root fix
kelemeno Aug 22, 2024
4255c63
renaming and some fixes
kelemeno Aug 22, 2024
51d5dc4
lint
kelemeno Aug 22, 2024
f741346
wip
StanislavBreadless Aug 22, 2024
f617301
erc20 tests in foundry work
StanislavBreadless Aug 22, 2024
0d7ee23
aggregated root return value
kelemeno Aug 22, 2024
d2f83db
cover most of weth tsts
StanislavBreadless Aug 22, 2024
ebfb6d2
port the rest of the tests
StanislavBreadless Aug 22, 2024
c90c9f6
remove old tests
StanislavBreadless Aug 23, 2024
3c1b796
old proof support
StanislavBreadless Aug 23, 2024
6225350
unit tests
StanislavBreadless Aug 23, 2024
5e1ada2
fix lint
StanislavBreadless Aug 23, 2024
774ef90
fix comment
StanislavBreadless Aug 23, 2024
7931924
Merge pull request #736 from matter-labs/sb-support-old-proving-format
StanislavBreadless Aug 26, 2024
a4a2b06
add a few events for migration
StanislavBreadless Aug 26, 2024
e05866e
ensure that the STM has to be whitelisted before it is used
StanislavBreadless Aug 26, 2024
18f66ba
some fixes
StanislavBreadless Aug 26, 2024
7c8ef21
fix lint
StanislavBreadless Aug 26, 2024
9a3b546
rename event
StanislavBreadless Aug 26, 2024
b6d6c47
lint
StanislavBreadless Aug 26, 2024
e5b44c6
remove unused methods from validator timelock and executor
StanislavBreadless Aug 26, 2024
a478e2e
some more fixes
StanislavBreadless Aug 26, 2024
823ef65
Merge remote-tracking branch 'origin/sb-set-of-fixes-2' into sb-set-o…
StanislavBreadless Aug 26, 2024
3f17ff8
fix compile
StanislavBreadless Aug 26, 2024
caf4192
fix some more stuff
StanislavBreadless Aug 26, 2024
ae9add5
lint
StanislavBreadless Aug 26, 2024
dc1da58
migrate tests
StanislavBreadless Aug 26, 2024
60b7fc4
lint fix
StanislavBreadless Aug 26, 2024
2071f78
test
StanislavBreadless Aug 26, 2024
d5ecc4a
fmt
StanislavBreadless Aug 26, 2024
075eed8
Merge pull request #737 from matter-labs/sb-set-of-fixes-2
StanislavBreadless Aug 27, 2024
3a4fc67
make scripts work with the server
StanislavBreadless Aug 27, 2024
5cb5a03
sync with sync-layer-stable
StanislavBreadless Aug 27, 2024
d273ebf
fmt
StanislavBreadless Aug 27, 2024
95c501b
Merge pull request #744 from matter-labs/sb-port-kl/sync-layer-reorg
StanislavBreadless Aug 27, 2024
709bd86
Merge pull request #746 from matter-labs/sync-layer-stable
StanislavBreadless Aug 27, 2024
c82a950
sync with dev
StanislavBreadless Aug 28, 2024
7bcf8ac
sync with kl/sync-layer-reorg
StanislavBreadless Aug 28, 2024
a102e75
fix l1 tests
StanislavBreadless Aug 28, 2024
1dfc1ef
fmt
StanislavBreadless Aug 28, 2024
ad046e0
most of lints
StanislavBreadless Aug 28, 2024
4ac4e01
tmp: submodules work
StanislavBreadless Aug 28, 2024
d77b6a8
remove forge std
StanislavBreadless Aug 28, 2024
60935d3
remove l1-contracts/lib/murky
StanislavBreadless Aug 28, 2024
2c03a8d
remove mode subdmoules
StanislavBreadless Aug 28, 2024
f3e83dd
fix unit tests
StanislavBreadless Aug 28, 2024
8b025a4
fmt
StanislavBreadless Aug 28, 2024
60a1f7b
fix ci
StanislavBreadless Aug 28, 2024
f3a9481
fix spelling
StanislavBreadless Aug 28, 2024
fa4baf0
check hashes
StanislavBreadless Aug 28, 2024
6fa9393
better compare
StanislavBreadless Aug 28, 2024
8632559
correct address
StanislavBreadless Aug 28, 2024
2d92a68
comments
StanislavBreadless Aug 28, 2024
277d61d
fix addr
StanislavBreadless Aug 28, 2024
955979c
lint
StanislavBreadless Aug 28, 2024
10ec8ba
Merge pull request #749 from matter-labs/kl/sync-layer-reorg-dev
StanislavBreadless Aug 28, 2024
ac415e2
Merge pull request #753 from matter-labs/kl/sync-layer-reorg
StanislavBreadless Aug 28, 2024
03644e6
Merge branch 'kl/sync-layer-reorg' into kl/sync-layer-reorg-foundry
StanislavBreadless Aug 29, 2024
a557c01
upd workflow
StanislavBreadless Aug 29, 2024
487dd71
forge install: v2-testnet-contracts
StanislavBreadless Aug 29, 2024
4bac7cb
wip
StanislavBreadless Aug 29, 2024
1a2390c
forge install: @matterlabs/zksync-contracts
StanislavBreadless Aug 29, 2024
2d9ad08
using foundry deps
StanislavBreadless Aug 29, 2024
bc54d47
remove unneeded changes
StanislavBreadless Aug 29, 2024
e4689f0
wip
StanislavBreadless Aug 29, 2024
0a5e318
fix typo
StanislavBreadless Aug 29, 2024
6775587
install foundry zksync in ci
StanislavBreadless Aug 29, 2024
12cb8d0
fix lint
StanislavBreadless Aug 29, 2024
db7eafb
more efficient forge install
StanislavBreadless Aug 29, 2024
e70b722
fmt
StanislavBreadless Aug 29, 2024
e572c91
compile sc contracts also
StanislavBreadless Aug 29, 2024
dfd969c
Merge pull request #755 from matter-labs/kl/sync-layer-reorg-foundry
StanislavBreadless Aug 29, 2024
c905dd3
sync with stable
StanislavBreadless Aug 29, 2024
f17d7e1
Merge branch 'kl/sync-layer-reorg' into kl/migrate-back-from-gw
StanislavBreadless Aug 29, 2024
8affc3c
fix compile
StanislavBreadless Aug 29, 2024
adc2e76
Merge pull request #706 from matter-labs/kl/migrate-back-from-gw
StanislavBreadless Aug 29, 2024
3301a13
add ability to recover from failed migration (#715)
koloz193 Aug 29, 2024
de2cca7
sync with stable
StanislavBreadless Aug 29, 2024
464382e
fix compile
StanislavBreadless Aug 29, 2024
c05daf6
Fixed yarn clean - to remove zksync artifacts too
mm-zk Aug 30, 2024
262ee7e
Merge pull request #759 from matter-labs/mmzk_0830_fix_cleanup
StanislavBreadless Aug 30, 2024
989f2c1
L2 verifier support (#756)
StanislavBreadless Aug 30, 2024
d669a5f
Merge pull request #758 from matter-labs/sb-sync-sync-layer-stable
StanislavBreadless Aug 30, 2024
b212535
sync with kl sync layer reorg
StanislavBreadless Aug 30, 2024
840df35
fix comile
StanislavBreadless Aug 30, 2024
9fa2d66
fix lint
StanislavBreadless Aug 30, 2024
f469e7c
fix script
StanislavBreadless Aug 30, 2024
9d319e7
Merge branch 'sync-layer-stable' into kl/message-root-update
StanislavBreadless Aug 30, 2024
73ddd6d
Merge pull request #724 from matter-labs/kl/message-root-update
StanislavBreadless Aug 30, 2024
3a1aecc
Fix token info upon migration (#760)
StanislavBreadless Sep 2, 2024
78b0ce8
STM -> CTM
StanislavBreadless Sep 4, 2024
213f990
chore: Kl/merge-dev-sync-layer-stable (#763)
kelemeno Sep 4, 2024
249e012
Merge branch 'kl/sync-layer-reorg' into sb-rename-stm
StanislavBreadless Sep 4, 2024
28aadaa
migrate in script files as well
StanislavBreadless Sep 4, 2024
e8d47b4
l1 foundry test work
StanislavBreadless Sep 4, 2024
ae911bb
fix ts tests
StanislavBreadless Sep 4, 2024
b23bf7c
lint
StanislavBreadless Sep 4, 2024
566a54b
Resolve some of the leftover todos (#765)
StanislavBreadless Sep 5, 2024
9d1ce13
fix lib to remove it from coverage report
StanislavBreadless Sep 5, 2024
6fff2b1
sync with base
StanislavBreadless Sep 5, 2024
af14533
recalc hashes
StanislavBreadless Sep 5, 2024
aab2f77
toml file
StanislavBreadless Sep 5, 2024
42933cd
Merge pull request #766 from matter-labs/sb-rename-stm
StanislavBreadless Sep 5, 2024
4a062d0
Rename hyperchain -> ZK chain (#771)
StanislavBreadless Sep 5, 2024
c95f623
sync with dev
StanislavBreadless Sep 6, 2024
93ed4dc
fix l1 compile
StanislavBreadless Sep 6, 2024
265166b
fix l1 foundry tests
StanislavBreadless Sep 6, 2024
1a23102
fix l2 compile
StanislavBreadless Sep 6, 2024
bd438c5
fix lint
StanislavBreadless Sep 6, 2024
99e9a0a
hopefully fix ci
StanislavBreadless Sep 6, 2024
2929483
hopefully fix ci 2
StanislavBreadless Sep 6, 2024
a1705ab
delete duplicated contract
StanislavBreadless Sep 6, 2024
b6766b0
Merge pull request #777 from matter-labs/sb-merge-dev-kl-sync-layer-r…
StanislavBreadless Sep 6, 2024
dccc114
Remove most info from relayed L1->GW priority ops (#775)
StanislavBreadless Sep 6, 2024
cb3c177
sync with reorg
StanislavBreadless Sep 6, 2024
23f5e3c
fmt
StanislavBreadless Sep 6, 2024
cb42ae4
Merge pull request #779 from matter-labs/sb-sync-reorg-with-stable
StanislavBreadless Sep 6, 2024
4df0d23
Add support for registerAlreadyDeployedHyperchain (#761)
koloz193 Sep 6, 2024
49868af
Change Executor.sol interface (#780)
vladbochok Sep 9, 2024
9c9bd30
add check for bridgehub (#782)
koloz193 Sep 9, 2024
bebdefc
(feat): add tx filterer contract (#772)
Raid5594 Sep 10, 2024
f95beef
Ra/split asset router (#595)
Raid5594 Sep 10, 2024
8479868
chore: merge stable (#785)
kelemeno Sep 10, 2024
ec8e9da
Deploy legacy bridge inside foundry (#787)
Deniallugo Sep 10, 2024
d1b7e16
Update l1-contracts/contracts/bridge/L1Nullifier.sol
kelemeno Sep 10, 2024
e741471
Update l1-contracts/contracts/bridge/asset-router/IL1AssetRouter.sol
kelemeno Sep 10, 2024
a42b991
fix: vlad issues (#788)
kelemeno Sep 10, 2024
94b18c1
just merge
StanislavBreadless Sep 10, 2024
9615d90
resolve most of the conflicts
StanislavBreadless Sep 10, 2024
2508f36
Recover some tests (#789)
StanislavBreadless Sep 10, 2024
b3564ef
Kl/chain balance fix (#786)
kelemeno Sep 10, 2024
1404dc0
Merge branch 'dev' of ssh://github.com/matter-labs/era-contracts into…
kelemeno Sep 10, 2024
8155711
Merge branch 'dev' of ssh://github.com/matter-labs/era-contracts into…
kelemeno Sep 10, 2024
c0d45fa
test fixes
kelemeno Sep 10, 2024
6de2963
Merge pull request #791 from matter-labs/kl/merge-dev
StanislavBreadless Sep 10, 2024
07d0462
Fixes (#792)
vladbochok Sep 11, 2024
a4d8f5e
sync with stable
StanislavBreadless Sep 11, 2024
c8a7208
sync 2
StanislavBreadless Sep 11, 2024
0bb6705
Merge pull request #794 from matter-labs/sb-sync-stable-reorg
StanislavBreadless Sep 11, 2024
1673186
sync head with base
StanislavBreadless Sep 11, 2024
eb3583a
delete unneeded files
StanislavBreadless Sep 11, 2024
e5727a0
Sync audit head with base (#797)
StanislavBreadless Sep 11, 2024
ef318e2
Merge pull request #798 from matter-labs/sb-sync-head-base
StanislavBreadless Sep 11, 2024
73b20c4
deploy legacy bridge (#795)
Deniallugo Sep 12, 2024
3a1b5d4
use chain admin for bridgehub manipulations (#799)
Deniallugo Sep 12, 2024
cadf921
feat: compute migrated chain's diamond proxy address (#804)
ly0va Sep 13, 2024
0c2c4f1
Copy consensus contracts from main (#800)
StanislavBreadless Sep 13, 2024
9ebf9be
fix(deploy): Initilize chain using ChainAdmin (#807)
Deniallugo Sep 13, 2024
bce4b2d
feat: multicall3 on L2 (#805)
pompon0 Sep 14, 2024
7206350
fix: get the server to start (#803)
kelemeno Sep 16, 2024
bc1f84b
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Sep 17, 2024
b9c2fef
lint
kelemeno Sep 17, 2024
c566ee7
chore: Kl/merge-stable (#809)
kelemeno Sep 17, 2024
3b51ccf
Merge pull request #810 from matter-labs/kl/merge-stable
kelemeno Sep 17, 2024
6b1f483
Merge pull request #768 from matter-labs/kl/sync-layer-reorg
kelemeno Sep 17, 2024
e0a27a3
bridge fixes
kelemeno Sep 17, 2024
18167a2
fixes
kelemeno Sep 18, 2024
56b4e1f
register Token new function new msg format
kelemeno Sep 19, 2024
9aa7401
(feat): comment out unit tests and fix, small bug in shared bridge (#…
Raid5594 Sep 20, 2024
b3c30ae
Sync layer stable toolbox (#806)
StanislavBreadless Sep 20, 2024
d145e0d
sync with main
StanislavBreadless Sep 21, 2024
1a8e168
fix scripts
StanislavBreadless Sep 21, 2024
8db3824
ignore l2 dev contracts
StanislavBreadless Sep 21, 2024
4568e1f
fix script
StanislavBreadless Sep 21, 2024
de3f407
Merge pull request #817 from matter-labs/sb-sync-stable-with-main-2
StanislavBreadless Sep 22, 2024
d5afbdf
Improve variety of chains sync layer stable (#818)
StanislavBreadless Sep 23, 2024
6a8dc33
better governance protection
StanislavBreadless Sep 25, 2024
82a2639
fix old tests
StanislavBreadless Sep 25, 2024
54f3c8b
fix lint
StanislavBreadless Sep 25, 2024
c2c3dbe
tests wip
StanislavBreadless Sep 25, 2024
6ea2aed
min gas for fallable call
StanislavBreadless Sep 25, 2024
4be4c29
full test cover for tryGetNewAdminFromMigration
StanislavBreadless Sep 25, 2024
c77fd57
some rename + better coverage
StanislavBreadless Sep 25, 2024
950862e
lint fix
StanislavBreadless Sep 25, 2024
16a26bc
comment
StanislavBreadless Sep 25, 2024
30f1e54
add tests for l2 admin factory
StanislavBreadless Sep 25, 2024
2c6d116
fix lint
StanislavBreadless Sep 25, 2024
5bd14e1
exclude l2adminfactory as it is covered by l2 tests
StanislavBreadless Sep 25, 2024
61e8cda
use legacy functions
StanislavBreadless Sep 25, 2024
a27fdea
ensure that the function never panics
StanislavBreadless Sep 25, 2024
8e4c1fc
fix things
StanislavBreadless Sep 25, 2024
b18032a
Merge branch 'oz-audit-sep-head' into sb-better-governance-protection
vladbochok Sep 26, 2024
c261251
Merge branch 'sync-layer-stable' into sb-merge-stable-to-reorg
StanislavBreadless Sep 26, 2024
d7ee927
Merge pull request #823 from matter-labs/sb-merge-stable-to-reorg
StanislavBreadless Sep 26, 2024
5c5c967
Merge branch 'kl/sync-layer-reorg' into sb-better-governance-protection
StanislavBreadless Sep 26, 2024
c99b936
Merge pull request #820 from matter-labs/sb-better-governance-protection
StanislavBreadless Sep 26, 2024
90b5173
Merge branch 'sync-layer-stable' of ssh://github.com/matter-labs/era-…
kelemeno Sep 26, 2024
1e009c8
copied some test mods from interop branch
kelemeno Sep 26, 2024
acdf8e9
some fixes
kelemeno Sep 27, 2024
9791cec
linting
kelemeno Sep 27, 2024
c2c2dba
(feat): add legacy read for withdrawal finalization, update l2-l1 enc…
Sep 27, 2024
0c7cc45
fixed test
kelemeno Sep 27, 2024
18dc862
some fixes, enabling l2 integrationt tests
kelemeno Sep 28, 2024
4c4e3f6
lint
kelemeno Sep 28, 2024
e7cf415
diamond selectors
kelemeno Sep 28, 2024
5449b51
add back test for coverage
kelemeno Sep 28, 2024
ae57b24
trying to fix foundry deploy script tests
kelemeno Sep 28, 2024
da58aa0
fixing l1 and l2 tests
kelemeno Sep 29, 2024
acc2e77
renaming
kelemeno Sep 29, 2024
21d11f3
undo bh initialize change
kelemeno Sep 29, 2024
3d8b202
fmt
kelemeno Sep 29, 2024
72c83b0
getting tests to work
kelemeno Sep 29, 2024
8af590e
fmt
kelemeno Sep 29, 2024
4c40c89
chain withdrawal test
kelemeno Sep 29, 2024
8ce6905
some bridge fixes
kelemeno Sep 29, 2024
183589c
script
kelemeno Sep 29, 2024
546bd3f
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Sep 30, 2024
c3030f5
First iteration on testing the gateway upgrade (#826)
StanislavBreadless Sep 30, 2024
0b0e4a7
Merge branch 'kl/sync-layer-reorg' of ssh://github.com/matter-labs/er…
kelemeno Sep 30, 2024
aa87952
l1 test fixes
kelemeno Sep 30, 2024
f6e3538
gateway -> l1 migration fix
kelemeno Oct 1, 2024
ffcc50f
stas issue fixes
kelemeno Oct 1, 2024
40a556a
rename l2 dummy tests
kelemeno Oct 1, 2024
b88b1b6
renamed the dummy-tests folder
kelemeno Oct 1, 2024
5e55954
(fix): support in Nullifier L2 native tokens, correct recovery of fai…
Oct 2, 2024
47ed94c
Merge commit '90b517394e222c98ea99713e1ce9b5a1c4e0870e' into ra/fix-l…
Oct 2, 2024
0199a62
(merge): fix
Oct 2, 2024
905cc0d
(fix): merger
Oct 2, 2024
ec73c3f
(fix): formatting
Oct 2, 2024
885605e
(test)
Oct 2, 2024
069a34f
(fix): merge newer commit
Oct 2, 2024
d79b32b
(fix): typo
Oct 2, 2024
37dc6cd
missing broadcast
kelemeno Oct 2, 2024
340d506
contract ad vm.broadcast
kelemeno Oct 3, 2024
8e7af17
zks fmt
kelemeno Oct 3, 2024
21185a2
Merge branch 'kl/l2-native-token' of ssh://github.com/matter-labs/era…
kelemeno Oct 3, 2024
a3ba4b3
Merge pull request #831 from matter-labs/sb-merge-reorg-stable
StanislavBreadless Oct 3, 2024
6bbcb1d
Merge pull request #837 from matter-labs/ra/l2-native
kelemeno Oct 3, 2024
5d60926
hopefully final cleanup
kelemeno Oct 4, 2024
4c9b96c
sys hashes
kelemeno Oct 4, 2024
fa030cd
stas issue fixes
kelemeno Oct 4, 2024
6afd801
compilation and test
kelemeno Oct 4, 2024
1d1e732
fmt
kelemeno Oct 4, 2024
24f6464
stas issues 2
kelemeno Oct 7, 2024
28c91ad
error selector typo
kelemeno Oct 7, 2024
53b0283
Merge pull request #811 from matter-labs/kl/l2-native-token
kelemeno Oct 8, 2024
9e4a192
Merge pull request #842 from matter-labs/kl/sync-layer-reorg
kelemeno Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
152 changes: 146 additions & 6 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,37 @@ jobs:
node-version: 18.18.0
cache: yarn

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install dependencies
run: yarn

- name: Build artifacts
run: yarn l1 build
- name: Install l2 deps
working-directory: ./l2-contracts
run: yarn

- name: Install l1 deps
working-directory: ./l1-contracts
run: yarn

- name: Build L2 artifacts
- name: Build l2 artifacts
run: yarn l2 build

- name: Build l1 artifacts
run: yarn l1 build

- name: Build da-contracts artifacts
run: yarn da build:foundry

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
Expand Down Expand Up @@ -90,12 +106,69 @@ jobs:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain

- name: Run tests
working-directory: ./l1-contracts
run: FOUNDRY_PROFILE=default yarn test:foundry

test-foundry-zksync:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build system contract artifacts
run: yarn sc build

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain

- name: Install foundry zksync
run: |
wget https://github.com/matter-labs/foundry-zksync/releases/download/nightly-f908ce43834bc1ffb4de6576ea5600eaab49dddb/foundry_nightly_linux_amd64.tar.gz -O foundry-zksync.tar.gz
tar -xzf foundry-zksync.tar.gz
sudo mv forge /usr/local/bin/forge
sudo mv cast /usr/local/bin/cast
sudo chmod +x /usr/local/bin/forge
sudo chmod +x /usr/local/bin/cast
forge --version

- name: Run tests
run: yarn l1 test:foundry
working-directory: ./l1-contracts
run: FOUNDRY_PROFILE=default yarn test:zkfoundry

test-hardhat:
needs: [build, lint]
Expand All @@ -114,23 +187,32 @@ jobs:
- name: Install dependencies
run: yarn

- name: Install l1 deps
working-directory: ./l1-contracts
run: yarn

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain

- name: Build L2 contracts
run: yarn l2 build

- name: Run tests
run: yarn l1 test --no-compile

check-verifier-generator:
check-verifier-generator-l1:
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -182,9 +264,14 @@ jobs:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/artifacts
l1-contracts/artifacts-zk
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain

- name: Run coverage
run: FOUNDRY_PROFILE=default yarn test:foundry && FOUNDRY_PROFILE=default yarn coverage:foundry --report summary --report lcov
Expand All @@ -199,7 +286,7 @@ jobs:
- name: Filter directories
run: |
sudo apt update && sudo apt install -y lcov
lcov --remove lcov.info 'test/*' 'contracts/dev-contracts/*' '../lib/forge-std/*' '../lib/murky/*' 'lib/*' '../lib/*' 'lib/' --output-file lcov.info --rc lcov_branch_coverage=1
lcov --remove lcov.info 'test/*' 'contracts/dev-contracts/*' '../lib/forge-std/*' '../lib/murky/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' --output-file lcov.info --rc lcov_branch_coverage=1

# This step posts a detailed coverage report as a comment and deletes previous comments on
# each push. The below step is used to fail coverage if the specified coverage threshold is
Expand All @@ -220,3 +307,56 @@ jobs:
coverage-files: ./l1-contracts/lcov.info
working-directory: l1-contracts
minimum-coverage: 85 # Set coverage threshold.

gas-report:
needs: [build, lint]
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/cache
l1-contracts/typechain

# Add any step generating a gas report to a temporary file named gasreport.ansi. For example:
- name: Run tests
run: yarn l1 test:foundry --gas-report | tee gasreport.ansi # <- this file name should be unique in your repository!

- name: Compare gas reports
uses: Rubilmax/[email protected]
with:
summaryQuantile: 0.0 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
sortCriteria: avg,max # sort diff rows by criteria
sortOrders: desc,asc # and directions
ignore: test-foundry/**/*,l1-contracts/contracts/dev-contracts/**/*,l1-contracts/lib/**/*,l1-contracts/contracts/common/Dependencies.sol
id: gas_diff

- name: Add gas diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact gas costs
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}
134 changes: 134 additions & 0 deletions .github/workflows/l1-contracts-foundry-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: L1 contracts foundry CI

env:
ANVIL_PRIVATE_KEY: "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
ANVIL_RPC_URL: "http://127.0.0.1:8545"

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.18.0
cache: yarn

- name: Install dependencies
run: yarn

- name: Build hardhat artifacts
run: yarn l1 build

- name: Build artifacts
working-directory: ./l1-contracts
run: forge build

- name: Build system-contract artifacts
run: yarn sc build

- name: Build l2 artifacts
run: yarn l2 build

- name: Build da-contracts artifacts
run: yarn da build:foundry

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/cache
l1-contracts/out
l1-contracts/artifacts-zk
l2-contracts/artifacts-zk
l2-contracts/cache-zk
system-contracts/artifacts-zk
system-contracts/bootloader/build
system-contracts/cache-zk
system-contracts/contracts-preprocessed
system-contracts/typechain

scripts:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: true

- name: Restore artifacts cache
uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
key: artifacts-l1-contracts-foudry-${{ github.sha }}
path: |
da-contracts/out
l1-contracts/cache
l1-contracts/out
l1-contracts/artifacts-zk
l2-contracts/artifacts-zk
l2-contracts/cache-zk
system-contracts/artifacts-zk
system-contracts/bootloader/build
system-contracts/cache-zk
system-contracts/contracts-preprocessed
system-contracts/typechain

- name: Use Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Copy configs from template
working-directory: ./l1-contracts
run: cp -r deploy-script-config-template/. script-config

- name: Run anvil
run: |
anvil --silent &

ANVIL_READY=0
for i in {1..10}; do
if curl -s -o /dev/null $ANVIL_RPC_URL -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","method":"eth_chainId","id":1}'; then
echo "Anvil is ready"
ANVIL_READY=1
break
else
echo "Waiting for Anvil to become ready..."
sleep 1
fi
done

if [ $ANVIL_READY -ne 1 ]; then
echo "Anvil failed to become ready after 10 attempts."
exit 1
fi

- name: Run DeployL1 script
working-directory: ./l1-contracts
run: forge script ./deploy-scripts/DeployL1.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY

- name: Run DeployErc20 script
working-directory: ./l1-contracts
run: forge script ./deploy-scripts/DeployErc20.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# TODO restore scripts verification
# - name: Run RegisterZKChain script
# working-directory: ./l1-contracts
# run: |
# cat ./script-out/output-deploy-l1.toml >> ./script-config/register-zk-chain.toml
# forge script ./deploy-scripts/RegisterZKChain.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
# - name: Run InitializeL2WethToken script
# working-directory: ./l1-contracts-foundry
# run: forge script ./deploy-scripts/InitializeL2WethToken.s.sol --ffi --rpc-url $ANVIL_RPC_URL --broadcast --private-key $ANVIL_PRIVATE_KEY
Loading
Loading