Skip to content

Commit 114834f

Browse files
feat(zk_toolbox): Redesign zk_toolbox commands (#3003)
## What ❔ <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> - merge `zk_supervisor` and `zk_inception`. `zk_supervisor` commands would be available in `zk_inception dev` subcommand. - rename `zk_inception` to `zkstack` - rename `zk_toolbox` to `ZK Stack CLI` (in human-readable context) and `zkstack_cli` (in "code" context, e.g. workspace name) - rename `zkup` to `zkstackup` similarly to `foundryup` and `rustup`. - remove `zks` and `zki` aliases - update all the docs in the repo and make sure that new naming is consistently used ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [x] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor lint`. --------- Co-authored-by: Danil <deniallugo@gmail.com>
1 parent 15fe5a6 commit 114834f

File tree

264 files changed

+1103
-1457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

264 files changed

+1103
-1457
lines changed

.githooks/pre-push

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,29 @@
66
RED='\033[0;31m'
77
NC='\033[0m' # No Color
88

9+
# Common prompts
10+
INSTALL_PROPT="Please install ZK Stack CLI using zkstackup from https://github.com/matter-labs/zksync-era/tree/main/zkstack_cli/zkstackup"
11+
FORMAT_PROMPT="Please format the code via 'zkstack dev fmt', cannot push unformatted code"
12+
913
# Check that prettier formatting rules are not violated.
10-
if which zk_supervisor >/dev/null; then
11-
if ! zk_supervisor fmt --check; then
14+
if which zkstack >/dev/null; then
15+
if ! zkstack dev fmt --check; then
1216
echo -e "${RED}Push error!${NC}"
13-
echo "Please format the code via 'zks fmt', cannot push unformatted code"
17+
echo -e "${FORMAT_PROMPT}"
1418
exit 1
1519
fi
1620
else
17-
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."
18-
exit 1
21+
if which zk_supervisor >/dev/null; then
22+
echo -e "${RED}WARNING: zkup, zk_inception/zki, and zk_supervisor/zks are DEPRECATED.${NC}"
23+
echo -e "${RED}${INSTALL_PROPT}${NC}"
24+
25+
if ! zk_supervisor fmt --check; then
26+
echo -e "${RED}Push error!${NC}"
27+
echo -e "${FORMAT_PROMPT}"
28+
exit 1
29+
fi
30+
else
31+
echo -e "${INSTALL_PROPT}"
32+
exit 1
33+
fi
1934
fi

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
- [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
1818
- [ ] Tests for the changes have been added / updated.
1919
- [ ] Documentation comments have been added / updated.
20-
- [ ] Code has been formatted via `zk_supervisor fmt` and `zk_supervisor lint`.
20+
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev lint`.

.github/release-please/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"release-type": "simple",
2121
"component": "prover"
2222
},
23-
"zk_toolbox": {
23+
"zkstack_cli": {
2424
"release-type": "simple",
25-
"component": "zk_toolbox",
25+
"component": "zkstack_cli",
2626
"plugins": [
2727
"cargo-workspace"
2828
]

.github/release-please/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"core": "24.28.0",
33
"prover": "16.5.0",
4-
"zk_toolbox": "0.1.2"
4+
"zkstack_cli": "0.1.2"
55
}

.github/workflows/build-contract-verifier-template.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,19 @@ jobs:
113113
ci_run git config --global --add safe.directory /usr/src/zksync/sdk/binaryen
114114
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
115115
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
116-
ci_run ./bin/zkt || true
117116
ci_run ./bin/zk || true
118117
ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key
119118
119+
- name: install zkstack
120+
run: |
121+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
122+
ci_run zkstackup -g --local
123+
120124
- name: build contracts
121125
if: env.BUILD_CONTRACTS == 'true'
122126
run: |
123127
ci_run cp etc/tokens/{test,localhost}.json
124-
ci_run zk_supervisor contracts
128+
ci_run zkstack dev contracts
125129
126130
- name: Login to Docker registries
127131
if: ${{ inputs.action == 'push' }}

.github/workflows/build-core-template.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,18 @@ jobs:
127127
ci_run git config --global --add safe.directory /usr/src/zksync/contracts/system-contracts
128128
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
129129
ci_run ./bin/zk || true
130-
ci_run ./bin/zkt || true
131130
ci_run run_retried curl -LO https://storage.googleapis.com/matterlabs-setup-keys-us/setup-keys/setup_2\^26.key
131+
132+
- name: Install zkstack
133+
run: |
134+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
135+
ci_run zkstackup -g --local
132136
133137
- name: build contracts
134138
if: env.BUILD_CONTRACTS == 'true'
135139
run: |
136140
ci_run cp etc/tokens/{test,localhost}.json
137-
ci_run zk_supervisor contracts
141+
ci_run zkstack dev contracts
138142
139143
- name: Login to Docker registries
140144
if: ${{ inputs.action == 'push' }}

.github/workflows/build-local-node-docker.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ jobs:
5353
mkdir -p ./volumes/postgres
5454
run_retried docker compose pull zk postgres
5555
docker compose up -d zk postgres
56+
57+
- name: Install zkstack
58+
run: |
59+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup || true
60+
ci_run zkstackup -g
5661
5762
- name: init
5863
run: |
@@ -61,9 +66,11 @@ jobs:
6166
ci_run git config --global --add safe.directory /usr/src/zksync/contracts
6267
6368
ci_run zk
64-
ci_run zkt
6569
ci_run cp etc/tokens/{test,localhost}.json
66-
ci_run zk_supervisor contracts
70+
71+
- name: build contracts
72+
run: |
73+
ci_run zkstack dev contracts
6774
6875
- name: update-image
6976
run: |

.github/workflows/ci-common-reusable.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,14 @@ jobs:
2929
run_retried docker-compose -f ${RUNNER_COMPOSE_FILE} pull
3030
mkdir -p ./volumes/postgres
3131
docker-compose -f ${RUNNER_COMPOSE_FILE} up --build -d zk postgres
32-
33-
- name: Init
32+
33+
- name: Install zkstack
3434
run: |
35-
ci_run zkt
35+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup
36+
ci_run zkstackup -g --local
3637
3738
# This does both linting and "building". We're using `zk lint prover` as it's common practice within our repo
3839
# `zk lint prover` = cargo clippy, which does cargo check behind the scenes, which is a lightweight version of cargo build
3940
- name: Lints
40-
run: ci_run zk_supervisor lint -t rs --check
41+
run: ci_run zkstack dev lint -t rs --check
4142

.github/workflows/ci-core-lint-reusable.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,30 @@ jobs:
2626
- name: Start services
2727
run: |
2828
ci_localnet_up
29+
30+
- name: Install zkstack
31+
run: |
32+
ci_run ./zkstack_cli/zkstackup/install -g --path ./zkstack_cli/zkstackup/zkstackup
33+
ci_run zkstackup -g --local
2934
3035
- name: Build
3136
run: |
32-
ci_run ./bin/zkt
3337
ci_run yarn install
3438
ci_run git config --global --add safe.directory /usr/src/zksync
35-
ci_run zk_supervisor db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
3639
40+
- name: Database setup
41+
run: |
42+
ci_run zkstack dev db setup --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
3743
3844
- name: Lints
3945
run: |
40-
ci_run zk_supervisor fmt --check
41-
ci_run zk_supervisor lint -t md --check
42-
ci_run zk_supervisor lint -t sol --check
43-
ci_run zk_supervisor lint -t js --check
44-
ci_run zk_supervisor lint -t ts --check
45-
ci_run zk_supervisor lint -t rs --check
46+
ci_run zkstack dev fmt --check
47+
ci_run zkstack dev lint -t md --check
48+
ci_run zkstack dev lint -t sol --check
49+
ci_run zkstack dev lint -t js --check
50+
ci_run zkstack dev lint -t ts --check
51+
ci_run zkstack dev lint -t rs --check
4652
4753
- name: Check Database
4854
run: |
49-
ci_run zk_supervisor database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}
55+
ci_run zkstack dev database check-sqlx-data --prover-url=${{ env.prover_url }} --core-url=${{ env.core_url }}

0 commit comments

Comments
 (0)