Repository navigation
websocket: Deliver the received signature notification instead of closing the connection - #706
Merged
michaelhly merged 1 commit intoOct 4, 2026
Conversation
…nnection With enable_received_notification, the node sends a signatureNotification whose value is the string "receivedSignature" before the processed one. solders can't parse it, so the reader failed and closed the connection, dropping every subscription on it. Parse that notification in the client as SignatureReceivedNotification and keep the signature subscription until the processed notification ends it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #706 +/- ##
==========================================
+ Coverage 95.26% 95.30% +0.03%
==========================================
Files 25 25
Lines 1902 1917 +15
==========================================
+ Hits 1812 1827 +15
Misses 90 90 🚀 New features to boost your workflow:
|
Collaborator
|
looks good But I think fix in solders is better. I'll try open a pr to solders |
Contributor
Author
|
Thanks! Agreed that solders is the right place for the parsing. I can open that PR since I already have the repro, unless you've started on it. Since solana-py pins |
Collaborator
|
Maybe we can add this temp fix in solana-py and waiting for solders fix? |
Owner
|
Thank you. Let me make a minor release on master first. |
michaelhly
approved these changes
Oct 4, 2026
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.
Problem
signature_subscribe(enable_received_notification=True)(new in #703, not released yet) closes the whole websocket connection as soon as the node reports the signature as received.With that option the node sends an extra notification ahead of the processed one, and its
valueis a plain string instead of an object (ReceivedSignatureResult::ReceivedSignaturein Agave'srpc-client-types/src/response.rs):{"jsonrpc":"2.0","method":"signatureNotification","params":{"result":{"context":{"slot":505544335},"value":"receivedSignature"},"subscription":13566433}}solders only models the processed shape (
RpcSignatureResponse { err }), soparse_websocket_messageraisesSerdeJSONError. InSolanaWsClientthat ends the reader task, which abandons the connection: every subscription on it is dropped,recv()raises, and the client has to be rebuilt.I found this while going through the new
signature_subscribeoptions from #703: solders'SignatureNotificationonly covers the processed result, so I checked what the node actually sends for the received one. Reproduced on devnet at 96047a5 by subscribing to a transfer's signature withenable_received_notification=Trueand then sending the transfer:Fix
_parse_framerecognizes the"receivedSignature"notification before the frame reaches solders and returns a newSignatureReceivedNotification(subscription, slot). Every other frame still goes throughparse_websocket_message.recv()and iteration yield it like any other notification. Only the processedSignatureNotificationdrops the local handle, since the server keeps the subscription until then, sounsubscribe()still works in between.signature_subscribedocstring and the cookbook page mention the extra notification.The underlying gap is in solders, which could model this as an enum like Agave does. Handling it here keeps the option usable with the solders version this release depends on.
I left
CHANGELOG.mdalone since #705 is rewriting the Unreleased section. Happy to add a line to either PR.Verification
test_received_signature_notification_is_deliveredfeeds the received notification and then the processed one through the fake socket, and checks that the connection stays open, the handle survives the first notification and is dropped by the second. Removing the parsing change makes it fail withSerdeJSONError; letting the received notification drop the handle makes it fail too.make lintandmake unit-testspass (202 passed).Devnet script