Skip to content

Commit

Permalink
feat(devnet): use eigenda
Browse files Browse the repository at this point in the history
- update README
- create make altda-devnet-up command
- swap da-server for eigenda-proxy
- use redis-cache for eigenda-proxy

devnet(high-throughput): change devnetL1-template to use 60M gas with eip1559 elasticity of 2
  • Loading branch information
samlaf committed Oct 9, 2024
1 parent 111e0f9 commit 8f95502
Show file tree
Hide file tree
Showing 12 changed files with 4,983 additions and 510 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ devnet-up: pre-devnet ## Starts the local devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=.
.PHONY: devnet-up

altda-devnet-up:
@( \
set -a; . ./.env; set +a; \
DEVNET_ALTDA=true GENERIC_ALTDA=true TRAFFIC_GEN=true make devnet-up; \
)

devnet-test: pre-devnet ## Runs tests on the local devnet
make -C op-e2e test-devnet
.PHONY: devnet-test
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [devnet with eigenda alt-da](#devnet-with-eigenda-alt-da)
- [What is Optimism?](#what-is-optimism)
- [Documentation](#documentation)
- [Specification](#specification)
Expand All @@ -26,6 +27,32 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## devnet with eigenda alt-da

First you will need to build the dev docker image for eigenda-proxy, until we make a new release.

```bash
git clone https://github.com/Layr-Labs/eigenda-proxy.git
make docker-build
```

Now create a `.env` file in the root of this repository with the following content (you will need to add an ecdsa private key that is authorized on the eigenda disperser, as well as an ethereum rpc endpoint):

```bash
MEMSTORE_ENABLED=false
EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR=0x54A03db2784E3D0aCC08344D05385d0b62d4F432 #holesky preprod
EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX=
EIGENDA_PROXY_EIGENDA_ETH_RPC=
```

Finally run `make altda-devnet-up` to start the devnet with the eigenda proxy as alt-da server, which sends batches to `disperser-preprod-holesky.eigenda.xyz:443`.

This will also start a grafana instance, which you can access at `http://localhost:3000` with user:pw `admin:admin`.

![](./ops-bedrock/monitoring/grafana/grafana-dashboard-overview-high-throughput.png)

The devnet starts an instance of https://github.com/Layr-Labs/evm-tx-load-gen which is submitting transactions with large amounts of calldata to reach 1.5MB/s of throughput.

## What is Optimism?

[Optimism](https://www.optimism.io/) is a project dedicated to scaling Ethereum's technology and expanding its ability to coordinate people from across the world to build effective decentralized economies and governance systems. The [Optimism Collective](https://www.optimism.io/vision) builds open-source software that powers scalable blockchains and aims to address key governance and economic challenges in the wider Ethereum ecosystem. Optimism operates on the principle of **impact=profit**, the idea that individuals who positively impact the Collective should be proportionally rewarded with profit. **Change the incentives and you change the world.**
Expand Down
12 changes: 9 additions & 3 deletions bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
DEVNET_L2OO = os.getenv('DEVNET_L2OO') == "true"
DEVNET_ALTDA = os.getenv('DEVNET_ALTDA') == "true"
GENERIC_ALTDA = os.getenv('GENERIC_ALTDA') == "true"
TRAFFIC_GEN = os.getenv('TRAFFIC_GEN') == "true"

class Bunch:
def __init__(self, **kwds):
Expand Down Expand Up @@ -175,7 +176,7 @@ def devnet_l2_allocs(paths):
def devnet_deploy(paths):

log.info('Starting peripheral telemetry services.')
run_command(['docker', 'compose', 'up', '-d', 'prometheus', 'grafana', 'loki', 'promtail'], cwd=paths.ops_bedrock_dir, env={
run_command(['docker', 'compose', 'up', '-d', 'prometheus', 'grafana', 'loki', 'promtail', 'ethereum-metrics-exporter-l2'], cwd=paths.ops_bedrock_dir, env={
'PWD': paths.ops_bedrock_dir
})

Expand Down Expand Up @@ -293,15 +294,20 @@ def devnet_deploy(paths):
log.info('Bringing up `op-node`, `op-proposer` and `op-batcher`.')
run_command(['docker', 'compose', 'up', '-d', 'op-node', 'op-proposer', 'op-batcher', 'artifact-server'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up traffic-gen.
if TRAFFIC_GEN:
log.info('Bringing up `evm-tx-load-gen`.')
run_command(['docker', 'compose', 'up', '-d', 'evm-tx-load-gen'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up op-challenger.
if not DEVNET_L2OO:
log.info('Bringing up `op-challenger`.')
run_command(['docker', 'compose', 'up', '-d', 'op-challenger'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up Alt-DA Mode components.
if DEVNET_ALTDA:
log.info('Bringing up `da-server`, `sentinel`.') # TODO(10141): We don't have public sentinel images yet
run_command(['docker', 'compose', 'up', '-d', 'da-server'], cwd=paths.ops_bedrock_dir, env=docker_env)
log.info('Bringing up `da-server`, `redis-cache`.') # TODO(10141): We don't have public sentinel images yet
run_command(['docker', 'compose', 'up', '-d', 'da-server', 'redis-cache'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Fin.
log.info('Devnet ready.')
Expand Down
65 changes: 62 additions & 3 deletions ops-bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,23 @@ services:
OP_BATCHER_L1_ETH_RPC: http://l1:8545
OP_BATCHER_L2_ETH_RPC: http://l2:8545
OP_BATCHER_ROLLUP_RPC: http://op-node:8545
OP_BATCHER_MAX_CHANNEL_DURATION: 2
OP_BATCHER_MAX_CHANNEL_DURATION: 10 # 10 L1 blocks = 60 seconds
OP_BATCHER_SUB_SAFETY_MARGIN: 4 # SWS is 15, ChannelTimeout is 40
OP_BATCHER_POLL_INTERVAL: 1s
OP_BATCHER_POLL_INTERVAL: 2s
OP_BATCHER_NUM_CONFIRMATIONS: 1
OP_BATCHER_MAX_PENDING_TX: 0 # no limit
OP_BATCHER_MNEMONIC: test test test test test test test test test test test junk
OP_BATCHER_SEQUENCER_HD_PATH: "m/44'/60'/0'/0/2"
OP_BATCHER_PPROF_ENABLED: "true"
OP_BATCHER_METRICS_ENABLED: "true"
OP_BATCHER_RPC_ENABLE_ADMIN: "true"
OP_BATCHER_BATCH_TYPE: 1
OP_BATCHER_BATCH_TYPE: 0
OP_BATCHER_ALTDA_ENABLED: "${ALTDA_ENABLED}"
OP_BATCHER_ALTDA_DA_SERVICE: "${ALTDA_SERVICE}"
OP_BATCHER_ALTDA_DA_SERVER: "http://da-server:3100"
OP_BATCHER_DATA_AVAILABILITY_TYPE: "${DA_TYPE}"
OP_BATCHER_ALTDA_MAX_CONCURRENT_DA_REQUESTS: 200
OP_BATCHER_TARGET_NUM_FRAMES: 16

op-challenger:
depends_on:
Expand Down Expand Up @@ -238,6 +241,58 @@ services:
OP_CHALLENGER_NUM_CONFIRMATIONS: 1

da-server:
# platform: linux/amd64
image: ghcr.io/layr-labs/eigenda-proxy:dev
depends_on:
- redis-cache
environment:
EIGENDA_PROXY_ADDR: 0.0.0.0
EIGENDA_PROXY_PORT: 3100
EIGENDA_PROXY_METRICS_ENABLED: true
EIGENDA_PROXY_METRICS_PORT: 7300
# MEMSTORE_ENABLED=true means data id only stored in a memcache inside the proxy,
# and is not forwarded to eigenda.
MEMSTORE_ENABLED: ${MEMSTORE_ENABLED-true}
MEMSTORE_EXPIRATION: 45m
MEMSTORE_PUT_LATENCY: 1m
MEMSTORE_GET_LATENCY: 1s
# if MEMSTORE_ENABLED=false, then these variables need to be set properly to connect to eigenda
EIGENDA_PROXY_EIGENDA_DISPERSER_RPC: disperser-preprod-holesky.eigenda.xyz:443
EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR: ${EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR}
EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX: ${EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX}
EIGENDA_PROXY_EIGENDA_ETH_RPC: ${EIGENDA_PROXY_EIGENDA_ETH_RPC}
EIGENDA_PROXY_REDIS_ENDPOINT: redis-cache:6379
EIGENDA_PROXY_REDIS_EVICTION: 1h
EIGENDA_PROXY_CACHE_TARGETS: "redis"
EIGENDA_PROXY_ETH_CONFIRMATION_DEPTH: 0 # don't wait for finality (-1)
ports:
- 3100:3100
- 6969:7300

evm-tx-load-gen:
image: ghcr.io/layr-labs/evm-tx-load-gen:latest
depends_on:
- l2
environment:
TRAFFIC_GENERATOR_HOSTNAME: http://l2:8545
TRAFFIC_GENERATOR_TIMEOUT: 30s
TRAFFIC_GENERATOR_NUM_INSTANCES: 1
TRAFFIC_GENERATOR_SIGNER_ADDRESSES: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
TRAFFIC_GENERATOR_SIGNER_PRIVATE_KEYS_HEX: ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# to send 1 MB/s, set interval to 125ms and pad_size to 130958
# with the tx overhead (signature, nonce, etc) the actual txs send will have size exactly 128KB = 131072 bytes
# this will send 8 txs/s, each of size 128KB, such that 8 * 128 KB = 1 MB
# max block size with 30M gas is ~1.7MB. To make sure blocks are almost full but txpool doesn't just keep increasing unboundedly,
# we send 1.5MB of data (100KB every 133ms)
TRAFFIC_GENERATOR_REQUEST_INTERVAL: 133ms
TRAFFIC_GENERATOR_PAD_SIZE: 100000

# for eigenda-proxy da-server
redis-cache:
image: redis:7.0.11
ports:
- "6379:6379"

grafana:
image: grafana/grafana:11.1.0
restart: unless-stopped
Expand Down Expand Up @@ -281,6 +336,10 @@ services:
- /var/run/docker.sock:/var/run/docker.sock # Mount Docker socket to read container logs
command: -config.file=/etc/promtail/config.yaml

ethereum-metrics-exporter-l2:
image: ethpandaops/ethereum-metrics-exporter:latest
command: --consensus-url http://op-node:8545 --execution-url http://l2:8545

sentinel:
image: quarry/sentinel # TODO(10141): We need a public image for this (sentinel is out of repo)
volumes:
Expand Down
Loading

0 comments on commit 8f95502

Please sign in to comment.