From 92882b2abb4f1469a0bd4fded3ba3be94faa7bef Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Fri, 14 Apr 2023 15:00:30 -0700 Subject: [PATCH 1/7] update rust deps --- rust-peer/Cargo.lock | 119 ++++++++++++++++--------------------------- rust-peer/Cargo.toml | 8 +-- 2 files changed, 47 insertions(+), 80 deletions(-) diff --git a/rust-peer/Cargo.lock b/rust-peer/Cargo.lock index df6951df..c5062d9a 100644 --- a/rust-peer/Cargo.lock +++ b/rust-peer/Cargo.lock @@ -237,9 +237,9 @@ dependencies = [ [[package]] name = "asn1_der" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" +checksum = "155a5a185e42c6b77ac7b88a15143d930a9e9727a5b7b77eed417404ab15c247" [[package]] name = "async-channel" @@ -1438,9 +1438,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba7abdbb86e485125dad06c2691e1e393bf3b08c7b743b43aa162a00fd39062e" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" dependencies = [ "async-io", "core-foundation", @@ -1533,15 +1533,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.6" @@ -1574,9 +1565,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libm" @@ -1587,7 +1578,7 @@ checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" [[package]] name = "libp2p" version = "0.51.3" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "bytes", "futures", @@ -1617,7 +1608,7 @@ dependencies = [ [[package]] name = "libp2p-allow-block-list" version = "0.1.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "libp2p-core", "libp2p-identity", @@ -1628,7 +1619,7 @@ dependencies = [ [[package]] name = "libp2p-connection-limits" version = "0.1.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "libp2p-core", "libp2p-identity", @@ -1639,7 +1630,7 @@ dependencies = [ [[package]] name = "libp2p-core" version = "0.39.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "either", "fnv", @@ -1666,7 +1657,7 @@ dependencies = [ [[package]] name = "libp2p-dns" version = "0.39.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "futures", "libp2p-core", @@ -1680,12 +1671,13 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" version = "0.44.3" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "asynchronous-codec", "base64 0.21.0", "byteorder", "bytes", + "either", "fnv", "futures", "hex_fmt", @@ -1710,7 +1702,7 @@ dependencies = [ [[package]] name = "libp2p-identify" version = "0.42.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "asynchronous-codec", "either", @@ -1730,8 +1722,8 @@ dependencies = [ [[package]] name = "libp2p-identity" -version = "0.1.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +version = "0.1.2" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "asn1_der", "bs58", @@ -1739,7 +1731,6 @@ dependencies = [ "log", "multiaddr", "multihash", - "prost", "quick-protobuf", "rand 0.8.5", "ring", @@ -1750,8 +1741,8 @@ dependencies = [ [[package]] name = "libp2p-kad" -version = "0.43.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +version = "0.43.2" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "arrayvec", "asynchronous-codec", @@ -1778,7 +1769,7 @@ dependencies = [ [[package]] name = "libp2p-mdns" version = "0.43.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "data-encoding", "futures", @@ -1798,7 +1789,7 @@ dependencies = [ [[package]] name = "libp2p-metrics" version = "0.12.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "libp2p-core", "libp2p-gossipsub", @@ -1814,7 +1805,7 @@ dependencies = [ [[package]] name = "libp2p-noise" version = "0.42.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "bytes", "curve25519-dalek 3.2.0", @@ -1836,7 +1827,7 @@ dependencies = [ [[package]] name = "libp2p-ping" version = "0.42.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "either", "futures", @@ -1853,7 +1844,7 @@ dependencies = [ [[package]] name = "libp2p-quic" version = "0.7.0-alpha.3" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "bytes", "futures", @@ -1873,8 +1864,8 @@ dependencies = [ [[package]] name = "libp2p-relay" -version = "0.15.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +version = "0.15.2" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "asynchronous-codec", "bytes", @@ -1896,8 +1887,8 @@ dependencies = [ [[package]] name = "libp2p-swarm" -version = "0.42.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +version = "0.42.2" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "async-std", "either", @@ -1918,7 +1909,7 @@ dependencies = [ [[package]] name = "libp2p-swarm-derive" version = "0.32.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "heck", "quote", @@ -1928,7 +1919,7 @@ dependencies = [ [[package]] name = "libp2p-tcp" version = "0.39.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "futures", "futures-timer", @@ -1944,7 +1935,7 @@ dependencies = [ [[package]] name = "libp2p-tls" version = "0.1.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "futures", "futures-rustls", @@ -1962,7 +1953,7 @@ dependencies = [ [[package]] name = "libp2p-webrtc" version = "0.4.0-alpha.4" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "async-trait", "asynchronous-codec", @@ -2024,9 +2015,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e7d46de488603ffdd5f30afbc64fbba2378214a2c3a2fb83abf3d33126df17" +checksum = "03f1160296536f10c833a82dca22267d5486734230d47bf00bf435885814ba1e" dependencies = [ "hashbrown 0.13.2", ] @@ -2151,7 +2142,7 @@ dependencies = [ [[package]] name = "multistream-select" version = "0.12.1" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "bytes", "futures", @@ -2612,29 +2603,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "prost" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -2653,7 +2621,7 @@ dependencies = [ [[package]] name = "quick-protobuf-codec" version = "0.1.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "asynchronous-codec", "bytes", @@ -2973,7 +2941,7 @@ dependencies = [ [[package]] name = "rw-stream-sink" version = "0.3.0" -source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=deprecate/gossipsub-close-event-update-multiaddr#201c7a88a82983bb35b409f55f85f9bf3c1947b0" +source = "git+https://github.com/p-shahi/rust-libp2p.git?branch=master-plus-webrtc-code#331308802c87c2e2d5eda49d7dee1e4751029f9f" dependencies = [ "futures", "pin-project", @@ -3384,14 +3352,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot 0.12.1", @@ -3404,13 +3371,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.13", ] [[package]] @@ -4242,9 +4209,9 @@ dependencies = [ [[package]] name = "yasna" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed2e7a52e3744ab4d0c05c20aa065258e84c49fd4226f5191b2ed29712710b4" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" dependencies = [ "time", ] diff --git a/rust-peer/Cargo.toml b/rust-peer/Cargo.toml index dd5cfc1e..e6c225d8 100644 --- a/rust-peer/Cargo.toml +++ b/rust-peer/Cargo.toml @@ -11,7 +11,7 @@ clap = { version = "4.1.11", features = ["derive"] } env_logger = "0.10.0" futures = "0.3.27" futures-timer = "3.0.2" -libp2p = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "deprecate/gossipsub-close-event-update-multiaddr", version = "0.51.2", features = [ +libp2p = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "master-plus-webrtc-code", version = "0.51.2", features = [ "identify", "ping", "tokio", @@ -24,13 +24,13 @@ libp2p = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "depreca "ed25519", "quic", ] } -libp2p-webrtc = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "deprecate/gossipsub-close-event-update-multiaddr", version = "0.4.0-alpha.4", features = [ +libp2p-webrtc = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "master-plus-webrtc-code", version = "0.4.0-alpha.4", features = [ "tokio", ] } -libp2p-quic = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "deprecate/gossipsub-close-event-update-multiaddr", features = ["tokio"] } +libp2p-quic = { git = "https://github.com/p-shahi/rust-libp2p.git", branch = "master-plus-webrtc-code", features = ["tokio"] } log = "0.4.17" multiaddr = { git = "https://github.com/p-shahi/rust-multiaddr.git", branch = "support-webrtc-protocol-code" } rand = "0.8.5" -tokio = { version = "1.26.0", features = ["full"] } +tokio = { version = "1.27.0", features = ["full"] } tokio-util = { version = "0.7", features = ["full"] } webrtc = { version = "0.6.0", optional = true } From 3fe2dd467539443ebaeb3759569901a849cfa736 Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Fri, 14 Apr 2023 15:23:33 -0700 Subject: [PATCH 2/7] update stream limits --- package-lock.json | 24 ++++++++++++------------ packages/frontend/src/lib/libp2p.ts | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7b6b8a26..170b88c1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2901,9 +2901,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.364", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.364.tgz", - "integrity": "sha512-v6GxKdF57qfweXSfnne9nw1vS/86G4+UtscEe+3HQF+zhhrjAY4+9A4gstIQO56gyZvVrt9MZwt9aevCz/tohQ==", + "version": "1.4.365", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.365.tgz", + "integrity": "sha512-FRHZO+1tUNO4TOPXmlxetkoaIY8uwHzd1kKopK/Gx2SKn1L47wJXWD44wxP5CGRyyP98z/c8e1eBzJrgPeiBOg==", "dev": true }, "node_modules/emoji-regex": { @@ -3205,9 +3205,9 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dependencies": { "debug": "^3.2.7" }, @@ -9226,9 +9226,9 @@ } }, "electron-to-chromium": { - "version": "1.4.364", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.364.tgz", - "integrity": "sha512-v6GxKdF57qfweXSfnne9nw1vS/86G4+UtscEe+3HQF+zhhrjAY4+9A4gstIQO56gyZvVrt9MZwt9aevCz/tohQ==", + "version": "1.4.365", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.365.tgz", + "integrity": "sha512-FRHZO+1tUNO4TOPXmlxetkoaIY8uwHzd1kKopK/Gx2SKn1L47wJXWD44wxP5CGRyyP98z/c8e1eBzJrgPeiBOg==", "dev": true }, "emoji-regex": { @@ -9464,9 +9464,9 @@ } }, "eslint-module-utils": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", - "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "requires": { "debug": "^3.2.7" }, diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index 8881c4bd..4b8a8b86 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -17,7 +17,7 @@ import { BOOTSTRAP_NODE, CHAT_TOPIC, CIRCUIT_RELAY_CODE } from './constants' import * as filters from "@libp2p/websockets/filters" // @ts-ignore -import { circuitRelayTransport } from 'libp2p/circuit-relay' +import { circuitRelayTransport, circuitRelayServer } from 'libp2p/circuit-relay' export async function startLibp2p() { @@ -26,7 +26,7 @@ export async function startLibp2p() { // libp2p is the networking layer that underpins Helia const libp2p = await createLibp2p({ - dht: kadDHT({protocolPrefix: "/universal-connectivity", maxInboundStreams: 100, maxOutboundStreams: 100, clientMode: true}), + dht: kadDHT({protocolPrefix: "/universal-connectivity", maxInboundStreams: 1000, maxOutboundStreams: 1000, clientMode: true}), transports: [webTransport(), webSockets({ filter: filters.all, }), webRTC({ @@ -52,7 +52,8 @@ export async function startLibp2p() { peerDiscovery: [ bootstrap({ list: [ - BOOTSTRAP_NODE, + // BOOTSTRAP_NODE, + '/ip4/127.0.0.1/udp/9090/webrtc-direct/certhash/uEiBy_U1UNQ0IDvot_PKlQM_QeU3yx-zCAVaMxxVm2JxWBg/p2p/12D3KooWSFfVyasFDa4NBQMzTmzSQBehUV92Exs9dsGjr9DL5TS3', ], }), ], @@ -62,11 +63,18 @@ export async function startLibp2p() { ignoreDuplicatePublishError: true, }), identify: { - maxPushOutgoingStreams: 2, + maxPushOutgoingStreams: 1000, + maxPushIncomingStreams: 1000, + maxInboundStreams: 1000, + maxOutboundStreams: 1000, }, autonat: { startupDelay: 60 * 60 *24 * 1000, }, + relay: circuitRelayServer({ + maxInboundHopStreams: 1000, + maxOutboundHopStreams: 1000 + }), }) libp2p.pubsub.subscribe(CHAT_TOPIC) From d4157459a889f6c109c5e473c1296ccb3db871ec Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Fri, 14 Apr 2023 15:27:23 -0700 Subject: [PATCH 3/7] add comments --- packages/frontend/src/lib/libp2p.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index 4b8a8b86..ac12d665 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -26,6 +26,8 @@ export async function startLibp2p() { // libp2p is the networking layer that underpins Helia const libp2p = await createLibp2p({ + // set the inbound and outbound stream limits to these values + // because we were seeing a lot of the default limits being hit dht: kadDHT({protocolPrefix: "/universal-connectivity", maxInboundStreams: 1000, maxOutboundStreams: 1000, clientMode: true}), transports: [webTransport(), webSockets({ filter: filters.all, @@ -63,6 +65,8 @@ export async function startLibp2p() { ignoreDuplicatePublishError: true, }), identify: { + // these are set because we were seeing a lot of identify and identify push + // stream limits being hit maxPushOutgoingStreams: 1000, maxPushIncomingStreams: 1000, maxInboundStreams: 1000, @@ -71,6 +75,10 @@ export async function startLibp2p() { autonat: { startupDelay: 60 * 60 *24 * 1000, }, + // This allows the browser node to act as a relay + // this is set because this seems to be the only + // way to set the inbound and outbound hop stream limits + // We were seeing the default limit of 64 being hit and resulting errors relay: circuitRelayServer({ maxInboundHopStreams: 1000, maxOutboundHopStreams: 1000 From 565ae77d1bed7ea2a886cee990323904e2f2d2d5 Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Sat, 15 Apr 2023 07:17:31 -0700 Subject: [PATCH 4/7] update limits --- packages/frontend/src/lib/libp2p.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index 4ed63bb5..5a215d9d 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -17,18 +17,22 @@ import { BOOTSTRAP_NODE, CHAT_TOPIC, CIRCUIT_RELAY_CODE } from './constants' import * as filters from "@libp2p/websockets/filters" // @ts-ignore -import { circuitRelayTransport, circuitRelayServer } from 'libp2p/circuit-relay' +import { circuitRelayTransport } from 'libp2p/circuit-relay' export async function startLibp2p() { // localStorage.debug = 'libp2p*,-*:trace' // application-specific data lives in the datastore - // libp2p is the networking layer that underpins Helia const libp2p = await createLibp2p({ // set the inbound and outbound stream limits to these values // because we were seeing a lot of the default limits being hit - dht: kadDHT({protocolPrefix: "/universal-connectivity", maxInboundStreams: 1000, maxOutboundStreams: 1000, clientMode: true}), + dht: kadDHT({ + protocolPrefix: "/universal-connectivity", + maxInboundStreams: 5000, + maxOutboundStreams: 5000, + clientMode: true + }), transports: [webTransport(), webSockets({ filter: filters.all, }), webRTC({ @@ -74,16 +78,8 @@ export async function startLibp2p() { maxOutboundStreams: 1000, }, autonat: { - startupDelay: 60 * 60 *24 * 1000, + startupDelay: 60 * 60 * 24 * 1000, }, - // This allows the browser node to act as a relay - // this is set because this seems to be the only - // way to set the inbound and outbound hop stream limits - // We were seeing the default limit of 64 being hit and resulting errors - relay: circuitRelayServer({ - maxInboundHopStreams: 1000, - maxOutboundHopStreams: 1000 - }), }) libp2p.pubsub.subscribe(CHAT_TOPIC) From 817a5be94882e681a0a15f49cde1e5b3558bff39 Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Sat, 15 Apr 2023 08:21:18 -0700 Subject: [PATCH 5/7] reduce maxconnections to 10 --- packages/frontend/src/lib/libp2p.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index 5a215d9d..7a7a18c0 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -51,7 +51,7 @@ export async function startLibp2p() { }),], connectionEncryption: [noise()], connectionManager: { - maxConnections: 200, + maxConnections: 10, minConnections: 1, }, streamMuxers: [yamux()], From e27b66757294934a0e88d48e057ae59147fa4c35 Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Sat, 15 Apr 2023 08:47:52 -0700 Subject: [PATCH 6/7] update min connections --- packages/frontend/src/lib/libp2p.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index 7a7a18c0..e0b6b352 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -52,7 +52,7 @@ export async function startLibp2p() { connectionEncryption: [noise()], connectionManager: { maxConnections: 10, - minConnections: 1, + minConnections: 50, }, streamMuxers: [yamux()], peerDiscovery: [ From 13c0675d07578a17cfc166473437d3964f26db4c Mon Sep 17 00:00:00 2001 From: Prithvi Shahi Date: Sat, 15 Apr 2023 09:47:13 -0700 Subject: [PATCH 7/7] rm connection manager configs --- packages/frontend/src/lib/libp2p.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/frontend/src/lib/libp2p.ts b/packages/frontend/src/lib/libp2p.ts index e0b6b352..e3ae7cdb 100644 --- a/packages/frontend/src/lib/libp2p.ts +++ b/packages/frontend/src/lib/libp2p.ts @@ -50,10 +50,6 @@ export async function startLibp2p() { discoverRelays: 10, }),], connectionEncryption: [noise()], - connectionManager: { - maxConnections: 10, - minConnections: 50, - }, streamMuxers: [yamux()], peerDiscovery: [ bootstrap({