Skip to content

Commit

Permalink
Remove DEBUG usage
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Dec 5, 2024
1 parent 8417b29 commit 92d5c25
Show file tree
Hide file tree
Showing 48 changed files with 80 additions and 111 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This provide an interactive environment for debugging the CI test.

## Debugging

Logging goes through the [DebugLogger](yarn-project/foundation/src/log/debug.ts) module in Typescript. To see the log output, set a `DEBUG` environment variable to the name of the module you want to debug, to `aztec:*`, or to `*` to see all logs.
Logging goes through the [DebugLogger](yarn-project/foundation/src/log/debug.ts) module in Typescript. `LOG_LEVEL` controls the default log level, and one can set alternate levels for specific modules, such as `debug; warn: module1, module2; error: module3`.

## Releases

Expand Down
4 changes: 2 additions & 2 deletions aztec-up/bin/.aztec-run
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ while [[ "$#" -gt 0 ]]; do
done

DOCKER_ENV="-e HOME=$HOME"
if ! [ -z "${DEBUG:-}" ] ; then
DOCKER_ENV="-e DEBUG=$DEBUG"
if ! [ -z "${LOG_LEVEL:-}" ] ; then
DOCKER_ENV="-e LOG_LEVEL=$LOG_LEVEL"
fi
for env in ${ENV_VARS_TO_INJECT:-}; do
# SSH_AUTH_SOCK must be handled separately
Expand Down
2 changes: 1 addition & 1 deletion aztec-up/bin/docker-compose.sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
ports:
- "${PXE_PORT:-8080}:${PXE_PORT:-8080}"
environment:
DEBUG: # Loaded from the user shell if explicitly set
LOG_LEVEL: # Loaded from the user shell if explicitly set
HOST_WORKDIR: "${PWD}" # Loaded from the user shell to show log files absolute path in host
ETHEREUM_HOST: ${ETHEREUM_HOST:-http://ethereum}:${ANVIL_PORT:-8545}
L1_CHAIN_ID: 31337
Expand Down
1 change: 0 additions & 1 deletion aztec-up/bin/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ services:
txe:
image: "aztecprotocol/aztec"
environment:
DEBUG: # Loaded from the user shell if explicitly set
LOG_LEVEL: # Loaded from the user shell if explicitly set
HOST_WORKDIR: "${PWD}" # Loaded from the user shell to show log files absolute path in host
volumes:
Expand Down
4 changes: 0 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ services:
platform: linux/amd64
environment:
LOG_LEVEL: ${LOG_LEVEL:-info}
DEBUG: ${DEBUG:-aztec:*,-json-rpc:*,-aztec:circuits:artifact_hash,-aztec:randomness_singleton}
DEBUG_COLORS: 1
L1_CHAIN_ID: 31337
VERSION: 1
PXE_PROVER_ENABLED: ${PXE_PROVER_ENABLED:-1}
Expand Down Expand Up @@ -38,8 +36,6 @@ services:
platform: linux/amd64
environment:
LOG_LEVEL: ${LOG_LEVEL:-info}
DEBUG: ${DEBUG:-aztec:*,-json-rpc:*,-aztec:circuits:artifact_hash,-aztec:randomness_singleton,-aztec:avm_simulator:*}
DEBUG_COLORS: 1
L1_CHAIN_ID: 31337
VERSION: 1
NODE_NO_WARNINGS: 1
Expand Down
5 changes: 2 additions & 3 deletions docs/docs/reference/developer_references/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ debug_log_array(my_array);

### Start Sandbox in debug mode

Update the `DEBUG` environment variable in docker-compose.sandbox.yml to the following:
Set `LOG_LEVEL` to `verbose` or `debug`:

```yml
# ~/.aztec/docker-compose.sandbox.yml
Expand All @@ -65,8 +65,7 @@ aztec:
ports:
- "${PXE_PORT:-8080}:${PXE_PORT:-8080}"
environment:
DEBUG: aztec:simulator:client_execution_context, aztec:sandbox, aztec:avm_simulator:debug_log
LOG_LEVEL: verbose # optionally add this for more logs
LOG_LEVEL: verbose
# ...
```

Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/deploy-l1-verifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ spec:
env:
- name: NODE_NO_WARNINGS
value: "1"
- name: DEBUG
value: "aztec:*"
- name: LOG_LEVEL
value: "debug"
- name: L1_CHAIN_ID
Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/prover-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ spec:
value: "{{ .Values.proverAgent.logLevel }}"
- name: LOG_JSON
value: "1"
- name: DEBUG
value: "{{ .Values.proverAgent.debug }}"
- name: PROVER_REAL_PROOFS
value: "{{ .Values.aztec.realProofs }}"
- name: PROVER_AGENT_COUNT
Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/prover-broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ spec:
value: "{{ .Values.proverBroker.logLevel }}"
- name: LOG_JSON
value: "1"
- name: DEBUG
value: "{{ .Values.proverBroker.debug }}"
- name: PROVER_BROKER_POLL_INTERVAL_MS
value: "{{ .Values.proverBroker.pollIntervalMs }}"
- name: PROVER_BROKER_JOB_TIMEOUT_MS
Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/pxe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ spec:
value: "1"
- name: LOG_LEVEL
value: "{{ .Values.pxe.logLevel }}"
- name: DEBUG
value: "{{ .Values.pxe.debug }}"
- name: PXE_PROVER_ENABLED
value: "{{ .Values.aztec.realProofs }}"
ports:
Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/setup-l2-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ spec:
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js setup-protocol-contracts --skipProofWait --l1-chain-id {{ .Values.ethereum.chainId }}
echo "L2 contracts initialized"
env:
- name: DEBUG
value: "aztec:*"
- name: LOG_LEVEL
value: "debug"
- name: NETWORK_PUBLIC
Expand Down
2 changes: 0 additions & 2 deletions spartan/aztec-network/templates/transaction-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ spec:
value: "1"
- name: LOG_LEVEL
value: "{{ .Values.bot.logLevel }}"
- name: DEBUG
value: "{{ .Values.bot.debug }}"
- name: BOT_PRIVATE_KEY
value: "{{ .Values.bot.botPrivateKey }}"
- name: BOT_TX_INTERVAL_SECONDS
Expand Down
10 changes: 3 additions & 7 deletions spartan/aztec-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bootNode:
p2pUdpPort: 40400
nodePort: 8080
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
debug: ""
coinbaseAddress: "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
sequencer:
maxSecondsBetweenBlocks: 0
Expand Down Expand Up @@ -87,7 +87,7 @@ validator:
p2pUdpPort: 40400
nodePort: 8080
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
debug: ""
sequencer:
maxSecondsBetweenBlocks: 0
minTxsPerBlock: 1
Expand Down Expand Up @@ -117,7 +117,7 @@ proverNode:
p2pUdpPort: 40400
nodePort: 8080
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
debug: ""
proverAgent:
count: 0
pollIntervalMs: 1000
Expand All @@ -136,7 +136,6 @@ proverNode:

pxe:
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
replicas: 1
service:
nodePort: 8081
Expand All @@ -155,7 +154,6 @@ bot:
enabled: true
nodeUrl: ""
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:l2_block_stream,-aztec:world-state:database"
replicas: 1
botPrivateKey: "0xcafe"
txIntervalSeconds: 24
Expand Down Expand Up @@ -216,7 +214,6 @@ proverAgent:
gke:
spotEnabled: false
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
bb:
hardwareConcurrency: ""
nodeSelector: {}
Expand All @@ -232,7 +229,6 @@ proverBroker:
jobMaxRetries: 3
dataDirectory: ""
logLevel: "debug"
debug: "aztec:*,-aztec:avm_simulator*,-aztec:libp2p_service*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*"
nodeSelector: {}
resources: {}

Expand Down
2 changes: 1 addition & 1 deletion spartan/aztec-network/values/prover-node-with-agents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ validator:
external: true

bootNode:
debug: "aztec:*,-aztec:avm_simulator:*,-aztec:world-state:database,discv5:*,-JsonProxy:*"
debug: "discv5:*"
validator:
disabled: true

Expand Down
1 change: 0 additions & 1 deletion spartan/releases/rough-rhino/aztec-spartan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ services:
- VALIDATOR_PRIVATE_KEY=${KEY}
- SEQ_PUBLISHER_PRIVATE_KEY=${KEY}
- L1_PRIVATE_KEY=${KEY}
- DEBUG=aztec:*,-aztec:avm_simulator*,-aztec:circuits:artifact_hash,-aztec:libp2p_service,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*
- LOG_LEVEL=debug
- AZTEC_PORT=${PORT}
- P2P_ENABLED=true
Expand Down
1 change: 0 additions & 1 deletion spartan/testnet-runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ Verbose logging on Aztec nodes should be enabled by default using the following

- `LOG_JSON=1`
- `LOG_LEVEL=debug`
- `DEBUG=discv5*,aztec:*,-aztec:avm_simulator*,-aztec:circuits:artifact_hash,-json-rpc*,-aztec:world-state:database,-aztec:l2_block_stream*`

Deployments are initiated from CI by manually running the (_name pending_) workflow.

Expand Down
7 changes: 4 additions & 3 deletions yarn-project/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,16 @@ test:

run-e2e:
ARG test
ARG log_level=""
ARG debug=""
FROM +end-to-end
RUN DEBUG=$debug yarn test $test
RUN DEBUG=$debug LOG_LEVEL=$log_level yarn test $test

prover-client-test:
FROM +build
ARG test
ARG debug=""
RUN cd prover-client && DEBUG=$debug yarn test $test
ARG log_level=""
RUN cd prover-client && LOG_LEVEL=$log_level yarn test $test

# NOTE: This is not in the end-to-end Earthfile as that is entirely LOCALLY commands that will go away sometime.
# Running this inside the main builder as the point is not to run this through dockerization.
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-faucet/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ resource "aws_ecs_task_definition" "aztec-faucet" {
value = "80"
},
{
name = "DEBUG",
value = "aztec:*"
name = "LOG_LEVEL",
value = "verbose"
},
{
name = "RPC_URL",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
ports:
- '${SANDBOX_PXE_PORT:-8080}:8080'
environment:
DEBUG: # Loaded from the user shell if explicitly set
LOG_LEVEL: # Loaded from the user shell if explicitly set
HOST_WORKDIR: '${PWD}' # Loaded from the user shell to show log files absolute path in host
ETHEREUM_HOST: http://ethereum:8545
L1_CHAIN_ID: 31337
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"build:dev": "tsc -b --watch",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests",
"run:example:token": "DEBUG='aztec:*' node ./dest/examples/token.js"
"run:example:token": "LOG_LEVEL='verbose' node ./dest/examples/token.js"
},
"inherits": [
"../package.common.json"
Expand Down Expand Up @@ -114,4 +114,4 @@
"engines": {
"node": ">=18"
}
}
}
4 changes: 0 additions & 4 deletions yarn-project/aztec/terraform/node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ resource "aws_ecs_task_definition" "aztec-node" {
name = "AZTEC_PORT"
value = "80"
},
{
name = "DEBUG"
value = "aztec:*,-json-rpc:json_proxy:*,-aztec:avm_simulator:*"
},
{
name = "ETHEREUM_HOST"
value = "${local.eth_host}"
Expand Down
1 change: 0 additions & 1 deletion yarn-project/aztec/terraform/prover-node/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ resource "aws_ecs_task_definition" "aztec-prover-node" {
{ name = "NODE_ENV", value = "production" },
{ name = "LOG_LEVEL", value = "verbose" },
{ name = "LOG_JSON", value = "1" },
{ name = "DEBUG", value = "aztec:*,-json-rpc:json_proxy:*,-aztec:avm_simulator:*" },
{ name = "DEPLOY_TAG", value = var.DEPLOY_TAG },
{ name = "NETWORK_NAME", value = "${var.DEPLOY_TAG}" },
{ name = "ETHEREUM_HOST", value = "${local.eth_host}" },
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec/terraform/prover/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ resource "aws_ecs_task_definition" "aztec-proving-agent" {
"value": "production"
},
{
"name": "DEBUG",
"value": "aztec:*"
"name": "LOG_LEVEL",
"value": "verbose"
},
{
"name": "DEPLOY_TAG",
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/cli-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"start": "node --no-warnings ./dest/bin",
"start:debug": "node --inspect=0.0.0.0:9221 --no-warnings ./dest/bin",
"dev": "DEBUG='aztec:*' LOG_LEVEL=debug && node ./dest/bin",
"dev": "LOG_LEVEL=debug && node ./dest/bin",
"build": "yarn clean && tsc -b",
"build:dev": "tsc -b --watch",
"clean": "rm -rf ./dest .tsbuildinfo",
Expand Down Expand Up @@ -100,4 +100,4 @@
"engines": {
"node": ">=18"
}
}
}
8 changes: 4 additions & 4 deletions yarn-project/end-to-end/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"clean": "rm -rf ./dest .tsbuildinfo",
"formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src",
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
"test": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test:with-alerts": "./scripts/test-with-alerts.sh",
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000 --forceExit",
"test:profile": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 0x --output-dir \"flame_graph/{pid}.0x\" -- node --experimental-vm-modules ../node_modules/jest/bin/jest.js --runInBand --testTimeout=300000 --forceExit",
"serve:flames": "python3 -m http.server --directory \"flame_graph\" 8000",
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test:debug": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --inspect --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test:integration": "concurrently -k -s first -c reset,dim -n test,anvil \"yarn test:integration:run\" \"anvil\"",
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --no-cache --runInBand --config jest.integration.config.json",
"test:unit": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest src/fixtures"
Expand Down Expand Up @@ -156,4 +156,4 @@
"testRegex": "./src/.*\\.test\\.(js|mjs|ts)$",
"rootDir": "./src"
}
}
}
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/package.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"scripts": {
"build": "yarn clean && tsc -b && webpack",
"formatting": "run -T prettier --check ./src \"!src/web/main.js\" && run -T eslint ./src",
"test": "LOG_LEVEL=${LOG_LEVEL:-verbose} DEBUG_COLORS=1 NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test": "LOG_LEVEL=${LOG_LEVEL:-verbose} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=300000 --forceExit",
"test:unit": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest src/fixtures"
}
}
}
3 changes: 1 addition & 2 deletions yarn-project/end-to-end/scripts/docker-compose-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ services:
- aztec-node-url
- faucet-url
environment:
DEBUG: ${DEBUG:-'aztec:*'}
DEBUG_COLORS: 1
LOG_LEVEL: ${LOG_LEVEL:-'verbose'}
ETHEREUM_HOST:
JOB_NAME: ${JOB_NAME:-''}
PXE_PROVER_ENABLED: ${PXE_PROVER_ENABLED:-1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ services:
image: aztecprotocol/end-to-end:${AZTEC_DOCKER_TAG:-latest}
environment:
BENCHMARK: 'true'
DEBUG: ${DEBUG:-'aztec:*'}
DEBUG_COLORS: 1
LOG_LEVEL: ${LOG_LEVEL:-'verbose'}
ETHEREUM_HOST: http://fork:8545
L1_CHAIN_ID: 31337
ARCHIVER_POLLING_INTERVAL_MS: 50
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/end-to-end/scripts/docker-compose-p2p.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
- '40400:40400/tcp'
- '40400:40400/udp'
environment:
DEBUG: 'aztec:*'
DEBUG_COLORS: 1
LOG_LEVEL: ${LOG_LEVEL:-'verbose'}
DEBUG: ${DEBUG:-""}
P2P_TCP_LISTEN_ADDR: '0.0.0.0:40400'
P2P_TCP_ANNOUNCE_ADDR: 'p2p-bootstrap:40400'
P2P_UDP_ANNOUNCE_ADDR: 'p2p-bootstrap:40400'
Expand All @@ -25,8 +25,8 @@ services:
image: aztecprotocol/end-to-end:${AZTEC_DOCKER_TAG:-latest}
environment:
BENCHMARK: true
DEBUG: ${DEBUG:-'aztec:*'}
DEBUG_COLORS: 1
LOG_LEVEL: ${LOG_LEVEL:-'verbose'}
DEBUG: ${DEBUG:-""}
ETHEREUM_HOST: http://fork:8545
L1_CHAIN_ID: 31337
ARCHIVER_POLLING_INTERVAL_MS: 500
Expand Down
Loading

0 comments on commit 92d5c25

Please sign in to comment.