-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.A task for a first time contributor to become familiar with the Polkadot-SDK.I5-enhancementAn additional feature request.An additional feature request.
Description
Is there an existing issue?
- I have searched the existing issues
Experiencing problems? Have you tried our Stack Exchange first?
- This is not a support question.
Request
Per the latest archive_v1_storage specification, the paginationStartKey parameter enables specifying a starting key for fetching storage items, which facilitates paginated retrieval.
It appears that the current implementation of archive_v1_storage does not yet support this parameter. Do we have plans to add support for it to ensure the API aligns with the specification?
polkadot-sdk/substrate/client/rpc-spec-v2/src/archive/archive.rs
Lines 217 to 266 in fd2bfd5
| fn archive_v1_storage( | |
| &self, | |
| pending: PendingSubscriptionSink, | |
| hash: Block::Hash, | |
| items: Vec<StorageQuery<String>>, | |
| child_trie: Option<String>, | |
| ) { | |
| let mut storage_client = | |
| StorageSubscriptionClient::<Client, Block, BE>::new(self.client.clone()); | |
| let fut = async move { | |
| let Ok(mut sink) = pending.accept().await.map(Subscription::from) else { return }; | |
| let items = match items | |
| .into_iter() | |
| .map(|query| { | |
| let key = StorageKey(parse_hex_param(query.key)?); | |
| Ok(StorageQuery { key, query_type: query.query_type }) | |
| }) | |
| .collect::<Result<Vec<_>, ArchiveError>>() | |
| { | |
| Ok(items) => items, | |
| Err(error) => { | |
| let _ = sink.send(&ArchiveStorageEvent::err(error.to_string())); | |
| return | |
| }, | |
| }; | |
| let child_trie = child_trie.map(|child_trie| parse_hex_param(child_trie)).transpose(); | |
| let child_trie = match child_trie { | |
| Ok(child_trie) => child_trie.map(ChildInfo::new_default_from_vec), | |
| Err(error) => { | |
| let _ = sink.send(&ArchiveStorageEvent::err(error.to_string())); | |
| return | |
| }, | |
| }; | |
| let (tx, mut rx) = tokio::sync::mpsc::channel(STORAGE_QUERY_BUF); | |
| let storage_fut = storage_client.generate_events(hash, items, child_trie, tx); | |
| // We don't care about the return value of this join: | |
| // - process_events might encounter an error (if the client disconnected) | |
| // - storage_fut might encounter an error while processing a trie queries and | |
| // the error is propagated via the sink. | |
| let _ = futures::future::join(storage_fut, process_storage_events(&mut rx, &mut sink)) | |
| .await; | |
| }; | |
| self.executor.spawn("substrate-rpc-subscription", Some("rpc"), fut.boxed()); | |
| } |
bkchr
Metadata
Metadata
Assignees
Labels
C2-good-first-issueA task for a first time contributor to become familiar with the Polkadot-SDK.A task for a first time contributor to become familiar with the Polkadot-SDK.I5-enhancementAn additional feature request.An additional feature request.
Type
Projects
Status
backlog