-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Use Rayon for plexer stage (#5)
- Loading branch information
Showing
8 changed files
with
308 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ pub mod model; | |
pub mod prelude; | ||
pub mod storage; | ||
pub mod upstream; | ||
|
||
#[cfg(test)] | ||
mod tests; |
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,43 @@ | ||
use pallas::network::miniprotocols::Point; | ||
use tracing::info; | ||
|
||
use crate::upstream::plexer; | ||
use crate::upstream::prelude::*; | ||
|
||
#[test] | ||
fn connect_to_real_relay() { | ||
tracing::subscriber::set_global_default( | ||
tracing_subscriber::FmtSubscriber::builder() | ||
.with_max_level(tracing::Level::TRACE) | ||
.finish(), | ||
) | ||
.unwrap(); | ||
|
||
let known_point = Point::Specific( | ||
3866155, | ||
hex::decode("9a5446c4178c708706f8218ee05cec7674396e5f044f911eacc1ad1147cc353e").unwrap(), | ||
); | ||
|
||
let mut input = MuxInputPort::default(); | ||
let mut output = DemuxOutputPort::default(); | ||
|
||
let client_channel = protocol_channel(2, &mut input, &mut output); | ||
|
||
let worker = plexer::Worker::new( | ||
"preview-node.world.dev.cardano.org:30002".into(), | ||
2, | ||
input, | ||
output, | ||
); | ||
|
||
let tether = gasket::runtime::spawn_stage(worker, gasket::runtime::Policy::default(), None); | ||
|
||
let mut client = OuroborosClient::new(client_channel); | ||
let (point, _) = client.find_intersect(vec![known_point.clone()]).unwrap(); | ||
|
||
assert_eq!(point.unwrap(), known_point); | ||
|
||
info!("dismissing"); | ||
tether.dismiss_stage().unwrap(); | ||
tether.join_stage(); | ||
} |
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,2 +1,3 @@ | ||
pub mod chainsync; | ||
pub mod plexer; | ||
pub mod prelude; |
Oops, something went wrong.