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

Add basic peer manager #108

Draft
wants to merge 8 commits into
base: unstable
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 commits
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
68 changes: 40 additions & 28 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ parking_lot = "0.12"
reqwest = "0.12.12"
rusqlite = "0.28.0"
serde = { version = "1.0.208", features = ["derive"] }
smallvec = "2.0.0-alpha.9"
dknopik marked this conversation as resolved.
Show resolved Hide resolved
strum = { version = "0.24", features = ["derive"] }
tokio = { version = "1.39.2", features = [
"rt",
Expand Down
6 changes: 6 additions & 0 deletions anchor/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ edition = { workspace = true }
authors = ["Sigma Prime <[email protected]>"]

[dependencies]
arbitrary = "1.4.1"
delay_map = "0.4"
dirs = { workspace = true }
discv5 = { workspace = true }
ethereum_serde_utils = "1.0.0-beta.0"
ethereum_ssz = "0.8.1"
ethereum_ssz_derive = "0.8.1"
futures = { workspace = true }
hex = "0.4.3"
itertools = "0.10.5"
libp2p = { version = "0.54", default-features = false, features = [
"identify",
"yamux",
Expand All @@ -25,8 +28,11 @@ libp2p = { version = "0.54", default-features = false, features = [
"ping",
] }
lighthouse_network = { workspace = true }
parking_lot = { workspace = true }
serde = { workspace = true }
smallvec = { workspace = true }
ssz_types = "0.10"
strum = "0.24.1"
task_executor = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions anchor/network/src/behaviour.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::discovery::Discovery;
use crate::peer_manager::PeerManager;
use libp2p::swarm::NetworkBehaviour;
use libp2p::{gossipsub, identify, ping};

Expand All @@ -12,4 +13,6 @@ pub struct AnchorBehaviour {
pub gossipsub: gossipsub::Behaviour,
/// Discv5 Discovery protocol.
pub discovery: Discovery,
/// The peer manager that keeps track of peer's reputation and status.
pub peer_manager: PeerManager,
}
1 change: 1 addition & 0 deletions anchor/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod config;
mod discovery;
mod keypair_utils;
mod network;
mod peer_manager;
mod transport;
pub mod types;

Expand Down
Loading
Loading