-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Add js-libp2p Echo Protocol Interoperability Tests #800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add js-libp2p Echo Protocol Interoperability Tests #800
Conversation
|
quick clarification notes for reviewers: • this echo-interop/ suite follows existing test-plans patterns (similar to gossipsub-interop/) and integrates through lib-test-execution.sh without introducing new orchestration frameworks. • Redis is used only for lightweight multiaddr discovery between the JS echo server container and the Python client container. No persistent state or external dependencies are introduced. • the JS libp2p node uses the default stack configuration intentionally, to match baseline js-libp2p behavior in existing interop suites. Explicit transport/security/muxer configuration can be added if preferred by maintainers. • all Docker containers are ephemeral and self-contained - no host system modifications or persistent volumes required. happy to adjust structure or naming if the maintainers prefer a different convention. 🙂 |
|
This is a great start. Can we rename the root folder to just This is a good first pass, but please look at how the transport or perf tests are built using their run.sh, lib/*.sh scripts. |
- Follows naming convention preferred by maintainers - Consistent with other test directories (perf, transport, hole-punch) - Addresses @dhuseby review feedback in PR libp2p#800
@dhuseby thank you for the excellent feedback. i've implemented both requested changes: 1. Directory renamed:
|
Implements Echo protocol (/echo/1.0.0) interoperability tests between js-libp2p (server) and py-libp2p (client) following existing test-plans structure and conventions. - JS Echo Server: Containerized js-libp2p node implementing Echo protocol - Python Test Harness: pytest-based client using py-libp2p with trio - Uses existing test-plans framework for orchestration and execution - Supports TCP transport with Noise security and Yamux/Mplex muxers Closes libp2p/py-libp2p#1155
Follow existing test-plans naming convention where interop test directories use the -interop suffix (transport/, perf/, hole-punch/, gossipsub-interop/).
- Update trio version to >=0.26.0 to resolve dependency conflict - Ensures compatibility with libp2p==0.5.0
- Add libgmp-dev system dependency for fastecdsa compilation - Required for cryptographic operations in libp2p
- Remove unused imports to avoid compatibility issues - Streamline echo test implementation - Maintain core functionality for interop testing
- Use minimal dependency set with libp2p and redis - Remove version-specific imports to avoid compatibility issues - Focus on core functionality for echo server
- Generated from npm install with simplified dependencies - Ensures reproducible builds
- Use default libp2p configuration to avoid version conflicts - Implement manual stream handling for echo protocol - Add better error logging and Redis coordination - Remove complex transport/security configuration
- Implements Docker-based test coordination - Manages JS server and Python client containers - Handles Redis coordination service - Provides automated cleanup and error handling
- Explains Echo protocol testing rationale vs Ping tests - Documents architecture and test cases - Provides usage instructions and troubleshooting - Follows test-plans documentation conventions - Includes manual testing and debugging guidance
- Follows naming convention preferred by maintainers - Consistent with other test directories (perf, transport, hole-punch) - Addresses @dhuseby review feedback in PR libp2p#800
- Implements proper test-plans framework pattern - Generates test combinations: js-server × py-client × transport × security × muxer - Supports filtering and caching like transport/perf tests - Uses lib-filter-engine.sh for consistent filtering behavior - Addresses @dhuseby feedback on framework compliance
- Implements Docker-based test orchestration per test-plans pattern - Manages Redis coordination, server/client containers - Provides structured JSON output for results aggregation - Includes proper cleanup and error handling - Follows run-single-test.sh pattern from transport/perf tests
- Creates interactive HTML dashboard showing test results - Displays pass/fail status with summary statistics - Organized by server/client/transport/security/muxer combinations - Responsive design matching test-plans visual standards - Follows generate-dashboard.sh pattern from other test suites
- Replaces direct lib-test-execution.sh call with full framework - Adds test matrix generation, image building, compose file generation - Implements parallel test execution with worker support - Includes inputs.yaml generation and caching - Adds comprehensive CLI argument parsing and help - Addresses @dhuseby feedback on framework compliance
2f7bb4e to
4eb7a85
Compare
Overview
Implements comprehensive Echo protocol (
/echo/1.0.0) interoperability tests between js-libp2p and py-libp2p, addressing the Universal Connectivity initiative requirements for 2026.Closes: libp2p/py-libp2p#1155
Motivation
As part of the Universal Connectivity initiative, py-libp2p is expanding interoperability coverage to ensure parity with other libp2p implementations. While we have:
We were missing dedicated Echo protocol tests for js-libp2p.
Echo protocol validation is critical because it tests full bidirectional stream read/write capabilities (muxing, window management, payload integrity), whereas simple Ping tests often miss subtle stream handling bugs (e.g., Yamux hangs).
Implementation
Architecture
Key Components
JavaScript Echo Server
/echo/1.0.0handlerPython Test Harness
Framework Integration
run.shusinglib-test-execution.shimages.yamlfollowing test-plans conventionsTesting
Test Coverage
"Hello, Echo!"\x00\x01\x02\x03\x04Validation Results
Changes Made
New Files
echo-interop/run.sh- Framework integrationecho-interop/test-echo.sh- Test orchestrationecho-interop/images.yaml- Implementation configecho-interop/images/js-libp2p/v1.x/- JS server implementationecho-interop/images/py-libp2p/v0.x/- Python client implementationDependencies
Compliance
Requirements Fulfilled
/echo/1.0.0implementationTest-Plans Conventions
lib-test-execution.shframeworkimages.yamlconfigurationReview Notes
Key Areas for Review
Testing Instructions