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(zk_toolbox): Redesign zk_toolbox commands #3003

Merged
merged 125 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
b9f87c4
refactor: add `zks` as `zki dev` subcommand
manuelmauro Oct 2, 2024
827e281
style: format code
manuelmauro Oct 2, 2024
4585320
style: format imports
manuelmauro Oct 2, 2024
8e03c16
refactor: use `zki dev` instead of `zks` in CI
manuelmauro Oct 2, 2024
3c9ff94
refactor: remove zk_supervisor crate
manuelmauro Oct 2, 2024
ab7d584
fix: remove occurences of zks in dev and installation scripts
manuelmauro Oct 2, 2024
2d02e41
fix: remove unused flags in zkup
manuelmauro Oct 2, 2024
0394cac
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 2, 2024
a2c36ff
fix: allor to run benchmarks on main branch after zks will be removed
manuelmauro Oct 3, 2024
dde2fc1
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 3, 2024
5f04a79
style: format code
manuelmauro Oct 3, 2024
c51dd69
refactor: rename zk_inception to zkstack
manuelmauro Oct 3, 2024
805515c
style: format code
manuelmauro Oct 3, 2024
5e2de69
docs: fix zk_supervisor occurences in docs
manuelmauro Oct 3, 2024
fa0c34c
refactor: remove occurences of zk_toolbox
manuelmauro Oct 3, 2024
f41b59c
refactor: replace ZkInception with ZkStack
manuelmauro Oct 3, 2024
07373fa
style: format code
manuelmauro Oct 3, 2024
89d92d9
refactor: remove some more occurences of toolbox wording
manuelmauro Oct 3, 2024
52c1ca7
refactor: rename zkup to zkstackup
manuelmauro Oct 3, 2024
1456d03
refactor: rename ZkToolboxConfig to ZkStackConfig
manuelmauro Oct 4, 2024
664aed4
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 4, 2024
240636a
refactor: remove last occurences of the wording "toolbox"
manuelmauro Oct 4, 2024
b3fd67a
refactor: update ascii art banner
manuelmauro Oct 4, 2024
ad06223
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 8, 2024
0770782
fix: remove unsupported flag --alias
manuelmauro Oct 8, 2024
1b7d110
refactor: remove occurences of old ZK supervisor wording
manuelmauro Oct 8, 2024
a0d0eae
docs: use new ZK Stack CLI wording in docs
manuelmauro Oct 8, 2024
15aecf7
docs: remove occurences of zks alias from docs
manuelmauro Oct 8, 2024
d84ad52
feat: fallback to zk_supervisor in case zkstack is not installed
manuelmauro Oct 8, 2024
2f73330
docs: change deprecation message to include zkup
manuelmauro Oct 8, 2024
eb3d7b4
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
a86cf29
feat: remove zkt
manuelmauro Oct 9, 2024
bdb1e13
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
f15d3a9
fix: invoke zkstackup using its relative path
manuelmauro Oct 9, 2024
8b448e6
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
45e639f
fix: install zkstackup in CI before invoking zkstack
manuelmauro Oct 9, 2024
4f3cde5
fix: typo in zkstackup installation command
manuelmauro Oct 9, 2024
ae868d1
fix: fix more typos
manuelmauro Oct 9, 2024
c556a3f
fix: source /root/.bashrc before invoking zkstackup
manuelmauro Oct 9, 2024
04d6bbe
fix: invoke zkstackup using its relative path
manuelmauro Oct 9, 2024
341e2a9
fix: invoke zkstack with its relative path
manuelmauro Oct 9, 2024
704e854
feat: install zkstack in $HOME/.local/bin
manuelmauro Oct 9, 2024
4423428
feat: use $HOME/.local in zkstackup
manuelmauro Oct 9, 2024
5286e90
refactor: improve CI steps subdivision
manuelmauro Oct 9, 2024
605fdd8
feat: add bin folder to path in zkstackup
manuelmauro Oct 9, 2024
3ac3a05
docs: improve zkstack installation messages
manuelmauro Oct 9, 2024
783cffa
fix: add more folders to GITHUB_PATH
manuelmauro Oct 9, 2024
4e3ec09
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
89f1638
fix: invoke zkstackup using its relative path
manuelmauro Oct 9, 2024
0894726
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
94235c4
Revert "fix: invoke zkstackup using its relative path"
manuelmauro Oct 9, 2024
9d982ab
fix: add zkstack and zkstackup to PATH in containers
manuelmauro Oct 9, 2024
8c3b92e
fix: fix typo in PATH export
manuelmauro Oct 9, 2024
9408ea8
fix: use relative path for zkstackup in Makefile
manuelmauro Oct 9, 2024
6f6f328
fix: add zkstackup to containers PATH
manuelmauro Oct 9, 2024
7bd7520
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 9, 2024
77b4603
fix: add zkstackup to PATH in makefile
manuelmauro Oct 9, 2024
e5149d3
fix: use relative paths to zkstackup in workflow templates
manuelmauro Oct 9, 2024
20bbc0b
fix: fix relative invoations of zkstackup in CI
manuelmauro Oct 10, 2024
88d2229
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
67a446f
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
Deniallugo Oct 10, 2024
c33cdcf
chore: update sqruff-lib to 0.19.0
manuelmauro Oct 10, 2024
7427509
chore: use published version for sqruff-lib
manuelmauro Oct 10, 2024
884c2fd
ci: use relative invocations of zkstackup in all CI jobs
manuelmauro Oct 10, 2024
3afee03
fix: temporarily invoke zkstack using its absolute path
manuelmauro Oct 10, 2024
0ad41b8
chore: update Cargo.lock
manuelmauro Oct 10, 2024
67ee796
fix: add executable permissions to zkstack bin
manuelmauro Oct 10, 2024
975b189
refactor: rely on PATH for zkstack invocation
manuelmauro Oct 10, 2024
801775c
refactor: use zkstackup instead of zkt
manuelmauro Oct 10, 2024
92f8079
style: add EOF newline
manuelmauro Oct 10, 2024
87a19b4
Revert "refactor: rely on PATH for zkstack invocation"
manuelmauro Oct 10, 2024
b15d688
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
7516cd1
style: add EOF newline
manuelmauro Oct 10, 2024
1ac7c63
refactor: deduplicate format prompts in pre-push
manuelmauro Oct 10, 2024
27f7de2
fix: add back deleted command
manuelmauro Oct 10, 2024
d11e4c4
Revert "fix: add back deleted command"
manuelmauro Oct 10, 2024
5c76625
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
603e9ff
refactor: rely on PATH for zkstack invocation in CI
manuelmauro Oct 10, 2024
15f5f42
test: print PATH
manuelmauro Oct 10, 2024
8d8110c
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
b517a46
Revert "refactor: rely on PATH for zkstack invocation in CI"
manuelmauro Oct 10, 2024
fde4703
test: print PATH in CI
manuelmauro Oct 10, 2024
5673190
test: print PATH again
manuelmauro Oct 10, 2024
00279d2
fix: add /root/.local/bin to GITHUB_ENV
manuelmauro Oct 10, 2024
fb07e36
refactor: rely on PATH for zkstack invocation
manuelmauro Oct 10, 2024
c772f54
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
7adf3b9
Revert "refactor: rely on PATH for zkstack invocation"
manuelmauro Oct 10, 2024
65e2f88
Revert "Revert "refactor: rely on PATH for zkstack invocation""
manuelmauro Oct 10, 2024
2696f90
refactor: try installing zkstack in /usr/local
manuelmauro Oct 10, 2024
ed4be01
fix: typo in LOCAL_DIR
manuelmauro Oct 10, 2024
008a7d9
feat: add global installation option for zkstackup and zkstack
manuelmauro Oct 10, 2024
3fadff4
refactor: remove /root/.local/bin from GITHUB_PATH
manuelmauro Oct 10, 2024
c47e520
fix: update BIN_DIR on -g flag
manuelmauro Oct 10, 2024
4436a8c
fix: removed --local flag from zkstackup invocations
manuelmauro Oct 10, 2024
28dfeb2
fix: add missing --path options to zkstackup invocations
manuelmauro Oct 10, 2024
699f476
fix: one more missing --path option
manuelmauro Oct 10, 2024
f6e7037
fix: missing ;; in --global option parsing
manuelmauro Oct 10, 2024
40bc139
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 10, 2024
08b1232
refactor: lint code
manuelmauro Oct 10, 2024
6eb730c
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 11, 2024
edf1e07
fix: correctly invoke zkstackup in CI
manuelmauro Oct 11, 2024
9622e34
fix: use ZKSYNC_HOME instead of relative path
manuelmauro Oct 11, 2024
a283d8b
fix: use sudo for global installation
manuelmauro Oct 11, 2024
0c94073
Revert "fix: use sudo for global installation"
manuelmauro Oct 11, 2024
5a65009
fix: install zkstack locally
manuelmauro Oct 11, 2024
3eb7a0a
fix: use local installation of zkstack
manuelmauro Oct 11, 2024
4c56f4f
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 11, 2024
e04d7ee
test: test zkstackup install script in CI
manuelmauro Oct 11, 2024
2dafd48
fix: use relative path instead of ZKSYNC_HOME
manuelmauro Oct 11, 2024
7b37fcb
fix: update BIN_PATH variable when --global option is submitted
manuelmauro Oct 11, 2024
96c6ae2
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 11, 2024
f13106f
fix: fix global installation for zkstackup
manuelmauro Oct 11, 2024
a3a0d4c
fix: fix relative path invocation of install script
manuelmauro Oct 11, 2024
14c4c1a
refactor: remove zkstackup folder from GITHUB_PATH
manuelmauro Oct 11, 2024
cd2ebe4
fix: keep a bunch of zkstackup in GITHUB_PATH
manuelmauro Oct 11, 2024
28f1314
feat: configure githooks in zk
manuelmauro Oct 11, 2024
989a0ad
refactor: minimize use of zkstackup in GITHUB_PATH
manuelmauro Oct 11, 2024
9173320
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 11, 2024
51a85ad
refactor: configure git hooks in zkstackup
manuelmauro Oct 11, 2024
5dbb2d2
fix: setup hooks only if inside a git repo
manuelmauro Oct 11, 2024
211c048
docs: add TODO for code that must be removed in a future PR
manuelmauro Oct 14, 2024
3548fd3
fix: restore contracts submodule
manuelmauro Oct 14, 2024
e8c1d14
Merge branch 'main' into manuel-redesign-zk-toolbox-commands
manuelmauro Oct 14, 2024
dfc9349
docs: suggest the use of zkstackup for zkstack installation
manuelmauro Oct 14, 2024
c7cbfa5
feat: add --local alias for --path ./
manuelmauro Oct 14, 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
25 changes: 20 additions & 5 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,29 @@
RED='\033[0;31m'
NC='\033[0m' # No Color

