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
fix chain subscription: less boiler plate #10285
Merged
niklasad1
merged 3 commits into
dp-jsonrpsee-integration-2
from
na-jsonrpsee-chain-subscription-less-boiler-plate
Nov 22, 2021
Merged
Changes from all commits
Commits
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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,6 @@ | |
//! Substrate blockchain API. | ||
|
||
mod chain_full; | ||
mod helpers; | ||
|
||
#[cfg(test)] | ||
mod tests; | ||
|
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.
This will only send the result if
maybe_header.is_some()
it should be infallible to get the best_block AFAIU....More similar to how
substrate master
behaves FWIW.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.
See https://github.com/paritytech/substrate/blob/master/client/rpc/src/chain/mod.rs#L301-#L322
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.
Well, it's a db lookup right? So sure, if it fails the node has bigger problems, but it's not infallible.
Not sure if you suggest we should get rid of the comment about "holes" in the stream, but I don't think this new code changes that. If there's a new block between when we lookup the best block (i.e. resolve
maybe_header
) and the time we read from the stream, the block we sent as "best" might not be immediately precedent to the next one we send. I don't think this is a catastrophic flaw though, more like something to be aware of.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.
Yeah, you right I was under impression that it was cached.
My point was that before the error was sent over the channel now it's just logged and filtered out via
stream:iter(None)
.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.
Thus, the comment is still "accurate"