You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(dispatcher): advance mint counter past caller-supplied request ids
The dispatcher's minted-id guard only checked the in-flight table, so
once a caller-supplied numeric request id completed, the monotonic
counter could reach the same value and put it on the wire again. The
spec forbids reusing a request id within a session ("The request ID
MUST NOT have been previously used by the requestor within the same
session"), and stateful peers may cross-wire responses for duplicate
ids (#3060).
When a supplied id is accepted, advance the mint counter past its
coerced key so minted ids can never revisit it — in both
JSONRPCDispatcher (pending keys) and DirectDispatcher (in-flight ids).
Minted ids are ints, so only numeric keys ("7" and 7 share the coerced
key) can collide; string ids are unaffected. Caller re-supply of its
own used id stays allowed, as asserted by existing tests.
One existing test's expected mint sequence changes from [1, 2, 4] to
[4, 5, 6]: the counter now clears the supplied id at acceptance rather
than skipping it only on collision. The never-collide contract it tests
still holds.
Closes#3126
0 commit comments