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

[DO NOT MERGE]: Release v25 protocol defense #774

Open
wants to merge 62 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
4c0e566
extend utils & update compilation process (#396)
Raid5594 Apr 24, 2024
3601648
NonceHolder Tests (#176)
neotheprogramist May 16, 2024
2840540
chore(scripts): remove unconditionally removed facets (#448)
koloz193 May 16, 2024
622638a
chore(contracts): remove usage of ergs (#454)
koloz193 May 16, 2024
bd9bec5
chore(verifier): update generation to include vk hash (#453)
koloz193 May 16, 2024
994897b
chore(contract): applied new solhint rules across l1, l2, and system …
koloz193 May 16, 2024
8e4c291
Merge branch 'release-v23' into dev
koloz193 Jun 5, 2024
d97d8cd
tests and fix merge conflict
koloz193 Jun 5, 2024
704b41b
fix merge conflicts and bump hashes
koloz193 Jun 5, 2024
ee5667e
fixed lint
koloz193 Jun 5, 2024
5c4525a
update system contracts hashes and verifier hash
koloz193 Jun 5, 2024
131f823
update forge-std
koloz193 Jun 5, 2024
360a918
Merge pull request #508 from matter-labs/zk-merge-release-23-dev
StanislavBreadless Jun 5, 2024
680b252
sync with dev
StanislavBreadless Jun 11, 2024
8df3025
Merge pull request #523 from matter-labs/sb-merge-main-to-dev
StanislavBreadless Jun 11, 2024
311b82e
chore: zksync-ethers 5.8.0-beta.5 (#387)
benceharomi Jun 11, 2024
ab2f13d
feat: check diamond cut hash locally (#525)
dimazhornyk Jun 12, 2024
7d7af53
Fix incorrect clause (#535)
StanislavBreadless Jun 18, 2024
100b3bf
Adding doc comments to the chain contracts (#530)
vladbochok Jun 18, 2024
dc7bd13
Add CI coverage (reopenned to dev) (#543)
vladbochok Jun 21, 2024
8fec7ec
Mailbox unit testing (#489)
neotheprogramist Jun 27, 2024
116206c
Revert "Mailbox unit testing (#489)" (#558)
saxenism Jun 27, 2024
fb3a5d8
chore(ci): Additional permissions for CI token (#565)
artmakh Jul 2, 2024
1c1b93b
Mailbox unit testing (#559)
tommysr Jul 3, 2024
c9a8a68
chore: zksync-ethers to stable v5.9.0 (#567)
benceharomi Jul 3, 2024
bc98e4b
remove outdated folder (#601)
kelemeno Jul 8, 2024
c808b1f
Merge branch 'main' into zk-sync-main-dev
koloz193 Aug 5, 2024
5b8d6ae
Merge pull request #678 from matter-labs/zk-sync-main-dev
StanislavBreadless Aug 6, 2024
3161150
sync main with dev
StanislavBreadless Aug 7, 2024
0b80914
Merge pull request #681 from matter-labs/sb-merge-main-into-dev
StanislavBreadless Aug 7, 2024
1812c31
Merge branch 'main' into deniallugo-merge-main
Deniallugo Aug 13, 2024
d0d735c
Merge pull request #696 from matter-labs/deniallugo-merge-main
StanislavBreadless Aug 13, 2024
118f081
Bridgehub Test Coverage Increase (#494)
neotheprogramist Aug 14, 2024
7f4f460
feat(foundry): use foundry zksync (dev) (#551)
Deniallugo Aug 16, 2024
80e8234
feat(consensus): add L2 registry contract (BFT-434) (#555)
moshababo Aug 19, 2024
2c8a5fa
Revert: "feat(consensus): add L2 registry contract (BFT-434)" (#717)
pompon0 Aug 20, 2024
8be87b2
Merge Protocol Defense Tasks into Dev (#518)
koloz193 Aug 20, 2024
7b488e6
chore: foundry config cleanup (#722)
benceharomi Aug 20, 2024
2395aed
Update solidity contracts version (#688)
IAvecilla Aug 23, 2024
a36c6c2
chore(config): Fix server build with symlinks (#740)
StanislavBreadless Aug 28, 2024
8d9240f
feat: add a script to prepare chain registration calldata (#671)
dimazhornyk Aug 28, 2024
1e0df10
feat(l2): solidity 0.8.24 and zksolc 1.5.0 (#743)
benceharomi Aug 28, 2024
f2d553b
feat(l1): added missing foundry lib symlinks (#741)
benceharomi Aug 28, 2024
383e1b0
docs: update zkSync casing to ZKsync (#733)
benceharomi Aug 28, 2024
dba0212
chore(contracts): add missing spdx licenses (#732)
koloz193 Aug 28, 2024
874bc6b
fix(scrips): read bytecode from foundry not hardhat (#750)
koloz193 Aug 29, 2024
7f2c27a
Small PR to Fix "Ethers" and "ETH" encoding (#762)
Raid5594 Sep 3, 2024
3d6e02f
Set foundry optimizer_runs (#770)
perekopskiy Sep 5, 2024
1fba03d
merging main (#824)
koloz193 Sep 27, 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
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
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"no-console": "off"
},
"ignorePatterns": [
"**/lib/*"
"**/lib/*",
"lib/*"
]
}
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
127 changes: 110 additions & 17 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,54 @@ name: L1 contracts CI
on:
pull_request:

# We need this permissions for this CI to work with external contributions
permissions:
contents: read
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest

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 @@ -67,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 @@ -123,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 All @@ -145,3 +163,78 @@ jobs:

- name: Compare
run: diff tools/data/Verifier.sol l1-contracts/contracts/state-transition/Verifier.sol

coverage:
defaults:
run:
working-directory: l1-contracts
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 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

- 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

- name: Run coverage
run: FOUNDRY_PROFILE=default yarn test:foundry && FOUNDRY_PROFILE=default yarn coverage:foundry --report summary --report lcov

# To ignore coverage for certain directories modify the paths in this step as needed. The
# below default ignores coverage results for the test and script directories. Alternatively,
# to include coverage in all directories, comment out this step. Note that because this
# filtering applies to the lcov file, the summary table generated in the previous step will
# still include all files and directories.
# The `--rc lcov_branch_coverage=1` part keeps branch info in the filtered report, since lcov
# defaults to removing branch info.
- 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

# 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
# not met. The below step can post a comment (when it's `github-token` is specified) but it's
# not as useful, and this action cannot fail CI based on a minimum coverage threshold, which
# is why we use both in this way.
- name: Post coverage report
if: github.event_name == 'pull_request' # This action fails when ran outside of a pull request.
uses: romeovs/lcov-reporter-action@v0.3.1
with:
delete-old-comments: true
lcov-file: ./l1-contracts/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }} # Adds a coverage summary comment to the PR.

- name: Verify minimum coverage
uses: zgosalvez/github-actions-report-lcov@v2
with:
coverage-files: ./l1-contracts/lcov.info
working-directory: l1-contracts
minimum-coverage: 85 # Set coverage threshold.
117 changes: 0 additions & 117 deletions .github/workflows/l1-contracts-foundry-ci.yaml

This file was deleted.

Loading
Loading