Skip to content

Commit

Permalink
Merge branch 'tim/memory-transport2' into 'master'
Browse files Browse the repository at this point in the history
feat: [NET-1441] Memory transport

This is intended for testing the state sync manager by simulating a network with limited capacity links and latency. 


There is a description in `lib.rs` of how the network is modeled. 

See merge request dfinity-lab/public/ic!13180
  • Loading branch information
tthebst committed Jun 27, 2023
2 parents a7a3d10 + 30e8dc2 commit 1771349
Show file tree
Hide file tree
Showing 6 changed files with 443 additions and 0 deletions.
16 changes: 16 additions & 0 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 @@ -192,6 +192,7 @@ members = [
"rs/orchestrator/registry_replicator",
"rs/p2p",
"rs/p2p/peer_manager",
"rs/p2p/memory_transport",
"rs/p2p/quic_transport",
"rs/p2p/state_sync_manager",
"rs/p2p/experimental/prototype",
Expand Down
35 changes: 35 additions & 0 deletions rs/p2p/memory_transport/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = [
"//rs/p2p/quic_transport:__subpackages__",
"//rs/p2p/state_sync_manager:__subpackages__",
])

DEPENDENCIES = [
"//rs/types/types",
"//rs/p2p/quic_transport",
"@crate_index//:axum",
"@crate_index//:bytes",
"@crate_index//:futures",
"@crate_index//:http",
"@crate_index//:prost",
"@crate_index//:tokio",
"@crate_index//:tower",
]

MACRO_DEPENDENCIES = [
"@crate_index//:async-trait",
]

ALIASES = {}

rust_library(
name = "memory_transport",
testonly = True,
srcs = glob(["src/**/*.rs"]),
aliases = ALIASES,
crate_name = "ic_memory_transport",
proc_macro_deps = MACRO_DEPENDENCIES,
version = "0.8.0",
deps = DEPENDENCIES,
)
19 changes: 19 additions & 0 deletions rs/p2p/memory_transport/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "ic-memory-transport"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
async-trait = "0.1.36"
axum = "0.6.12"
bytes = "1.0.1"
futures = "0.3.10"
http = "0.2.9"
ic-types = { path = "../../types/types" }
ic-quic-transport = { path = "../quic_transport" }
prost = "0.11.0"
tokio = { version = "1.15.0", features = ["full"] }
tower = "0.4.13"

0 comments on commit 1771349

Please sign in to comment.