Skip to content

Commit

Permalink
test: Add best effort messages to random traffic canister (#3108)
Browse files Browse the repository at this point in the history
Adds support for best-effort calls on the random traffic canister. All
arguments used to run the canister are collected in the `Config` now
(except the random seed) since otherwise the number of update calls and
individual parameters would get quite large.
Adds a new test where a local canister makes only best-effort calls, to
itself and to a remote subnet. Checks that the local canister can be
stopped even if the remote subnet stalls.

To change any parameter you can query the current config, then change it
accordingly and send it back to the canister. The seed is excluded since
reseeding the rng every time would reset the random sequence.

Additionally the records now contain a timeout if the call is
best-effort and the time from making the call to receiving a reply is
measured (for all calls).

---------

Co-authored-by: IDX GitHub Automation <[email protected]>
  • Loading branch information
stiegerc and IDX GitHub Automation authored Jan 23, 2025
1 parent 967fe21 commit ca3b684
Show file tree
Hide file tree
Showing 13 changed files with 1,120 additions and 392 deletions.
200 changes: 199 additions & 1 deletion Cargo.Bazel.Fuzzing.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "83fe54506d70571bc78b225d938b614a57ef3cec26747b3b0b49650297ead5b3",
"checksum": "12261e4e43785de1ae9b245dee18085d41c7b97556016ba5e1b71191acea6117",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -18838,6 +18838,11 @@
"id": "ic-cdk 0.16.0",
"target": "ic_cdk"
},
{
"id": "ic-cdk 0.18.0-alpha.1",
"target": "ic_cdk",
"alias": "ic_cdk_next"
},
{
"id": "ic-cdk-timers 0.11.0",
"target": "ic_cdk_timers"
Expand Down Expand Up @@ -19734,6 +19739,11 @@
"id": "ic-cdk-macros 0.9.0",
"target": "ic_cdk_macros"
},
{
"id": "ic-cdk-macros 0.18.0-alpha.1",
"target": "ic_cdk_macros",
"alias": "ic_cdk_macros_next"
},
{
"id": "indoc 1.0.9",
"target": "indoc"
Expand Down Expand Up @@ -30927,6 +30937,81 @@
],
"license_file": "LICENSE"
},
"ic-cdk 0.18.0-alpha.1": {
"name": "ic-cdk",
"version": "0.18.0-alpha.1",
"package_url": "https://github.com/dfinity/cdk-rs",
"repository": {
"Git": {
"remote": "https://github.com/dfinity/cdk-rs.git",
"commitish": {
"Rev": "4e287ce51636b0e70768c193da38d2fc5324ea15"
},
"strip_prefix": "ic-cdk"
}
},
"targets": [
{
"Library": {
"crate_name": "ic_cdk",
"crate_root": "src/lib.rs",
"srcs": {
"allow_empty": true,
"include": [
"**/*.rs"
]
}
}
}
],
"library_target_name": "ic_cdk",
"common_attrs": {
"compile_data_glob": [
"**"
],
"deps": {
"common": [
{
"id": "candid 0.10.13",
"target": "candid"
},
{
"id": "ic0 0.24.0-alpha.1",
"target": "ic0"
},
{
"id": "serde 1.0.217",
"target": "serde"
},
{
"id": "serde_bytes 0.11.15",
"target": "serde_bytes"
},
{
"id": "thiserror 2.0.3",
"target": "thiserror"
}
],
"selects": {}
},
"edition": "2021",
"proc_macro_deps": {
"common": [
{
"id": "ic-cdk-macros 0.18.0-alpha.1",
"target": "ic_cdk_macros"
}
],
"selects": {}
},
"version": "0.18.0-alpha.1"
},
"license": "Apache-2.0",
"license_ids": [
"Apache-2.0"
],
"license_file": "LICENSE"
},
"ic-cdk-macros 0.8.4": {
"name": "ic-cdk-macros",
"version": "0.8.4",
Expand Down Expand Up @@ -31195,6 +31280,76 @@
],
"license_file": "LICENSE"
},
"ic-cdk-macros 0.18.0-alpha.1": {
"name": "ic-cdk-macros",
"version": "0.18.0-alpha.1",
"package_url": "https://github.com/dfinity/cdk-rs",
"repository": {
"Git": {
"remote": "https://github.com/dfinity/cdk-rs.git",
"commitish": {
"Rev": "4e287ce51636b0e70768c193da38d2fc5324ea15"
},
"strip_prefix": "ic-cdk-macros"
}
},
"targets": [
{
"ProcMacro": {
"crate_name": "ic_cdk_macros",
"crate_root": "src/lib.rs",
"srcs": {
"allow_empty": true,
"include": [
"**/*.rs"
]
}
}
}
],
"library_target_name": "ic_cdk_macros",
"common_attrs": {
"compile_data_glob": [
"**"
],
"deps": {
"common": [
{
"id": "candid 0.10.13",
"target": "candid"
},
{
"id": "proc-macro2 1.0.89",
"target": "proc_macro2"
},
{
"id": "quote 1.0.37",
"target": "quote"
},
{
"id": "serde 1.0.217",
"target": "serde"
},
{
"id": "serde_tokenstream 0.2.1",
"target": "serde_tokenstream"
},
{
"id": "syn 2.0.87",
"target": "syn"
}
],
"selects": {}
},
"edition": "2021",
"version": "0.18.0-alpha.1"
},
"license": "Apache-2.0",
"license_ids": [
"Apache-2.0"
],
"license_file": "LICENSE"
},
"ic-cdk-timers 0.11.0": {
"name": "ic-cdk-timers",
"version": "0.11.0",
Expand Down Expand Up @@ -32769,6 +32924,47 @@
],
"license_file": "LICENSE"
},
"ic0 0.24.0-alpha.1": {
"name": "ic0",
"version": "0.24.0-alpha.1",
"package_url": "https://github.com/dfinity/cdk-rs",
"repository": {
"Git": {
"remote": "https://github.com/dfinity/cdk-rs.git",
"commitish": {
"Rev": "4e287ce51636b0e70768c193da38d2fc5324ea15"
},
"strip_prefix": "ic0"
}
},
"targets": [
{
"Library": {
"crate_name": "ic0",
"crate_root": "src/lib.rs",
"srcs": {
"allow_empty": true,
"include": [
"**/*.rs"
]
}
}
}
],
"library_target_name": "ic0",
"common_attrs": {
"compile_data_glob": [
"**"
],
"edition": "2021",
"version": "0.24.0-alpha.1"
},
"license": "Apache-2.0",
"license_ids": [
"Apache-2.0"
],
"license_file": "LICENSE"
},
"ic_bls12_381 0.10.0": {
"name": "ic_bls12_381",
"version": "0.10.0",
Expand Down Expand Up @@ -87648,7 +87844,9 @@
"ic-canister-sig-creation 1.1.0",
"ic-cbor 3.0.2",
"ic-cdk 0.16.0",
"ic-cdk 0.18.0-alpha.1",
"ic-cdk-macros 0.9.0",
"ic-cdk-macros 0.18.0-alpha.1",
"ic-cdk-timers 0.11.0",
"ic-certificate-verification 3.0.2",
"ic-certification 3.0.2",
Expand Down
33 changes: 33 additions & 0 deletions Cargo.Bazel.Fuzzing.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3086,6 +3086,8 @@ dependencies = [
"ic-canister-sig-creation",
"ic-cbor",
"ic-cdk 0.16.0",
"ic-cdk 0.18.0-alpha.1",
"ic-cdk-macros 0.18.0-alpha.1",
"ic-cdk-macros 0.9.0",
"ic-cdk-timers",
"ic-certificate-verification",
Expand Down Expand Up @@ -5129,6 +5131,19 @@ dependencies = [
"serde_bytes",
]

[[package]]
name = "ic-cdk"
version = "0.18.0-alpha.1"
source = "git+https://github.com/dfinity/cdk-rs.git?rev=4e287ce51636b0e70768c193da38d2fc5324ea15#4e287ce51636b0e70768c193da38d2fc5324ea15"
dependencies = [
"candid",
"ic-cdk-macros 0.18.0-alpha.1",
"ic0 0.24.0-alpha.1",
"serde",
"serde_bytes",
"thiserror 2.0.3",
]

[[package]]
name = "ic-cdk-macros"
version = "0.8.4"
Expand Down Expand Up @@ -5185,6 +5200,19 @@ dependencies = [
"syn 2.0.87",
]

[[package]]
name = "ic-cdk-macros"
version = "0.18.0-alpha.1"
source = "git+https://github.com/dfinity/cdk-rs.git?rev=4e287ce51636b0e70768c193da38d2fc5324ea15#4e287ce51636b0e70768c193da38d2fc5324ea15"
dependencies = [
"candid",
"proc-macro2",
"quote",
"serde",
"serde_tokenstream 0.2.1",
"syn 2.0.87",
]

[[package]]
name = "ic-cdk-timers"
version = "0.11.0"
Expand Down Expand Up @@ -5488,6 +5516,11 @@ version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f"

[[package]]
name = "ic0"
version = "0.24.0-alpha.1"
source = "git+https://github.com/dfinity/cdk-rs.git?rev=4e287ce51636b0e70768c193da38d2fc5324ea15#4e287ce51636b0e70768c193da38d2fc5324ea15"

[[package]]
name = "ic_bls12_381"
version = "0.10.0"
Expand Down
Loading

0 comments on commit ca3b684

Please sign in to comment.