forked from near/nearcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new routing exchange prototype using IBF (near#4112)
Implement new algorithm for exchanging routing tables using Inverse Bloom Filters. near#3838 Reposting near#4108
- Loading branch information
Showing
50 changed files
with
2,198 additions
and
191 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
use crate::errors::RpcError; | ||
use near_network::routing::{Edge, SimpleEdge}; | ||
use near_primitives::network::PeerId; | ||
use serde::Deserialize; | ||
use serde_json::Value; | ||
|
||
#[derive(Deserialize)] | ||
pub struct SetRoutingTableRequest { | ||
pub add_edges: Option<Vec<Edge>>, | ||
pub remove_edges: Option<Vec<SimpleEdge>>, | ||
pub prune_edges: Option<bool>, | ||
} | ||
|
||
impl SetRoutingTableRequest { | ||
pub fn parse(value: Option<Value>) -> Result<Self, RpcError> { | ||
if let Some(value) = value { | ||
serde_json::from_value(value) | ||
.map_err(|err| RpcError::parse_error(format!("Error {:?}", err))) | ||
} else { | ||
Err(RpcError::parse_error("Require at least one parameter".to_owned())) | ||
} | ||
} | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct SetAdvOptionsRequest { | ||
pub disable_edge_signature_verification: Option<bool>, | ||
pub disable_edge_propagation: Option<bool>, | ||
pub disable_edge_pruning: Option<bool>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct StartRoutingTableSyncRequest { | ||
pub peer_id: PeerId, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#[cfg(feature = "adversarial")] | ||
pub mod adversarial; | ||
pub mod blocks; | ||
pub mod changes; | ||
pub mod chunks; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.