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

docs: add eigenda steps to run #271

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
140 changes: 136 additions & 4 deletions content/10.zk-stack/20.running-a-zk-chain/80.validium.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,23 +181,155 @@ updates/optimizations or completely changing the DA verification logic, e.g. due
<details>
<summary>How to configure EigenDA client?</summary>

1. Add the following block to the `general.yaml`, values used are only an example:
## Common changes

Changes needed both for local and mainnet/testnet setup.

1. Add `da_client` to `etc/env/file_based/general.yaml`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about etc/env/file_based as those are the base for all the chains, I'd prefer we use a generic pattern to point to the specific chain config


```yaml
da_client:
eigen:
rpc_node_url: https://disperser-holesky.eigenda.xyz:443
inclusion_polling_interval_ms: 2000
disperser_rpc: <your_desired_disperser>
settlement_layer_confirmation_depth: -1
eigenda_eth_rpc: <your_desired_rpc>
eigenda_svc_manager_address: '0xD4A7E1Bd8015057293f0D0A557088c286942e84b'
status_query_timeout: 1800000 # ms
status_query_interval: 5 # ms
wait_for_finalization: false
authenticated: false
verify_cert: true
path_to_points: ./resources
chain_id: <your_chain_id>
```

2. Add the following block to the `secrets.yaml`:
2. Also set the private key in `etc/env/file_based/secrets.yaml`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


```yaml
da:
eigen:
private_key: YOUR_PRIVATE_KEY
```

3. (optional) for using pubdata with 2MiB (as per specification), modify `etc/env/file_based/general.yaml`:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here


```yaml
max_pubdata_per_batch: 2097152
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we actually have a limit of 761856 enforced in the system contracts
it should be removed soon, but still, let's not confuse the readers here

```

## Local Setup

1. Install `zkstack`

```bash
cargo install --path zkstack_cli/crates/zkstack --force --locked
```

2. Start containers

```bash
zkstack containers --observability true
```

3. Create `eigen_da` chain

```bash
zkstack chain create \
--chain-name eigen_da \
--chain-id sequential \
--prover-mode no-proofs \
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode validium \
--base-token-address 0x0000000000000000000000000000000000000001 \
--base-token-price-nominator 1 \
--base-token-price-denominator 1 \
--set-as-default false
```

4. Initialize created ecosystem

```bash
zkstack ecosystem init \
--deploy-paymaster true \
--deploy-erc20 true \
--deploy-ecosystem true \
--l1-rpc-url http://127.0.0.1:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_eigen_da \
--chain eigen_da \
--verbose
```

You may enable observability here if you want to.

5. Start the server

```bash
zkstack server --chain eigen_da
```

## Mainnet/Testnet setup

### Modify localhost chain id number

Modify line 32 in `zk_toolbox/crates/types/src/l1_network.rs`:

```rs
L1Network::Localhost => 17000,
```

Then recompile the zkstack:

```bash
cargo install --path zkstack_cli/crates/zkstack --force --locked
```

### Used wallets

Modify `etc/env/file_based/wallets.yaml` and `configs/wallets.yaml` with the following wallets:

```yaml
# Use your own holesky wallets, be sure they have enough funds
```

> ⚠️ Some steps distribute ~5000ETH to some wallets, modify `AMOUNT_FOR_DISTRIBUTION_TO_WALLETS` to a lower value if
> needed.

### Create and initialize the ecosystem

(be sure to have postgres container running on the background)

```bash
zkstack chain create \
--chain-name holesky_eigen_da \
--chain-id 114411 \
--prover-mode no-proofs \
--wallet-creation localhost \
--l1-batch-commit-data-generator-mode validium \
--base-token-address 0x0000000000000000000000000000000000000001 \
--base-token-price-nominator 1 \
--base-token-price-denominator 1 \
--set-as-default false

zkstack ecosystem init \
--deploy-paymaster true \
--deploy-erc20 true \
--deploy-ecosystem true \
--l1-rpc-url $HOLESKY_RPC_URL \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_holesky_eigen_da \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_holesky_eigen_da \
--chain holesky_eigen_da \
--verbose
```

### Start the server

```bash
zkstack server --chain holesky_eigen_da
```

</details>

<details>
Expand Down
1 change: 1 addition & 0 deletions cspell-config/cspell-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ celestia
Eigen
eigen
turing
eigenda