From 8cdbc1be9505778633073aad702423bd38f550b9 Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:07:51 -0300 Subject: [PATCH 1/3] Remove steps to run from integration docs --- .../da_clients/src/eigen/eigenda-client.md | 13 ++ .../src/eigen/eigenda-integration.md | 177 ------------------ 2 files changed, 13 insertions(+), 177 deletions(-) create mode 100644 core/node/da_clients/src/eigen/eigenda-client.md delete mode 100644 core/node/da_clients/src/eigen/eigenda-integration.md diff --git a/core/node/da_clients/src/eigen/eigenda-client.md b/core/node/da_clients/src/eigen/eigenda-client.md new file mode 100644 index 000000000000..cc4e2dfe11b9 --- /dev/null +++ b/core/node/da_clients/src/eigen/eigenda-client.md @@ -0,0 +1,13 @@ +# EigenDA Client + +EigenDA is as a high-throughput data availability layer for rollups. It is an EigenLayer AVS (Actively Validated +Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators. +For more information you can check the [docs](https://docs.eigenda.xyz/). + +## Scope + +The scope of this first milestone is to spin up a local EigenDA dev environment, spin up a local zksync-era dev +environment and integrate them. Instead of sending 4844 blobs, the zksync-era sends blobs to EigenDA. On L1, mock the +verification logic, such that blocks continue building. Increase the blob size from 4844 size to 2MiB blob. Deploy the +integration to Holesky testnet and provide scripts to setup a network using EigenDA as DA provider. + diff --git a/core/node/da_clients/src/eigen/eigenda-integration.md b/core/node/da_clients/src/eigen/eigenda-integration.md deleted file mode 100644 index fa31ef596d96..000000000000 --- a/core/node/da_clients/src/eigen/eigenda-integration.md +++ /dev/null @@ -1,177 +0,0 @@ -# Zksync-era <> EigenDA Integration - -EigenDA is as a high-throughput data availability layer for rollups. It is an EigenLayer AVS (Actively Validated -Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators. -For more information you can check the [docs](https://docs.eigenda.xyz/). - -## Scope - -The scope of this first milestone is to spin up a local EigenDA dev environment, spin up a local zksync-era dev -environment and integrate them. Instead of sending 4844 blobs, the zksync-era sends blobs to EigenDA. On L1, mock the -verification logic, such that blocks continue building. Increase the blob size from 4844 size to 2MiB blob. Deploy the -integration to Holesky testnet and provide scripts to setup a network using EigenDA as DA provider. - -## Common changes - -Changes needed both for local and mainnet/testnet setup. - -1. Add `da_client` to `etc/env/file_based/general.yaml`: - -```yaml -da_client: - eigen: - disperser_rpc: - eth_confirmation_depth: -1 - eigenda_eth_rpc: - eigenda_svc_manager_address: '0xD4A7E1Bd8015057293f0D0A557088c286942e84b' - blob_size_limit: 2097152 - 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: -``` - -Also set the private key in `etc/env/file_based/secrets.yaml`: - -```yaml -da: - eigen: - private_key: '' -``` - -2. (optional) for using pubdata with 2MiB (as per specification), modify `etc/env/file_based/general.yaml`: - -```yaml -max_pubdata_per_batch: 2097152 -``` - -## 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 -``` - -### Testing - -Modify the following flag in `core/lib/config/src/configs/da_dispatcher.rs` (then restart the server) - -```rs -pub const DEFAULT_USE_DUMMY_INCLUSION_DATA: bool = true; -``` - -And with the server running on one terminal, you can run the server integration tests on a separate terminal with the -following command: - -```bash -zkstack dev test integration --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 -``` From 5765f87d09dcb1d67e02a39323de323563ee4b75 Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Wed, 27 Nov 2024 09:49:51 -0300 Subject: [PATCH 2/3] Combine readme --- core/node/da_clients/src/eigen/README.md | 16 ++++++++++++---- core/node/da_clients/src/eigen/eigenda-client.md | 13 ------------- 2 files changed, 12 insertions(+), 17 deletions(-) delete mode 100644 core/node/da_clients/src/eigen/eigenda-client.md diff --git a/core/node/da_clients/src/eigen/README.md b/core/node/da_clients/src/eigen/README.md index 634b4eb58780..81aafca9cdf8 100644 --- a/core/node/da_clients/src/eigen/README.md +++ b/core/node/da_clients/src/eigen/README.md @@ -1,9 +1,17 @@ -# EigenDA client +# EigenDA Client ---- +EigenDA is as a high-throughput data availability layer for rollups. It is an EigenLayer AVS (Actively Validated +Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators. +For more information you can check the [docs](https://docs.eigenda.xyz/). -This is an implementation of the EigenDA client capable of sending the blobs to DA layer. It uses authenticated -requests, though the auth headers are kind of mocked in the current API implementation. +## Scope + +The scope of this first milestone is to spin up a local EigenDA dev environment, spin up a local zksync-era dev +environment and integrate them. Instead of sending 4844 blobs, the zksync-era sends blobs to EigenDA. On L1, mock the +verification logic, such that blocks continue building. Increase the blob size from 4844 size to 2MiB blob. Deploy the +integration to Holesky testnet and provide scripts to setup a network using EigenDA as DA provider. + +## Temporary The generated files are received by compiling the `.proto` files from EigenDA repo using the following function: diff --git a/core/node/da_clients/src/eigen/eigenda-client.md b/core/node/da_clients/src/eigen/eigenda-client.md deleted file mode 100644 index cc4e2dfe11b9..000000000000 --- a/core/node/da_clients/src/eigen/eigenda-client.md +++ /dev/null @@ -1,13 +0,0 @@ -# EigenDA Client - -EigenDA is as a high-throughput data availability layer for rollups. It is an EigenLayer AVS (Actively Validated -Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators. -For more information you can check the [docs](https://docs.eigenda.xyz/). - -## Scope - -The scope of this first milestone is to spin up a local EigenDA dev environment, spin up a local zksync-era dev -environment and integrate them. Instead of sending 4844 blobs, the zksync-era sends blobs to EigenDA. On L1, mock the -verification logic, such that blocks continue building. Increase the blob size from 4844 size to 2MiB blob. Deploy the -integration to Holesky testnet and provide scripts to setup a network using EigenDA as DA provider. - From 836913b930b30525f95f8ad5d0b3348c24c45485 Mon Sep 17 00:00:00 2001 From: Gianbelinche <39842759+gianbelinche@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:39:03 -0300 Subject: [PATCH 3/3] Clarify readme --- core/node/da_clients/src/eigen/README.md | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/core/node/da_clients/src/eigen/README.md b/core/node/da_clients/src/eigen/README.md index 81aafca9cdf8..01e7cf036f81 100644 --- a/core/node/da_clients/src/eigen/README.md +++ b/core/node/da_clients/src/eigen/README.md @@ -4,16 +4,34 @@ EigenDA is as a high-throughput data availability layer for rollups. It is an Ei Service), so it leverages Ethereum's economic security instead of bootstrapping a new network with its own validators. For more information you can check the [docs](https://docs.eigenda.xyz/). -## Scope +## Status + +There a 3 milestones defined, we are currently on the first one. + +### M0: Read and Write integration The scope of this first milestone is to spin up a local EigenDA dev environment, spin up a local zksync-era dev environment and integrate them. Instead of sending 4844 blobs, the zksync-era sends blobs to EigenDA. On L1, mock the verification logic, such that blocks continue building. Increase the blob size from 4844 size to 2MiB blob. Deploy the integration to Holesky testnet and provide scripts to setup a network using EigenDA as DA provider. +### M1: Secure integration with ZKProver + +For this milestone the scope is to replace the mocked L1 verification logic with EigenDA compatible verifier. It should +integrate EigenDA certificate verification, and use it as the equivalent part for 4844 versioned hash. More importantly +modify the equivalence proof in Zksync L1 contract such that the proof can be verified correctly with respect to the +EigenDA commitment, which also lives in BN254 as zksync. Start with 128MiB blob, then 2MiB, up-to 32MiB blobs. Prepare +documentation and tooling in order to onboard rollups with EigenDA. + +### M2: Secure and cost efficient + +The scope is to explore approaches to reduce cost. For example, faster proof generation time. Verify EigenDA signature +inside circuit, this requires L2 having access to L1 state. Integrate EigenDA into ZKporter. + ## Temporary -The generated files are received by compiling the `.proto` files from EigenDA repo using the following function: +In order to implement the integration we generated some `.proto` files from EigenDA repo that were compiled using the +following function: ```rust pub fn compile_protos() { @@ -36,8 +54,5 @@ pub fn compile_protos() { } ``` -proto files are not included here to not create confusion in case they are not updated in time, so the EigenDA -[repo](https://github.com/Layr-Labs/eigenda/tree/master/api/proto) has to be a source of truth for the proto files. - -The generated folder here is considered a temporary solution until the EigenDA has a library with either a protogen, or +The generated folder is considered a temporary solution until the EigenDA has a library with either a protogen, or preferably a full Rust client implementation.