diff --git a/docker/Makefile b/docker/Makefile index d4b946804085..d7dc80c6f348 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -55,7 +55,7 @@ check-tools: check-nodejs check-yarn check-rust check-sqlx-cli check-docker chec # Check that contracts are checkout properly check-contracts: - @if [ ! -d ../contracts/l1-contracts/lib/forge-std/foundry.toml ] || [ -z "$$(ls -A ../contracts/l1-contracts/lib/forge-std/foundry.toml)" ]; then \ + @if [ -z "$$(ls -A ../contracts/l1-contracts/lib/forge-std/foundry.toml)" ]; then \ echo "l1-contracts git submodule is missing. Please re-download repo with 'git clone --recurse-submodules https://github.com/matter-labs/zksync-era.git'"; \ exit 1; \ fi @@ -65,8 +65,7 @@ check-contracts: prepare-contracts: check-tools check-contracts @cd ../ && \ export ZKSYNC_HOME=$$(pwd) && \ - export PATH=$$PATH:$${ZKSYNC_HOME}/bin && \ - export PATH=$$PATH:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ + export PATH=$$PATH:$${ZKSYNC_HOME}/bin:$${ZKSYNC_HOME}/zkstack_cli/zkstackup && \ zkt || true && \ zk_supervisor contracts && \ mkdir -p contracts/l1-contracts/artifacts diff --git a/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile b/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile index 79d3bb3d6af5..90f089ba8bd4 100644 --- a/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile +++ b/docker/zk-environment/20.04_amd64_cuda_11_8.Dockerfile @@ -104,9 +104,7 @@ RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ # Setup the environment ENV ZKSYNC_HOME=/usr/src/zksync -ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" \ - PATH="${ZKSYNC_HOME}/zkstack_cli/zkstackup:${PATH}" \ - PATH="${HOME}/.local/bin:${PATH}" +ENV PATH="${ZKSYNC_HOME}/bin:${ZKSYNC_HOME}/zkstack_cli/zkstackup:${HOME}/.local/bin:${PATH}" ENV CI=1 RUN cargo install sccache ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache diff --git a/docker/zk-environment/20.04_amd64_cuda_12_0.Dockerfile b/docker/zk-environment/20.04_amd64_cuda_12_0.Dockerfile index 48bd4469639f..b6b023a5b7f4 100644 --- a/docker/zk-environment/20.04_amd64_cuda_12_0.Dockerfile +++ b/docker/zk-environment/20.04_amd64_cuda_12_0.Dockerfile @@ -93,9 +93,7 @@ RUN wget -c https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksol # Setup the environment ENV ZKSYNC_HOME=/usr/src/zksync -ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" \ - PATH="${ZKSYNC_HOME}/zkstack_cli/zkstackup:${PATH}" \ - PATH="${HOME}/.local/bin:${PATH}" +ENV PATH="${ZKSYNC_HOME}/bin:${ZKSYNC_HOME}/zkstack_cli/zkstackup:${HOME}/.local/bin:${PATH}" ENV CI=1 RUN cargo install sccache ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache diff --git a/docker/zk-environment/Dockerfile b/docker/zk-environment/Dockerfile index 04b2cb947a0d..c04e5720e4d7 100644 --- a/docker/zk-environment/Dockerfile +++ b/docker/zk-environment/Dockerfile @@ -164,9 +164,7 @@ RUN wget -c https://sourceware.org/pub/valgrind/valgrind-3.20.0.tar.bz2 && \ # Setup the environment ENV ZKSYNC_HOME=/usr/src/zksync -ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" \ - PATH="${ZKSYNC_HOME}/zkstack_cli/zkstackup:${PATH}" \ - PATH="${HOME}/.local/bin:${PATH}" +ENV PATH="${ZKSYNC_HOME}/bin:${ZKSYNC_HOME}/zkstack_cli/zkstackup:${HOME}/.local/bin:${PATH}" ENV CI=1 ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache diff --git a/docs/guides/external-node/00_quick_start.md b/docs/guides/external-node/00_quick_start.md index 67a1b89eef51..b24571d342fc 100644 --- a/docs/guides/external-node/00_quick_start.md +++ b/docs/guides/external-node/00_quick_start.md @@ -6,6 +6,8 @@ Install `docker compose` and `Docker` ## Running ZKsync node locally +These commands start ZKsync node locally inside docker. + To start a mainnet instance, run: ```sh @@ -34,9 +36,10 @@ cd docker-compose-examples sudo docker compose --file testnet-external-node-docker-compose.yml down --volumes ``` -You can see the status of the node (after recovery) in [local grafana dashboard](http://localhost:3000/dashboards). +### Observability -Those commands start ZKsync node locally inside docker. +You can see the status of the node (after recovery) in [local grafana dashboard](http://localhost:3000/dashboards). +You can also access a debug page with more information about the node [here](http://localhost:5000). The HTTP JSON-RPC API can be accessed on port `3060` and WebSocket API can be accessed on port `3061`. diff --git a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/Consensus.json b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/Consensus.json index be869ead40b2..74b4b8228016 100644 --- a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/Consensus.json +++ b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/Consensus.json @@ -24,7 +24,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 3, + "id": 2, "links": [], "liveNow": false, "panels": [ @@ -1005,7 +1005,7 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "description": "Rate of RPC client requests, in packets per second.", + "description": "Rate of RPC client requests, in requests per second.", "fieldConfig": { "defaults": { "color": { @@ -1054,7 +1054,7 @@ } ] }, - "unit": "pps" + "unit": "reqps" }, "overrides": [] }, @@ -1098,7 +1098,7 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "description": "Rate of RPC server responses, in packets per second.", + "description": "Rate of RPC server responses, in requests per second.", "fieldConfig": { "defaults": { "color": { @@ -1147,7 +1147,7 @@ } ] }, - "unit": "pps" + "unit": "reqps" }, "overrides": [] }, @@ -1202,6 +1202,6 @@ "timezone": "", "title": "Consensus", "uid": "STAAEORNk", - "version": 4, + "version": 2, "weekStart": "" } \ No newline at end of file diff --git a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/General.json b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/General.json index d7177ae802ef..0b3cb681e3be 100644 --- a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/General.json +++ b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/General.json @@ -24,7 +24,7 @@ "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, - "id": 2, + "id": 1, "links": [], "liveNow": false, "panels": [ @@ -103,13 +103,49 @@ "mode": "palette-classic" }, "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 0, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" } }, "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, "unit": "bytes" }, "overrides": [] @@ -123,18 +159,11 @@ "id": 2, "options": { "legend": { + "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, "tooltip": { "mode": "single", "sort": "none" @@ -167,7 +196,7 @@ } ], "title": "Total disk space usage", - "type": "piechart" + "type": "timeseries" }, { "datasource": { @@ -409,6 +438,7 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "description": "Shows the batch numbers on the local node and the server node.", "fieldConfig": { "defaults": { "color": { @@ -421,7 +451,7 @@ "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", - "fillOpacity": 33, + "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, @@ -470,13 +500,13 @@ "x": 12, "y": 16 }, - "id": 4, + "id": 39, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": false + "showLegend": true }, "tooltip": { "mode": "single", @@ -489,14 +519,28 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "editorMode": "builder", "exemplar": true, - "expr": "sum by (stage) (external_node_sync_lag)", + "expr": "sum by(stage) (external_node_fetcher_l1_batch{stage=\"open\"})", "interval": "", - "legendFormat": "", + "legendFormat": "Server", + "range": true, "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "zksync_consensus_storage_batch_store_next_persisted_batch", + "hide": false, + "legendFormat": "Local", + "range": true, + "refId": "B" } ], - "title": "Sync lag (blocks)", + "title": "L1 batch sync lag", "transformations": [], "type": "timeseries" }, @@ -546,8 +590,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -598,7 +641,6 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "description": "The percentage of transactions that are being reverted or that are succeeding.", "fieldConfig": { "defaults": { "color": { @@ -610,8 +652,8 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, - "drawStyle": "bars", - "fillOpacity": 0, + "drawStyle": "line", + "fillOpacity": 33, "gradientMode": "none", "hideFrom": { "legend": false, @@ -619,16 +661,19 @@ "viz": false }, "lineInterpolation": "linear", - "lineWidth": 2, + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", - "spanNulls": false, + "spanNulls": true, "stacking": { "group": "A", - "mode": "percent" + "mode": "none" }, "thresholdsStyle": { "mode": "off" @@ -639,8 +684,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -657,13 +701,13 @@ "x": 12, "y": 24 }, - "id": 38, + "id": 4, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", - "showLegend": true + "showLegend": false }, "tooltip": { "mode": "single", @@ -676,14 +720,15 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "builder", - "expr": "sum by(status) (increase(server_state_keeper_tx_execution_result[1h]))", - "legendFormat": "__auto", - "range": true, + "exemplar": true, + "expr": "sum by (stage) (external_node_sync_lag)", + "interval": "", + "legendFormat": "", "refId": "A" } ], - "title": "Transactions execution status (%)", + "title": "L2 blocks sync lag", + "transformations": [], "type": "timeseries" }, { @@ -731,8 +776,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -778,6 +822,98 @@ "title": "Avg number of transactions in L2 block", "type": "timeseries" }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "The percentage of transactions that are being reverted or that are succeeding.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "percent" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 38, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "expr": "sum by(status) (increase(server_state_keeper_tx_execution_result[1h]))", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Transactions execution status (%)", + "type": "timeseries" + }, { "datasource": { "type": "prometheus", @@ -823,8 +959,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -839,7 +974,7 @@ "h": 8, "w": 12, "x": 12, - "y": 32 + "y": 40 }, "id": 34, "options": { @@ -886,6 +1021,6 @@ "timezone": "", "title": "General", "uid": "1", - "version": 9, + "version": 3, "weekStart": "" } \ No newline at end of file diff --git a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/default.yml b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/default.yml index 65f33c78b0e0..fac65298bbc0 100644 --- a/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/default.yml +++ b/docs/guides/external-node/docker-compose-examples/grafana/provisioning/dashboards/default.yml @@ -5,6 +5,7 @@ providers: orgId: 1 folder: '' type: file + allowUiUpdates: true disableDeletion: false updateIntervalSeconds: 10 # How often Grafana will scan for changed dashboards options: