test: Avoid interface_ipc.py Duplicate ID errors
What changed, and why it matters
This is a test-only fix that changes the order of import directories in a single Python test file. It prevents a false 'duplicate ID' error when the test accidentally loads two copies of the same Cap'n Proto schema file from different libmultiprocess installations. It does not change production Bitcoin Core code and does not create a security vulnerability.
No security action required. Treat as a normal test reliability improvement. Reviewers may verify the change only affects test import ordering and does not alter production IPC behavior.
Security signals we found
No production code changed
Test-only import path ordering fix
No input validation, memory handling, or cryptography changes
No privilege escalation, remote execution, or data integrity impact
Evidence from the diff
The commit modifies test/functional/interface_ipc.py to place the local libmultiprocess include directory (mp_dir) first in the capnp.load() imports list. Previously, if a system-wide or alternative libmultiprocess installation appeared earlier in the search path, Cap’n Proto could load proxy.capnp twice with the same schema ID, triggering ‘mp/proxy.capnp:0: failed: Duplicate ID @0xcc316e3f71a040fb’. The fix ensures deterministic loading of the local schema. This is a test reliability issue, not a runtime security issue.
Changed components
test/functional/interface_ipc.pyInspect captured patch +6 / −1
diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py
index ff1f74bf..4231e95b 100755
--- a/test/functional/interface_ipc.py
+++ b/test/functional/interface_ipc.py
@@ -35,7 +35,12 @@ class IPCInterfaceTest(BitcoinTestFramework):
capnp_dir = Path(capnp.__path__[0]).parent
src_dir = Path(self.config['environment']['SRCDIR']) / "src"
mp_dir = src_dir / "ipc" / "libmultiprocess" / "include"
- imports = [str(capnp_dir), str(src_dir), str(mp_dir)]
+ # List of import directories. Note: it is important for mp_dir to be
+ # listed first, in case there are other libmultiprocess installations on
+ # the system, to ensure that `import "/mp/proxy.capnp"` lines load the
+ # same file as capnp.load() loads directly below, and there are not
+ # "failed: Duplicate ID @0xcc316e3f71a040fb" errors.
+ imports = [str(mp_dir), str(capnp_dir), str(src_dir)]
return {
"proxy": capnp.load(str(mp_dir / "mp" / "proxy.capnp"), imports=imports),
"init": capnp.load(str(src_dir / "ipc" / "capnp" / "init.capnp"), imports=imports),
Why this scored 17/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.