sc-network: expose add_to_priority_group and `remove_from_priority_…#7247
Conversation
…group` in `NetworkService`
client/network/src/service.rs
Outdated
| /// | ||
| /// Returns an `Err` if one of the given addresses is invalid or contains an | ||
| /// invalid peer ID (which includes the local peer ID). | ||
| pub fn add_to_priority_group(&self, group_id: String, peers: HashSet<Multiaddr>) -> Result<(), String> { |
There was a problem hiding this comment.
| pub fn add_to_priority_group(&self, group_id: String, peers: HashSet<Multiaddr>) -> Result<(), String> { | |
| pub async fn add_to_priority_group(&self, group_id: String, peers: HashSet<Multiaddr>) -> Result<(), String> { |
Declaring this method as async would grant us a greater implementation flexibility in the future, e.g. a bounded channel between NetworkService and NetworkWorker.
@tomaka what do you think of requiring all new methods on NetworkService to be able to yield?
@ordian Are you able to await this method within Polkadot?
There was a problem hiding this comment.
yes, awaiting is fine, but would we need to change all three methods then (set_, add_, remove_)?
There was a problem hiding this comment.
👍 As eventually it'd be nice if the queue from the network service to the worker was bounded as well.
…up-updates * master: Async keystore + Authority-Discovery async/await (#7000) Fixes logging of target names with dashes (#7281) seal: Add automated weights for contract API calls (#7017) add ss58 id for nodle (#7279) Refactor CurrencyToVote (#6896) bump-allocator: document & poison (#7277) Reset flaming fir network (#7274) reschedule (#6860) Drop system cache for trie benchmarks (#7242) client: improve log formatting (#7272) Rework `InspectState` (#7271) SystemOrigin trait (#7226) Update ss58 registry for Dock network (#7263) .maintain/monitoring: Add alert when continuous task ends (#7250) Rename `TRANSACTION_VERSION` to `EXTRINSIC_VERSION` (#7258) Split block announce processing into two parts (#6958) Fix offchain election to respect the weight (#7215)
Co-authored-by: Max Inden <mail@max-inden.de>
…f github.com:paritytech/substrate into ao-network-expose-incremental-priority-group-updates * 'ao-network-expose-incremental-priority-group-updates' of github.com:paritytech/substrate: Update client/network/src/service.rs
mxinden
left a comment
There was a problem hiding this comment.
Looks good to me. Small suggestion. I am fine either way.
Co-authored-by: Max Inden <mail@max-inden.de>
|
bot merge |
|
Waiting for commit status. |
|
Merge failed: |
|
bot merge |
|
Trying merge. |
A follow up to #3376 (comment).
Needed for paritytech/polkadot#1763.
polkadot companion: paritytech/polkadot#1800