libp2p-test-plans/DESIGN.md

7.0 KiB
Raw Permalink Blame History

libp2p testing story

Date: 2022-10-18
Status: In Progress

Overview

This document describes our process for testing interoperability & backward compatibility across libp2p implementations.

Why:

  • Interoperability is a shared concern.
  • There is no single blessed libp2p reference implementation that we use for conformance testing.
  • No single maintainer (go|rust|js-libp2p or IPDX) will succeed without everyone's involvement.
  • We want to share a Testing Story with the world that shows we care about quality & interop.
  • We want to encourage other implementations to join the testing party.

Historical Context:

  • We completed a “PING” interop test with Testground. It is running in the go-libp2p and rust-libp2p CI pipeline.
  • It means we “proved” that we can write and run interop tests between versions AND implementations.

Libp2p Testing Matrix

What do we want to test next?

go-libp2p rust-libp2p js-libp2p (node) js-libp2p (browser) jvm-libp2p nim-libp2p
Simple PING #35 🍎 🔥
Circuit Relay
WebTransport Transport 🔥 🔥 (depends on https://github.com/libp2p/js-libp2p-webtransport/issues/1) 🔥 (depends on https://github.com/libp2p/js-libp2p-webtransport/issues/1)
WebRTC Transport 🔥 (depends on working implementation) 🔥 (depends on working implementation) 🔥 (depends on working implementation) 🔥 (depends on working implementation)
NAT Traversal
Hole Punching (STUN)
Identify Protocol
AutoNAT
DHT
QUIC
Benchmarking?

Dependencies

Questions

  • When do we revisit this table to discuss priorities and add new tests?

Legend

  •  Done
  • 🚚 In Progress
  • 🔥 Highest Priority
  • 🍎 Low-hanging fruit
  • 🧊 Lowest priority

How does libp2p test interoperability?



Background

The approach outlined below is pretty much what happen with the go|rust-libp2p ping tests in 2022Q3.

libp2p implementations aren't forced to adopt this approach, but it is the approach that has been taken by some of the longer-lived implementations (go, JS, and rust).

I (@laurent) havent had time to look at libp2p/interop yet. Some information may be missing.

202210 Proposal

Example:

Question:

  • What should be the format for this description?
  • Can we live with a rough “here is a general idea of what the test should do”, and let the first implementor figure out the details?
  • Do we need to make these decisions now? (09-09-2022)

Example:

Why:

  • During implementation, some decisions might be taken on how coordination works, details of the tests, etc. It will be easier to clear the path from one implementation.

Example:

Example:

Example:

  • TODO: add the full interop test to go-libp2p + update their release documentation.

Open Questions

  • When do we revisit this scenario to improve and gather feedback?
    • How do we evaluate progress & success?
      • When were able to use these tests for benchmarking probably.
    • Whats the plan for the day when everything starts to break?
    • Whats the plan for the time when we start to crumble under test complexity?
  • Maintenance
    • Tests will need updates on new releases, etc.
  • What are the dependencies between tests?
    • ex: Does it make sense to test HOLE PUNCHING if you dont test AUTONAT first?

Refs