Repository navigation
SEPARATE (optional): keep long-poll on for an echoed legacy -32021 - #100
Merged
Merged
Conversation
Separate parity change (not part of the echo corpus sync). The waiter dropped the wait on every legacy -32021, even when the error carried data.waitedMs. Align with the Rust SDK: an echoed pending error keeps long polling, a malformed echo is a protocol error, and a pending error without an echo still drops the wait.
MastaP
approved these changes
Nov 2, 2026
MastaP
left a comment
Member
There was a problem hiding this comment.
Approving df6db7c. The change is correct and matches the Rust SDK (src/client/http/wait.rs, the RPC_INCLUSION_PENDING branch) and JS #205. Whether to take it is the owner's call; notes below.
- A pending error that echoes
waitedMskeeps long polling. After the pending error, the waiter still callsnext(max(interval, MIN_POLL_GAP_MILLIS)), so an instantwaitedMs: 0cannot cause a tight loop. - The echo counts only in a narrow case. It must be
data.has("waitedMs")on object data, on a call that asked for a wait (asked > 0), on an id-matched -32021 that was not classified as an overload first. Non-object data, or data without the member, still drops the wait (aLegacyPendingErrorWithDataButNoEchoStillDropsTheWait). - There is one new terminal path. A malformed echo (
LongPoll.isWireMillisfalse) now ends the wait withJsonRpcResponseException; before, it polled on without long poll. This matches Rust and the existing treatment of a malformedwaitedMson a result. - Our servers never reach this code today. Neither aggregator-go nor the gateway sends -32021. It only matters for a legacy or third-party aggregator.
- Checks pass.
./gradlew buildpasses, with checkstyle and all tests;InclusionProofWaiterTestruns 49 of 49. WithInclusionProofWaiter.javareverted to main,aLegacyPendingErrorThatEchoesTheWaitKeepsLongPollingandaLegacyPendingErrorWithAMalformedEchoIsAProtocolErrorfail. - Nit. The tests spell out
com.fasterxml.jackson…types fully qualified instead of importing them.
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.
Separate, optional parity change; independent of the echo corpus sync PR. The owner may decline it.
The waiter disabled long-poll on every legacy -32021, even when the error echoed
data.waitedMs. Aligns with the Rust SDK: an echoed pending error keeps long polling, a malformed echo is a protocol error, and a pending error without an echo still drops the wait.