# Common prompts
INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup"
FORMAT_PROMPT="Please format the code via 'zkstack dev fmt', cannot push unformatted code"

# Check that prettier formatting rules are not violated.
if which zk_supervisor >/dev/null; then
if ! zk_supervisor fmt --check; then
if which zkstack >/dev/null; then
if ! zkstack dev fmt --check; then
manuelmauro marked this conversation as resolved.
Show resolved Hide resolved
echo -e "${RED}Push error!${NC}"
echo "Please format the code via 'zks fmt', cannot push unformatted code"
echo -e "${FORMAT_PROMPT}"
exit 1
fi
else
echo "Please install zk_toolbox using zkup from https://github.com/matter-labs/zksync-era/tree/main/zk_toolbox/zkup, and then run ./bin/zkt from the zksync-era repository."
exit 1
if which zk_supervisor >/dev/null; then
echo -e "${RED}WARNING: zkup, zk_inception/zki, and zk_supervisor/zks are DEPRECATED.${NC}"
echo -e "${RED}${INSTALL_PROPT}${NC}"

if ! zk_supervisor fmt --check; then
echo -e "${RED}Push error!${NC}"
echo -e "${FORMAT_PROMPT}"
exit 1
fi
else
echo -e "${INSTALL_PROPT}"
exit 1
fi
fi
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
- [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor lint`.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.
4 changes: 2 additions & 2 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"release-type": "simple",
"component": "prover"
},
"zk_toolbox": {
"zkstack_cli": {
"release-type": "simple",
"component": "zk_toolbox",
"component": "zkstack_cli",
"plugins": [
"cargo-workspace"
]
Expand Down
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "24.28.0",
"prover": "16.5.0",
"zk_toolbox": "0.1.2"
"zkstack_cli": "0.1.2"
}
8 changes: 6 additions & 2 deletions .github/workflows/build-contract-verifier-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,19 @@ jobs:
ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
ci_run ./bin/zkt || true
ci_run ./bin/zk || true
ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key

- name: install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
ci_run zkstackup -g --path ./

- name: build contracts
if: env.BUILD_CONTRACTS == 'true'
run: |
ci_run cp etc/tokens/{test,localhost}.json
ci_run zk_supervisor contracts
ci_run zkstack dev contracts

- name: Login to Docker registries
if: ${{ inputs.action == 'push' }}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,18 @@ jobs:
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
ci_run ./bin/zk || true
ci_run ./bin/zkt || true
ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key

- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
ci_run zkstackup -g --path ./

- name: build contracts
if: env.BUILD_CONTRACTS == 'true'
run: |
ci_run cp etc/tokens/{test,localhost}.json
ci_run zk_supervisor contracts
ci_run zkstack dev contracts

- name: Login to Docker registries
if: ${{ inputs.action == 'push' }}
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/build-local-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ jobs:
mkdir -p ./volumes/postgres
run_retried docker compose pull zk postgres
docker compose up -d zk postgres

- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
ci_run zkstackup -g

- name: init
run: |
Expand All @@ -61,9 +66,11 @@ jobs:
ci_run git config --global --add safe.directory /usr/src/zksync/contracts

ci_run zk
ci_run zkt
ci_run cp etc/tokens/{test,localhost}.json
ci_run zk_supervisor contracts

- name: build contracts
run: |
ci_run zkstack dev contracts

- name: update-image
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/ci-common-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ jobs:
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
mkdir -p ./volumes/postgres
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres

- name: Init
- name: Install zkstack
run: |
ci_run zkt
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup
ci_run zkstackup -g --path ./

# This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo
# `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build
- name: Lints
run: ci_run zk_supervisor lint -t rs --check
run: ci_run zkstack dev lint -t rs --check

24 changes: 15 additions & 9 deletions .github/workflows/ci-core-lint-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,30 @@ jobs:
- name: Start services
run: |
ci_localnet_up

- name: Install zkstack
run: |
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup
ci_run zkstackup -g --path ./

- name: Build
run: |
ci_run ./bin/zkt
ci_run yarn install
ci_run git config --global --add safe.directory /usr/src/zksync
ci_run zk_supervisor db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}

- name: Database setup
run: |
ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}

- name: Lints
run: |
ci_run zk_supervisor fmt --check
ci_run zk_supervisor lint -t md --check
ci_run zk_supervisor lint -t sol --check
ci_run zk_supervisor lint -t js --check
ci_run zk_supervisor lint -t ts --check
ci_run zk_supervisor lint -t rs --check
ci_run zkstack dev fmt --check
ci_run zkstack dev lint -t md --check
ci_run zkstack dev lint -t sol --check
ci_run zkstack dev lint -t js --check
ci_run zkstack dev lint -t ts --check
ci_run zkstack dev lint -t rs --check

- name: Check Database
run: |
ci_run zk_supervisor database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
Loading
Loading