ci: add one more routable address to the VMs (docker containers)
What changed, and why it matters
This commit changes the Bitcoin Core continuous integration (CI) test setup script. It adds a second Docker network with a fixed IPv4 address (1.1.1.5) and assigns a fixed IPv6 address (1111:1111::5) to the test container. The purpose is to enable two specific network-related functional tests that require predictable routable IP addresses. There is no user-facing software change and no security vulnerability is introduced or fixed.
No security action required. This is a CI/test infrastructure change. Reviewers may optionally confirm that the chosen IP ranges (1.1.1.0/24 and 1111:1111::/112) do not conflict with any private internal network used by the CI environment, but this is an operational concern, not a product security issue.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies ci/test/02_run_container.py to create an additional Docker IPv4 subnet (1.1.1.0/24, named ci-ip4net) and explicitly binds the container to IPv6 address 1111:1111::5 on the existing ci-ip6net. It then connects the running container to ci-ip4net with the static IPv4 address 1.1.1.5. These addresses are hard-coded because they are referenced by feature_bind_port_discover.py and feature_bind_port_externalip.py. The change is purely CI infrastructure configuration.
Changed components
ci/test/02_run_container.pyInspect captured patch +4 / −0
diff --git a/ci/test/02_run_container.py b/ci/test/02_run_container.py
index abaa5355..05887000 100755
--- a/ci/test/02_run_container.py
+++ b/ci/test/02_run_container.py
@@ -115,6 +115,7 @@ def main():
CI_CCACHE_MOUNT = f"type=bind,src={os.environ['CCACHE_DIR']},dst={os.environ['CCACHE_DIR']}"
run(["docker", "network", "create", "--ipv6", "--subnet", "1111:1111::/112", "ci-ip6net"], check=False)
+ run(["docker", "network", "create", "--subnet", "1.1.1.0/24", "ci-ip4net"], check=False)
if os.getenv("RESTART_CI_DOCKER_BEFORE_RUN"):
print("Restart docker before run to stop and clear all containers started with --rm")
@@ -144,6 +145,7 @@ def main():
f"--env-file={env_file}",
f"--name={os.environ['CONTAINER_NAME']}",
"--network=ci-ip6net",
+ "--ip6=1111:1111::5", # Used by some of the tests, don't change it just here (keep them in sync).
f"--platform={os.environ['CI_IMAGE_PLATFORM']}",
os.environ["CONTAINER_NAME"],
]
@@ -154,6 +156,8 @@ def main():
text=True,
).stdout.strip()
+ run(["docker", "network", "connect", "--ip=1.1.1.5", "ci-ip4net", container_id]) # The IP address is used by some of the tests, don't change it just here (keep them in sync).
+
def ci_exec(cmd_inner, **kwargs):
if os.getenv("DANGER_RUN_CI_ON_HOST"):
prefix = []
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.