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.7k
babe: replace usage of SharedEpochChanges with internal RPC #13883
Merged
paritytech-processbot
merged 10 commits into
master
from
andre/babe-refactor-shared-data
Apr 18, 2023
Merged
babe: replace usage of SharedEpochChanges with internal RPC #13883
paritytech-processbot
merged 10 commits into
master
from
andre/babe-refactor-shared-data
Apr 18, 2023
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
andresilva
commented
Apr 11, 2023
client/consensus/babe/src/lib.rs
Outdated
let answer_requests = | ||
answer_requests(worker_rx, babe_link.config, client, babe_link.epoch_changes); | ||
|
||
spawner.spawn_essential("babe-worker", None, Box::pin(answer_requests)); |
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 isn't great but I wanted to minimize changes to the structure of service.
SinkExt::send provides backpressure in case the channel is full
bkchr
approved these changes
Apr 11, 2023
Co-authored-by: Bastian Köcher <git@kchr.de>
acatangiu
approved these changes
Apr 12, 2023
davxy
approved these changes
Apr 12, 2023
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.
🟢
@davxy addressed |
bot merge force |
15 tasks
nathanwhit
pushed a commit
to nathanwhit/substrate
that referenced
this pull request
Jul 19, 2023
…ch#13883) * babe: replace usage of SharedEpochChanges with internal RPC * babe-rpc: fix tests * babe: use SinkExt::send instead of Sender::try_send SinkExt::send provides backpressure in case the channel is full * Update client/consensus/babe/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * babe: fix spawn * babe: send handles backpressure * babe: use testing::TaskExecutor * babe-rpc: better error handling --------- Co-authored-by: Bastian Köcher <git@kchr.de>
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.
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.
Currently in order for different components to fetch BABE-related data they share ownership of the
SharedEpochChanges
data structure, exposing internal details of BABE to external consumers. This PR creates a request/response system for BABE which runs in a background worker when the BABE import queue is created, and changes the BABE and SyncState RPC to instead retrieve their required data asynchronously using this worker (rather than directly fromSharedEpochChanges
).There is still one user of
SharedEpochChanges
which is themanual-seal
crate. I have made changes to support this new system but since there are no tests for this I am not sure if I have broken anything. I will deal with that in a future PR.polkadot companion: paritytech/polkadot#7059