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
Simplify trait bounds in network to prepare for collator-rpc #12082
Merged
Conversation
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
skunert
added
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
labels
Aug 22, 2022
skunert
added
the
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
label
Aug 22, 2022
koute
reviewed
Aug 25, 2022
koute
approved these changes
Aug 26, 2022
bkchr
approved these changes
Aug 31, 2022
3 tasks
Fyi ipfs clients don't seem to receive responses from substate bitswap anymore after this PR... Edit: Or rather this PR #12242 finishing the job |
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this pull request
Feb 27, 2023
…ech#12082) * Hack towards PoC * Abstract away runtime requirement * blockchainevents * Remove bitswap * Remove unused sync more * Remove unused features in network * Re-enable bitswap change * Remove `Chain` trait bound * Reimplement blockchain-rpc-events * Move network to cumulus * Make AuthorityDiscovery async * Remove `ProofProvider` requirement from network behaviour * Extract bitswap * Adjustments after merge * Remove HeaderMetadata trait from network * Introduce NetworkHeaderBackend * Add comments * Improve comments * Move NetworkHeaderBackend to new module * Improve naming, remove redundand send + sync * Clean up generics * Fix CI * Improve comment and readability * Remove NetworkHeaderBackend * Fix Cargo.lock Co-authored-by: Sebastian Kunert <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
A0-please_review
Pull request needs code review.
B0-silent
Changes should not be mentioned in any release notes
C1-low
PR touches the given topic and has a low impact on builders.
D3-trivial 🧸
PR contains trivial changes in a runtime directory that do not require an audit
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.
This is a preparation PR for paritytech/cumulus#989.
Why is this needed?
We will introduce a minimal relay chain node in cumulus, which only runs a subset
of all Polkadot subsystems and also only required network functionality.
This minimal node will connect to the relay chain via RPC and fetch the required information.
This PR refactors some issues in substrate to make implementing this RPC client easier, behaviour should not change.
Change Summary
I try to remove as many bounds as possible from the client instance that goes into the network.
ProofProvider
was already unused since the sync refactoringHeaderMetadata
was already unused since the sync refactoringBlockBackend
is used in theBitswap
protocol. The protocol was already optional but required theBlockBackend
bound. I introduce new abstractions, and Bitswap can now be passed into the network via parameters.NetworkHeaderBackend
that accepts onlyHash
instead ofBlockId
, which resembles our RPC interface more