Skip to content

feat: add haskell to kad-dht interop matrix - #136

Open
adust09 wants to merge 1 commit into
libp2p:masterfrom
adust09:feat/kad-dht-haskell
Open

feat: add haskell to kad-dht interop matrix#136
adust09 wants to merge 1 commit into
libp2p:masterfrom
adust09:feat/kad-dht-haskell

Conversation

@adust09

@adust09 adust09 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Add haskell to the Kad-DHT suite.

libp2p-hs is a Haskell implementation of
the libp2p stack. It is already registered in the transport suite as
haskell-v0.1 (#134); this adds its Kademlia DHT node here.

Test app

The node implements all three roles behind the ROLE env var and follows the
contract in kad-dht/README.md:

  • Reads ROLE, TEST_KEY, REDIS_ADDR
  • bootstrap — listens, SETs {TEST_KEY}_bootstrap_addr, runs a DHT server
  • provider — dials the bootstrap, runs provide + putValue, then SETs
    {TEST_KEY}_provider_done
  • querier — waits for both keys, runs findProviders + getValue, prints
    status: pass / status: fail (plus error: lines) on stdout
  • Keys match the py and dotnet nodes: interop-test-key-{TEST_KEY} and
    /example/data/{TEST_KEY}, value hello from haskell client
  • All logging goes to stderr; stdout carries only the YAML result

The image builds from the repository's own Dockerfile with the repo root as
build context, so it uses the existing source.dockerfile path in
build-images.sh — the same mode as nim. No changes to build-images.sh,
generate-tests.sh, or run-single-test.sh were needed.

Validation

Full local run of all 37 matrix tests involving haskell, with the image built
from the pinned commit through the same path CI takes:

→ Building kad-dht-haskell from adust09/libp2p-hs@25cf16e3 (-f interop/kad-dht-node/Dockerfile)
Ran: 37, Skipped: 27, Passed: 37, Failed: 0

Getting there took two fixes in libp2p-hs (adust09/libp2p-hs#265), both found by
running against this suite rather than against itself:

passed
initial 8 / 37
+ store/match the hello from payload convention 30 / 37
+ register Identify handlers 37 / 37

The second one is worth flagging for anyone adding an implementation:
dotnet-libp2p awaits /ipfs/id/1.0.0 on every outbound connection before its
dial resolves, so a node that does not serve Identify is undialable from dotnet
even though the transport handshake completes.

Note on the existing matrix

For reference, the 27 pre-existing py/dotnet/nim tests score 24/27 on the
same machine. The three failures (py_x_py_x_dotnet, dotnet_x_py_x_dotnet,
dotnet_x_dotnet_x_dotnet) are dotnet-querier lookups timing out and are
unrelated to this change — they reproduce without haskell in images.yaml.

The matrix grows from 27 to 64 tests. The image is a GHC build and takes roughly
10 minutes from cold; let me know if that is a problem for the test pass budget.

Register libp2p-hs, a Haskell implementation of libp2p, as an
implementation in the kad-dht suite. The node implements all three roles
(bootstrap, provider, querier) behind the ROLE env var and follows the
Redis coordination contract.

The image builds from the repository's own Dockerfile, matching the nim
entry's source layout.
@adust09
adust09 requested a review from dhuseby as a code owner August 17, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant