fix(entrypoint): respect operator-provided P2P_ADVERTISE_IP#1111
Open
faisalnugroho wants to merge 1 commit into
Open
fix(entrypoint): respect operator-provided P2P_ADVERTISE_IP#1111faisalnugroho wants to merge 1 commit into
faisalnugroho wants to merge 1 commit into
Conversation
The consensus-entrypoint script always calls get_public_ip() and exports the result as BASE_NODE_P2P_ADVERTISE_IP, overriding any value the operator already set in their env file. This is a problem for operators running behind NAT or in restricted networks where the external IP services are unreachable — the script exits with code 8 and the node won't start, even though the operator already knows their public IP and configured it. Now checks if BASE_NODE_P2P_ADVERTISE_IP is already set before attempting discovery. If the operator provided a value, it's used as-is. Discovery only runs as a fallback. Refs base#1107
Collaborator
🟡 Heimdall Review Status
|
Author
|
Hi! I'd love to get this PR reviewed when you have a moment. This PR addresses respect operator-provided P2P_ADVERTISE_IP. Happy to make any adjustments based on your feedback. Let me know if there's anything I can do to help move this forward. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the
consensus-entrypointscript respectBASE_NODE_P2P_ADVERTISE_IPif the operator has already set it, instead of always running IP discovery and potentially overriding or failing.The problem
The script unconditionally calls
get_public_ip()(which triesifconfig.me,api.ipify.org,ipecho.net,v4.ident.me) and exports the result asBASE_NODE_P2P_ADVERTISE_IP, even if the operator already configured this in their env file.This causes two issues:
Silent override: If an operator sets
BASE_NODE_P2P_ADVERTISE_IPto a specific value (e.g., a load balancer IP or a specific interface), the script ignores it and replaces it with whatever the discovery endpoints return.Hard failure on restricted networks: If all four IP services are unreachable (firewalled host, restricted egress, transient network issues), the script exits with code 8 and the consensus container won't start — even when the operator already provided the correct IP.
The fix
Discovery only runs as a fallback when no value is provided. Existing operators who don't set this variable see no behavior change — the script still discovers their IP automatically.
Fixes #1107