This repository was 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.7k
Add Subscription RPC for Grandpa Finality #5732
Merged
75 commits merged into
paritytech:master
from
HCastano:hc-add-subscription-rpc-for-finality
Aug 10, 2020
Merged
Changes from 41 commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
2f5367f
Rough skeleton for what I think the RPC should look like
HCastano 9d369ac
Create channel for sending justifications
HCastano 0095b78
WIP: Add subscribers for justifications to Grandpa
HCastano 7719292
WIP: Add a struct for managing subscriptions
HCastano 8c35b1e
Make naming more clear and lock data in Arc
HCastano 07ef5fa
Rough idea of what RPC would look like
HCastano c9aa9e2
Remove code from previous approach
HCastano 78250b7
Missed some things
HCastano fe31500
Update client/rpc-api/src/chain/mod.rs
HCastano ba13ee6
Update client/rpc-api/src/chain/mod.rs
HCastano fe360b9
Split justification subscription into sender and receiver halves
HCastano 254bebe
Replace RwLock with a Mutex
HCastano 9c996ea
Add sample usage from the Service's point of view
HCastano 8090161
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano 1150e5d
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano 130a871
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano f42b6c3
Remove code that referred to "chain_" RPC
HCastano d61d7ec
Use the Justification sender/receivers from Grandpa LinkHalf
HCastano 56e716b
Add some PubSub boilerplate
HCastano c0c6508
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano 1bc9103
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano 30e3831
Merge branch 'master' into hc-add-subscription-rpc-for-finality
HCastano 8b0850a
Add guiding comments
HCastano cf07f2f
TMP: comment out to fix compilation
octol ab64ecb
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol b1c04ba
Return MetaIoHandler from PubSubHandler in create_full
octol ebad4d7
Uncomment pubsub methods in rpc handler (fails to build)
octol caaaa61
node/rpc: make Metadata concrete in create_full to fix compilation
octol f3cc272
node: pass in SubscriptionManger to grandpa rpc handler
octol 3c4505a
grandpa-rpc: use SubscriptionManger to add subscriber
octol 9a225ac
grandpa-rpc: attempt at setting up the justification stream (fails to…
octol a85dd53
grandpa-rpc: fix compilation of connecting stream to sink
octol 1b0344f
grandpa-rpc: implement unsubscribe
octol 12dd5df
grandpa-rpc: update older tests
octol bca6a13
grandpa-rpc: add full prefix to avoid confusing rust-analyzer
octol efaa0d1
grandpa-rpc: add test for pubsub not available
octol 9632988
grandpa-rpc: tidy up leftover code
octol 964f1e3
grandpa-rpc: add test for sub and unsub of justifications
octol 82004cb
grandpa-rpc: minor stylistic changes
octol e526f95
grandpa-rpc: split unit test
octol 6c71b8f
grandpa-rpc: minor stylistic changes in test
octol 8bfb560
grandpa-rpc: skip returning future when cancelling
octol be7cb78
grandpa-rpc: reuse testing executor from sc-rpc
octol ac81cdf
grandpa-rpc: don't need to use PubSubHandler in tests
octol 3f8630d
node-rpc: use MetaIoHandler rather than PubSubHandler
octol 3b387e6
grandpa: log if getting header failed
octol bf4b19a
grandpa: move justification channel creation into factory function
octol 4c96b73
grandpa: make the justification sender optional
octol 12158a2
grandpa: fix compilation warnings
octol e2584e5
grandpa: move justification notification types to new file
octol dc3c888
grandpa-rpc: move JustificationNotification to grandpa-rpc
octol 410af1f
grandpa-rpc: move JustificationNotification to its own file
octol fb3ad63
grandpa: rename justification channel pairs
octol 5d80399
grandpa: rename notifier types
octol 3f33fd2
grandpa: pass justification as GrandpaJustification to the rpc module
octol 57f1963
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 90ae56e
Move Metadata to sc-rpc-api
tomusdrw be1df4f
grandpa-rpc: remove unsed error code
octol d4cddf3
grandpa: fix bug for checking if channel is closed before sendind
octol 8bd9e5c
grandpa-rpc: unit test for sending justifications
octol 127c19e
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol f43ee9b
grandpa-rpc: update comments for the pubsub test
octol 39640c1
grandpa-rpc: update pubsub tests with more steps
octol f3c6c54
grandpa-rpc: fix pubsub test
octol 44ba73e
grandpa-rpc: minor indendation
octol 01f7d73
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 3f3b136
grandpa-rpc: decode instead of encode in test
octol 908cf15
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol bb9ad4b
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 410ddea
grandpa: fix review comments
octol ca126fd
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 452024f
grandpa: remove unused serde dependency
octol 8b0cf76
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 7ddffef
Merge branch 'master' into hc-add-subscription-rpc-for-finality
octol 817b425
Merge remote-tracking branch 'upstream/master' into hc-add-subscripti…
octol 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 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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,15 +9,21 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" | |
|
|
||
| [dependencies] | ||
| sc-finality-grandpa = { version = "0.8.0-rc3", path = "../" } | ||
| sc-rpc = { version = "2.0.0-rc3", path = "../../rpc" } | ||
| sp-runtime = { version = "2.0.0-rc3", path = "../../../primitives/runtime" } | ||
| finality-grandpa = { version = "0.12.3", features = ["derive-codec"] } | ||
| jsonrpc-core = "14.2.0" | ||
| jsonrpc-core-client = "14.2.0" | ||
| jsonrpc-derive = "14.2.1" | ||
| jsonrpc-pubsub = "14.2.0" | ||
| futures = { version = "0.3.4", features = ["compat"] } | ||
| serde = { version = "1.0.105", features = ["derive"] } | ||
| serde_json = "1.0.50" | ||
| log = "0.4.8" | ||
| derive_more = "0.99.2" | ||
| parking_lot = "0.10.0" | ||
|
||
|
|
||
| [dev-dependencies] | ||
| sp-core = { version = "2.0.0-rc3", path = "../../../primitives/core" } | ||
| lazy_static = "1.4" | ||
| sc-network-test = { version = "0.8.0-rc3", path = "../../network/test" } | ||
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.
Is this needed?
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.
Currently it's used due to using a concrete
sc_rpc::Metadatainstead of the generic one used before. I'll try again to see if we can switch back to a generic type