Skip to content

Commit

Permalink
chore(en): Add sepolia en config (#663)
Browse files Browse the repository at this point in the history
## What ❔

- marks goerli testnet EN config as deprecated
- adds sepolia testnet EN config
- removes `EN_BOOTLOADER_HASH`, `EN_DEFAULT_AA_HASH` from configs as
these vars are not used anymore

## Why ❔

Prepare docs for sepolia testnet EN launch

## 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 fmt` and `zk lint`.
- [x] Spellcheck has been run via `cargo spellcheck
--cfg=./spellcheck/era.cfg --code 1`.
  • Loading branch information
perekopskiy authored Dec 12, 2023
1 parent 7120f55 commit ba861ae
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/guides/external-node/02_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

This document outlines various configuration options for the EN. Currently, the EN requires the definition of numerous
environment variables. To streamline this process, we provide prepared configs for the zkSync Era - for both
[mainnet](prepared_configs/mainnet-config.env) and [testnet](prepared_configs/testnet-config.env). You can use these
files as a starting point and modify only the necessary sections.
[mainnet](prepared_configs/mainnet-config.env) and [testnet](prepared_configs/testnet-sepolia-config.env). You can use
these files as a starting point and modify only the necessary sections.

## Database

Expand All @@ -20,7 +20,7 @@ recommended to use an NVME SSD for RocksDB. RocksDB requires two variables to be
## L1 Web3 client

EN requires a connection to an Ethereum node. The corresponding env variable is `EN_ETH_CLIENT_URL`. Make sure to set
the URL corresponding to the correct L1 network (L1 mainnet for L2 mainnet and L1 goerli for L2 testnet).
the URL corresponding to the correct L1 network (L1 mainnet for L2 mainnet and L1 sepolia for L2 testnet).

Note: Currently, the EN makes 2 requests to the L1 per L1 batch, so the Web3 client usage for a synced node should not
be high. However, during the synchronization phase the new batches would be persisted on the EN quickly, so make sure
Expand Down
3 changes: 0 additions & 3 deletions docs/guides/external-node/prepared_configs/mainnet-config.env
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ EN_MAIN_NODE_URL=https://zksync2-mainnet.zksync.io
EN_L2_CHAIN_ID=324
EN_L1_CHAIN_ID=1

EN_BOOTLOADER_HASH=0x010007794e73f682ad6d27e86b6f71bbee875fc26f5708d1713e7cfd476098d3
EN_DEFAULT_AA_HASH=0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc

# Optional, required only if sentry is configured.
EN_SENTRY_ENVIRONMENT=zksync_mainnet

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ EN_MAIN_NODE_URL=https://zksync2-testnet.zksync.dev
EN_L2_CHAIN_ID=280
EN_L1_CHAIN_ID=5

EN_BOOTLOADER_HASH=0x010007794e73f682ad6d27e86b6f71bbee875fc26f5708d1713e7cfd476098d3
EN_DEFAULT_AA_HASH=0x0100067d861e2f5717a12c3e869cfb657793b86bbb0caa05cc1421f16c5217bc

# Optional, required only if sentry is configured.
EN_SENTRY_ENVIRONMENT=zksync_testnet

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ------------------------------------------------------------------------
# -------------- YOU MUST CHANGE THE FOLLOWING VARIABLES -----------------
# ------------------------------------------------------------------------

# URL of the Postgres DB.
DATABASE_URL=postgres://postgres@localhost/zksync_local_ext_node
# PostgreSQL connection pool size
DATABASE_POOL_SIZE=50

# Folder where the state_keeper cache will be stored (RocksDB).
# If containerized, this path should be mounted to a volume.
EN_STATE_CACHE_PATH=./db/ext-node/state_keeper
# Folder where the Merkle Tree will be stored (RocksDB).
# If containerized, this path should be mounted to a volume.
EN_MERKLE_TREE_PATH=./db/ext-node/lightweight

# URL of the Ethereum client (e.g. infura / alchemy).
EN_ETH_CLIENT_URL=http://127.0.0.1:8545

# ------------------------------------------------------------------------
# -------------- YOU MAY CONFIGURE THE FOLLOWING VARIABLES ---------------
# ------------------------------------------------------------------------

# Port on which to serve the HTTP JSONRPC API.
EN_HTTP_PORT=3060
# Port on which to serve the WebSocket JSONRPC API.
EN_WS_PORT=3061

# Port on which to serve metrics to be collected by Prometheus.
# If not set, metrics won't be collected.
# EN_PROMETHEUS_PORT=3322

# Port on which to serve the healthcheck endpoint (to check if the service is live).
EN_HEALTHCHECK_PORT=3081

# Max possible limit of entities to be requested at once.
EN_REQ_ENTITIES_LIMIT=10000
# Max possible limit of filters to be active at once.
EN_FILTERS_LIMIT=10000
# Max possible limit of subscriptions to be active at once.
EN_SUBSCRIPTIONS_LIMIT=10000
# Interval for polling the DB for pubsub (in ms).
EN_PUBSUB_POLLING_INTERVAL=200
# Number of threads per API server.
EN_THREADS_PER_SERVER=128
# Tx nonce: how far ahead from the committed nonce can it be.
# This shouldn't be larger than the value on the main node (50).
EN_MAX_NONCE_AHEAD=50
# The multiplier to use when suggesting gas price. Should be higher than one,
# otherwise if the L1 prices soar, the suggested gas price won't be sufficient to be included in block.
EN_GAS_PRICE_SCALE_FACTOR=1.2
# The factor by which to scale the gasLimit
EN_ESTIMATE_GAS_SCALE_FACTOR=1.2
# The max possible number of gas that `eth_estimateGas` is allowed to overestimate.
EN_ESTIMATE_GAS_ACCEPTABLE_OVERESTIMATION=1000
# Max possible size of an ABI encoded tx (in bytes).
# This shouldn't be larger than the value on the main node.
EN_MAX_TX_SIZE=1000000
# Enabled JSON-RPC API namespaces. Also available: en, debug.
EN_API_NAMESPACES=eth,net,web3,zks,pubsub

# Settings related to sentry and opentelemetry.
MISC_LOG_FORMAT=plain
MISC_SENTRY_URL=unset
MISC_SENTRY_PANIC_INTERVAL=1800
MISC_SENTRY_ERROR_INTERVAL=10800
MISC_OTLP_URL=unset

# Settings related to Rust logging and backtraces.
# You can read about the format [here](https://docs.rs/env_logger/0.10.0/env_logger/#enabling-logging) to fine-tune logging.
RUST_LOG=zksync_core=debug,zksync_dal=info,zksync_eth_client=info,zksync_merkle_tree=info,zksync_storage=info,zksync_state=debug,zksync_types=info,vm=info,zksync_external_node=info,zksync_utils=debug,
RUST_BACKTRACE=full
RUST_LIB_BACKTRACE=1


# ------------------------------------------------------------------------
# -------------- THE FOLLOWING VARIABLES DEPEND ON THE ENV ---------------
# ------------------------------------------------------------------------

# URL of the main zkSync node.
EN_MAIN_NODE_URL=https://sepolia.era.zksync.dev

EN_L2_CHAIN_ID=300
EN_L1_CHAIN_ID=11155111

# Optional, required only if sentry is configured.
EN_SENTRY_ENVIRONMENT=zksync_testnet

# ------------------------------------------------------------------------
# -------------- THE FOLLOWING VARIABLES ARE NOT USED --------------------
# -------------- BUT HAVE TO BE SET. JUST LEAVE THEM AS IS ---------------
# ------------------------------------------------------------------------

ZKSYNC_HOME=/

0 comments on commit ba861ae

Please sign in to comment.