Skip to content

consensus-entrypoint always overrides BASE_NODE_P2P_ADVERTISE_IP and exits if public IP discovery fails #1107

@Gercekkriptocu

Description

@Gercekkriptocu

Summary

consensus-entrypoint always calls get_public_ip and assigns its result to BASE_NODE_P2P_ADVERTISE_IP, overriding any value the operator set in their env file. If none of the four upstream IP services are reachable, the script exits with code 8 and the node fails to start.

What I found

In consensus-entrypoint:

  • The script unconditionally invokes get_public_ip against four external endpoints (ifconfig.me, api.ipify.org, ipecho.net, v4.ident.me).
  • It then runs export BASE_NODE_P2P_ADVERTISE_IP=$PUBLIC_IP, which silently replaces any value already provided via .env.
  • If all four endpoints are unreachable (firewalled host, restricted egress, transient network failure), the script exits with code 8 and the consensus container will not start.

Expected behavior

  • If the operator has already set BASE_NODE_P2P_ADVERTISE_IP, the script should respect that value and skip discovery.
  • Discovery failure should not be a hard startup failure when the operator has provided their own value.

Suggested fix

Skip discovery when BASE_NODE_P2P_ADVERTISE_IP is already set:

if [[ -z "${BASE_NODE_P2P_ADVERTISE_IP:-}" ]]; then ... fi

Impact

  • Operators on hosts with restricted outbound HTTP cannot start the consensus node even when they know their public IP.
  • Operators behind NAT or with a static advertised IP cannot pin it through env config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions