fix(acl01): raise the identify size limit so the relay is still seen as a relay - #275
Merged
Merged
Conversation
libp2p rejects an identify response above `maxMessageSize` — 8192 by default — and rejects it whole, not the entries that made it large. The relay announces one libp2p protocol per database it holds open (`/orbitdb/heads/<address>`, from OrbitDB's own sync), so its response has grown past that line: 10538 bytes at 122 protocols, 11056 an hour later at 129. Every browser therefore drops the relay's identify message, and with it `/libp2p/circuit/relay/0.2.0/hop`. `circuitRelayTransport` never recognises the connected, working relay as a relay, so there is no reservation and no `/p2p-circuit` address — the peer stays visible over gossipsub while being unreachable. That is the "peers are listed but nobody can be called" report. Paired measurement against production, same client twice, this the only difference: default 8192 hop advertised: no circuit address: none after 30 s 65536 hop advertised: yes circuit address: after 2.0 s 64 KiB leaves room for roughly 700 databases. The relay side is NiKrause/orbitdb-relay#50 (the size, now reported on /health) and #51 (why the protocol list grows at all); this keeps browsers working meanwhile. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Browsers cannot get a circuit reservation from the production relay, so peers appear in the list and none of them can be reached.
Cause
libp2p rejects an identify response above
maxMessageSize(8192 by default) and rejects it whole. The relay announces one libp2p protocol per database it holds open —/orbitdb/heads/<address>, from OrbitDB's own sync — and has crossed that line:/orbitdb/heads/*So every browser drops the message, and
/libp2p/circuit/relay/0.2.0/hopdisappears from the protocol list along withbitswapandmeshsub.circuitRelayTransport({ discoverRelays: 1 })looks for relays in exactly that list, finds none, and logsnot discovered enough relays 0/1. No reservation, no/p2p-circuitaddress.Nothing is wrong with the relay itself: it answers
hopimmediately if you open the stream by name, and a client that names the relay inaddresses.listenstill gets a reservation. Only discovery is broken — and discovery is what this app uses.Proof
Same client twice —
listen: ['/p2p-circuit'],circuitRelayTransport({ discoverRelays: 1 }), bootstrapped to the relay, exactly as configured here. The identify limit is the only difference:Why 64 KiB
Today's payload is ~11 KiB and grows by roughly 72 bytes per database the relay opens. 64 KiB leaves room for about 700 of them. The cost is a larger identify message accepted from any peer, which at this size is modest.
Not the fix, only the guard
The relay side is tracked in NiKrause/orbitdb-relay#50 — which now reports the payload size on
/healthand in metrics so the cliff is visible — and NiKrause/orbitdb-relay#51, which asks whether one protocol id per database can work for a relay at all. Neither is resolved; this keeps browsers connecting meanwhile and is worth having regardless, since no client should lose a relay silently because a peer got chatty.svelte-check: 0 errors, 0 warnings.🤖 Generated with Claude Code