From 7f7c3efefaefd8880c18efdc63b938ca60bc7601 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sun, 7 Dec 2025 11:27:39 +0800 Subject: [PATCH 1/5] fix(devnet): disable block gossip by default --- create-l2-rollup-example/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/create-l2-rollup-example/docker-compose.yml b/create-l2-rollup-example/docker-compose.yml index 4d95ea919..a6b645327 100644 --- a/create-l2-rollup-example/docker-compose.yml +++ b/create-l2-rollup-example/docker-compose.yml @@ -30,6 +30,7 @@ services: --p2p.advertise.tcp=9222 --p2p.advertise.udp=9222 --p2p.sequencer.key=${PRIVATE_KEY} + --p2p.disable-block-gossip # For local devnet only. Remove this flag for production deployments. --rpc.addr=0.0.0.0 --rpc.port=8547 --rpc.enable-admin From 5e948d50dae09869e67ae5afa7d35e233a90787c Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sun, 7 Dec 2025 11:30:56 +0800 Subject: [PATCH 2/5] docs(devnet): add notes for p2p.disable-block-gossip --- create-l2-rollup-example/README.md | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/create-l2-rollup-example/README.md b/create-l2-rollup-example/README.md index b9b78ac57..d121604e4 100644 --- a/create-l2-rollup-example/README.md +++ b/create-l2-rollup-example/README.md @@ -176,6 +176,41 @@ make restart docker-compose restart op-batcher ``` +## P2P Block Gossip Configuration + +By default, this devnet disables block gossip to avoid validation warnings when running locally. The `--p2p.disable-block-gossip` flag is set in `docker-compose.yml` (line 33). + + +**For production deployments**, you should **remove** the `--p2p.disable-block-gossip` flag to enable block propagation across the network. Block gossip is essential for: +- Distributing newly sequenced blocks to other nodes +- Enabling peer nodes to validate and sync with your chain +- Supporting a decentralized network of nodes + + +### When to Enable Block Gossip + +| Environment | Block Gossip | Reason | +|-------------|-------------|---------| +| **Local devnet** | Disabled (default) | Prevents "invalid block signature" warnings when testing solo | +| **Private testnet** | Disabled | No other nodes to gossip with | +| **Public testnet** | Enabled | Other nodes need to receive your blocks | +| **Production mainnet** | Enabled | Required for network operation | + +### Enabling Block Gossip for Production + +1. Open `docker-compose.yml` +2. Remove or comment out line 33: `--p2p.disable-block-gossip` +3. Ensure your P2P networking is properly configured: + - Set `P2P_ADVERTISE_IP` to your public IP address + - Ensure port 9222 is accessible from the internet + - Configure proper firewall rules + +```bash +# Example: Enable block gossip +sed -i '' '/--p2p.disable-block-gossip/d' docker-compose.yml +docker-compose restart op-node +``` + ## Troubleshooting ### Common Issues From a2edb5b9e37be4e2d61f9b0308d2211629f40e11 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sun, 7 Dec 2025 11:47:55 +0800 Subject: [PATCH 3/5] fix(devnet): no disable-block-gossip --- create-l2-rollup-example/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create-l2-rollup-example/docker-compose.yml b/create-l2-rollup-example/docker-compose.yml index a6b645327..47b71669e 100644 --- a/create-l2-rollup-example/docker-compose.yml +++ b/create-l2-rollup-example/docker-compose.yml @@ -30,7 +30,7 @@ services: --p2p.advertise.tcp=9222 --p2p.advertise.udp=9222 --p2p.sequencer.key=${PRIVATE_KEY} - --p2p.disable-block-gossip # For local devnet only. Remove this flag for production deployments. + --p2p.disable # For local devnet only. Remove this flag for production deployments. --rpc.addr=0.0.0.0 --rpc.port=8547 --rpc.enable-admin From e00e9d4361931a01a1ec511e938691f496f983fe Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sun, 7 Dec 2025 11:48:21 +0800 Subject: [PATCH 4/5] update status --- create-l2-rollup-example/docker-compose.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/create-l2-rollup-example/docker-compose.yml b/create-l2-rollup-example/docker-compose.yml index 47b71669e..fbd8c14c9 100644 --- a/create-l2-rollup-example/docker-compose.yml +++ b/create-l2-rollup-example/docker-compose.yml @@ -23,13 +23,6 @@ services: --sequencer.stopped=false --sequencer.max-safe-lag=3600 --verifier.l1-confs=4 - --p2p.listen.ip=0.0.0.0 - --p2p.listen.tcp=9222 - --p2p.listen.udp=9222 - --p2p.advertise.ip=${P2P_ADVERTISE_IP} - --p2p.advertise.tcp=9222 - --p2p.advertise.udp=9222 - --p2p.sequencer.key=${PRIVATE_KEY} --p2p.disable # For local devnet only. Remove this flag for production deployments. --rpc.addr=0.0.0.0 --rpc.port=8547 @@ -39,7 +32,7 @@ services: depends_on: - op-geth healthcheck: - test: ["CMD", "wget", "--post-data={\"jsonrpc\":\"2.0\",\"method\":\"opp2p_self\",\"params\":[],\"id\":1}", "--header=Content-Type: application/json", "--quiet", "--tries=1", "--timeout=10", "--output-document=-", "http://localhost:8547"] + test: ["CMD", "wget", "--post-data={\"jsonrpc\":\"2.0\",\"method\":\"optimism_syncStatus\",\"params\":[],\"id\":1}", "--header=Content-Type: application/json", "--quiet", "--tries=1", "--timeout=10", "--output-document=-", "http://localhost:8547"] interval: 30s timeout: 10s retries: 5 From 5bbd73ef99e29313f17bc09b88b21a682c30a4eb Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sun, 7 Dec 2025 11:48:54 +0800 Subject: [PATCH 5/5] update docs --- create-l2-rollup-example/README.md | 51 +++++++++++++++++++----------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/create-l2-rollup-example/README.md b/create-l2-rollup-example/README.md index d121604e4..6a3cd507b 100644 --- a/create-l2-rollup-example/README.md +++ b/create-l2-rollup-example/README.md @@ -176,38 +176,51 @@ make restart docker-compose restart op-batcher ``` -## P2P Block Gossip Configuration +## P2P Networking Configuration -By default, this devnet disables block gossip to avoid validation warnings when running locally. The `--p2p.disable-block-gossip` flag is set in `docker-compose.yml` (line 33). +By default, this devnet disables P2P networking entirely to avoid validation warnings when running locally. The `--p2p.disable` flag is set in `docker-compose.yml` (line 26). -**For production deployments**, you should **remove** the `--p2p.disable-block-gossip` flag to enable block propagation across the network. Block gossip is essential for: -- Distributing newly sequenced blocks to other nodes -- Enabling peer nodes to validate and sync with your chain +**For production deployments**, you must **remove** the `--p2p.disable` flag and configure P2P networking properly. P2P is essential for: +- Distributing newly sequenced blocks to other nodes in the network +- Enabling peer nodes to sync and validate your chain - Supporting a decentralized network of nodes +- Network resilience and redundancy -### When to Enable Block Gossip +### When to Enable P2P -| Environment | Block Gossip | Reason | -|-------------|-------------|---------| -| **Local devnet** | Disabled (default) | Prevents "invalid block signature" warnings when testing solo | -| **Private testnet** | Disabled | No other nodes to gossip with | -| **Public testnet** | Enabled | Other nodes need to receive your blocks | +| Environment | P2P Networking | Reason | +|-------------|---------------|---------| +| **Local devnet** | Disabled (default) | Prevents P2P warnings when testing solo without peers | +| **Private testnet** | Disabled | No other nodes to connect with | +| **Public testnet** | Enabled | Other nodes need to receive blocks and sync | | **Production mainnet** | Enabled | Required for network operation | -### Enabling Block Gossip for Production +### Enabling P2P for Production 1. Open `docker-compose.yml` -2. Remove or comment out line 33: `--p2p.disable-block-gossip` -3. Ensure your P2P networking is properly configured: - - Set `P2P_ADVERTISE_IP` to your public IP address - - Ensure port 9222 is accessible from the internet - - Configure proper firewall rules +2. Remove `--p2p.disable # For local devnet only...` +3. Add back the P2P configuration flags: + ```yaml + --p2p.listen.ip=0.0.0.0 + --p2p.listen.tcp=9222 + --p2p.listen.udp=9222 + --p2p.advertise.ip=${P2P_ADVERTISE_IP} + --p2p.advertise.tcp=9222 + --p2p.advertise.udp=9222 + --p2p.sequencer.key=${PRIVATE_KEY} + ``` +4. Ensure your P2P networking environment is properly configured: + - Set `P2P_ADVERTISE_IP` in `.env` to your public IP address (not 127.0.0.1) + - Ensure port 9222 (both TCP and UDP) is accessible from the internet + - Configure proper firewall rules to allow P2P traffic + - Consider setting up bootnodes for better peer discovery ```bash -# Example: Enable block gossip -sed -i '' '/--p2p.disable-block-gossip/d' docker-compose.yml +# Example: Quick enable P2P for testing +sed -i '' '/--p2p.disable/d' docker-compose.yml +# Then add back P2P flags manually in docker-compose.yml docker-compose restart op-node ```