diff --git a/simulators/portal/Cargo.lock b/simulators/portal/Cargo.lock index 2f441966bf..7c022e5fe6 100644 --- a/simulators/portal/Cargo.lock +++ b/simulators/portal/Cargo.lock @@ -388,15 +388,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.15" @@ -599,17 +590,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auto_impl" version = "1.2.0" @@ -1189,26 +1169,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "discv5" version = "0.4.1" @@ -1362,8 +1322,9 @@ dependencies = [ [[package]] name = "eth_trie" -version = "0.4.0" -source = "git+https://github.com/ethereum/eth-trie.rs?tag=v0.1.0-alpha.2#46da867d8a7eace0a9e912271b236b2007e4cd41" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ffb0d2fa42ad87f02c0683c04b31cb41bf3853f2327d037738345bc5b56671" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -1422,8 +1383,8 @@ dependencies = [ [[package]] name = "ethportal-api" -version = "0.2.2" -source = "git+https://github.com/ethereum/trin?rev=4b212d4f3e8afa7b3298eebd4b4b6e3ec04d680f#4b212d4f3e8afa7b3298eebd4b4b6e3ec04d680f" +version = "0.4.0" +source = "git+https://github.com/ethereum/trin?rev=5ae01c3ad2c69b4b003e0c206a961f2cf09f3be9#5ae01c3ad2c69b4b003e0c206a961f2cf09f3be9" dependencies = [ "alloy", "alloy-rlp", @@ -1457,13 +1418,13 @@ dependencies = [ "serde_json", "sha2", "sha3 0.9.1", + "shadow-rs", "ssz_types", "superstruct", "thiserror", "tokio", "tree_hash", "tree_hash_derive", - "trin-utils", "ureq", "url", "validator", @@ -1820,15 +1781,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.9" @@ -2422,16 +2374,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "libz-sys" version = "1.1.20" @@ -2475,15 +2417,6 @@ dependencies = [ "hashbrown 0.15.0", ] -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "matches" version = "0.1.10" @@ -2527,7 +2460,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -2596,7 +2529,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi", "libc", ] @@ -2920,7 +2853,7 @@ dependencies = [ "rand", "rand_chacha", "rand_xorshift", - "regex-syntax 0.8.5", + "regex-syntax", "rusty-fork", "tempfile", "unarray", @@ -3016,17 +2949,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox", - "thiserror", -] - [[package]] name = "regex" version = "1.11.0" @@ -3035,17 +2957,8 @@ checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", + "regex-automata", + "regex-syntax", ] [[package]] @@ -3056,15 +2969,9 @@ checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.5", + "regex-syntax", ] -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -4054,14 +3961,10 @@ version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "matchers", "nu-ansi-term", - "once_cell", - "regex", "sharded-slab", "smallvec", "thread_local", - "tracing", "tracing-core", "tracing-log", ] @@ -4089,20 +3992,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "trin-utils" -version = "0.1.1-alpha.1" -source = "git+https://github.com/ethereum/trin?rev=4b212d4f3e8afa7b3298eebd4b4b6e3ec04d680f#4b212d4f3e8afa7b3298eebd4b4b6e3ec04d680f" -dependencies = [ - "ansi_term", - "atty", - "directories", - "shadow-rs", - "tempfile", - "tracing", - "tracing-subscriber", -] - [[package]] name = "try-lock" version = "0.2.5" diff --git a/simulators/portal/Cargo.toml b/simulators/portal/Cargo.toml index b84feca476..ccedebec7e 100755 --- a/simulators/portal/Cargo.toml +++ b/simulators/portal/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] alloy-rlp = "0.3.8" alloy-primitives = "0.8.3" -ethportal-api = { git = "https://github.com/ethereum/trin", rev = "4b212d4f3e8afa7b3298eebd4b4b6e3ec04d680f" } +ethportal-api = { git = "https://github.com/ethereum/trin", rev = "5ae01c3ad2c69b4b003e0c206a961f2cf09f3be9" } futures = "0.3.25" hivesim = { git = "https://github.com/ethereum/hive", rev = "4408fc1de3fee3ac23acd25a812c117756af2f39" } itertools = "0.10.5" diff --git a/simulators/portal/src/suites/history/interop.rs b/simulators/portal/src/suites/history/interop.rs index ed927f21d0..bda00ae82d 100644 --- a/simulators/portal/src/suites/history/interop.rs +++ b/simulators/portal/src/suites/history/interop.rs @@ -1,7 +1,7 @@ use std::str::FromStr; use alloy_primitives::Bytes; -use ethportal_api::types::portal::{FindContentInfo, GetContentInfo}; +use ethportal_api::types::portal::{FindContentInfo, GetContentInfo, PutContentInfo}; use ethportal_api::types::portal_wire::MAX_PORTAL_CONTENT_PAYLOAD_SIZE; use ethportal_api::{ ContentValue, Discv5ApiClient, HistoryContentKey, HistoryContentValue, HistoryNetworkApiClient, @@ -180,10 +180,10 @@ dyn_async! { // Test gossiping a collection of blocks to node B (B will gossip back to A) test.run( NClientTestSpec { - name: format!("GOSSIP blocks from A:{} --> B:{}", client_a.name, client_b.name), + name: format!("PUT CONTENT blocks from A:{} --> B:{}", client_a.name, client_b.name), description: "".to_string(), always_run: false, - run: test_gossip_two_nodes, + run: test_put_content_two_nodes, environments: None, test_data: content.clone(), clients: vec![client_a.clone(), client_b.clone()], @@ -425,7 +425,7 @@ dyn_async! { } dyn_async! { - async fn test_gossip_two_nodes<'a> (clients: Vec, test_data: TestData) { + async fn test_put_content_two_nodes<'a> (clients: Vec, test_data: TestData) { let (client_a, client_b) = match clients.iter().collect_tuple() { Some((client_a, client_b)) => (client_a, client_b), None => panic!("Unable to get expected amount of clients from NClientTestSpec"), @@ -445,10 +445,10 @@ dyn_async! { // With default node settings nodes should be storing all content for (content_key, content_value) in test_data.clone() { - match client_a.rpc.gossip(content_key.clone(), content_value.encode()).await { - Ok(nodes_gossiped_to) => { - if nodes_gossiped_to != 1 { - panic!("We expected to gossip to 1 node instead we gossiped to: {nodes_gossiped_to}"); + match client_a.rpc.put_content(content_key.clone(), content_value.encode()).await { + Ok(PutContentInfo { peer_count, .. }) => { + if peer_count != 1 { + panic!("We expected to gossip to 1 node instead we gossiped to: {peer_count}"); } } Err(err) => panic!("Unable to get received content: {err:?}"), diff --git a/simulators/portal/src/suites/state/interop.rs b/simulators/portal/src/suites/state/interop.rs index 1f5c846407..5c4511a7d4 100644 --- a/simulators/portal/src/suites/state/interop.rs +++ b/simulators/portal/src/suites/state/interop.rs @@ -9,7 +9,7 @@ use ethportal_api::jsonrpsee::http_client::HttpClient; use ethportal_api::types::execution::header_with_proof::{ BlockHeaderProof, HeaderWithProof, SszNone, }; -use ethportal_api::types::portal::{FindContentInfo, GetContentInfo}; +use ethportal_api::types::portal::{FindContentInfo, GetContentInfo, PutContentInfo}; use ethportal_api::types::portal_wire::MAX_PORTAL_CONTENT_PAYLOAD_SIZE; use ethportal_api::utils::bytes::hex_encode; use ethportal_api::{ @@ -196,10 +196,10 @@ dyn_async! { // Test gossiping a collection of blocks to node B (B will gossip back to A) test.run( NClientTestSpec { - name: format!("GOSSIP blocks from A:{} --> B:{}", client_a.name, client_b.name), + name: format!("PUT CONTENT blocks from A:{} --> B:{}", client_a.name, client_b.name), description: "".to_string(), always_run: false, - run: test_gossip_two_nodes, + run: test_put_content_two_nodes, environments: environments.clone(), test_data: content.clone(), clients: vec![client_a.clone(), client_b.clone()], @@ -439,7 +439,7 @@ dyn_async! { } dyn_async! { - async fn test_gossip_two_nodes<'a> (clients: Vec, test_data: Vec) { + async fn test_put_content_two_nodes<'a> (clients: Vec, test_data: Vec) { let (client_a, client_b) = match clients.iter().collect_tuple() { Some((client_a, client_b)) => (client_a, client_b), None => panic!("Unable to get expected amount of clients from NClientTestSpec"), @@ -461,10 +461,10 @@ dyn_async! { for TestData { header, key: content_key, offer_value: content_offer_value, .. } in test_data.clone() { store_header(header, &client_b.rpc).await; - match client_a.rpc.gossip(content_key.clone(), content_offer_value.encode()).await { - Ok(nodes_gossiped_to) => { - if nodes_gossiped_to != 1 { - panic!("We expected to gossip to 1 node instead we gossiped to: {nodes_gossiped_to}"); + match client_a.rpc.put_content(content_key.clone(), content_offer_value.encode()).await { + Ok(PutContentInfo { peer_count, .. }) => { + if peer_count != 1 { + panic!("We expected to gossip to 1 node instead we gossiped to: {peer_count}"); } } Err(err) => panic!("Unable to get received content: {err:?}"),