From c14a357773d20dbbd15a8ae6401df765154b4b74 Mon Sep 17 00:00:00 2001 From: goldsquid Date: Mon, 6 Jul 2026 22:02:42 +0700 Subject: [PATCH] reth for mode --- compose_registry.json | 36 +++- ...ode-mainnet-op-reth-pruned-trace--kona.yml | 190 ++++++++++++++++++ ...ode-sepolia-op-reth-pruned-trace--kona.yml | 180 +++++++++++++++++ 3 files changed, 404 insertions(+), 2 deletions(-) create mode 100644 op/reth/mode-mainnet-op-reth-pruned-trace--kona.yml create mode 100644 op/reth/mode-sepolia-op-reth-pruned-trace--kona.yml diff --git a/compose_registry.json b/compose_registry.json index 540bfcd4..cdff6b0e 100644 --- a/compose_registry.json +++ b/compose_registry.json @@ -7563,7 +7563,7 @@ "trace" ], "network": "hashkeychain", - "node": "kona", + "node": "node", "relay": null, "stack": "op", "type": "pruned", @@ -7579,7 +7579,7 @@ "trace" ], "network": "hashkeychain", - "node": "kona", + "node": "node", "relay": null, "stack": "op", "type": "pruned", @@ -7811,6 +7811,38 @@ "metal-mainnet-op-reth-pruned-trace" ] }, + { + "chain": "mainnet", + "client": "reth", + "compose_file": "op/reth/mode-mainnet-op-reth-pruned-trace--kona", + "features": [ + "trace" + ], + "network": "mode", + "node": "kona", + "relay": null, + "stack": "op", + "type": "pruned", + "volumes": [ + "mode-mainnet-op-reth-pruned-trace" + ] + }, + { + "chain": "sepolia", + "client": "reth", + "compose_file": "op/reth/mode-sepolia-op-reth-pruned-trace--kona", + "features": [ + "trace" + ], + "network": "mode", + "node": "kona", + "relay": null, + "stack": "op", + "type": "pruned", + "volumes": [ + "mode-sepolia-op-reth-pruned-trace" + ] + }, { "chain": "mainnet", "client": "reth", diff --git a/op/reth/mode-mainnet-op-reth-pruned-trace--kona.yml b/op/reth/mode-mainnet-op-reth-pruned-trace--kona.yml new file mode 100644 index 00000000..cf42630b --- /dev/null +++ b/op/reth/mode-mainnet-op-reth-pruned-trace--kona.yml @@ -0,0 +1,190 @@ +--- +x-logging-defaults: &logging-defaults + driver: json-file + options: + max-size: "10m" + max-file: "3" + +# Usage: +# +# mkdir rpc && cd rpc +# +# git init +# git remote add origin https://github.com/StakeSquid/ethereum-rpc-docker.git +# git fetch origin vibe +# git checkout origin/vibe +# +# docker run --rm alpine sh -c "printf '0x'; head -c32 /dev/urandom | xxd -p -c 64" > .jwtsecret +# +# env +# ... +# IP=$(curl ipinfo.io/ip) +# DOMAIN=${IP}.traefik.me +# COMPOSE_FILE=base.yml:rpc.yml:op/reth/mode-mainnet-op-reth-pruned-trace--kona.yml +# +# docker compose up -d +# +# curl -X POST https://${IP}.traefik.me/mode-mainnet-op-reth-pruned \ +# -H "Content-Type: application/json" \ +# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' + +services: + mode-mainnet-op-reth-pruned: + image: ${MODE_RETH_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/op-reth}:${MODE_MAINNET_RETH_VERSION:-v2.3.2} + sysctls: + # TCP Performance + net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle + net.ipv4.tcp_no_metrics_save: 1 # Disable metrics cache + net.ipv4.tcp_rmem: 4096 87380 16777216 # Increase TCP read buffers + net.ipv4.tcp_wmem: 4096 87380 16777216 # Increase TCP write buffers + net.core.somaxconn: 32768 # Higher connection queue + # Memory/Connection Management + # net.core.netdev_max_backlog: 50000 # Increase network buffer + net.ipv4.tcp_max_syn_backlog: 30000 # More SYN requests + net.ipv4.tcp_max_tw_buckets: 2000000 # Allow more TIME_WAIT sockets + ulimits: + nofile: 1048576 # Max open files (for RPC/WS connections) + memlock: -1 # Disable memory locking limits (for in-memory DBs like MDBX) + user: root + ports: + - 14035:14035 + - 14035:14035/udp + expose: + - 8545 + - 9001 + - 8551 + entrypoint: [op-reth, node] + command: + - --chain=/config/genesis.json + - --config=/config/reth/reth.toml + - --datadir=/root/.local/share/reth + - --discovery.addr=0.0.0.0 + - --discovery.port=14035 + - --discovery.v5.addr=0.0.0.0 + - --discovery.v5.port=14035 + - --engine.cross-block-cache-size=${MODE_MAINNET_RETH_STATE_CACHE:-4096} + - --full + - --max-inbound-peers=50 + - --max-outbound-peers=50 + - --metrics=0.0.0.0:9001 + - --nat=extip:${IP} + - --port=14035 + - --rollup.sequencer-http=https://mainnet.mode.network + - --rpc-cache.max-blocks=10000 + - --rpc-cache.max-concurrent-db-requests=2048 + - --rpc.gascap=600000000 + - --rpc.max-blocks-per-filter=0 + - --rpc.max-connections=50000 + - --rpc.max-logs-per-response=0 + - --rpc.max-trace-filter-blocks=10000 + - --http + - --http.addr=0.0.0.0 + - --http.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev + - --http.corsdomain=* + - --http.port=8545 + - --ws + - --ws.addr=0.0.0.0 + - --ws.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev + - --ws.origins=* + - --ws.port=8545 + - --authrpc.addr=0.0.0.0 + - --authrpc.jwtsecret=/jwtsecret + restart: unless-stopped + stop_grace_period: 5m + networks: + - chains + volumes: + - ${MODE_MAINNET_OP_RETH_PRUNED_TRACE_DATA:-mode-mainnet-op-reth-pruned-trace}:/root/.local/share/reth + - ./op/mode/mainnet:/config + - .jwtsecret:/jwtsecret:ro + - /slowdisk:/slowdisk + logging: *logging-defaults + labels: + - prometheus-scrape.enabled=true + - prometheus-scrape.port=9001 + - prometheus-scrape.path=/metrics + - traefik.enable=true + - traefik.http.middlewares.mode-mainnet-op-reth-pruned-trace-stripprefix.stripprefix.prefixes=/mode-mainnet-op-reth-pruned + - traefik.http.services.mode-mainnet-op-reth-pruned-trace.loadbalancer.server.port=8545 + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace.entrypoints=websecure} + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace.tls.certresolver=myresolver} + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace.rule=Host(`$DOMAIN`) && (Path(`/mode-mainnet-op-reth-pruned`) || Path(`/mode-mainnet-op-reth-pruned/`))} + - ${NO_SSL:+traefik.http.routers.mode-mainnet-op-reth-pruned-trace.rule=Path(`/mode-mainnet-op-reth-pruned`) || Path(`/mode-mainnet-op-reth-pruned/`)} + - traefik.http.routers.mode-mainnet-op-reth-pruned-trace.middlewares=mode-mainnet-op-reth-pruned-trace-stripprefix, ipallowlist + shm_size: 2gb + + mode-mainnet-op-reth-pruned-node: + image: ${MODE_KONA_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/kona-node}:${MODE_MAINNET_KONA_VERSION:-v1.6.1} + ports: + - 19035:19035 + - 19035:19035/udp + environment: + - KONA_METRICS_ADDR=0.0.0.0 + - KONA_NODE_L1_BEACON=${ETHEREUM_MAINNET_BEACON_REST} + - KONA_NODE_L1_ETH_RPC=${MODE_MAINNET_L1_EXECUTION_RPC:-${ETHEREUM_MAINNET_EXECUTION_RPC}} + - KONA_NODE_L1_TRUST_RPC=${ETHEREUM_MAINNET_EXECUTION_TRUST:-false} + - KONA_NODE_L2_CHAIN_ID=34443 + - KONA_NODE_L2_ENGINE_AUTH=/jwtsecret + - KONA_NODE_L2_ENGINE_RPC=http://mode-mainnet-op-reth-pruned:8551 + - KONA_NODE_L2_ENGINE_TIMEOUT=120000 + - KONA_NODE_L2_TRUST_RPC=true + - KONA_NODE_METRICS_PORT=7300 + - KONA_NODE_MODE=Validator + - KONA_NODE_P2P_ADVERTISE_IP=${IP} + - KONA_NODE_P2P_LISTEN_IP=0.0.0.0 + - KONA_NODE_P2P_LISTEN_TCP_PORT=19035 + - KONA_NODE_P2P_LISTEN_UDP_PORT=19035 + - KONA_NODE_RPC_ADDR=0.0.0.0 + - KONA_NODE_RPC_PORT=9545 + entrypoint: [kona-node, node] + restart: unless-stopped + depends_on: + mode-mainnet-op-reth-pruned: + condition: service_started + restart: true + networks: + - chains + volumes: + - ./op/mode/mainnet:/config + - .jwtsecret:/jwtsecret:ro + logging: *logging-defaults + labels: + - prometheus-scrape.enabled=true + - prometheus-scrape.port=7300 + - prometheus-scrape.path=/metrics + - traefik.enable=true + - traefik.http.middlewares.mode-mainnet-op-reth-pruned-trace-node-stripprefix.stripprefix.prefixes=/mode-mainnet-op-reth-pruned/node + - traefik.http.services.mode-mainnet-op-reth-pruned-trace-node.loadbalancer.server.port=9545 + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace-node.entrypoints=websecure} + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace-node.tls.certresolver=myresolver} + - ${NO_SSL:-traefik.http.routers.mode-mainnet-op-reth-pruned-trace-node.rule=Host(`$DOMAIN`) && PathPrefix(`/mode-mainnet-op-reth-pruned/node`)} + - ${NO_SSL:+traefik.http.routers.mode-mainnet-op-reth-pruned-trace-node.rule=PathPrefix(`/mode-mainnet-op-reth-pruned/node`)} + - traefik.http.routers.mode-mainnet-op-reth-pruned-trace-node.middlewares=mode-mainnet-op-reth-pruned-trace-node-stripprefix, ipallowlist + +volumes: + mode-mainnet-op-reth-pruned-trace: + +x-upstreams: + - id: $${ID} + labels: + provider: $${PROVIDER} + connection: + generic: + rpc: + url: $${RPC_URL} + ws: + frameSize: 20Mb + msgSize: 50Mb + url: $${WS_URL} + chain: mode + method-groups: + enabled: + - debug + - filter + - trace + methods: + disabled: + - name: eth_maxPriorityFeePerGas + enabled: + - name: txpool_content # TODO: should be disabled for rollup nodes +... \ No newline at end of file diff --git a/op/reth/mode-sepolia-op-reth-pruned-trace--kona.yml b/op/reth/mode-sepolia-op-reth-pruned-trace--kona.yml new file mode 100644 index 00000000..aa12c206 --- /dev/null +++ b/op/reth/mode-sepolia-op-reth-pruned-trace--kona.yml @@ -0,0 +1,180 @@ +--- +x-logging-defaults: &logging-defaults + driver: json-file + options: + max-size: "10m" + max-file: "3" + +# Usage: +# +# mkdir rpc && cd rpc +# +# git init +# git remote add origin https://github.com/StakeSquid/ethereum-rpc-docker.git +# git fetch origin vibe +# git checkout origin/vibe +# +# docker run --rm alpine sh -c "printf '0x'; head -c32 /dev/urandom | xxd -p -c 64" > .jwtsecret +# +# env +# ... +# IP=$(curl ipinfo.io/ip) +# DOMAIN=${IP}.traefik.me +# COMPOSE_FILE=base.yml:rpc.yml:op/reth/mode-sepolia-op-reth-pruned-trace--kona.yml +# +# docker compose up -d +# +# curl -X POST https://${IP}.traefik.me/mode-sepolia-op-reth-pruned \ +# -H "Content-Type: application/json" \ +# --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' + +services: + mode-sepolia-op-reth-pruned: + image: ${MODE_RETH_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/op-reth}:${MODE_SEPOLIA_RETH_VERSION:-v2.3.2} + sysctls: + # TCP Performance + net.ipv4.tcp_slow_start_after_idle: 0 # Disable slow start after idle + net.ipv4.tcp_no_metrics_save: 1 # Disable metrics cache + net.ipv4.tcp_rmem: 4096 87380 16777216 # Increase TCP read buffers + net.ipv4.tcp_wmem: 4096 87380 16777216 # Increase TCP write buffers + net.core.somaxconn: 32768 # Higher connection queue + # Memory/Connection Management + # net.core.netdev_max_backlog: 50000 # Increase network buffer + net.ipv4.tcp_max_syn_backlog: 30000 # More SYN requests + net.ipv4.tcp_max_tw_buckets: 2000000 # Allow more TIME_WAIT sockets + ulimits: + nofile: 1048576 # Max open files (for RPC/WS connections) + memlock: -1 # Disable memory locking limits (for in-memory DBs like MDBX) + user: root + expose: + - 8545 + - 9001 + - 8551 + entrypoint: [op-reth, node] + command: + - --chain=mode-sepolia + - --datadir=/root/.local/share/reth + - --disable-discovery + - --engine.cross-block-cache-size=${MODE_SEPOLIA_RETH_STATE_CACHE:-4096} + - --full + - --max-inbound-peers=50 + - --max-outbound-peers=50 + - --metrics=0.0.0.0:9001 + - --rollup.sequencer-http=https://sepolia.mode.network + - --rpc-cache.max-blocks=10000 + - --rpc-cache.max-concurrent-db-requests=2048 + - --rpc.gascap=600000000 + - --rpc.max-blocks-per-filter=0 + - --rpc.max-connections=50000 + - --rpc.max-logs-per-response=0 + - --rpc.max-trace-filter-blocks=10000 + - --http + - --http.addr=0.0.0.0 + - --http.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev + - --http.corsdomain=* + - --http.port=8545 + - --ws + - --ws.addr=0.0.0.0 + - --ws.api=admin,debug,eth,net,trace,txpool,web3,rpc,reth,ots,flashbots,mev + - --ws.origins=* + - --ws.port=8545 + - --authrpc.addr=0.0.0.0 + - --authrpc.jwtsecret=/jwtsecret + restart: unless-stopped + stop_grace_period: 5m + networks: + - chains + volumes: + - ${MODE_SEPOLIA_OP_RETH_PRUNED_TRACE_DATA:-mode-sepolia-op-reth-pruned-trace}:/root/.local/share/reth + - .jwtsecret:/jwtsecret:ro + - /slowdisk:/slowdisk + logging: *logging-defaults + labels: + - prometheus-scrape.enabled=true + - prometheus-scrape.port=9001 + - prometheus-scrape.path=/metrics + - traefik.enable=true + - traefik.http.middlewares.mode-sepolia-op-reth-pruned-trace-stripprefix.stripprefix.prefixes=/mode-sepolia-op-reth-pruned + - traefik.http.services.mode-sepolia-op-reth-pruned-trace.loadbalancer.server.port=8545 + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace.entrypoints=websecure} + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace.tls.certresolver=myresolver} + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace.rule=Host(`$DOMAIN`) && (Path(`/mode-sepolia-op-reth-pruned`) || Path(`/mode-sepolia-op-reth-pruned/`))} + - ${NO_SSL:+traefik.http.routers.mode-sepolia-op-reth-pruned-trace.rule=Path(`/mode-sepolia-op-reth-pruned`) || Path(`/mode-sepolia-op-reth-pruned/`)} + - traefik.http.routers.mode-sepolia-op-reth-pruned-trace.middlewares=mode-sepolia-op-reth-pruned-trace-stripprefix, ipallowlist + shm_size: 2gb + + mode-sepolia-op-reth-pruned-node: + image: ${MODE_KONA_IMAGE:-us-docker.pkg.dev/oplabs-tools-artifacts/images/kona-node}:${MODE_SEPOLIA_KONA_VERSION:-v1.6.1} + ports: + - 15994:15994 + - 15994:15994/udp + environment: + - KONA_METRICS_ADDR=0.0.0.0 + - KONA_NODE_L1_BEACON=${ETHEREUM_SEPOLIA_BEACON_REST} + - KONA_NODE_L1_ETH_RPC=${MODE_SEPOLIA_L1_EXECUTION_RPC:-${ETHEREUM_SEPOLIA_EXECUTION_RPC}} + - KONA_NODE_L1_TRUST_RPC=${ETHEREUM_SEPOLIA_EXECUTION_TRUST:-false} + - KONA_NODE_L2_CHAIN_ID=919 + - KONA_NODE_L2_ENGINE_AUTH=/jwtsecret + - KONA_NODE_L2_ENGINE_RPC=http://mode-sepolia-op-reth-pruned:8551 + - KONA_NODE_L2_ENGINE_TIMEOUT=120000 + - KONA_NODE_L2_TRUST_RPC=true + - KONA_NODE_METRICS_PORT=7300 + - KONA_NODE_MODE=Validator + - KONA_NODE_OVERRIDE_PECTRA_BLOB_SCHEDULE=1742486400 + - KONA_NODE_P2P_ADVERTISE_IP=${IP} + - KONA_NODE_P2P_LISTEN_IP=0.0.0.0 + - KONA_NODE_P2P_LISTEN_TCP_PORT=15994 + - KONA_NODE_P2P_LISTEN_UDP_PORT=15994 + - KONA_NODE_RPC_ADDR=0.0.0.0 + - KONA_NODE_RPC_PORT=9545 + entrypoint: [kona-node, node] + restart: unless-stopped + depends_on: + mode-sepolia-op-reth-pruned: + condition: service_started + restart: true + networks: + - chains + volumes: + - .jwtsecret:/jwtsecret:ro + logging: *logging-defaults + labels: + - prometheus-scrape.enabled=true + - prometheus-scrape.port=7300 + - prometheus-scrape.path=/metrics + - traefik.enable=true + - traefik.http.middlewares.mode-sepolia-op-reth-pruned-trace-node-stripprefix.stripprefix.prefixes=/mode-sepolia-op-reth-pruned/node + - traefik.http.services.mode-sepolia-op-reth-pruned-trace-node.loadbalancer.server.port=9545 + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace-node.entrypoints=websecure} + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace-node.tls.certresolver=myresolver} + - ${NO_SSL:-traefik.http.routers.mode-sepolia-op-reth-pruned-trace-node.rule=Host(`$DOMAIN`) && PathPrefix(`/mode-sepolia-op-reth-pruned/node`)} + - ${NO_SSL:+traefik.http.routers.mode-sepolia-op-reth-pruned-trace-node.rule=PathPrefix(`/mode-sepolia-op-reth-pruned/node`)} + - traefik.http.routers.mode-sepolia-op-reth-pruned-trace-node.middlewares=mode-sepolia-op-reth-pruned-trace-node-stripprefix, ipallowlist + +volumes: + mode-sepolia-op-reth-pruned-trace: + +x-upstreams: + - id: $${ID} + labels: + provider: $${PROVIDER} + connection: + generic: + rpc: + url: $${RPC_URL} + ws: + frameSize: 20Mb + msgSize: 50Mb + url: $${WS_URL} + chain: mode-testnet + method-groups: + enabled: + - debug + - filter + - trace + methods: + disabled: + - name: eth_maxPriorityFeePerGas + enabled: + - name: txpool_content # TODO: should be disabled for rollup nodes +... \ No newline at end of file