Skip to content

Conversation

@MegaRedHand
Copy link
Collaborator

@MegaRedHand MegaRedHand commented Nov 12, 2025

Motivation

Description

This PR adds a flag to set the listening address for P2P.

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

Lines of code report

Total lines added: 8
Total lines removed: 0
Total lines changed: 8

Detailed view
+--------------------------+-------+------+
| File                     | Lines | Diff |
+--------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs | 768   | +8   |
+--------------------------+-------+------+

@MegaRedHand MegaRedHand marked this pull request as ready for review November 12, 2025 18:22
@MegaRedHand MegaRedHand requested a review from a team as a code owner November 12, 2025 18:22
Copilot AI review requested due to automatic review settings November 12, 2025 18:22
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Nov 12, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new CLI flag --p2p.addr to allow users to specify the P2P listening address for the node, providing more control over network configuration. When not specified, the node continues to auto-detect the local IP address as before.

Key changes:

  • Added optional --p2p.addr CLI parameter for specifying the P2P listening address
  • Refactored P2P node initialization to use the provided address or fall back to auto-detection
  • Updated help text for consistency across P2P-related options

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
cmd/ethrex/cli.rs Adds new optional p2p_addr field to Options struct with CLI argument definition
cmd/ethrex/initializers.rs Updates get_local_p2p_node to use the new CLI option, simplifying socket address parsing
docs/CLI.md Documents the new --p2p.addr option in the CLI reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

[default: INFO]
--aligned
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This option was moved, but wasn't removed from here.

[env: ETHREX_BLOCK_PRODUCER_OPERATOR_FEE_PER_GAS=]
--block-producer.l1-fee-vault-address <ADDRESS>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some options weren't updated since they're not checked in the CI

@MegaRedHand MegaRedHand marked this pull request as draft November 14, 2025 16:20
@ethrex-project-sync ethrex-project-sync bot moved this from In Review to In Progress in ethrex_l1 Nov 14, 2025
@MegaRedHand
Copy link
Collaborator Author

MegaRedHand commented Nov 14, 2025

I'm getting some errors:

2025-11-14T16:20:29.118061Z ERROR Error sending message sent="Ping" to=0xd860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666 err=IoError(Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" })
2025-11-14T16:20:29.118275Z ERROR Error sending message sent="Ping" to=0x22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de err=IoError(Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" })
2025-11-14T16:20:29.118409Z ERROR Error sending message sent="Ping" to=0x2b252ab6a1d0f971d9722cb839a42cb81db019ba44c08754628ab4a823487071b5695317c8ccd085219c3a03af063495b2f1da8d18218da2d6a82981b45e6ffc err=IoError(Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" })
2025-11-14T16:20:29.118537Z ERROR Error sending message sent="Ping" to=0x4aeb4ab6c14b23e2c4cfdce879c04b0748a20d8e9b59e25ded2a08143e265c6c25936e74cbc8e641e3312ca288673d91f2f93f8e277de3cfa444ecdaaf982052 err=IoError(Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" })
2025-11-14T16:20:29.118596Z  INFO Global allocator: jemalloc (tikv-jemallocator)
2025-11-14T16:20:29.118687Z ERROR Error sending message sending="FindNode" addr=18.138.108.67:30303 err=Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" }
2025-11-14T16:20:29.220044Z ERROR Error sending message sending="FindNode" addr=157.90.35.166:30303 err=Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" }
2025-11-14T16:20:29.321436Z ERROR Error sending message sending="FindNode" addr=3.209.45.79:30303 err=Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" }
2025-11-14T16:20:29.422591Z ERROR Error sending message sending="FindNode" addr=65.108.70.101:30303 err=Os { code: 101, kind: NetworkUnreachable, message: "Network is unreachable" }

But node still syncs. I think we can fix those in a later PR.

Let's address this in another PR, but I think the main problem is bootnodes use IPv4 addresses (the ones in the error messages), so we need some way to translate those.

@MegaRedHand MegaRedHand marked this pull request as ready for review November 14, 2025 16:23
@ethrex-project-sync ethrex-project-sync bot moved this from In Progress to In Review in ethrex_l1 Nov 14, 2025
@MegaRedHand MegaRedHand added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit 4657f36 Nov 14, 2025
41 checks passed
@MegaRedHand MegaRedHand deleted the add-p2p-addr-flag branch November 14, 2025 21:03
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 14, 2025
lakshya-sky pushed a commit to lakshya-sky/ethrex that referenced this pull request Nov 17, 2025
…5297)

**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

**Description**

This PR adds a flag to set the listening address for P2P.

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants