Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
fb272a6
Convert `NetworkWorker::poll()` into async `next_action()`
dmitry-markin Jan 16, 2023
4b5d851
Use `NetworkWorker::next_action` instead of `poll` in `sc-network-test`
dmitry-markin Jan 18, 2023
1c87141
Revert "Use `NetworkWorker::next_action` instead of `poll` in `sc-net…
dmitry-markin Jan 23, 2023
dbd8ad9
Fix `sc-network-test` to poll `NetworkWorker::next_action`
dmitry-markin Jan 23, 2023
e8d0758
Fix `sc_network::service` tests to poll `NetworkWorker::next_action`
dmitry-markin Jan 23, 2023
3071b05
Fix docs
dmitry-markin Jan 23, 2023
431e550
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Jan 23, 2023
d7be660
kick CI
dmitry-markin Jan 23, 2023
78cce1a
Factor out `next_worker_message()` & `next_swarm_event()`
dmitry-markin Feb 3, 2023
c9f75f7
Error handling: replace `futures::pending!()` with `expect()`
dmitry-markin Feb 6, 2023
4a85d1f
Simplify stream polling in `select!`
dmitry-markin Feb 6, 2023
c165185
Replace `NetworkWorker::next_action()` with `run()`
dmitry-markin Feb 6, 2023
d827ae9
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 6, 2023
019ec35
Apply suggestions from code review
dmitry-markin Feb 6, 2023
d38b2b7
minor: comment
dmitry-markin Feb 6, 2023
343e9e9
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 6, 2023
dd4980d
Apply suggestions from code review
dmitry-markin Feb 7, 2023
403dded
Print debug log when network future is shut down
dmitry-markin Feb 7, 2023
5a7ec32
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 7, 2023
73dfd4b
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 8, 2023
5a63842
Evaluate `NetworkWorker::run()` future once before the loop
dmitry-markin Feb 10, 2023
913e21c
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 10, 2023
8e1db2c
Fix client code to match new `NetworkService` interfaces
dmitry-markin Feb 11, 2023
faec2e9
Make clippy happy
dmitry-markin Feb 11, 2023
9fa646d
Apply suggestions from code review
dmitry-markin Feb 13, 2023
9c5b610
Apply suggestions from code review
dmitry-markin Feb 13, 2023
f324937
Revert "Apply suggestions from code review"
dmitry-markin Feb 13, 2023
9856cc4
Make `NetworkWorker::run()` consume `self`
dmitry-markin Feb 13, 2023
f86ec12
Terminate system RPC future if RPC rx stream has terminated.
dmitry-markin Feb 13, 2023
9557a42
Rewrite with let-else
dmitry-markin Feb 13, 2023
533cc04
Fix comments
dmitry-markin Feb 13, 2023
e669c6a
Get `best_seen_block` and call `on_block_finalized` via `ChainSync` i…
dmitry-markin Feb 13, 2023
6ed5d48
rustfmt
dmitry-markin Feb 13, 2023
ab1ced4
make clippy happy
dmitry-markin Feb 13, 2023
4be62c7
Tests: schedule wake if `next_action()` returned true
dmitry-markin Feb 14, 2023
5e90af0
minor: comment
dmitry-markin Feb 14, 2023
a9123a7
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 14, 2023
113a888
minor: fix `NetworkWorker` rustdoc
dmitry-markin Feb 14, 2023
ac1452c
minor: amend the rustdoc
dmitry-markin Feb 14, 2023
5fc3831
Fix bug that caused `on_demand_beefy_justification_sync` test to hang
dmitry-markin Feb 15, 2023
6005109
Merge remote-tracking branch 'origin/master' into dm-network-service-…
dmitry-markin Feb 15, 2023
9df7d0e
rustfmt
dmitry-markin Feb 15, 2023
812c316
Apply review suggestions
dmitry-markin Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustfmt
  • Loading branch information
dmitry-markin committed Feb 13, 2023
commit 6ed5d48dce41918ed347eefd730f2ad66e6d99ce
4 changes: 1 addition & 3 deletions client/network-gossip/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,7 @@ mod tests {
}
}

