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(registration): Add Chain registrar contract #1064

Open
wants to merge 57 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ec8e9da
Deploy legacy bridge inside foundry (#787)
Deniallugo Sep 10, 2024
73b20c4
deploy legacy bridge (#795)
Deniallugo Sep 12, 2024
3a1b5d4
use chain admin for bridgehub manipulations (#799)
Deniallugo Sep 12, 2024
9ebf9be
fix(deploy): Initilize chain using ChainAdmin (#807)
Deniallugo Sep 13, 2024
bce4b2d
feat: multicall3 on L2 (#805)
pompon0 Sep 14, 2024
1fba03d
merging main (#824)
koloz193 Sep 27, 2024
939151e
Add utils for DecentralizeGovernance transaction (#829)
vladbochok Oct 2, 2024
aafee03
feat(zk_toolbox): dedicated command for deploying multicall3 on L2 (#…
pompon0 Oct 3, 2024
a7e8923
Merge main back into protocol defense (#839)
koloz193 Oct 4, 2024
8499c67
Merge branch 'main' into release-v25-protocol-defense
koloz193 Oct 4, 2024
efa5d3b
remove whitespace from config
koloz193 Oct 4, 2024
84d5e37
Update foundry bytecode (#764)
Deniallugo Oct 4, 2024
dcb0eca
feat(zkstack): Show chain info (#955)
Deniallugo Oct 22, 2024
72a3e8e
Add time window asserter
ischasny Oct 1, 2024
4c69685
Changed assertion message
ischasny Oct 30, 2024
9ed4ad0
Review feedback
ischasny Oct 31, 2024
26bcdbe
Merge branch 'release-v25-protocol-defense' into ivan/add-time-window…
ischasny Oct 31, 2024
9f3f710
Fix lint
ischasny Oct 31, 2024
698f6ae
Update l2-contracts/contracts/dev-contracts/TimestampAsserter.sol
ischasny Oct 31, 2024
50a0db7
add new lines
ischasny Oct 31, 2024
9fb1264
Merge pull request #843 from matter-labs/ivan/add-time-window-asserter
ischasny Oct 31, 2024
b7b9f1b
fix: add deploy timestap asserter command
ischasny Nov 11, 2024
46d7508
Typo
ischasny Nov 11, 2024
658713f
Merge pull request #1058 from matter-labs/ivan/add-deploy-timestamp-a…
ischasny Nov 11, 2024
9c3118c
add new chain registrator contract
Deniallugo Nov 11, 2024
9fd56a3
Add test
Deniallugo Nov 11, 2024
0589a9b
Make test passes
Deniallugo Nov 12, 2024
ca8edff
Add deployer
Deniallugo Nov 12, 2024
0e9e30d
Fix registrator
Deniallugo Nov 12, 2024
e4b0c85
Simplify propose chain signature
Deniallugo Nov 12, 2024
1804692
Simplify propose chain signature
Deniallugo Nov 12, 2024
9294bac
Finalize registration
Deniallugo Nov 13, 2024
5579d5a
Update initialization
Deniallugo Nov 14, 2024
43b788e
Fix reentranc
Deniallugo Nov 14, 2024
9c148cc
Change to call of get admin
Deniallugo Nov 14, 2024
7610082
Fix lints
Deniallugo Nov 14, 2024
567abc5
Return correct admin
Deniallugo Nov 14, 2024
6ea44a2
Small refactoring
Deniallugo Nov 14, 2024
7a642e5
Fix base token transfering
Deniallugo Nov 16, 2024
d0e3772
Propose chain registration script
Deniallugo Nov 18, 2024
e99c0ff
Propose chain registration script
Deniallugo Nov 18, 2024
9d007bb
Fix script
Deniallugo Nov 18, 2024
9a72fc2
Deploy registrar with transperent proxy
Deniallugo Nov 21, 2024
49befd8
Implemet get deployed config
Deniallugo Nov 21, 2024
b077dd4
Registered chain config as an additional function
Deniallugo Nov 21, 2024
9c138fd
Apply suggestions from code review
Deniallugo Nov 21, 2024
7cc89ac
Try to fix the test
Deniallugo Nov 21, 2024
139474f
Properly fix test
Deniallugo Nov 21, 2024
5828b73
Apply review suggestions
Deniallugo Nov 21, 2024
6ed3ebc
Remove unnnecessary functions
Deniallugo Nov 22, 2024
9ef8a21
Add more comments
Deniallugo Nov 22, 2024
8ceaa5b
Add more comments
Deniallugo Nov 22, 2024
2953478
Merge branch 'dev' into deniallugo-chain-registrator
Deniallugo Nov 25, 2024
2b54930
Fix system contracts
Deniallugo Nov 25, 2024
3388f52
Add more tests
Deniallugo Nov 25, 2024
8101384
Apply suggestions from code review
Deniallugo Nov 25, 2024
f0b38c0
Fix review
Deniallugo Nov 25, 2024
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
30 changes: 26 additions & 4 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit }}
submodules: recursive

- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

- name: Use Node.js
uses: actions/setup-node@v3
Expand All @@ -35,11 +44,24 @@ jobs:
yarn
echo "release_tag=${{ inputs.prefix }}-${{ inputs.commit }}" >> $GITHUB_OUTPUT

- name: Build contracts
- name: Build l1 contracts
working-directory: l1-contracts
run: |
forge build

- name: Build l2 contracts
working-directory: l2-contracts
run: |
forge build --zksync --zk-enable-eravm-extensions

- name: Build system-contracts
working-directory: system-contracts
run: |
yarn l1 build
yarn l2 build
yarn sc build
yarn install
yarn preprocess:system-contracts
forge build --zksync --zk-enable-eravm-extensions
yarn preprocess:bootloader
forge build --zksync --zk-enable-eravm-extensions

- name: Prepare artifacts
run: |
Expand Down
58 changes: 38 additions & 20 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,42 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

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

- name: Install dependencies
run: yarn

- name: Build artifacts
run: yarn l1 build
- name: Build l1 contracts
working-directory: l1-contracts
run: |
forge build

- name: Build L2 artifacts
run: yarn l2 build
- name: Build l2 contracts
working-directory: l2-contracts
run: |
forge build --zksync --zk-enable-eravm-extensions

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/cache-forge
l1-contracts/out
l2-contracts/cache-forge
l2-contracts/zkout

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,15 +81,19 @@ jobs:
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 foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH
- name: Install dependencies
run: yarn

Expand Down Expand Up @@ -128,7 +141,7 @@ jobs:
l2-contracts/typechain

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

check-verifier-generator:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -164,15 +177,20 @@ jobs:
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 foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

- name: Install dependencies
run: yarn

Expand Down
34 changes: 23 additions & 11 deletions .github/workflows/l2-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

- name: Use Node.js
uses: actions/setup-node@v3
Expand All @@ -20,23 +30,25 @@ jobs:
- name: Install dependencies
run: yarn

- name: Build L1 artifacts
run: yarn l1 build
- name: Build l1 contracts
working-directory: l1-contracts
run: |
forge build

- name: Build L2 artifacts
run: yarn l2 build
- name: Build l2 contracts
working-directory: l2-contracts
run: |
forge build --zksync --zk-enable-eravm-extensions

- name: Create cache
uses: actions/cache/save@v3
with:
key: artifacts-l2-${{ github.sha }}
key: artifacts-l1-${{ github.sha }}
path: |
l1-contracts/artifacts
l1-contracts/cache
l1-contracts/typechain
l2-contracts/artifacts-zk
l2-contracts/cache-zk
l2-contracts/typechain
l1-contracts/cache-forge
l1-contracts/out
l2-contracts/cache-forge
l2-contracts/zkout

lint:
runs-on: ubuntu-latest
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/slither.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ jobs:
with:
python-version: 3.8

- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

- name: Install Slither
run: |
pip install slither-analyzer

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

- name: Remove non-compiled files
run: |
rm -rf ./l1-contracts/contracts/state-transition/utils/
Expand All @@ -43,6 +48,6 @@ jobs:
rm -rf ./l1-contracts/contracts/dev-contracts/test/VerifierRecursiveTest.sol

- name: Run Slither
working-directory: l1-contracts
run: |
cd l1-contracts
slither --config ./slither.config.json .
66 changes: 27 additions & 39 deletions .github/workflows/system-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,45 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install foundry-zksync
run: |
mkdir ./foundry-zksync
curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly/foundry_nightly_linux_amd64.tar.gz
tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
echo "$PWD/foundry-zksync" >> $GITHUB_PATH

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

- name: Install dependencies
run: yarn

- name: Build artifacts
run: yarn sc build
working-directory: system-contracts
run: |
yarn install
yarn preprocess:system-contracts
forge build --zksync --zk-enable-eravm-extensions
yarn preprocess:bootloader
forge build --zksync --zk-enable-eravm-extensions
yarn build

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

lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,11 +88,13 @@ jobs:
fail-on-cache-miss: true
key: artifacts-system-${{ github.sha }}
path: |
system-contracts/zkout
system-contracts/cache-forge
system-contracts/bootloader/build
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain
system-contracts/contracts-preprocessed
system-contracts/bootloader/build

- name: Run bootloader tests
run: |
Expand Down Expand Up @@ -111,47 +129,17 @@ jobs:
fail-on-cache-miss: true
key: artifacts-system-${{ github.sha }}
path: |
system-contracts/zkout
system-contracts/cache-forge
system-contracts/bootloader/build
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain
system-contracts/contracts-preprocessed
system-contracts/bootloader/build

- name: Run tests
run: yarn sc test

- name: Print output logs of era_test_node
if: always()
run: cat era_test_node.log

check-hashes:
needs: [build]
runs-on: ubuntu-latest

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

- 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-system-${{ github.sha }}
path: |
system-contracts/artifacts-zk
system-contracts/cache-zk
system-contracts/typechain
system-contracts/contracts-preprocessed
system-contracts/bootloader/build

- name: Check hashes
run: yarn sc calculate-hashes:check
3 changes: 2 additions & 1 deletion gas-bound-caller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"ethers": "^5.7.0",
"fast-glob": "^3.3.2",
"hardhat": "=2.22.2",
"preprocess": "^3.2.0"
"preprocess": "^3.2.0",
"zksync-ethers": "^5.9.0"
},
"devDependencies": {
"@matterlabs/hardhat-zksync-chai-matchers": "^0.2.0",
Expand Down
Loading
Loading