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

feat(network): start network impl and rpc handling #462

Closed
wants to merge 1 commit into from

Conversation

dancoombs
Copy link
Collaborator

#248

Proposed Changes

  • Start the Network implementation with the RPC behavior (sorry about the behaviour spelling, thats what libp2p uses to I was consistent).
  • Implement the RPC behavior with its custom connection handler, and inbound and outbound protocols
  • Start an integration test suite

@dancoombs
Copy link
Collaborator Author

Next up:

  • Gossipsub implementation
  • Discv5 discovery behavior
  • Peer management
    • Metadata, status, ping management
    • Peer reputation and scoring
    • Peer rate limiting

}
}
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: tests

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #462 (0eb3059) into danc/p2p-codec (c43c845) will increase coverage by 1.19%.
The diff coverage is 77.09%.

Impacted file tree graph

Files Coverage Δ
crates/network/src/behaviour.rs 100.00% <100.00%> (ø)
crates/network/src/rpc/handler/serde.rs 95.67% <100.00%> (+0.03%) ⬆️
crates/network/src/rpc/message.rs 67.92% <ø> (+11.32%) ⬆️
crates/network/src/rpc/handler/outbound.rs 89.58% <89.58%> (ø)
crates/network/src/rpc/handler/inbound.rs 80.43% <80.43%> (ø)
crates/network/src/rpc/behaviour.rs 87.91% <87.91%> (ø)
crates/network/src/rpc/handler/handler.rs 90.97% <90.97%> (ø)
crates/network/src/enr.rs 61.22% <61.22%> (ø)
bin/tools/src/bin/network.rs 0.00% <0.00%> (ø)
crates/network/src/network.rs 77.55% <77.55%> (ø)

... and 1 file with indirect coverage changes

Flag Coverage Δ
unit-tests 55.71% <77.09%> (+1.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
rundler binary 0.00% <0.00%> (ø)
builder 45.04% <ø> (ø)
dev 0.00% <ø> (ø)
pool 59.54% <ø> (ø)
provider 1.33% <ø> (ø)
rpc 18.26% <ø> (ø)
sim 82.61% <ø> (ø)
tasks ∅ <ø> (∅)
types 93.56% <ø> (ø)
utils 7.20% <ø> (ø)
network 88.54% <81.98%> (-1.07%) ⬇️


let transport = tcp::tokio::Transport::default()
.upgrade(upgrade::Version::V1Lazy)
.authenticate(noise::Config::new(&local_key).unwrap())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove these unwraps

Comment on lines +181 to +182
let mplex_config = libp2p_mplex::MplexConfig::new();
let yamux_config = libp2p::yamux::Config::default();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: pass these in through config

use rundler_network::{Config as NetworkConfig, ConnectionConfig, Network};
use tokio::sync::mpsc;

const PRIVATE_KEY: &str = "b0ddfec7d365b4599ff8367e960f8c4890364f99e2151beac352338cc0cfe1bc";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this to a .env

@github-actions github-actions bot added the stale label Nov 13, 2023
@github-actions github-actions bot closed this Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants