Skip to content

Commit a4ff202

Browse files
committed
final tests, removed redundant id check within specs
1 parent 9ace59d commit a4ff202

File tree

3 files changed

+22
-25
lines changed

3 files changed

+22
-25
lines changed

compute/src/node/reqres.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@ impl DriaComputeNode {
5151
spec_request.request_id
5252
);
5353

54-
// ensure peer is authorized
55-
if !self.dria_nodes.rpc_peerids.contains(&peer_id) {
56-
log::warn!(
57-
"Received spec request from unauthorized source: {}",
58-
peer_id
59-
);
60-
log::debug!("Allowed sources: {:#?}", self.dria_nodes.rpc_peerids);
61-
return Err(eyre!("Received unauthorized spec request from {}", peer_id));
62-
}
63-
6454
let response = SpecResponder::respond(spec_request, self.spec_collector.collect().await);
6555
let response_data = serde_json::to_vec(&response)?;
6656

@@ -145,7 +135,12 @@ impl DriaComputeNode {
145135
Some(channel) => {
146136
TaskResponder::handle_respond(self, task_response, channel).await?;
147137
}
148-
None => log::error!("Channel not found for task id: {}", task_response.task_id),
138+
None => {
139+
return Err(eyre!(
140+
"Channel not found for task id: {}",
141+
task_response.task_id
142+
))
143+
}
149144
};
150145

151146
Ok(())

