Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Request based collator protocol: validator side
Browse files Browse the repository at this point in the history
- Missing: tests
- Collator side
- don't connect, if not connected
  • Loading branch information
eskimor committed Mar 12, 2021
1 parent bb34beb commit 999ace3
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 300 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions node/network/bridge/src/multiplexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ fn multiplex_single(
decode_with_peer::<v1::AvailabilityFetchingRequest>(peer, payload)?,
pending_response,
)),
Protocol::CollationFetching => From::from(IncomingRequest::new(
peer,
decode_with_peer::<v1::CollationFetchingRequest>(peer, payload)?,
pending_response,
)),
};
Ok(r)
}
Expand Down
1 change: 1 addition & 0 deletions node/network/collator-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ polkadot-node-network-protocol = { path = "../../network/protocol" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
always-assert = "0.1.2"

[dev-dependencies]
log = "0.4.13"
Expand Down
4 changes: 1 addition & 3 deletions node/network/collator-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ mod collator_side;
mod validator_side;

const LOG_TARGET: &'static str = "collator_protocol";
const REQUEST_TIMEOUT: Duration = Duration::from_secs(1);

#[derive(Debug, Error)]
enum Error {
Expand Down Expand Up @@ -94,7 +93,6 @@ impl CollatorProtocolSubsystem {
match self.protocol_side {
ProtocolSide::Validator(metrics) => validator_side::run(
ctx,
REQUEST_TIMEOUT,
metrics,
).await,
ProtocolSide::Collator(id, metrics) => collator_side::run(
Expand Down Expand Up @@ -129,7 +127,7 @@ where
#[tracing::instrument(level = "trace", skip(ctx), fields(subsystem = LOG_TARGET))]
async fn modify_reputation<Context>(ctx: &mut Context, peer: PeerId, rep: Rep)
where
Context: SubsystemContext<Message = CollatorProtocolMessage>,
Context: SubsystemContext,
{
tracing::trace!(
target: LOG_TARGET,
Expand Down
Loading

0 comments on commit 999ace3

Please sign in to comment.