This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
chainHead: Add support for storage pagination and cancellation #14755
Merged
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a97fd42
chainHead/api: Add `chain_head_unstable_continue` method
lexnv fe3404c
chainHead/subscriptions: Register operations for pagination
lexnv 72b26c3
chainHead/subscriptions: Merge limits with registered operation
lexnv e28d982
chainHead/subscriptions: Expose the operation state
lexnv 1d717df
chain_head/storage: Generate WaitingForContinue event
lexnv 3bbc9ba
chainHead: Use the continue operation
lexnv 5afe9c0
chainHead/tests: Adjust testing to the new storage interface
lexnv c8e8ed5
chainHead/config: Make pagination limit configurable
lexnv 60492c7
chainHead/tests: Adjust chainHeadConfig
lexnv 6929ec5
chainHead/tests: Check pagination and continue method
lexnv 2791c90
chainHead/api: Add `chainHead_unstable_stopOperation` method
lexnv 8bda477
chainHead/subscription: Add shared atomic state for efficient alloc
lexnv 382ce98
chainHead: Implement operation stop
lexnv 3a5c12a
chainHead/tests: Check that storage ops can be cancelled
lexnv 6d825a6
chainHead/storage: Change docs for query_storage_iter_pagination
lexnv cab6202
chainHead/subscriptions: Fix merge conflicts
lexnv 141ca3f
chainHead: Replace `async-channel` with `tokio::sync`
lexnv 7ccef40
chainHead/subscription: Add comment about the sender/recv continue
lexnv d1b2817
Merge remote-tracking branch 'origin/master' into lexnv/chainhead_pag
lexnv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Can you explain why
async-channel
is used here?You already got the
futures-channel and tokio sync
in the dependency tree so I don't follow why this dependency is introduced as the both tokio and futures-channel provides an API for the stuff you implemented on top of the channelEDIT: tokio::sync::mpsc creates a buffer with 1 and futures_channel a buffer with 1 + num senders, so I guess you want exactly one here
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.
That makes sense! I can't actually remember if I picked the
async-channel
here since it doesn't require the receiver part to be mutable 🤔I'll change a bit the API since it's worth not adding extra dependencies, thanks!
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.
ah, didn't notice that :D