Repository navigation
test(protocols): run the req/resp sim checks between two real hosts - #87
Open
IvanAnishchuk wants to merge 5 commits into
Open
IvanAnishchuk wants to merge 5 commits into
IvanAnishchuk wants to merge 5 commits into
Conversation
…tiate The host builds its upgrade from the public stages of libp2p/negotiate. The secured checkpoint sits between the handshake and the muxer stage, where the core seam puts it. Stream selection is a host shell over the pure negotiate core. This commit deletes the Negotiate.Legacy copy, and the unit 1b host legs now run. Part of etheorem#70.
Root ARCHITECTURE §3.1 says every suite above the transport runs on the test values, and the Noise test value has fixed keys. The host legs used Noise.securityProtocol, whose ephemeral keys come from Rng.system. Each suite host now takes Noise.fixedKeyProtocol, seeded from its identity byte. The host PLAN offered the production value as an option, and now names the test value only. Part of etheorem#70.
The sim checks of the req/resp suite now run between two hosts with Noise and yamux. Tests/HostPair.lean builds the pair. The requester opens its stream through the host's newStream. This commit deletes Protocols.Mock.Muxer and Protocols.Mock.HostStream. An id the peer does not serve now fails the open. Multistream-select answers na, so the stream never opens for that id. Part of etheorem#78.
The req/resp section said the host still upgrades through a mock of libp2p/negotiate, so the suite ran against a mock of the stream call. etheorem#86 puts the host on the real negotiate, and this branch runs the suite between two real hosts, so the sentence goes. Part of etheorem#78.
… test clock Root ARCHITECTURE §3.1 says every suite above the transport runs on the test values. Tests/HostPair.lean built its hosts with Noise.securityProtocol and the system clock. Each host now takes Noise.fixedKeyProtocol, seeded from its identity byte, and both hosts run on one TestClock that Pair.close closes. Part of etheorem#78.
IvanAnishchuk
force-pushed
the
seam-reqresp-mocks
branch
from
November 10, 2026 12:57
225b1e9 to
0d4c414
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The req/resp sim checks now run between two real hosts, on the fixed-key Noise value, yamux, and a test clock. This PR deletes
Protocols.Mock.MuxerandProtocols.Mock.HostStream, the two mocks #78 still owes. Closes #78.This PR stacks on #86, which puts the host on the real negotiate. Until #86 merges, the diff also shows its two commits. Review the three commits after them:
test(protocols): run the req/resp sim checks between two real hosts, the swap.docs(protocols): …, which drops the req/resp sentence that said the host still upgrades through a negotiate mock.test(protocols): run the host pair on the fixed-key Noise value and a test clock, which putsTests/HostPair.leanon the test values of root §3.1.What changed
Tests:
Tests/HostPair.lean(new): two hosts over a new sim net, on the test values of root §3.1. Each host takesNoise.fixedKeyProtocolwith an Ed25519 identity from one byte, and its ephemeral keys from anRngseeded from that byte. Both hosts run on oneTestClock, whichPair.closecloses. The muxer isMux.yamux. The server listens on/memory/4100, and the client holds a session to it.Tests/ReqResp.lean: the sim section takes the pair.openStreamOfmaps the host'snewStreamonto theOpenStreamofrequestPeer. A host failure that wraps a seam error reaches the requester as that error.openFailed). The mock reset the stream. The real host runs multistream-select, which answersna, so the stream never opens for that id.libp2p/protocols:Mock/Muxer.leanandMock/HostStream.leanare deleted.naanswer.Test plan
lake build --wfailonLibp2pProtocols,Tests.HostPair, andTests.ReqRespis green.lake testpasses: 27824 passed, 0 failed, 4 skipped. It passes again withLEAN_NUM_THREADS=1.Risk / trust footprint
None added or removed. The deleted
Mock/HostStream.leanheld twopartial defloops (readHeader,serveLoop). They go with it.Notes for reviewers
Protocols/Mock/Core.leanandMock/Host.leanstay. Identify and ping type over them, and their swap is [SEAM] W5.7 identify/ping: the mock connections of #45 #55.Protocols/Mock/Muxer.leanandProtocols/Mock/HostStream.lean(PR feat(protocols): W6.3, the req/resp framework over the snappy framing format #46) can be struck when this merges.LICENSE (LGPL version 3)