-
Notifications
You must be signed in to change notification settings - Fork 2.6k
chainHead_storage: Backport queries for value types #14551
Conversation
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
match result { | ||
QueryResult::Buffered(storage_result) => storage_results.push(storage_result), | ||
QueryResult::Immediate(event) => { | ||
let _ = sink.send(&event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec says this about errors: "This can only be the first event generated by this subscription. No other event will be generated with this subscription.". As far as I see we continue to send events here even after some error was sent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out! I opened paritytech/json-rpc-interface-spec#63 in the spec to ask for some clarifications here, since we could have multiple items in the query we might still want to return the Error
after processing and sending some results back to the user
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oki doki, have made the error event here the first event and only event submitted.
No more events would be produced now after we encounter an error here
I've opened paritytech/json-rpc-interface-spec#63 for further discussion about intermediate error events.
In the meanwhile, to make some progress here we'll stick with today's version of the spec
Thanks!
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
Co-authored-by: Sebastian Kunert <[email protected]>
Signed-off-by: Alexandru Vasile <[email protected]>
… lexnv/rpc_query_value_hash
Signed-off-by: Alexandru Vasile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Signed-off-by: Alexandru Vasile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me from what I understand!
* chainHead/events: Add storage params and events Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Check storage events serialization / deserialization Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/error: Add error for invalid WaitForContinue storage call Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/storage: Use new items params Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Adjust storage tests to the new API Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/events: Generalize StorageQuery by provided key Signed-off-by: Alexandru Vasile <[email protected]> * chain_head: Add dedicated ChainHeadStorage client for queries Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/storage: Implement queries for hashes of values Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/tests: Check storage queries for hashes of values Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Improve API documentation wrt multiple entries Signed-off-by: Alexandru Vasile <[email protected]> * chainHead/event: Rename StorageQueue ty to queue_ty Signed-off-by: Alexandru Vasile <[email protected]> * chianHead: Add helper to encode chainHead results as hex str Signed-off-by: Alexandru Vasile <[email protected]> * Update client/rpc-spec-v2/src/chain_head/error.rs Co-authored-by: Sebastian Kunert <[email protected]> * chainHead: Change the `queryResult` to a plain `Result` Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Stop producing events after the first error Signed-off-by: Alexandru Vasile <[email protected]> * chainHead: Change child_key to child_trie API param Signed-off-by: Alexandru Vasile <[email protected]> --------- Signed-off-by: Alexandru Vasile <[email protected]> Co-authored-by: Sebastian Kunert <[email protected]>
This PR backports the following RPC V2 spec changes for
chainHead_storage
:ChainHeadEvent::Done
has divergedvalue
similarly as beforeCloses: #14547
// @paritytech/subxt-team