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(MR): [MR-638] Use both guaranteed and best-effort calls in all XNet tests #3582

Merged
merged 18 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1768bfc
feat(MR): [MR-638] Basic XNet test with best-effort calls
alin-at-dfinity Jan 20, 2025
f5cc74e
Merge branch 'master' into alin/MR-638-best-effort-xnet-test
alin-at-dfinity Jan 20, 2025
33cc4ef
Revive return_cycles() endpoint.
alin-at-dfinity Jan 20, 2025
84c819b
Merge branch 'master' into alin/MR-638-best-effort-xnet-test
alin-at-dfinity Jan 20, 2025
6c06bf4
Merge branch 'master' into alin/MR-638-best-effort-xnet-test
alin-at-dfinity Jan 20, 2025
0d04d31
Automatically updated Cargo*.lock
Jan 20, 2025
e0e0f10
Fix formatting.
alin-at-dfinity Jan 21, 2025
486e2a1
Merge branch 'master' into alin/MR-638-best-effort-xnet-test
alin-at-dfinity Jan 21, 2025
87dc81c
Apply reviewer suggestion.
alin-at-dfinity Jan 22, 2025
2074a50
feat(MR): [MR-638] Include best-effort calls in `xnet_compatibility` …
alin-at-dfinity Jan 23, 2025
2d16c71
feat(MR): [MR-638] Use both guaranteed and best-effort calls in all X…
alin-at-dfinity Jan 23, 2025
83280d1
Merge branch 'master' into alin/MR-638-best-effort-xnet-tests
alin-at-dfinity Jan 23, 2025
cf71d19
Make clippy happy.
alin-at-dfinity Jan 23, 2025
a5251c5
Address review comments.
alin-at-dfinity Jan 27, 2025
ae70a81
Merge branch 'alin/MR-638-best-effort-xnet_compatibility' into alin/M…
alin-at-dfinity Jan 27, 2025
3cc64d1
Merge branch 'master' into alin/MR-638-best-effort-xnet-tests
alin-at-dfinity Feb 7, 2025
d54f5e3
Revert temporary embedder config change.
alin-at-dfinity Feb 7, 2025
f048339
Address review comments: depend on explicit ic_cdk versions.
alin-at-dfinity Feb 7, 2025
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
40 changes: 20 additions & 20 deletions Cargo.Bazel.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "ac36051bb3fd1c488e3c6fdbdfc95fff29f3760abf119cb1fa2e1d829f1251f8",
"checksum": "3f10fe866380ffcf94872915ab98dc48eb140f9fd8fb8be016d15092561ee5f4",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -7373,7 +7373,7 @@
"target": "hex_lit"
},
{
"id": "secp256k1 0.29.1",
"id": "secp256k1 0.29.0",
"target": "secp256k1"
},
{
Expand Down Expand Up @@ -18933,7 +18933,7 @@
"target": "ic_agent"
},
{
"id": "ic-identity-hsm 0.39.2",
"id": "ic-identity-hsm 0.39.3",
"target": "ic_identity_hsm"
},
{
Expand Down Expand Up @@ -33370,14 +33370,14 @@
],
"license_file": "LICENSE"
},
"ic-identity-hsm 0.39.2": {
"ic-identity-hsm 0.39.3": {
derlerd-dfinity marked this conversation as resolved.
Show resolved Hide resolved
"name": "ic-identity-hsm",
"version": "0.39.2",
"version": "0.39.3",
"package_url": "https://github.com/dfinity/agent-rs",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/ic-identity-hsm/0.39.2/download",
"sha256": "0ebb94d7cb5be09bed47655008f0c2968a3a3253dcf680297f3e8475e4b317c4"
"url": "https://static.crates.io/crates/ic-identity-hsm/0.39.3/download",
"sha256": "e294ee038eb647cd9cce78b5961533be7f883494e6ea1faece52459bce2d29e9"
}
},
"targets": [
Expand Down Expand Up @@ -33429,7 +33429,7 @@
"selects": {}
},
"edition": "2021",
"version": "0.39.2"
"version": "0.39.3"
},
"license": "Apache-2.0",
"license_ids": [
Expand Down Expand Up @@ -38055,7 +38055,7 @@
"target": "base64"
},
{
"id": "minreq 2.13.0",
"id": "minreq 2.13.2",
"target": "minreq"
},
{
Expand Down Expand Up @@ -44133,14 +44133,14 @@
],
"license_file": "LICENSE"
},
"minreq 2.13.0": {
"minreq 2.13.2": {
"name": "minreq",
"version": "2.13.0",
"version": "2.13.2",
"package_url": "https://github.com/neonmoe/minreq",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/minreq/2.13.0/download",
"sha256": "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390"
"url": "https://static.crates.io/crates/minreq/2.13.2/download",
"sha256": "da0c420feb01b9fb5061f8c8f452534361dd783756dcf38ec45191ce55e7a161"
}
},
"targets": [
Expand Down Expand Up @@ -44189,7 +44189,7 @@
"target": "log"
},
{
"id": "minreq 2.13.0",
"id": "minreq 2.13.2",
"target": "build_script_build"
},
{
Expand All @@ -44204,7 +44204,7 @@
"selects": {}
},
"edition": "2018",
"version": "2.13.0"
"version": "2.13.2"
},
"build_script_attrs": {
"compile_data_glob": [
Expand Down Expand Up @@ -67049,14 +67049,14 @@
],
"license_file": "LICENSE"
},
"secp256k1 0.29.1": {
"secp256k1 0.29.0": {
"name": "secp256k1",
"version": "0.29.1",
"version": "0.29.0",
"package_url": "https://github.com/rust-bitcoin/rust-secp256k1/",
"repository": {
"Http": {
"url": "https://static.crates.io/crates/secp256k1/0.29.1/download",
"sha256": "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
"url": "https://static.crates.io/crates/secp256k1/0.29.0/download",
"sha256": "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3"
}
},
"targets": [
Expand Down Expand Up @@ -67113,7 +67113,7 @@
"selects": {}
},
"edition": "2021",
"version": "0.29.1"
"version": "0.29.0"
},
"license": "CC0-1.0",
"license_ids": [
Expand Down
14 changes: 7 additions & 7 deletions Cargo.Bazel.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ dependencies = [
"bitcoin_hashes 0.14.0",
"hex-conservative",
"hex_lit",
"secp256k1 0.29.1",
"secp256k1 0.29.0",
"serde",
]

Expand Down Expand Up @@ -5613,9 +5613,9 @@ dependencies = [

[[package]]
name = "ic-identity-hsm"
version = "0.39.2"
version = "0.39.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ebb94d7cb5be09bed47655008f0c2968a3a3253dcf680297f3e8475e4b317c4"
checksum = "e294ee038eb647cd9cce78b5961533be7f883494e6ea1faece52459bce2d29e9"
dependencies = [
"hex",
"ic-agent",
Expand Down Expand Up @@ -7315,9 +7315,9 @@ dependencies = [

[[package]]
name = "minreq"
version = "2.13.0"
version = "2.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36a8e50e917e18a37d500d27d40b7bc7d127e71c0c94fb2d83f43b4afd308390"
checksum = "da0c420feb01b9fb5061f8c8f452534361dd783756dcf38ec45191ce55e7a161"
dependencies = [
"log",
"serde",
Expand Down Expand Up @@ -10520,9 +10520,9 @@ dependencies = [

[[package]]
name = "secp256k1"
version = "0.29.1"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113"
checksum = "0e0cc0f1cf93f4969faf3ea1c7d8a9faed25918d96affa959720823dfe86d4f3"
dependencies = [
"bitcoin_hashes 0.14.0",
"rand 0.8.5",
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

19 changes: 16 additions & 3 deletions rs/messaging/tests/queue_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use ic_types::{
Cycles,
};
use maplit::btreemap;
use std::collections::BTreeSet;
use std::sync::Arc;
use std::{collections::BTreeSet, vec};
use xnet_test::{Metrics, StartArgs};

const MAX_TICKS: u64 = 100;
Expand All @@ -33,6 +33,7 @@ struct SubnetPairProxy {
pub local_canister_id: CanisterId,
pub remote_env: Arc<StateMachine>,
pub remote_canister_id: CanisterId,
call_timeouts_seconds: Vec<Option<u32>>,
}

impl SubnetPairProxy {
Expand Down Expand Up @@ -73,9 +74,17 @@ impl SubnetPairProxy {
local_canister_id,
remote_env: Arc::from(remote_env),
remote_canister_id,
// Default to a mix of guaranteed response and best-effort calls.
call_timeouts_seconds: vec![None, Some(u32::MAX)],
}
}

/// Sets the desired call timeouts.
fn with_call_timeouts(mut self, call_timeouts_seconds: &[Option<u32>]) -> Self {
self.call_timeouts_seconds = call_timeouts_seconds.to_vec();
self
}

/// Generates a routing table with canister ranges for 3 subnets.
fn make_routing_table() -> RoutingTable {
let mut routing_table = RoutingTable::new();
Expand All @@ -102,7 +111,9 @@ impl SubnetPairProxy {
Encode!(&StartArgs {
network_topology,
canister_to_subnet_rate,
payload_size_bytes,
request_payload_size_bytes: payload_size_bytes,
call_timeouts_seconds: self.call_timeouts_seconds.clone(),
response_payload_size_bytes: payload_size_bytes,
})
}

Expand Down Expand Up @@ -261,6 +272,7 @@ impl SubnetPairProxy {
local_canister_id: self.local_canister_id,
remote_env: Arc::new(destination_env),
remote_canister_id: self.remote_canister_id,
call_timeouts_seconds: self.call_timeouts_seconds.clone(),
})
}
}
Expand Down Expand Up @@ -418,7 +430,8 @@ fn test_timeout_removes_requests_from_output_queues() {
/// an empty output queue.
#[test]
fn test_response_in_output_queue_causes_backpressure() {
let subnets = SubnetPairProxy::with_new_subnets();
// Guaranteed response calls only.
let subnets = SubnetPairProxy::with_new_subnets().with_call_timeouts(&[None]);

let canister_to_subnet_rate = 10;
let payload_size_bytes = 1024 * 1024;
Expand Down
4 changes: 2 additions & 2 deletions rs/rust_canisters/xnet_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ DEPENDENCIES = [
# Keep sorted.
"@crate_index//:candid",
"@crate_index//:futures",
"@crate_index//:ic-cdk",
"@crate_index//:ic_cdk_next",
"@crate_index//:rand",
"@crate_index//:rand_pcg",
"@crate_index//:serde",
Expand All @@ -16,7 +16,7 @@ DEPENDENCIES = [

MACRO_DEPENDENCIES = [
# Keep sorted.
"@crate_index//:ic-cdk-macros",
"@crate_index//:ic_cdk_macros_next",
]

rust_library(
Expand Down
4 changes: 2 additions & 2 deletions rs/rust_canisters/xnet_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ path = "src/main.rs"
[dependencies]
candid = { workspace = true }
futures = { workspace = true }
ic-cdk = { workspace = true }
ic-cdk-macros = { workspace = true }
ic-cdk = { git = "https://github.com/dfinity/cdk-rs", rev = "4e287ce51636b0e70768c193da38d2fc5324ea15" }
ic-cdk-macros = { git = "https://github.com/dfinity/cdk-rs", rev = "4e287ce51636b0e70768c193da38d2fc5324ea15" }
rand = { workspace = true }
rand_pcg = "0.3"
serde = { workspace = true }
Expand Down
4 changes: 3 additions & 1 deletion rs/rust_canisters/xnet_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ pub type NetworkTopology = Vec<Vec<CanisterId>>;
pub struct StartArgs {
pub network_topology: NetworkTopology,
pub canister_to_subnet_rate: u64,
pub payload_size_bytes: u64,
pub request_payload_size_bytes: u64,
pub call_timeouts_seconds: Vec<Option<u32>>,
pub response_payload_size_bytes: u64,
}

/// Metrics observed by this canister.
Expand Down
Loading