compute/src/utils/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl DriaMessage {
8686
let recovery_id =
8787
RecoveryId::parse(self.recovery_id).wrap_err("could not decode recovery id")?;
8888

89-
// verify signature w.r.t the body and the given public key
89+
// verify signature w.r.t the payload and the given public key
9090
let message = Message::parse(&sha256hash(&self.payload));
9191

9292
let recovered_public_key = recover(&message, &signature, &recovery_id)?;

p2p/src/network.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ impl DriaNetworkType {
4545
pub fn get_static_bootstrap_nodes(&self) -> Vec<Multiaddr> {
4646
match self {
4747
DriaNetworkType::Community => [
48-
// "/ip4/18.205.158.27/tcp/4001/p2p/16Uiu2HAmB2GFG8oYa7DuivXYEsMUPiiKQ6yq9haQHRHHjJrn7FHo",
49-
"/ip4/44.206.245.139/tcp/4001/p2p/16Uiu2HAm4q3LZU2T9kgjKK4ysy6KZYKLq8KiXQyae4RHdF7uqSt4",
50-
"/ip4/18.234.39.91/tcp/4001/p2p/16Uiu2HAmJqegPzwuGKWzmb5m3RdSUJ7NhEGWB5jNCd3ca9zdQ9dU",
51-
"/ip4/54.242.44.217/tcp/4001/p2p/16Uiu2HAmR2sAoh9F8jT9AZup9y79Mi6NEFVUbwRvahqtWamfabkz",
52-
"/ip4/52.201.242.227/tcp/4001/p2p/16Uiu2HAmFEUCy1s1gjyHfc8jey4Wd9i5bSDnyFDbWTnbrF2J3KFb",
48+
"/ip4/18.205.158.27/tcp/4001/p2p/16Uiu2HAmB2GFG8oYa7DuivXYEsMUPiiKQ6yq9haQHRHHjJrn7FHo",
49+
// "/ip4/44.206.245.139/tcp/4001/p2p/16Uiu2HAm4q3LZU2T9kgjKK4ysy6KZYKLq8KiXQyae4RHdF7uqSt4",
50+
// "/ip4/18.234.39.91/tcp/4001/p2p/16Uiu2HAmJqegPzwuGKWzmb5m3RdSUJ7NhEGWB5jNCd3ca9zdQ9dU",
51+
// "/ip4/54.242.44.217/tcp/4001/p2p/16Uiu2HAmR2sAoh9F8jT9AZup9y79Mi6NEFVUbwRvahqtWamfabkz",
52+
// "/ip4/52.201.242.227/tcp/4001/p2p/16Uiu2HAmFEUCy1s1gjyHfc8jey4Wd9i5bSDnyFDbWTnbrF2J3KFb",
5353
].iter(),
5454
DriaNetworkType::Pro => [].iter(),
5555
DriaNetworkType::Test => [].iter(),
@@ -63,11 +63,11 @@ impl DriaNetworkType {
6363
pub fn get_static_relay_nodes(&self) -> Vec<Multiaddr> {
6464
match self {
6565
DriaNetworkType::Community => [
66-
// "/ip4/3.88.84.50/tcp/4001/p2p/16Uiu2HAmN35mw5MMf3SCUt3TpEU6WnBvjYJQ4ZZeKHRHEkSc4RPq",
67-
"/ip4/34.201.33.141/tcp/4001/p2p/16Uiu2HAkuXiV2CQkC9eJgU6cMnJ9SMARa85FZ6miTkvn5fuHNufa",
68-
"/ip4/18.232.93.227/tcp/4001/p2p/16Uiu2HAmHeGKhWkXTweHJTA97qwP81ww1W2ntGaebeZ25ikDhd4z",
69-
"/ip4/54.157.219.194/tcp/4001/p2p/16Uiu2HAm7A5QVSy5FwrXAJdNNsdfNAcaYahEavyjnFouaEi22dcq",
70-
"/ip4/54.88.171.104/tcp/4001/p2p/16Uiu2HAm5WP1J6bZC3aHxd7XCUumMt9txAystmbZSaMS2omHepXa",
66+
"/ip4/3.88.84.50/tcp/4001/p2p/16Uiu2HAmN35mw5MMf3SCUt3TpEU6WnBvjYJQ4ZZeKHRHEkSc4RPq",
67+
// "/ip4/34.201.33.141/tcp/4001/p2p/16Uiu2HAkuXiV2CQkC9eJgU6cMnJ9SMARa85FZ6miTkvn5fuHNufa",
68+
// "/ip4/18.232.93.227/tcp/4001/p2p/16Uiu2HAmHeGKhWkXTweHJTA97qwP81ww1W2ntGaebeZ25ikDhd4z",
69+
// "/ip4/54.157.219.194/tcp/4001/p2p/16Uiu2HAm7A5QVSy5FwrXAJdNNsdfNAcaYahEavyjnFouaEi22dcq",
70+
// "/ip4/54.88.171.104/tcp/4001/p2p/16Uiu2HAm5WP1J6bZC3aHxd7XCUumMt9txAystmbZSaMS2omHepXa",
7171
].iter(),
7272
DriaNetworkType::Pro => [].iter(),
7373
DriaNetworkType::Test => [].iter(),
@@ -81,8 +81,8 @@ impl DriaNetworkType {
8181
pub fn get_static_rpc_nodes(&self) -> Vec<Multiaddr> {
8282
match self {
8383
DriaNetworkType::Community => [
84-
// "/ip4/104.28.54.97/tcp/4001/p2p/16Uiu2HAmEcBQRQy4CVCnQ144rnvagKa1fS5uAguwq9S2DRiRmAWE",
85-
]
84+
"/ip4/3.238.173.11/tcp/4001/p2p/16Uiu2HAmEcBQRQy4CVCnQ144rnvagKa1fS5uAguwq9S2DRiRmAWE"
85+
]
8686
.iter(),
8787
DriaNetworkType::Pro => [].iter(),
8888
DriaNetworkType::Test => [].iter(),
@@ -95,7 +95,9 @@ impl DriaNetworkType {
9595
#[inline(always)]
9696
pub fn get_static_rpc_peer_ids(&self) -> Vec<PeerId> {
9797
match self {
98-
DriaNetworkType::Community => [].iter(),
98+
DriaNetworkType::Community => {
99+
["16Uiu2HAmEcBQRQy4CVCnQ144rnvagKa1fS5uAguwq9S2DRiRmAWE"].iter()
100+
}
99101
DriaNetworkType::Pro => [].iter(),
100102
DriaNetworkType::Test => [].iter(),
101103
}

0 commit comments

Comments
 (0)