Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Narwhal] cleanup more unused handlers #13060

Merged
merged 2 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
.
  • Loading branch information
mwtian committed Jul 19, 2023
commit 21eadaf07599ee9b5981da42fbb14d56d2a0bc34
6 changes: 6 additions & 0 deletions narwhal/primary/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ impl Primary {
epoch_string.clone(),
)));

let primary_peer_ids = committee
.authorities()
.map(|authority| PeerId(authority.network_key().0.to_bytes()));
let routes = anemo::Router::new()
.add_rpc_service(primary_service)
.route_layer(RequireAuthorizationLayer::new(AllowedPeers::new(
primary_peer_ids,
)))
.route_layer(RequireAuthorizationLayer::new(AllowedEpoch::new(
epoch_string.clone(),
)))
Expand Down
9 changes: 8 additions & 1 deletion narwhal/worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl Worker {
keypair,
id,
committee: committee.clone(),
worker_cache,
worker_cache: worker_cache.clone(),
protocol_config: protocol_config.clone(),
parameters: parameters.clone(),
store,
Expand Down Expand Up @@ -175,8 +175,15 @@ impl Worker {
epoch_string.clone(),
)));

let worker_peer_ids = worker_cache
.all_workers()
.into_iter()
.map(|(worker_name, _)| PeerId(worker_name.0.to_bytes()));
let routes = anemo::Router::new()
.add_rpc_service(worker_service)
.route_layer(RequireAuthorizationLayer::new(AllowedPeers::new(
worker_peer_ids,
)))
.route_layer(RequireAuthorizationLayer::new(AllowedEpoch::new(
epoch_string.clone(),
)))
Expand Down