impl NetworkBlock<<Block as BlockT>::Hash, NumberFor<Block>>
for TestNetwork
{
impl NetworkBlock<<Block as BlockT>::Hash, NumberFor<Block>> for TestNetwork {
fn announce_block(&self, _hash: <Block as BlockT>::Hash, _data: Option<Vec<u8>>) {
unimplemented!();
}
Expand Down
5 changes: 1 addition & 4 deletions client/network-gossip/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ mod validator;

/// Abstraction over a network.
pub trait Network<B: BlockT>:
NetworkPeers
+ NetworkEventStream
+ NetworkNotification
+ NetworkBlock<B::Hash, NumberFor<B>>
NetworkPeers + NetworkEventStream + NetworkNotification + NetworkBlock<B::Hash, NumberFor<B>>
{
fn add_set_reserved(&self, who: PeerId, protocol: ProtocolName) {
let addr =
Expand Down
4 changes: 1 addition & 3 deletions client/network-gossip/src/state_machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,7 @@ mod tests {
}
}

impl NetworkBlock<<Block as BlockT>::Hash, NumberFor<Block>>
for NoOpNetwork
{
impl NetworkBlock<<Block as BlockT>::Hash, NumberFor<Block>> for NoOpNetwork {
fn announce_block(&self, _hash: <Block as BlockT>::Hash, _data: Option<Vec<u8>>) {
unimplemented!();
}
Expand Down
3 changes: 1 addition & 2 deletions client/network/common/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@ pub trait NetworkBlock<BlockHash, BlockNumber> {
fn new_best_block_imported(&self, hash: BlockHash, number: BlockNumber);
}

impl<T, BlockHash, BlockNumber> NetworkBlock<BlockHash, BlockNumber>
for Arc<T>
impl<T, BlockHash, BlockNumber> NetworkBlock<BlockHash, BlockNumber> for Arc<T>
where
T: ?Sized,
T: NetworkBlock<BlockHash, BlockNumber>,
Expand Down
2 changes: 1 addition & 1 deletion client/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ pub use sc_network_common::{
},
sync::{
warp::{WarpSyncPhase, WarpSyncProgress},
StateDownloadProgress, SyncState,
StateDownloadProgress, SyncState,
},
};
pub use service::{
Expand Down
2 changes: 1 addition & 1 deletion client/network/sync/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ where
},
ToServiceCommand::Status { pending_response } => {
let _ = pending_response.send(self.status());
}
},
}
}
self.process_outbound_requests();
Expand Down
6 changes: 4 additions & 2 deletions client/network/sync/src/service/chain_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ pub enum ToServiceCommand<B: BlockT> {
),
JustificationImported(PeerId, B::Hash, NumberFor<B>, bool),
BlockFinalized(B::Hash, NumberFor<B>),
Status { pending_response: oneshot::Sender<SyncStatus<B>> },
Status {
pending_response: oneshot::Sender<SyncStatus<B>>,
},
}

/// Handle for communicating with `ChainSync` asynchronously
Expand All @@ -57,7 +59,7 @@ impl<B: BlockT> ChainSyncInterfaceHandle<B> {
}

/// Get sync status
///
///
/// Returns an error if `ChainSync` has terminated.
pub async fn status(&self) -> Result<SyncStatus<B>, ()> {
let (tx, rx) = oneshot::channel();
Expand Down
9 changes: 7 additions & 2 deletions client/service/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,11 @@ where
Some("networking"),
chain_sync_network_provider.run(network.clone()),
);
spawn_handle.spawn("import-queue", None, import_queue.run(Box::new(chain_sync_service.clone())));
spawn_handle.spawn(
"import-queue",
None,
import_queue.run(Box::new(chain_sync_service.clone())),
);

let (system_rpc_tx, system_rpc_rx) = tracing_unbounded("mpsc_system_rpc", 10_000);
spawn_handle.spawn(
Expand All @@ -978,7 +982,8 @@ where
),
);

let future = build_network_future(network_mut, client, chain_sync_service, config.announce_block);
let future =
build_network_future(network_mut, client, chain_sync_service, config.announce_block);

// TODO: Normally, one is supposed to pass a list of notifications protocols supported by the
// node through the `NetworkConfiguration` struct. But because this function doesn't know in
Expand Down