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

WIP - merging dev into main #226

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 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
8b5b296
Implement restriction to allow limiting chain admin in power (#699)
StanislavBreadless Sep 5, 2024
b6c7130
merge main into dev
StanislavBreadless Sep 6, 2024
0fa0fa2
foundry tests pass
StanislavBreadless Sep 6, 2024
00ddc06
fix compile for registry
StanislavBreadless Sep 6, 2024
ef33539
lint
StanislavBreadless Sep 6, 2024
b653ac8
Merge pull request #778 from matter-labs/sb-merge-main-to-dev
StanislavBreadless Sep 6, 2024
cc3b2ac
chore: merge main (#790)
kelemeno Sep 10, 2024
bf7f955
feat: Update zksolc for system contracts (#830)
0xVolosnikov Oct 18, 2024
a3254c8
fix: Fix bootloader bytecode loading after new `zksolc` version (#949)
0xVolosnikov Oct 18, 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/*"
]
}
75 changes: 75 additions & 0 deletions .github/workflows/l1-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ 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
Expand Down Expand Up @@ -145,3 +150,73 @@ 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 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

- 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/[email protected]
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.

2 changes: 1 addition & 1 deletion .github/workflows/system-contracts-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly-2023-04-17
toolchain: nightly-2024-08-01

- name: Restore artifacts cache
uses: actions/cache/restore@v3
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ l1-contracts/coverage/*
l1-contracts/out/*
l1-contracts/broadcast/*
l1-contracts/script-config/*
!l1-contracts/script-config/artifacts
l1-contracts/script-out/*
!l1-contracts/script-out/.gitkeep
*.timestamp
l1-contracts/test/foundry/l1/integration/deploy-scripts/script-out/*
l1-contracts/zkout/*
18 changes: 9 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[submodule "l1-contracts/lib/forge-std"]
path = l1-contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "l1-contracts/lib/murky"]
path = l1-contracts/lib/murky
[submodule "lib/murky"]
path = lib/murky
url = https://github.com/dmfxyz/murky
[submodule "l1-contracts/lib/openzeppelin-contracts-upgradeable"]
path = l1-contracts/lib/openzeppelin-contracts-upgradeable
[submodule "lib/openzeppelin-contracts-upgradeable-v4"]
path = lib/openzeppelin-contracts-upgradeable-v4
url = https://github.com/Openzeppelin/openzeppelin-contracts-upgradeable
branch = release-v4.9
[submodule "l1-contracts/lib/openzeppelin-contracts"]
path = l1-contracts/lib/openzeppelin-contracts
[submodule "lib/openzeppelin-contracts-v4"]
path = lib/openzeppelin-contracts-v4
url = https://github.com/Openzeppelin/openzeppelin-contracts
branch = release-v4.9
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
6 changes: 5 additions & 1 deletion .markdownlintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
node_modules

# l1-contracts
l1-contracts/lib
l1-contracts/node_modules

# l1-contracts-foundry
Expand All @@ -14,3 +13,8 @@ l2-contracts/node_modules
# system-contracts
system-contracts/node_modules
system-contracts/bootloader/test_infra/target

l1-contracts/lib
lib/
l2-contracts/lib
system-contracts/lib
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tools/data
l1-contracts/lib
l1-contracts-foundry/lib
lib
system-contracts/contracts/openzeppelin
system-contracts/contracts/Constants.sol
system-contracts/artifacts-zk
Expand All @@ -10,3 +11,6 @@ l1-contracts/cache
l1-contracts/cache-forge
l1-contracts/artifacts
l1-contracts/artifacts-forge
l1-contracts/zkout
l2-contracts/zkout
system-contracts/zkout
45 changes: 27 additions & 18 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"extends": "solhint:recommended",
"rules": {
"state-visibility": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }],
"var-name-mixedcase": "off",
"avoid-call-value": "off",
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"avoid-call-value": "error",
"avoid-low-level-calls": "off",
"no-inline-assembly": "off",
"avoid-sha3": "error",
"check-send-result": "error",
"compiler-version": ["error", "^0.8.0"],
"const-name-snakecase": "off",
"no-complex-fallback": "off",
"reason-string": "off",
"contract-name-camelcase": "off",
"gas-calldata-parameters": "error",
"gas-custom-errors": "error",
"gas-increment-by-one": "error",
"gas-length-in-loops": "error",
"gas-struct-packing": "error",
"explicit-types": "error",
"func-name-mixedcase": "off",
"custom-errors": "off",
"no-unused-vars": "error",
"func-named-parameters": ["error", 4],
"func-visibility": ["error", { "ignoreConstructors": true }],
"imports-on-top": "error",
"max-states-count": "off",
"modifier-name-mixedcase": "error",
"named-parameters-mapping": "off",
"no-complex-fallback": "off",
"no-console": "error",
"no-empty-blocks": "off",
"no-global-import": "error",
"no-inline-assembly": "off",
"no-unused-import": "error",
"explicit-types": "error",
"modifier-name-mixedcase": "error",
"imports-on-top": "error",
"no-unused-vars": "error",
"not-rely-on-time": "off",
"quotes": "error",
"use-forbidden-name": "error",
"visibility-modifier-order": "error",
"reason-string": "error",
"reentrancy": "error",
"func-named-parameters": ["error", 4],
"compiler-version": ["error", "^0.8.0"]
"state-visibility": "error",
"use-forbidden-name": "error",
"var-name-mixedcase": "off",
"visibility-modifier-order": "error"
}
}
12 changes: 12 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ l1-contracts/cache
l1-contracts/cache-forge
l1-contracts/lib
l1-contracts/node_modules
l1-contracts/contracts/dev-contracts
l1-contracts/test
l1-contracts/deploy-scripts

# l1-contracts-foundry
l1-contracts-foundry/cache
Expand All @@ -18,3 +21,12 @@ l2-contracts/node_modules
# system-contracts
system-contracts/contracts/openzeppelin
system-contracts/contracts/Constants.sol
system-contracts/contracts/test-contracts
system-contracts/contracts-preprocessed

# gas-bound-caller
gas-bound-caller

lib/*
l2-contracts/lib
system-contracts/lib
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ We aim to make it as easy as possible to contribute to the mission. This is stil
and suggestions here too. Some resources to help:

1. [In-repo docs aimed at developers](docs)
2. [zkSync Era docs!](https://era.zksync.io/docs/)
2. [ZKsync Era docs!](https://era.zksync.io/docs/)
3. Company links can be found in the [repo's readme](README.md)

## Code of Conduct
Expand Down
Loading