Skip to content

fix(acl01): raise the identify size limit so the relay is still seen as a relay - #275

Merged
NiKrause merged 1 commit into
acl01from
fix/identify-max-message-size-acl01
Aug 29, 2026
Merged

fix(acl01): raise the identify size limit so the relay is still seen as a relay#275
NiKrause merged 1 commit into
acl01from
fix/identify-max-message-size-acl01

Conversation

@NiKrause

Copy link
Copy Markdown
Owner

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:

Measured on the production relay Protocols of those /orbitdb/heads/* identify bytes
first measurement 122 109 10538
an hour later 129 116 11056

So every browser drops the message, and /libp2p/circuit/relay/0.2.0/hop disappears from the protocol list along with bitswap and meshsub. circuitRelayTransport({ discoverRelays: 1 }) looks for relays in exactly that list, finds none, and logs not discovered enough relays 0/1. No reservation, no /p2p-circuit address.

Nothing is wrong with the relay itself: it answers hop immediately if you open the stream by name, and a client that names the relay in addresses.listen still 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:

A · default 8192
   hop in the protocol list: no
   /p2p-circuit address: none after 30 s

B · maxMessageSize 65536
   hop in the protocol list: yes
   /p2p-circuit address: yes, after 2.0 s

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 /health and 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

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>
@NiKrause
NiKrause merged commit a930532 into acl01 Aug 29, 2026
1 check passed
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