From 737b320096e853dc3df16ce51530904976c094c2 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 1 Feb 2024 13:03:07 -0300 Subject: [PATCH 01/26] eth: init full switch to alloy --- Cargo.lock | 906 +++++++++++++++++++++++++++++++++++++------- Cargo.toml | 16 +- src/eth/provider.rs | 55 +-- src/eth/types.rs | 15 +- 4 files changed, 826 insertions(+), 166 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c459d5f..3157b852 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,6 +123,230 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +[[package]] +name = "alloy-eips" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rlp", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-json-rpc" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-network" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-eips", + "alloy-json-rpc", + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b6fb2b432ff223d513db7f908937f63c252bee0af9b82bfd25b0a5dd1eb0d8" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-primitives" +version = "0.6.2" +source = "git+https://github.com/alloy-rs/core.git#04d63af7d9a3dc69749355c8dfeb3413b29a4f76" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] +name = "alloy-providers" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-network", + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rpc-client", + "alloy-rpc-trace-types", + "alloy-rpc-types", + "alloy-transport", + "alloy-transport-http", + "async-trait", + "auto_impl", + "reqwest", + "serde", + "thiserror", +] + +[[package]] +name = "alloy-pubsub" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-transport", + "bimap", + "futures", + "serde_json", + "tokio", + "tower", + "tracing", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "alloy-rpc-client" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-pubsub", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ws", + "futures", + "pin-project", + "reqwest", + "serde_json", + "tokio", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-rpc-trace-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rpc-types", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-rlp", + "itertools 0.12.1", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "alloy-transport" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-json-rpc", + "base64 0.21.4", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "alloy-transport-http" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "url", +] + +[[package]] +name = "alloy-transport-ws" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +dependencies = [ + "alloy-pubsub", + "alloy-transport", + "futures", + "http", + "serde_json", + "tokio", + "tokio-tungstenite 0.20.1", + "tracing", + "ws_stream_wasm", +] + [[package]] name = "ambient-authority" version = "0.0.2" @@ -204,6 +428,130 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + [[package]] name = "array-init" version = "0.0.4" @@ -236,13 +584,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -253,7 +601,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -319,6 +667,12 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" + [[package]] name = "bincode" version = "1.3.3" @@ -346,7 +700,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -394,7 +748,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -408,7 +762,7 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq 0.3.0", - "digest", + "digest 0.10.7", ] [[package]] @@ -573,13 +927,13 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.17.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7daec1a2a2129eeba1644b220b4647ec537b0b5d4bfd6876fcc5a540056b592" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -735,7 +1089,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -752,7 +1106,7 @@ checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" dependencies = [ "bs58", "coins-core", - "digest", + "digest 0.10.7", "hmac", "k256", "serde", @@ -785,7 +1139,7 @@ dependencies = [ "base64 0.21.4", "bech32", "bs58", - "digest", + "digest 0.10.7", "generic-array", "hex", "ripemd", @@ -804,13 +1158,14 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-hex" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08849ed393c907c90016652a01465a12d86361cd38ad2a7de026c56a520cc259" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" dependencies = [ "cfg-if", "cpufeatures", "hex", + "proptest", "serde", ] @@ -832,6 +1187,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" version = "0.9.3" @@ -1111,7 +1472,7 @@ dependencies = [ "curve25519-dalek-derive", "fiat-crypto", "platforms", - "rustc_version", + "rustc_version 0.4.0", "subtle", "zeroize", ] @@ -1124,7 +1485,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -1206,6 +1567,17 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_builder" version = "0.9.0" @@ -1237,8 +1609,10 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case", "proc-macro2", "quote", + "rustc_version 0.4.0", "syn 1.0.109", ] @@ -1248,6 +1622,15 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" @@ -1357,7 +1740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -1378,7 +1761,7 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array", "group", @@ -1469,7 +1852,7 @@ checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes 0.8.3", "ctr 0.9.2", - "digest", + "digest 0.10.7", "hex", "hmac", "pbkdf2 0.11.0", @@ -1533,9 +1916,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad13497f6e0a24292fc7b408e30d22fe9dc262da1f40d7b542c3a44e7fc0476" +checksum = "6c7cd562832e2ff584fa844cd2f6e5d4f35bbe11b28c7c9b8df957b2e1d0c701" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1549,9 +1932,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e9e8acd0ed348403cc73a670c24daba3226c40b98dc1a41903766b3ab6240a" +checksum = "35dc9a249c066d17e8947ff52a4116406163cf92c7f0763cb8c001760b26403f" dependencies = [ "ethers-core", "once_cell", @@ -1561,9 +1944,9 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d79269278125006bb0552349c03593ffa9702112ca88bc7046cc669f148fb47c" +checksum = "43304317c7f776876e47f2f637859f6d0701c1ec7930a150f169d5fbe7d76f5a" dependencies = [ "const-hex", "ethers-contract-abigen", @@ -1580,9 +1963,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95a43c939b2e4e2f3191c5ad4a1f279780b8a39139c9905b43a7433531e2ab" +checksum = "f9f96502317bf34f6d71a3e3d270defaa9485d754d789e15a8e04a84161c95eb" dependencies = [ "Inflector", "const-hex", @@ -1597,16 +1980,16 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.32", - "toml 0.7.8", + "syn 2.0.48", + "toml 0.8.8", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9ce44906fc871b3ee8c69a695ca7ec7f70e50cb379c9b9cb5e532269e492f6" +checksum = "452ff6b0a64507ce8d67ffd48b1da3b42f03680dcf5382244e9c93822cbbf5de" dependencies = [ "Inflector", "const-hex", @@ -1615,14 +1998,14 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] name = "ethers-core" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0a17f0708692024db9956b31d7a20163607d2745953f5ae8125ab368ba280ad" +checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" dependencies = [ "arrayvec", "bytes", @@ -1641,7 +2024,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.32", + "syn 2.0.48", "tempfile", "thiserror", "tiny-keccak", @@ -1650,13 +2033,14 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e53451ea4a8128fbce33966da71132cf9e1040dcfd2a2084fd7733ada7b2045" +checksum = "16d45b981f5fa769e1d0343ebc2a44cfa88c9bc312eb681b676318b40cef6fb1" dependencies = [ + "chrono", "ethers-core", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -1665,9 +2049,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473f1ccd0c793871bbc248729fa8df7e6d2981d6226e4343e3bbaa9281074d5d" +checksum = "145211f34342487ef83a597c1e69f0d3e01512217a7c72cc8a25931854c7dca0" dependencies = [ "async-trait", "auto_impl", @@ -1692,9 +2076,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6838fa110e57d572336178b7c79e94ff88ef976306852d8cb87d9e5b1fc7c0b5" +checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" dependencies = [ "async-trait", "auto_impl", @@ -1730,9 +2114,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea44bec930f12292866166f9ddbea6aa76304850e4d8dcd66dc492b43d00ff1" +checksum = "b3b125a103b56aef008af5d5fb48191984aa326b50bfd2557d231dc499833de3" dependencies = [ "async-trait", "coins-bip32", @@ -1749,9 +2133,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de34e484e7ae3cab99fbfd013d6c5dc7f9013676a4e0e414d8b12e1213e8b3ba" +checksum = "d21df08582e0a43005018a858cc9b465c5fff9cf4056651be64f844e57d1f55f" dependencies = [ "cfg-if", "const-hex", @@ -1766,7 +2150,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver", + "semver 1.0.18", "serde", "serde_json", "solang-parser", @@ -1807,6 +2191,17 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "fd-lock" version = "4.0.0" @@ -1921,9 +2316,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1936,9 +2331,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1946,15 +2341,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1963,9 +2358,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-locks" @@ -1979,26 +2374,26 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -2012,9 +2407,9 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -2235,6 +2630,15 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" @@ -2251,7 +2655,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -2605,6 +3009,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -2671,7 +3084,7 @@ checksum = "6204285f77fe7d9784db3fdc449ecce1a0114927a51d5a41c4c7a292011c015f" dependencies = [ "base64 0.13.1", "crypto-common", - "digest", + "digest 0.10.7", "hmac", "serde", "serde_json", @@ -2701,11 +3114,30 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keccak-asm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" +dependencies = [ + "digest 0.10.7", + "sha3-asm", +] + [[package]] name = "kinode" version = "0.5.2" dependencies = [ "aes-gcm 0.10.2", + "alloy-network", + "alloy-primitives 0.6.2 (git+https://github.com/alloy-rs/core.git)", + "alloy-providers", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ws", "anyhow", "async-trait", "base64 0.13.1", @@ -2718,7 +3150,7 @@ dependencies = [ "clap", "crossterm", "dashmap", - "digest", + "digest 0.10.7", "elliptic-curve", "ethers", "ethers-providers", @@ -2825,6 +3257,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -2934,7 +3372,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -2994,9 +3432,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", @@ -3105,6 +3543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -3135,7 +3574,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -3221,7 +3660,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -3332,7 +3771,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest", + "digest 0.10.7", "hmac", "password-hash", "sha2", @@ -3344,7 +3783,7 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "digest", + "digest 0.10.7", "hmac", ] @@ -3369,6 +3808,17 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +[[package]] +name = "pest" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + [[package]] name = "petgraph" version = "0.6.4" @@ -3386,7 +3836,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -3419,7 +3869,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -3457,7 +3907,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -3559,7 +4009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -3583,7 +4033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] @@ -3618,13 +4068,33 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] +[[package]] +name = "proptest" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +dependencies = [ + "bit-set", + "bit-vec", + "bitflags 2.4.0", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax 0.8.2", + "rusty-fork", + "tempfile", + "unarray", +] + [[package]] name = "psm" version = "0.1.21" @@ -3656,10 +4126,16 @@ dependencies = [ ] [[package]] -name = "quote" -version = "1.0.33" +name = "quick-error" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -3710,6 +4186,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.7.0" @@ -3883,7 +4368,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -3946,6 +4431,36 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" +[[package]] +name = "ruint" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608a5726529f2f0ef81b8fde9873c4bb829d6b5b5ca6be4d97345ddf0749c825" +dependencies = [ + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp", + "num-bigint", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", +] + +[[package]] +name = "ruint-macro" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" + [[package]] name = "rusqlite" version = "0.30.0" @@ -3978,13 +4493,22 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.18", ] [[package]] @@ -4053,6 +4577,18 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.15" @@ -4181,6 +4717,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.18" @@ -4190,6 +4735,15 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + [[package]] name = "send_wrapper" version = "0.4.0" @@ -4230,7 +4784,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -4246,9 +4800,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -4273,7 +4827,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4284,7 +4838,7 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -4293,10 +4847,20 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] +[[package]] +name = "sha3-asm" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bac61da6b35ad76b195eb4771210f947734321a8d81d7738e1580d953bc7a15e" +dependencies = [ + "cc", + "cfg-if", +] + [[package]] name = "shellexpand" version = "2.1.2" @@ -4348,7 +4912,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ - "digest", + "digest 0.10.7", "rand_core", ] @@ -4412,7 +4976,7 @@ dependencies = [ "curve25519-dalek", "rand_core", "ring", - "rustc_version", + "rustc_version 0.4.0", "sha2", "subtle", ] @@ -4429,9 +4993,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -4439,9 +5003,9 @@ dependencies = [ [[package]] name = "solang-parser" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb9fa2fa2fa6837be8a2495486ff92e3ffe68a99b6eeba288e139efdd842457" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" dependencies = [ "itertools 0.11.0", "lalrpop", @@ -4552,7 +5116,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -4572,7 +5136,7 @@ dependencies = [ "hex", "once_cell", "reqwest", - "semver", + "semver 1.0.18", "serde", "serde_json", "sha2", @@ -4594,9 +5158,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -4693,7 +5257,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -4750,9 +5314,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -4761,20 +5325,20 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -4860,21 +5424,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.21.0", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -4884,6 +5448,17 @@ name = "toml_edit" version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap 2.0.0", "serde", @@ -4892,6 +5467,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -4900,11 +5496,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4913,20 +5508,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -5039,6 +5634,12 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + [[package]] name = "uint" version = "0.9.5" @@ -5051,6 +5652,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicase" version = "2.7.0" @@ -5168,6 +5775,12 @@ dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" @@ -5180,6 +5793,15 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.4.0" @@ -5300,7 +5922,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -5334,7 +5956,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5370,7 +5992,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53290b1276c5c2d47d694fb1a920538c01f51690e7e261acbe1d10c5fc306ea1" dependencies = [ "indexmap 2.0.0", - "semver", + "semver 1.0.18", ] [[package]] @@ -5380,7 +6002,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" dependencies = [ "indexmap 2.0.0", - "semver", + "semver 1.0.18", ] [[package]] @@ -5471,7 +6093,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -5663,7 +6285,7 @@ checksum = "f50f51f8d79bfd2aa8e9d9a0ae7c2d02b45fe412e62ff1b87c0c81b07c738231" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", ] [[package]] @@ -5808,7 +6430,7 @@ dependencies = [ "proc-macro2", "quote", "shellexpand", - "syn 2.0.32", + "syn 2.0.48", "witx", ] @@ -5820,7 +6442,7 @@ checksum = "c189fe00c67f61bb330827f2abab1af9b5925c7929535cd13a68d265ec20b02d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.48", "wiggle-generate", ] @@ -6051,7 +6673,7 @@ dependencies = [ "id-arena", "indexmap 2.0.0", "log", - "semver", + "semver 1.0.18", "serde", "serde_derive", "serde_json", @@ -6081,7 +6703,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", + "rustc_version 0.4.0", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -6109,6 +6731,20 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "zip" diff --git a/Cargo.toml b/Cargo.toml index 580bc6f8..9df282dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,18 @@ simulation-mode = [] [dependencies] aes-gcm = "0.10.2" +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy" } +alloy-primitives = { git = "https://github.com/alloy-rs/core.git" } +alloy-providers = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-network = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy.git", features = [ + "pubsub", + "ws", +] } +alloy-pubsub = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-transport = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy.git" } +alloy-transport-http = { git = "https://github.com/alloy-rs/alloy.git" } anyhow = "1.0.71" async-trait = "0.1.71" base64 = "0.13" @@ -33,8 +45,8 @@ crossterm = { version = "0.26.1", features = ["event-stream", "bracketed-paste"] dashmap = "5.5.3" digest = "0.10" elliptic-curve = { version = "0.13.8", features = ["ecdh"] } -ethers = "2.0" -ethers-providers = "2.0.9" +ethers = "2.0.13" +ethers-providers = "2.0.13" flate2 = "1.0" futures = "0.3" generic-array = "0.14" diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 75eed98e..6f5a8ccd 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,15 +1,14 @@ use crate::eth::types::*; use crate::types::*; +use alloy_primitives::U256; +use alloy_rpc_client::ClientBuilder; +use alloy_rpc_types::pubsub::SubscriptionResult; +use alloy_transport_ws::WsConnect; use anyhow::Result; -use ethers::prelude::Provider; -use ethers::types::Filter; -use ethers_providers::{Middleware, StreamExt, Ws}; use std::collections::HashMap; use std::sync::Arc; use url::Url; -const WS_RECONNECTS: usize = 10_000; // TODO workshop this - /// The ETH provider runtime process is responsible for connecting to one or more ETH RPC providers /// and using them to service indexing requests from other apps. This could also be done by a wasm /// app, but in the future, this process will hopefully expand in scope to perform more complex @@ -24,6 +23,7 @@ pub async fn provider( let our = Arc::new(our); // for now, we can only handle WebSocket RPC URLs. In the future, we should // be able to handle HTTP too, at least. + // todo add http reqwest.. match Url::parse(&rpc_url)?.scheme() { "http" | "https" => { return Err(anyhow::anyhow!( @@ -38,15 +38,18 @@ pub async fn provider( } } - let provider = match Provider::::connect_with_reconnects(&rpc_url, WS_RECONNECTS).await { - Ok(provider) => provider, - Err(e) => { - return Err(anyhow::anyhow!( - "eth: fatal: given RPC URL could not connect! {e:?}" - )); - } + let connector = WsConnect { + url: rpc_url.clone(), + auth: None, }; + // http option here, although doesn't implement .get_watcher()... investigating + // let client = ClientBuilder::default().reqwest_http(Url::from_str(&rpc_url)?); + + let client = ClientBuilder::default().pubsub(connector).await?; + + let provider = alloy_providers::provider::Provider::new_with_client(client); + let x = provider.inner(); let mut connections = RpcConnections { provider, ws_provider_subscriptions: HashMap::new(), @@ -123,10 +126,18 @@ async fn handle_request( // if this process has already used this subscription ID, // this subscription will **overwrite** the existing one. + let id = connections + .provider + .inner() + .prepare::<_, U256>("eth_subscribe", filter) + .await + .unwrap(); + + let rx = connections.provider.inner().get_watcher(id).await; + let handle = tokio::spawn(handle_subscription_stream( our.clone(), - connections.provider.clone(), - filter, + rx, target.clone(), send_to_loop.clone(), )); @@ -151,19 +162,13 @@ async fn handle_request( /// for a specific subscription made by a process. async fn handle_subscription_stream( our: Arc, - provider: Provider, - filter: Filter, + mut rx: tokio::sync::broadcast::Receiver>, target: Address, send_to_loop: MessageSender, ) -> Result<(), EthError> { - let mut stream = match provider.subscribe_logs(&filter).await { - Ok(s) => s, - Err(e) => { - return Err(EthError::ProviderError(e.to_string())); - } - }; - - while let Some(event) = stream.next().await { + while let Ok(value) = rx.recv().await { + println!("got some sub!! {:?}", value); + let event: SubscriptionResult = serde_json::from_value(value.get().into()).unwrap(); send_to_loop .send(KernelMessage { id: rand::random(), @@ -176,7 +181,7 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&EthSubEvent::Log(event)).unwrap(), + body: serde_json::to_vec(&event).unwrap(), metadata: None, capabilities: vec![], }), diff --git a/src/eth/types.rs b/src/eth/types.rs index c88f3755..a4b0f78a 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -1,7 +1,13 @@ use crate::types::ProcessId; -use ethers::prelude::Provider; -use ethers::types::{Filter, Log}; -use ethers_providers::Ws; +use alloy_primitives::{Address, ChainId, U256}; +use alloy_providers::provider::Provider; +use alloy_pubsub::{PubSubConnect, PubSubFrontend}; +use alloy_rpc_client::ClientBuilder; +use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; +use alloy_rpc_types::{Filter, Log}; +use alloy_transport::BoxTransport; +use alloy_transport::Transport; +use alloy_transport_ws::WsConnect; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tokio::task::JoinHandle; @@ -46,6 +52,7 @@ pub enum EthSubEvent { /// Primary state object of the `eth` module pub struct RpcConnections { - pub provider: Provider, + // todo generics when they work properly: pub struct RpcConnections + pub provider: Provider, pub ws_provider_subscriptions: HashMap<(ProcessId, u64), JoinHandle>>, } From ec4cd9b39e267a6210e9961a87aaa0fa5543148a Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 1 Feb 2024 13:19:56 -0300 Subject: [PATCH 02/26] kns_indexer: draft alloy --- modules/kns_indexer/kns_indexer/src/lib.rs | 185 +++++++++++---------- 1 file changed, 101 insertions(+), 84 deletions(-) diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index 37bbac1d..5d96df8f 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -1,17 +1,20 @@ -use alloy_rpc_types::Log; +use alloy_primitives::Address as EthAddress; +use alloy_rpc_types::pubsub::SubscriptionResult; +use alloy_rpc_types::{Filter, Log}; use alloy_sol_types::{sol, SolEvent}; -use kinode_process_lib::eth::{EthAddress, EthSubEvent, SubscribeLogsRequest}; use kinode_process_lib::{ await_message, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; use serde::{Deserialize, Serialize}; -use std::collections::{ - hash_map::{Entry, HashMap}, - BTreeMap, -}; -use std::str::FromStr; use std::string::FromUtf8Error; +use std::{ + collections::{ + hash_map::{Entry, HashMap}, + BTreeMap, + }, + str::FromStr, +}; wit_bindgen::generate!({ path: "../../../wit", @@ -21,6 +24,15 @@ wit_bindgen::generate!({ }, }); +//TEMP +#[derive(Debug, Serialize, Deserialize)] +pub enum EthAction { + /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. + SubscribeLogs { sub_id: u64, filter: Filter }, + /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. + UnsubscribeLogs(u64), +} + #[derive(Clone, Debug, Serialize, Deserialize)] struct State { // what contract this state pertains to @@ -161,16 +173,25 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { ))? .send()?; - SubscribeLogsRequest::new(1) // subscription id 1 - .address(EthAddress::from_str(contract_address.unwrap().as_str())?) - .from_block(state.block - 1) + let mut filter = Filter::new() + .address(contract_address.unwrap().parse::().unwrap()) + .from_block(0) .events(vec![ "NodeRegistered(bytes32,bytes)", "KeyUpdate(bytes32,bytes32)", "IpUpdate(bytes32,uint128)", "WsUpdate(bytes32,uint16)", "RoutingUpdate(bytes32,bytes32[])", - ]) + ]); + + filter = filter.from_block(0); + + Request::new() + .target((&our.node, "eth", "distro", "sys")) + .body(serde_json::to_vec(&EthAction::SubscribeLogs { + sub_id: 8, + filter, + })?) .send()?; let mut pending_requests: BTreeMap> = BTreeMap::new(); @@ -230,88 +251,84 @@ fn handle_eth_message( pending_requests: &mut BTreeMap>, body: &[u8], ) -> anyhow::Result<()> { - let Ok(msg) = serde_json::from_slice::(body) else { + let Ok(log) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; - match msg { - EthSubEvent::Log(log) => { - state.block = log.block_number.expect("expect").to::(); + state.block = log.block_number.expect("expect").to::(); - let node_id: alloy_primitives::FixedBytes<32> = log.topics[1]; + let node_id: alloy_primitives::FixedBytes<32> = log.topics[1]; - let name = match state.names.entry(node_id.to_string()) { - Entry::Occupied(o) => o.into_mut(), - Entry::Vacant(v) => v.insert(get_name(&log)), - }; + let name = match state.names.entry(node_id.to_string()) { + Entry::Occupied(o) => o.into_mut(), + Entry::Vacant(v) => v.insert(get_name(&log)), + }; - let node = state - .nodes - .entry(name.to_string()) - .or_insert_with(|| KnsUpdate::new(name, &node_id.to_string())); + let node = state + .nodes + .entry(name.to_string()) + .or_insert_with(|| KnsUpdate::new(name, &node_id.to_string())); - let mut send = true; + let mut send = true; - match log.topics[0] { - KeyUpdate::SIGNATURE_HASH => { - node.public_key = KeyUpdate::abi_decode_data(&log.data, true) - .unwrap() - .0 - .to_string(); - } - IpUpdate::SIGNATURE_HASH => { - let ip = IpUpdate::abi_decode_data(&log.data, true).unwrap().0; - node.ip = format!( - "{}.{}.{}.{}", - (ip >> 24) & 0xFF, - (ip >> 16) & 0xFF, - (ip >> 8) & 0xFF, - ip & 0xFF - ); - // when we get ip data, we should delete any router data, - // since the assignment of ip indicates an direct node - node.routers = vec![]; - } - WsUpdate::SIGNATURE_HASH => { - node.port = WsUpdate::abi_decode_data(&log.data, true).unwrap().0; - // when we get port data, we should delete any router data, - // since the assignment of port indicates an direct node - node.routers = vec![]; - } - RoutingUpdate::SIGNATURE_HASH => { - node.routers = RoutingUpdate::abi_decode_data(&log.data, true) - .unwrap() - .0 - .iter() - .map(|r| r.to_string()) - .collect::>(); - // when we get routing data, we should delete any ws/ip data, - // since the assignment of routers indicates an indirect node - node.ip = "".to_string(); - node.port = 0; - } - _ => { - send = false; - } - } - - if node.public_key != "" - && ((node.ip != "" && node.port != 0) || node.routers.len() > 0) - && send - { - print_to_terminal( - 1, - &format!( - "kns_indexer: sending ID to net: {node:?} (blocknum {})", - state.block - ), - ); - Request::new() - .target((&our.node, "net", "distro", "sys")) - .try_body(NetActions::KnsUpdate(node.clone()))? - .send()?; - } + match log.topics[0] { + KeyUpdate::SIGNATURE_HASH => { + node.public_key = KeyUpdate::abi_decode_data(&log.data, true) + .unwrap() + .0 + .to_string(); } + IpUpdate::SIGNATURE_HASH => { + let ip = IpUpdate::abi_decode_data(&log.data, true).unwrap().0; + node.ip = format!( + "{}.{}.{}.{}", + (ip >> 24) & 0xFF, + (ip >> 16) & 0xFF, + (ip >> 8) & 0xFF, + ip & 0xFF + ); + // when we get ip data, we should delete any router data, + // since the assignment of ip indicates an direct node + node.routers = vec![]; + } + WsUpdate::SIGNATURE_HASH => { + node.port = WsUpdate::abi_decode_data(&log.data, true).unwrap().0; + // when we get port data, we should delete any router data, + // since the assignment of port indicates an direct node + node.routers = vec![]; + } + RoutingUpdate::SIGNATURE_HASH => { + node.routers = RoutingUpdate::abi_decode_data(&log.data, true) + .unwrap() + .0 + .iter() + .map(|r| r.to_string()) + .collect::>(); + // when we get routing data, we should delete any ws/ip data, + // since the assignment of routers indicates an indirect node + node.ip = "".to_string(); + node.port = 0; + } + _ => { + send = false; + } + } + + if node.public_key != "" + && ((node.ip != "" && node.port != 0) || node.routers.len() > 0) + && send + { + print_to_terminal( + 1, + &format!( + "kns_indexer: sending ID to net: {node:?} (blocknum {})", + state.block + ), + ); + Request::new() + .target((&our.node, "net", "distro", "sys")) + .try_body(NetActions::KnsUpdate(node.clone()))? + .send()?; } // check the pending_requests btreemap to see if there are any requests that // can be handled now that the state block has been updated From 07a3a857b884cee657df2f6af0466e51688cbc1c Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 1 Feb 2024 18:58:10 -0300 Subject: [PATCH 03/26] eth & kns: reform subscribe action --- modules/kns_indexer/kns_indexer/src/lib.rs | 22 +++++-- src/eth/provider.rs | 77 +++++++++++++--------- src/eth/types.rs | 6 +- 3 files changed, 66 insertions(+), 39 deletions(-) diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index 5d96df8f..53b4a363 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -1,7 +1,10 @@ use alloy_primitives::Address as EthAddress; -use alloy_rpc_types::pubsub::SubscriptionResult; -use alloy_rpc_types::{Filter, Log}; +use alloy_rpc_types::{ + pubsub::{Params, SubscriptionKind, SubscriptionResult}, + BlockNumberOrTag, Filter, Log, +}; use alloy_sol_types::{sol, SolEvent}; + use kinode_process_lib::{ await_message, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, @@ -28,7 +31,11 @@ wit_bindgen::generate!({ #[derive(Debug, Serialize, Deserialize)] pub enum EthAction { /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. - SubscribeLogs { sub_id: u64, filter: Filter }, + SubscribeLogs { + sub_id: u64, + kind: SubscriptionKind, + params: Params, + }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), } @@ -173,9 +180,10 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { ))? .send()?; - let mut filter = Filter::new() + let filter = Filter::new() .address(contract_address.unwrap().parse::().unwrap()) .from_block(0) + .to_block(BlockNumberOrTag::Latest) .events(vec![ "NodeRegistered(bytes32,bytes)", "KeyUpdate(bytes32,bytes32)", @@ -184,13 +192,15 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { "RoutingUpdate(bytes32,bytes32[])", ]); - filter = filter.from_block(0); + let params = Params::Logs(Box::new(filter)); + let kind = SubscriptionKind::Logs; Request::new() .target((&our.node, "eth", "distro", "sys")) .body(serde_json::to_vec(&EthAction::SubscribeLogs { sub_id: 8, - filter, + kind, + params, })?) .send()?; diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 6f5a8ccd..bd16e956 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,8 +1,10 @@ use crate::eth::types::*; use crate::types::*; -use alloy_primitives::U256; +use alloy_primitives::{Bytes, U256}; +use alloy_providers::provider::TempProvider; use alloy_rpc_client::ClientBuilder; -use alloy_rpc_types::pubsub::SubscriptionResult; +use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; +use alloy_rpc_types::{BlockNumberOrTag, Filter}; use alloy_transport_ws::WsConnect; use anyhow::Result; use std::collections::HashMap; @@ -43,13 +45,14 @@ pub async fn provider( auth: None, }; - // http option here, although doesn't implement .get_watcher()... investigating + // note, reqwest::http is an option here, although doesn't implement .get_watcher() + // polling should be an option, investigating // let client = ClientBuilder::default().reqwest_http(Url::from_str(&rpc_url)?); let client = ClientBuilder::default().pubsub(connector).await?; let provider = alloy_providers::provider::Provider::new_with_client(client); - let x = provider.inner(); + let mut connections = RpcConnections { provider, ws_provider_subscriptions: HashMap::new(), @@ -120,27 +123,31 @@ async fn handle_request( send_to_loop: &MessageSender, ) -> Result<(), EthError> { match action { - EthAction::SubscribeLogs { sub_id, filter } => { + EthAction::SubscribeLogs { + sub_id, + kind, + params, + } => { let sub_id = (target.process.clone(), sub_id); - // if this process has already used this subscription ID, - // this subscription will **overwrite** the existing one. + let kind = serde_json::to_value(&kind).unwrap(); + let params = serde_json::to_value(¶ms).unwrap(); let id = connections .provider .inner() - .prepare::<_, U256>("eth_subscribe", filter) + .prepare("eth_subscribe", [kind, params]) .await .unwrap(); let rx = connections.provider.inner().get_watcher(id).await; - let handle = tokio::spawn(handle_subscription_stream( our.clone(), rx, target.clone(), send_to_loop.clone(), )); + connections.ws_provider_subscriptions.insert(sub_id, handle); Ok(()) } @@ -166,29 +173,35 @@ async fn handle_subscription_stream( target: Address, send_to_loop: MessageSender, ) -> Result<(), EthError> { - while let Ok(value) = rx.recv().await { - println!("got some sub!! {:?}", value); - let event: SubscriptionResult = serde_json::from_value(value.get().into()).unwrap(); - send_to_loop - .send(KernelMessage { - id: rand::random(), - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Request(Request { - inherit: false, - expects_response: None, - body: serde_json::to_vec(&event).unwrap(), - metadata: None, - capabilities: vec![], - }), - lazy_load_blob: None, - }) - .await - .unwrap(); + match rx.recv().await { + Err(e) => { + println!("got an error from the subscription stream: {:?}", e); + // TODO should we stop the subscription here? + // return Err(EthError::ProviderError(format!("{:?}", e))); + } + Ok(value) => { + let event: SubscriptionResult = serde_json::from_str(value.get()).unwrap(); + send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Request(Request { + inherit: false, + expects_response: None, + body: serde_json::to_vec(&event).unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .unwrap(); + } } Err(EthError::SubscriptionClosed) } diff --git a/src/eth/types.rs b/src/eth/types.rs index a4b0f78a..efc9f524 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -19,7 +19,11 @@ use tokio::task::JoinHandle; #[derive(Debug, Serialize, Deserialize)] pub enum EthAction { /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. - SubscribeLogs { sub_id: u64, filter: Filter }, + SubscribeLogs { + sub_id: u64, + kind: SubscriptionKind, + params: Params, + }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), } From 55c55ab5568dc49ed048273473d27e90725223ae Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 1 Feb 2024 19:12:27 -0300 Subject: [PATCH 04/26] eth: add get_logs & get_block_number --- modules/kns_indexer/kns_indexer/src/lib.rs | 11 ++++++- src/eth/provider.rs | 38 ++++++++++++++++++++++ src/eth/types.rs | 7 ++-- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index 53b4a363..14a52b34 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -38,6 +38,10 @@ pub enum EthAction { }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), + /// get_logs + GetLogs { filter: Filter }, + /// get_block_number + GetBlockNumber, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -192,9 +196,14 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { "RoutingUpdate(bytes32,bytes32[])", ]); - let params = Params::Logs(Box::new(filter)); + let params = Params::Logs(Box::new(filter.clone())); let kind = SubscriptionKind::Logs; + Request::new() + .target((&our.node, "eth", "distro", "sys")) + .body(serde_json::to_vec(&EthAction::GetLogs { filter })?) + .send()?; + Request::new() .target((&our.node, "eth", "distro", "sys")) .body(serde_json::to_vec(&EthAction::SubscribeLogs { diff --git a/src/eth/provider.rs b/src/eth/provider.rs index bd16e956..372f5635 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -161,6 +161,44 @@ async fn handle_request( handle.abort(); Ok(()) } + EthAction::GetBlockNumber => { + let block_number = connections.provider.get_block_number().await.unwrap(); + + Ok(()) + } + EthAction::GetLogs { filter } => { + let logs = connections + .provider + .get_logs(filter) + .await + .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; + + // TEMP, will change. + for log in logs { + send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Request(Request { + inherit: false, + expects_response: None, + body: serde_json::to_vec(&log).unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .unwrap(); + } + + Ok(()) + } } } diff --git a/src/eth/types.rs b/src/eth/types.rs index efc9f524..d9e36b86 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -5,9 +5,6 @@ use alloy_pubsub::{PubSubConnect, PubSubFrontend}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; use alloy_rpc_types::{Filter, Log}; -use alloy_transport::BoxTransport; -use alloy_transport::Transport; -use alloy_transport_ws::WsConnect; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tokio::task::JoinHandle; @@ -26,6 +23,10 @@ pub enum EthAction { }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), + /// get_logs + GetLogs { filter: Filter }, + /// get_block_number + GetBlockNumber, } /// The Response type which a process will get from requesting with an [`EthAction`] will be From e7363393bf3cc1d6eb843024684931c814e81349 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Fri, 2 Feb 2024 14:40:49 -0300 Subject: [PATCH 05/26] eth: wip other methods & apI --- Cargo.lock | 1440 +++++++++----------- Cargo.toml | 2 +- modules/kns_indexer/kns_indexer/src/lib.rs | 107 +- src/eth/provider.rs | 119 +- src/eth/types.rs | 68 +- src/register.rs | 4 +- 6 files changed, 852 insertions(+), 888 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3157b852..af56ed3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,15 +27,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array", -] - [[package]] name = "aead" version = "0.5.2" @@ -46,18 +37,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug", -] - [[package]] name = "aes" version = "0.8.3" @@ -65,54 +44,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] [[package]] name = "aes-gcm" -version = "0.9.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - -[[package]] -name = "aes-gcm" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" -dependencies = [ - "aead 0.5.2", - "aes 0.8.3", - "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "aead", + "aes", + "cipher", + "ctr", + "ghash", "subtle", ] [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -126,9 +92,9 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-rlp", "serde", "thiserror", @@ -137,9 +103,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "serde", "serde_json", "thiserror", @@ -148,11 +114,11 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-rlp", "serde", ] @@ -179,34 +145,13 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "alloy-primitives" -version = "0.6.2" -source = "git+https://github.com/alloy-rs/core.git#04d63af7d9a3dc69749355c8dfeb3413b29a4f76" -dependencies = [ - "alloy-rlp", - "bytes", - "cfg-if", - "const-hex", - "derive_more", - "hex-literal", - "itoa", - "k256", - "keccak-asm", - "proptest", - "rand", - "ruint", - "serde", - "tiny-keccak", -] - [[package]] name = "alloy-providers" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-network", - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-rpc-client", "alloy-rpc-trace-types", "alloy-rpc-types", @@ -222,13 +167,14 @@ dependencies = [ [[package]] name = "alloy-pubsub" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-transport", "bimap", "futures", + "serde", "serde_json", "tokio", "tower", @@ -260,10 +206,10 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-json-rpc", - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -271,8 +217,8 @@ dependencies = [ "futures", "pin-project", "reqwest", + "serde", "serde_json", - "tokio", "tower", "tracing", "url", @@ -281,9 +227,9 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-rpc-types", "serde", "serde_json", @@ -292,9 +238,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ - "alloy-primitives 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "alloy-primitives", "alloy-rlp", "itertools 0.12.1", "serde", @@ -305,10 +251,10 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-json-rpc", - "base64 0.21.4", + "base64 0.21.7", "serde", "serde_json", "thiserror", @@ -321,7 +267,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -334,7 +280,7 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#e6f98e15efac4bb2c598570580296925cc590dd3" +source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -342,7 +288,7 @@ dependencies = [ "http", "serde_json", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "tracing", "ws_stream_wasm", ] @@ -370,9 +316,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -384,43 +330,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arbitrary" @@ -552,15 +498,6 @@ dependencies = [ "rand", ] -[[package]] -name = "array-init" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" -dependencies = [ - "nodrop", -] - [[package]] name = "arrayref" version = "0.3.7" @@ -606,14 +543,13 @@ dependencies = [ [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -651,9 +587,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -726,9 +662,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -753,16 +689,15 @@ dependencies = [ [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec", "cc", "cfg-if", "constant_time_eq 0.3.0", - "digest 0.10.7", ] [[package]] @@ -786,9 +721,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -798,9 +733,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -843,50 +778,50 @@ dependencies = [ [[package]] name = "cap-fs-ext" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b779b2d0a001c125b4584ad586268fb4b92d957bff8d26d7fe0dd78283faa814" +checksum = "88e341d15ac1029aadce600be764a1a1edafe40e03cde23285bc1d261b3a4866" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 2.0.2", - "windows-sys 0.48.0", + "io-lifetimes", + "windows-sys 0.52.0", ] [[package]] name = "cap-net-ext" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ffc30dee200c20b4dcb80572226f42658e1d9c4b668656d7cc59c33d50e396e" +checksum = "434168fe6533055f0f4204039abe3ff6d7db338ef46872a5fa39e9d5ad5ab7a9" dependencies = [ "cap-primitives", "cap-std", - "rustix 0.38.27", - "smallvec 1.11.0", + "rustix", + "smallvec", ] [[package]] name = "cap-primitives" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf30c373a3bee22c292b1b6a7a26736a38376840f1af3d2d806455edf8c3899" +checksum = "fe16767ed8eee6d3f1f00d6a7576b81c226ab917eb54b96e5f77a5216ef67abb" dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 2.0.2", + "io-lifetimes", "ipnet", "maybe-owned", - "rustix 0.38.27", - "windows-sys 0.48.0", + "rustix", + "windows-sys 0.52.0", "winx", ] [[package]] name = "cap-rand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "577de6cff7c2a47d6b13efe5dd28bf116bd7f8f7db164ea95b7cc2640711f522" +checksum = "20e5695565f0cd7106bc3c7170323597540e772bb73e0be2cd2c662a0f8fa4ca" dependencies = [ "ambient-authority", "rand", @@ -894,33 +829,35 @@ dependencies = [ [[package]] name = "cap-std" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84bade423fa6403efeebeafe568fdb230e8c590a275fba2ba978dd112efcf6e9" +checksum = "593db20e4c51f62d3284bae7ee718849c3214f93a3b94ea1899ad85ba119d330" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 2.0.2", - "rustix 0.38.27", + "io-lifetimes", + "rustix", ] [[package]] name = "cap-time-ext" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f52b3c8f4abfe3252fd0a071f3004aaa3b18936ec97bdbd8763ce03aff6247" +checksum = "03261630f291f425430a36f38c847828265bc928f517cdd2004c56f4b02f002b" dependencies = [ + "ambient-authority", "cap-primitives", + "iana-time-zone", "once_cell", - "rustix 0.38.27", + "rustix", "winx", ] [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -933,7 +870,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -964,18 +901,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chacha20" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "zeroize", -] - [[package]] name = "chacha20" version = "0.9.1" @@ -983,57 +908,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.4.4", + "cipher", "cpufeatures", ] -[[package]] -name = "chacha20poly1305" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" -dependencies = [ - "aead 0.4.3", - "chacha20 0.8.2", - "cipher 0.3.0", - "poly1305 0.7.2", - "zeroize", -] - [[package]] name = "chacha20poly1305" version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.5.2", - "chacha20 0.9.1", - "cipher 0.4.4", - "poly1305 0.8.0", + "aead", + "chacha20", + "cipher", + "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.48.5", -] - -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", + "windows-targets 0.52.0", ] [[package]] @@ -1049,9 +952,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1060,9 +963,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.10" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -1070,9 +973,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1136,7 +1039,7 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bech32", "bs58", "digest 0.10.7", @@ -1171,9 +1074,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" @@ -1195,9 +1098,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1205,9 +1108,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpp_demangle" @@ -1220,9 +1123,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1250,10 +1153,10 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli", - "hashbrown 0.14.0", + "hashbrown 0.14.3", "log", "regalloc2", - "smallvec 1.11.0", + "smallvec", "target-lexicon", ] @@ -1299,7 +1202,7 @@ checksum = "e57374fd11d72cf9ffb85ff64506ed831440818318f58d09f45b4185e5e9c376" dependencies = [ "cranelift-codegen", "log", - "smallvec 1.11.0", + "smallvec", "target-lexicon", ] @@ -1331,8 +1234,8 @@ dependencies = [ "cranelift-frontend", "itertools 0.10.5", "log", - "smallvec 1.11.0", - "wasmparser 0.116.0", + "smallvec", + "wasmparser 0.116.1", "wasmtime-types", ] @@ -1345,48 +1248,30 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -1422,9 +1307,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -1443,22 +1328,13 @@ dependencies = [ "typenum", ] -[[package]] -name = "ctr" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "ctr" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -1479,9 +1355,9 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", @@ -1530,7 +1406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.0", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -1538,9 +1414,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "debugid" @@ -1548,7 +1424,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "uuid 1.4.1", + "uuid 1.7.0", ] [[package]] @@ -1563,9 +1439,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -1723,7 +1602,7 @@ checksum = "53ecafc952c4528d9b51a458d1a8904b81783feff9fde08ab6ed2545ff396872" dependencies = [ "cfg-if", "libc", - "socket2 0.4.9", + "socket2 0.4.10", "winapi", ] @@ -1735,9 +1614,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -1799,11 +1678,11 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "enr" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be7b2ac146c1f99fe245c02d16af0696450d8e06c135db75e10eeb9e642c20d" +checksum = "fe81b5c06ecfdbc71dd845216f225f53b62a10cb8a16c946836a3467f701d05b" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "hex", "k256", @@ -1811,7 +1690,6 @@ dependencies = [ "rand", "rlp", "serde", - "serde-hex", "sha3", "zeroize", ] @@ -1850,8 +1728,8 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ - "aes 0.8.3", - "ctr 0.9.2", + "aes", + "ctr", "digest 0.10.7", "hex", "hmac", @@ -1981,7 +1859,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.48", - "toml 0.8.8", + "toml 0.8.9", "walkdir", ] @@ -2040,7 +1918,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.18", + "semver 1.0.21", "serde", "serde_json", "thiserror", @@ -2082,7 +1960,7 @@ checksum = "fb6b15393996e3b8a78ef1332d6483c11d839042c17be58decc92fa8b1c3508a" dependencies = [ "async-trait", "auto_impl", - "base64 0.21.4", + "base64 0.21.7", "bytes", "const-hex", "enr", @@ -2102,7 +1980,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "tracing", "tracing-futures", "url", @@ -2150,7 +2028,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.18", + "semver 1.0.21", "serde", "serde_json", "solang-parser", @@ -2165,9 +2043,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -2187,9 +2065,9 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fastrlp" @@ -2204,13 +2082,13 @@ dependencies = [ [[package]] name = "fd-lock" -version = "4.0.0" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0377f1edc77dbd1118507bc7a66e4ab64d2b90c66f90726dc801e73a8c68f9" +checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix 0.38.27", - "windows-sys 0.48.0", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -2225,9 +2103,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "fixed-hash" @@ -2249,9 +2127,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -2280,22 +2158,22 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "fs-set-times" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd738b84894214045e8414eaded76359b4a5773f0a0a56b16575110739cdcf39" +checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 2.0.2", - "rustix 0.38.27", - "windows-sys 0.48.0", + "io-lifetimes", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -2438,7 +2316,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "debugid", "fxhash", "serde", @@ -2458,25 +2336,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", "wasi", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug", - "polyval 0.5.3", -] - [[package]] name = "ghash" version = "0.5.0" @@ -2484,17 +2352,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug", - "polyval 0.6.1", + "polyval", ] [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator", - "indexmap 2.0.0", + "indexmap", "stable_deref_trait", ] @@ -2529,9 +2397,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -2539,19 +2407,13 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.13.2" @@ -2563,9 +2425,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -2586,7 +2448,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -2595,7 +2457,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "headers-core", "http", @@ -2621,9 +2483,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -2642,9 +2504,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -2660,18 +2522,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -2680,9 +2542,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -2703,9 +2565,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -2718,7 +2580,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -2727,9 +2589,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -2768,16 +2630,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -2814,9 +2676,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2891,22 +2753,12 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", "serde", ] @@ -2930,36 +2782,25 @@ dependencies = [ [[package]] name = "io-extras" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d3c230ee517ee76b1cc593b52939ff68deda3fae9e41eca426c6b4993df51c4" +checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" dependencies = [ - "io-lifetimes 2.0.2", - "windows-sys 0.48.0", + "io-lifetimes", + "windows-sys 0.52.0", ] [[package]] name = "io-lifetimes" -version = "1.0.11" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "io-lifetimes" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb4def18c48926ccac55c1223e02865ce1a821751a95920448662696e7472c" +checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-docker" @@ -2972,13 +2813,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", - "rustix 0.38.27", - "windows-sys 0.48.0", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -3020,9 +2861,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "ittapi" @@ -3046,18 +2887,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -3068,9 +2909,9 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "pem", - "ring", + "ring 0.16.20", "serde", "serde_json", "simple_asn1", @@ -3093,9 +2934,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", @@ -3107,9 +2948,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -3128,9 +2969,9 @@ dependencies = [ name = "kinode" version = "0.5.2" dependencies = [ - "aes-gcm 0.10.2", + "aes-gcm", "alloy-network", - "alloy-primitives 0.6.2 (git+https://github.com/alloy-rs/core.git)", + "alloy-primitives", "alloy-providers", "alloy-pubsub", "alloy-rpc-client", @@ -3145,7 +2986,7 @@ dependencies = [ "blake3", "bytes", "cap-std", - "chacha20poly1305 0.10.1", + "chacha20poly1305", "chrono", "clap", "crossterm", @@ -3171,7 +3012,7 @@ dependencies = [ "public-ip", "rand", "reqwest", - "ring", + "ring 0.16.20", "rmp-serde", "rocksdb", "route-recognizer", @@ -3185,9 +3026,9 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "url", - "uuid 1.4.1", + "uuid 1.7.0", "walkdir", "warp", "wasmtime", @@ -3243,18 +3084,18 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -3263,6 +3104,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -3292,9 +3144,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "pkg-config", @@ -3303,21 +3155,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -3360,34 +3206,29 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "md-5" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ + "cfg-if", "digest 0.10.7", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix", ] [[package]] @@ -3490,15 +3331,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" dependencies = [ - "smallvec 1.11.0", + "smallvec", ] -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -3526,6 +3361,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.45" @@ -3538,9 +3379,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -3558,20 +3399,20 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70bf6736f74634d299d00086f02986875b3c2d924781a6a2cb6c201e73da0ceb" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ "num_enum_derive", ] [[package]] name = "num_enum_derive" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ea360eafe1022f7cc56cd7b869ed57330fb2453d0c7831d99b74c65d2f5597" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.48", @@ -3579,21 +3420,21 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.14.0", - "indexmap 2.0.0", + "hashbrown 0.14.3", + "indexmap", "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -3603,9 +3444,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfabf1927dce4d6fdf563d63328a0a506101ced3ec780ca2135747336c98cef8" +checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349" dependencies = [ "is-wsl", "libc", @@ -3639,11 +3480,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -3671,9 +3512,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -3689,9 +3530,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "parity-scale-codec" -version = "3.6.8" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88eaac72ead1b9bd4ce747d577dbd2ad31fb0a56a9a20c611bf27bd1b97fbed" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -3703,11 +3544,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.8" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33bdcd446e9400b6ad9fc85b4aea68846c258b07c3efb994679ae82707b133f0" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3725,14 +3566,14 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "smallvec 1.11.0", + "redox_syscall", + "smallvec", "windows-targets 0.48.5", ] @@ -3804,9 +3645,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -3826,7 +3667,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap", ] [[package]] @@ -3892,18 +3733,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", @@ -3934,26 +3775,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" -version = "3.1.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" - -[[package]] -name = "poly1305" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash 0.4.1", -] +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "poly1305" @@ -3963,19 +3793,7 @@ checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug", - "universal-hash 0.5.1", -] - -[[package]] -name = "polyval" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" -dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -3987,9 +3805,15 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.5.1", + "universal-hash", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -4004,9 +3828,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", "syn 2.0.48", @@ -4014,9 +3838,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -4037,27 +3861,21 @@ dependencies = [ ] [[package]] -name = "proc-macro-error" -version = "1.0.4" +name = "proc-macro-crate" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", + "toml_edit 0.20.7", ] [[package]] -name = "proc-macro-error-attr" -version = "1.0.4" +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "proc-macro2", - "quote", - "version_check", + "toml_edit 0.21.1", ] [[package]] @@ -4083,7 +3901,7 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.0", + "bitflags 2.4.2", "lazy_static", "num-traits", "rand", @@ -4197,9 +4015,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -4207,42 +4025,31 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] @@ -4256,14 +4063,14 @@ dependencies = [ "log", "rustc-hash", "slice-group-by", - "smallvec 1.11.0", + "smallvec", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -4273,9 +4080,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -4296,11 +4103,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -4324,6 +4131,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -4357,11 +4165,25 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -4467,12 +4289,12 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78046161564f5e7cd9008aff3b2990b3850dc8e0349119b98e8f251e099f24d" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", - "smallvec 1.11.0", + "smallvec", ] [[package]] @@ -4508,67 +4330,53 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.21", ] [[package]] name = "rustix" -version = "0.37.23" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes 1.0.11", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" -dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "itoa", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys", "once_cell", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring", + "ring 0.17.7", "rustls-webpki", "sct", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -4591,9 +4399,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "salsa20" @@ -4601,7 +4409,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "cipher 0.4.4", + "cipher", ] [[package]] @@ -4615,9 +4423,9 @@ dependencies = [ [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "cfg-if", "derive_more", @@ -4627,11 +4435,11 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -4639,11 +4447,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4672,12 +4480,12 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -4728,9 +4536,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] @@ -4758,29 +4566,18 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] -[[package]] -name = "serde-hex" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca37e3e4d1b39afd7ff11ee4e947efae85adfddf4841787bfa47c470e96dc26d" -dependencies = [ - "array-init", - "serde", - "smallvec 0.6.14", -] - [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -4789,9 +4586,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -4821,9 +4618,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -4832,9 +4629,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -4872,9 +4669,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" @@ -4908,9 +4705,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -4951,31 +4748,22 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "0.6.14" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "snow" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "aes-gcm 0.9.4", + "aes-gcm", "blake2", - "chacha20poly1305 0.9.1", + "chacha20poly1305", "curve25519-dalek", "rand_core", - "ring", + "ring 0.17.7", "rustc_version 0.4.0", "sha2", "subtle", @@ -4983,9 +4771,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -5029,9 +4817,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -5108,9 +4896,9 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck", "proc-macro2", @@ -5121,22 +4909,22 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "svm-rs" -version = "0.3.0" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597e3a746727984cb7ea2487b6a40726cad0dbe86628e7d429aa6b8c4c153db4" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" dependencies = [ "dirs 5.0.1", "fs2", "hex", "once_cell", "reqwest", - "semver 1.0.18", + "semver 1.0.21", "serde", "serde_json", "sha2", @@ -5167,6 +4955,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -5190,17 +4984,17 @@ dependencies = [ [[package]] name = "system-interface" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ce32341b2c0b70c144bbf35627fdc1ef18c76ced5e5e7b3ee8b5ba6b2ab6a0" +checksum = "0682e006dd35771e392a6623ac180999a9a854b1d4a6c12fb2e804941c2b1f58" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cap-fs-ext", "cap-std", "fd-lock", - "io-lifetimes 2.0.2", - "rustix 0.38.27", - "windows-sys 0.48.0", + "io-lifetimes", + "rustix", + "windows-sys 0.52.0", "winx", ] @@ -5212,21 +5006,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", - "rustix 0.38.27", - "windows-sys 0.48.0", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", ] [[package]] @@ -5242,18 +5036,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -5262,12 +5056,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -5275,16 +5071,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -5314,9 +5111,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -5372,18 +5169,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.18.0", -] - [[package]] name = "tokio-tungstenite" version = "0.20.1" @@ -5395,15 +5180,15 @@ dependencies = [ "rustls", "tokio", "tokio-rustls", - "tungstenite 0.20.1", + "tungstenite", "webpki-roots", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -5424,14 +5209,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -5449,18 +5234,29 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap", "toml_datetime", "winnow", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.0.0", + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -5576,7 +5372,7 @@ dependencies = [ "lazy_static", "log", "rand", - "smallvec 1.11.0", + "smallvec", "thiserror", "tinyvec", "tokio", @@ -5585,28 +5381,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - -[[package]] -name = "tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -5630,9 +5407,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -5669,15 +5446,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -5690,9 +5467,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -5700,16 +5477,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -5727,13 +5494,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] -name = "url" -version = "2.4.1" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", ] @@ -5767,9 +5540,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", "serde", @@ -5823,9 +5596,9 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" +checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" dependencies = [ "bytes", "futures-channel", @@ -5846,7 +5619,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-stream", - "tokio-tungstenite 0.18.0", + "tokio-tungstenite", "tokio-util", "tower-service", "tracing", @@ -5872,9 +5645,9 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 2.0.2", + "io-lifetimes", "once_cell", - "rustix 0.38.27", + "rustix", "system-interface", "tracing", "wasi-common", @@ -5888,12 +5661,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f6774ec9e464b7373f683bc57ff87fcca5fd26a7d6bdb7438fb2f56a545aa6" dependencies = [ "anyhow", - "bitflags 2.4.0", + "bitflags 2.4.2", "cap-rand", "cap-std", "io-extras", "log", - "rustix 0.38.27", + "rustix", "thiserror", "tracing", "wasmtime", @@ -5903,9 +5676,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -5913,9 +5686,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -5928,9 +5701,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -5940,9 +5713,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5950,9 +5723,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -5963,9 +5736,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-encoder" @@ -5978,41 +5751,42 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.38.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" +checksum = "e09bca7d6388637d27fb5edbeab11f56bfabcef8743c55ae34370e1e5030a071" dependencies = [ "leb128", ] [[package]] name = "wasmparser" -version = "0.116.0" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53290b1276c5c2d47d694fb1a920538c01f51690e7e261acbe1d10c5fc306ea1" +checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" dependencies = [ - "indexmap 2.0.0", - "semver 1.0.18", + "indexmap", + "semver 1.0.21", ] [[package]] name = "wasmparser" -version = "0.118.1" +version = "0.121.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" +checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" dependencies = [ - "indexmap 2.0.0", - "semver 1.0.18", + "bitflags 2.4.2", + "indexmap", + "semver 1.0.21", ] [[package]] name = "wasmprinter" -version = "0.2.75" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d027eb8294904fc715ac0870cebe6b0271e96b90605ee21511e7565c4ce568c" +checksum = "05e32c13c59fdc64d3f6998a1d52eb1d362b6904a88b754190ccb85661ad577a" dependencies = [ "anyhow", - "wasmparser 0.118.1", + "wasmparser 0.121.0", ] [[package]] @@ -6028,7 +5802,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.0.0", + "indexmap", "libc", "log", "object", @@ -6041,7 +5815,7 @@ dependencies = [ "serde_json", "target-lexicon", "wasm-encoder 0.36.2", - "wasmparser 0.116.0", + "wasmparser 0.116.1", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -6071,11 +5845,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aba5bf44d044d25892c03fb3534373936ee204141ff92bac8297787ac7f22318" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.7", "bincode", "directories-next", "log", - "rustix 0.38.27", + "rustix", "serde", "serde_derive", "sha2", @@ -6124,7 +5898,7 @@ dependencies = [ "object", "target-lexicon", "thiserror", - "wasmparser 0.116.0", + "wasmparser 0.116.1", "wasmtime-cranelift-shared", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -6155,7 +5929,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli", - "indexmap 2.0.0", + "indexmap", "log", "object", "serde", @@ -6163,7 +5937,7 @@ dependencies = [ "target-lexicon", "thiserror", "wasm-encoder 0.36.2", - "wasmparser 0.116.0", + "wasmparser 0.116.1", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -6178,7 +5952,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "rustix 0.38.27", + "rustix", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.48.0", @@ -6200,7 +5974,7 @@ dependencies = [ "log", "object", "rustc-demangle", - "rustix 0.38.27", + "rustix", "serde", "serde_derive", "target-lexicon", @@ -6219,7 +5993,7 @@ checksum = "4e0c4b74e606d1462d648631d5bc328e3d5b14e7f9d3ff93bc6db062fb8c5cd8" dependencies = [ "object", "once_cell", - "rustix 0.38.27", + "rustix", "wasmtime-versioned-export-macros", ] @@ -6244,7 +6018,7 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", - "indexmap 2.0.0", + "indexmap", "libc", "log", "mach", @@ -6252,7 +6026,7 @@ dependencies = [ "memoffset", "paste", "rand", - "rustix 0.38.27", + "rustix", "sptr", "wasm-encoder 0.36.2", "wasmtime-asm-macros", @@ -6274,7 +6048,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "wasmparser 0.116.0", + "wasmparser 0.116.1", ] [[package]] @@ -6296,7 +6070,7 @@ checksum = "eff3f4ad191a5e6d002bb5bffa3e2931a58984da9b30e57b48f353848748cf80" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.0", + "bitflags 2.4.2", "bytes", "cap-fs-ext", "cap-net-ext", @@ -6306,11 +6080,11 @@ dependencies = [ "fs-set-times", "futures", "io-extras", - "io-lifetimes 2.0.2", + "io-lifetimes", "libc", "log", "once_cell", - "rustix 0.38.27", + "rustix", "system-interface", "thiserror", "tokio", @@ -6334,7 +6108,7 @@ dependencies = [ "gimli", "object", "target-lexicon", - "wasmparser 0.116.0", + "wasmparser 0.116.1", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -6348,7 +6122,7 @@ checksum = "4b804dfd3d0c0d6d37aa21026fe7772ba1a769c89ee4f5c4f13b82d91d75216f" dependencies = [ "anyhow", "heck", - "indexmap 2.0.0", + "indexmap", "wit-parser", ] @@ -6369,30 +6143,31 @@ dependencies = [ [[package]] name = "wast" -version = "69.0.1" +version = "70.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ee37317321afde358e4d7593745942c48d6d17e0e6e943704de9bbee121e7a" +checksum = "a3d5061300042ff5065123dae1e27d00c03f567d34a2937c8472255148a216dc" dependencies = [ + "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.38.1", + "wasm-encoder 0.41.0", ] [[package]] name = "wat" -version = "1.0.82" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb338ee8dee4d4cd05e6426683f21c5087dc7cfc8903e839ccf48d43332da3c" +checksum = "afd7357b6cc46d46a2509c43dcb1dd4131dafbf4e75562d87017b5a05ffad2d6" dependencies = [ - "wast 69.0.1", + "wast 70.0.2", ] [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -6400,9 +6175,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "wiggle" @@ -6412,7 +6187,7 @@ checksum = "f91028b241e692fdf30627ac10ba9d5ac378353ea4119b4f904ac95177057a44" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.0", + "bitflags 2.4.2", "thiserror", "tracing", "wasmtime", @@ -6464,9 +6239,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -6487,19 +6262,19 @@ dependencies = [ "cranelift-codegen", "gimli", "regalloc2", - "smallvec 1.11.0", + "smallvec", "target-lexicon", - "wasmparser 0.116.0", + "wasmparser 0.116.1", "wasmtime-environ", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -6636,9 +6411,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" dependencies = [ "memchr", ] @@ -6655,25 +6430,25 @@ dependencies = [ [[package]] name = "winx" -version = "0.36.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357bb8e2932df531f83b052264b050b81ba0df90ee5a59b2d1d3949f344f81e5" +checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" dependencies = [ - "bitflags 2.4.0", - "windows-sys 0.48.0", + "bitflags 2.4.2", + "windows-sys 0.52.0", ] [[package]] name = "wit-parser" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15df6b7b28ce94b8be39d8df5cb21a08a4f3b9f33b631aedb4aa5776f785ead3" +checksum = "df4913a2219096373fd6512adead1fb77ecdaa59d7fc517972a7d30b12f625be" dependencies = [ "anyhow", "id-arena", - "indexmap 2.0.0", + "indexmap", "log", - "semver 1.0.18", + "semver 1.0.21", "serde", "serde_derive", "serde_json", @@ -6726,6 +6501,26 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "zeroize" version = "1.7.0" @@ -6752,7 +6547,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ - "aes 0.8.3", + "aes", "byteorder", "bzip2", "constant_time_eq 0.1.5", @@ -6787,11 +6582,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 9df282dd..d83cbbea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ simulation-mode = [] [dependencies] aes-gcm = "0.10.2" alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy" } -alloy-primitives = { git = "https://github.com/alloy-rs/core.git" } +alloy-primitives = "0.6.2" alloy-providers = { git = "https://github.com/alloy-rs/alloy.git" } alloy-network = { git = "https://github.com/alloy-rs/alloy.git" } alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy.git", features = [ diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index 14a52b34..6e9f48fd 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -44,6 +44,30 @@ pub enum EthAction { GetBlockNumber, } +//TEMP +/// Potential EthResponse type. +/// Can encapsulate all methods in their own response type, +/// or return generic result which can be parsed later.. +#[derive(Debug, Serialize, Deserialize)] +pub enum EthResponse { + // another possible strat, just return RpcResult, + // then try deserializing on the process_lib side. + Ok, + //Err(EthError), + Sub(SubscriptionResult), + GetLogs(Vec), + // GetBlockNumber(u64), + // GetBalance(U256), + // GetGasPrice(U256), + // Call(Vec), // alloy_primimtives::Bytes deserialization.. + // GetTransactionCount(U256), + // GetBlockByNumber(Option), + // GetBlockByHash(Option), + // // raw json vs enum type vs into T? + // RawRequest(serde_json::Value), + // SendRawTransaction(Vec), // alloy_primitives::TxHash deserialization.. +} + #[derive(Clone, Debug, Serialize, Deserialize)] struct State { // what contract this state pertains to @@ -270,10 +294,60 @@ fn handle_eth_message( pending_requests: &mut BTreeMap>, body: &[u8], ) -> anyhow::Result<()> { - let Ok(log) = serde_json::from_slice::(body) else { + let Ok(res) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; + match res { + EthResponse::GetLogs(logs) => { + for log in logs { + handle_log(our, state, &log)?; + } + } + EthResponse::Sub(result) => match result { + SubscriptionResult::Log(log) => { + handle_log(our, state, &log)?; + } + _ => {} + }, + _ => {} + } + + // check the pending_requests btreemap to see if there are any requests that + // can be handled now that the state block has been updated + let mut blocks_to_remove = vec![]; + for (block, requests) in pending_requests.iter() { + if *block <= state.block { + for request in requests.iter() { + match request { + IndexerRequests::NamehashToName { hash, .. } => { + Response::new() + .body(serde_json::to_vec(&state.names.get(hash))?) + .send() + .unwrap(); + } + IndexerRequests::NodeInfo { name, .. } => { + Response::new() + .body(serde_json::to_vec(&state.nodes.get(name))?) + .send() + .unwrap(); + } + } + } + blocks_to_remove.push(*block); + } else { + break; + } + } + for block in blocks_to_remove.iter() { + pending_requests.remove(block); + } + + set_state(&bincode::serialize(state)?); + Ok(()) +} + +fn handle_log(our: &Address, state: &mut State, log: &Log) -> anyhow::Result<()> { state.block = log.block_number.expect("expect").to::(); let node_id: alloy_primitives::FixedBytes<32> = log.topics[1]; @@ -349,37 +423,6 @@ fn handle_eth_message( .try_body(NetActions::KnsUpdate(node.clone()))? .send()?; } - // check the pending_requests btreemap to see if there are any requests that - // can be handled now that the state block has been updated - let mut blocks_to_remove = vec![]; - for (block, requests) in pending_requests.iter() { - if *block <= state.block { - for request in requests.iter() { - match request { - IndexerRequests::NamehashToName { hash, .. } => { - Response::new() - .body(serde_json::to_vec(&state.names.get(hash))?) - .send() - .unwrap(); - } - IndexerRequests::NodeInfo { name, .. } => { - Response::new() - .body(serde_json::to_vec(&state.nodes.get(name))?) - .send() - .unwrap(); - } - } - } - blocks_to_remove.push(*block); - } else { - break; - } - } - for block in blocks_to_remove.iter() { - pending_requests.remove(block); - } - - set_state(&bincode::serialize(state)?); Ok(()) } diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 372f5635..2f3d25b6 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,13 +1,15 @@ use crate::eth::types::*; use crate::types::*; -use alloy_primitives::{Bytes, U256}; +use alloy_primitives::{Address as EthAddress, Bytes, U256}; use alloy_providers::provider::TempProvider; +use alloy_pubsub::RawSubscription; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; use alloy_rpc_types::{BlockNumberOrTag, Filter}; use alloy_transport_ws::WsConnect; use anyhow::Result; use std::collections::HashMap; +use std::str::FromStr; use std::sync::Arc; use url::Url; @@ -58,6 +60,8 @@ pub async fn provider( ws_provider_subscriptions: HashMap::new(), }; + // turn into dashmap so we can share across threads + while let Some(km) = recv_in_client.recv().await { // this module only handles requests, ignores all responses let Message::Request(req) = &km.message else { @@ -140,7 +144,7 @@ async fn handle_request( .await .unwrap(); - let rx = connections.provider.inner().get_watcher(id).await; + let rx = connections.provider.inner().get_raw_subscription(id).await; let handle = tokio::spawn(handle_subscription_stream( our.clone(), rx, @@ -162,7 +166,7 @@ async fn handle_request( Ok(()) } EthAction::GetBlockNumber => { - let block_number = connections.provider.get_block_number().await.unwrap(); + let vc: Vec = Vec::new(); Ok(()) } @@ -174,28 +178,95 @@ async fn handle_request( .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; // TEMP, will change. - for log in logs { - send_to_loop - .send(KernelMessage { - id: rand::random(), - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Request(Request { + send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Response(( + Response { inherit: false, - expects_response: None, - body: serde_json::to_vec(&log).unwrap(), + body: serde_json::to_vec(&EthResponse::GetLogs(logs)).unwrap(), metadata: None, capabilities: vec![], - }), - lazy_load_blob: None, - }) - .await - .unwrap(); - } + }, + None, + )), + lazy_load_blob: None, + }) + .await + .unwrap(); + Ok(()) + } + EthAction::GetGasPrice => { + let gas_price = connections + .provider + .get_gas_price() + .await + .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; + + send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Request(Request { + inherit: false, + expects_response: None, + body: serde_json::to_vec(&gas_price).unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .unwrap(); + + Ok(()) + } + EthAction::GetBalance { address, tag } => { + let address = EthAddress::from_str(&address) + .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; + let balance = connections + .provider + .get_balance(address, tag) + .await + .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; + + send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Request(Request { + inherit: false, + expects_response: None, + body: serde_json::to_vec(&balance).unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .unwrap(); + + Ok(()) + } + _ => { + println!("eth: unhandled action: {:?}", action); + // will be handled soon. Ok(()) } @@ -207,7 +278,7 @@ async fn handle_request( /// for a specific subscription made by a process. async fn handle_subscription_stream( our: Arc, - mut rx: tokio::sync::broadcast::Receiver>, + mut rx: RawSubscription, target: Address, send_to_loop: MessageSender, ) -> Result<(), EthError> { @@ -231,7 +302,7 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&event).unwrap(), + body: serde_json::to_vec(&EthResponse::Sub(event)).unwrap(), metadata: None, capabilities: vec![], }), diff --git a/src/eth/types.rs b/src/eth/types.rs index d9e36b86..6bf13c2c 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -1,10 +1,10 @@ use crate::types::ProcessId; -use alloy_primitives::{Address, ChainId, U256}; +use alloy_primitives::{Address, BlockHash, Bytes, ChainId, TxHash, B256, U256}; use alloy_providers::provider::Provider; -use alloy_pubsub::{PubSubConnect, PubSubFrontend}; -use alloy_rpc_client::ClientBuilder; +use alloy_pubsub::PubSubFrontend; use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; -use alloy_rpc_types::{Filter, Log}; +use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, CallRequest, Filter, Log}; +use alloy_transport::RpcResult; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tokio::task::JoinHandle; @@ -16,6 +16,7 @@ use tokio::task::JoinHandle; #[derive(Debug, Serialize, Deserialize)] pub enum EthAction { /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. + /// Logs come in as alloy_rpc_types::pubsub::SubscriptionResults SubscribeLogs { sub_id: u64, kind: SubscriptionKind, @@ -24,9 +25,64 @@ pub enum EthAction { /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), /// get_logs - GetLogs { filter: Filter }, + /// Vec or loop through? + GetLogs { + filter: Filter, + }, /// get_block_number GetBlockNumber, + /// eth_getBalance + GetBalance { + address: String, // alloy_primitives::Address deserialization.. + tag: Option, + }, + GetGasPrice, + Call { + tx: CallRequest, + tag: BlockNumberOrTag, + }, + GetTransactionCount { + address: String, // alloy_primitives::Address deserialization.. + tag: Option, + }, + GetBlockByNumber { + block: BlockId, + full_tx: bool, + }, + GetBlockByHash { + hash: Vec, // alloy_primitives::BlockHash deserialization.. + full_tx: bool, + }, + RawRequest { + method: String, + params: Params, + }, + SendRawTransaction { + tx: Vec, // alloy_primitives::Bytes deserialization.. + }, +} + +/// Potential EthResponse type. +/// Can encapsulate all methods in their own response type, +/// or return generic result which can be parsed later.. +#[derive(Debug, Serialize, Deserialize)] +pub enum EthResponse { + // another possible strat, just return RpcResult, + // then try deserializing on the process_lib side. + Ok, + Err(EthError), + Sub(SubscriptionResult), + GetLogs(Vec), + GetBlockNumber(u64), + GetBalance(U256), + GetGasPrice(U256), + Call(Vec), // alloy_primimtives::Bytes deserialization.. + GetTransactionCount(U256), + GetBlockByNumber(Option), + GetBlockByHash(Option), + // raw json vs enum type vs into T? + RawRequest(serde_json::Value), + SendRawTransaction(Vec), // alloy_primitives::TxHash deserialization.. } /// The Response type which a process will get from requesting with an [`EthAction`] will be @@ -57,7 +113,7 @@ pub enum EthSubEvent { /// Primary state object of the `eth` module pub struct RpcConnections { - // todo generics when they work properly: pub struct RpcConnections + // todo generics when they work properly: pub struct RpcConnections, where T: Transport pub provider: Provider, pub ws_provider_subscriptions: HashMap<(ProcessId, u64), JoinHandle>>, } diff --git a/src/register.rs b/src/register.rs index ed31a5fe..532bd45e 100644 --- a/src/register.rs +++ b/src/register.rs @@ -267,10 +267,10 @@ async fn get_unencrypted_info(keyfile: Option>) -> Result Date: Mon, 5 Feb 2024 15:03:53 -0300 Subject: [PATCH 06/26] eth: clean and use reqeust --- src/eth/provider.rs | 103 ++++++++++---------------------------------- src/eth/types.rs | 97 ++++++++++++++++------------------------- 2 files changed, 59 insertions(+), 141 deletions(-) diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 2f3d25b6..017d8b49 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,15 +1,11 @@ use crate::eth::types::*; use crate::types::*; -use alloy_primitives::{Address as EthAddress, Bytes, U256}; -use alloy_providers::provider::TempProvider; use alloy_pubsub::RawSubscription; use alloy_rpc_client::ClientBuilder; -use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; -use alloy_rpc_types::{BlockNumberOrTag, Filter}; +use alloy_rpc_types::pubsub::SubscriptionResult; use alloy_transport_ws::WsConnect; use anyhow::Result; use std::collections::HashMap; -use std::str::FromStr; use std::sync::Arc; use url::Url; @@ -73,6 +69,7 @@ pub async fn provider( match handle_request( our.clone(), &km.rsvp.unwrap_or(km.source.clone()), + km.id, action, &mut connections, &send_to_loop, @@ -122,6 +119,7 @@ pub async fn provider( async fn handle_request( our: Arc, target: &Address, + id: u64, action: EthAction, connections: &mut RpcConnections, send_to_loop: &MessageSender, @@ -147,6 +145,7 @@ async fn handle_request( let rx = connections.provider.inner().get_raw_subscription(id).await; let handle = tokio::spawn(handle_subscription_stream( our.clone(), + sub_id.1.clone(), rx, target.clone(), send_to_loop.clone(), @@ -165,22 +164,23 @@ async fn handle_request( handle.abort(); Ok(()) } - EthAction::GetBlockNumber => { - let vc: Vec = Vec::new(); + EthAction::Request { method, params } => { + let method = to_static_str(&method).ok_or(EthError::ProviderError(format!( + "eth: method not found: {}", + method + )))?; - Ok(()) - } - EthAction::GetLogs { filter } => { - let logs = connections + // throw transportErrorKinds straight back to process + let ass: serde_json::Value = connections .provider - .get_logs(filter) + .inner() + .prepare(method, params) .await - .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; - - // TEMP, will change. + .unwrap(); + // send response back to loop: send_to_loop .send(KernelMessage { - id: rand::random(), + id, source: Address { node: our.to_string(), process: ETH_PROCESS_ID.clone(), @@ -190,7 +190,7 @@ async fn handle_request( message: Message::Response(( Response { inherit: false, - body: serde_json::to_vec(&EthResponse::GetLogs(logs)).unwrap(), + body: serde_json::to_vec(&EthResponse::Request(ass)).unwrap(), metadata: None, capabilities: vec![], }, @@ -202,68 +202,6 @@ async fn handle_request( .unwrap(); Ok(()) } - EthAction::GetGasPrice => { - let gas_price = connections - .provider - .get_gas_price() - .await - .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; - - send_to_loop - .send(KernelMessage { - id: rand::random(), - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Request(Request { - inherit: false, - expects_response: None, - body: serde_json::to_vec(&gas_price).unwrap(), - metadata: None, - capabilities: vec![], - }), - lazy_load_blob: None, - }) - .await - .unwrap(); - - Ok(()) - } - EthAction::GetBalance { address, tag } => { - let address = EthAddress::from_str(&address) - .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; - let balance = connections - .provider - .get_balance(address, tag) - .await - .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; - - send_to_loop - .send(KernelMessage { - id: rand::random(), - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Request(Request { - inherit: false, - expects_response: None, - body: serde_json::to_vec(&balance).unwrap(), - metadata: None, - capabilities: vec![], - }), - lazy_load_blob: None, - }) - .await - .unwrap(); - - Ok(()) - } _ => { println!("eth: unhandled action: {:?}", action); // will be handled soon. @@ -278,6 +216,7 @@ async fn handle_request( /// for a specific subscription made by a process. async fn handle_subscription_stream( our: Arc, + sub_id: u64, mut rx: RawSubscription, target: Address, send_to_loop: MessageSender, @@ -302,7 +241,11 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&EthResponse::Sub(event)).unwrap(), + body: serde_json::to_vec(&EthResponse::Sub { + id: sub_id, + result: event, + }) + .unwrap(), metadata: None, capabilities: vec![], }), diff --git a/src/eth/types.rs b/src/eth/types.rs index 6bf13c2c..e1f74060 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -4,7 +4,6 @@ use alloy_providers::provider::Provider; use alloy_pubsub::PubSubFrontend; use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, CallRequest, Filter, Log}; -use alloy_transport::RpcResult; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use tokio::task::JoinHandle; @@ -24,65 +23,19 @@ pub enum EthAction { }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), - /// get_logs - /// Vec or loop through? - GetLogs { - filter: Filter, - }, - /// get_block_number - GetBlockNumber, - /// eth_getBalance - GetBalance { - address: String, // alloy_primitives::Address deserialization.. - tag: Option, - }, - GetGasPrice, - Call { - tx: CallRequest, - tag: BlockNumberOrTag, - }, - GetTransactionCount { - address: String, // alloy_primitives::Address deserialization.. - tag: Option, - }, - GetBlockByNumber { - block: BlockId, - full_tx: bool, - }, - GetBlockByHash { - hash: Vec, // alloy_primitives::BlockHash deserialization.. - full_tx: bool, - }, - RawRequest { + /// Raw request. Used by kinode_process_lib. + Request { method: String, - params: Params, - }, - SendRawTransaction { - tx: Vec, // alloy_primitives::Bytes deserialization.. + params: serde_json::Value, }, } -/// Potential EthResponse type. -/// Can encapsulate all methods in their own response type, -/// or return generic result which can be parsed later.. #[derive(Debug, Serialize, Deserialize)] pub enum EthResponse { - // another possible strat, just return RpcResult, - // then try deserializing on the process_lib side. Ok, + Request(serde_json::Value), Err(EthError), - Sub(SubscriptionResult), - GetLogs(Vec), - GetBlockNumber(u64), - GetBalance(U256), - GetGasPrice(U256), - Call(Vec), // alloy_primimtives::Bytes deserialization.. - GetTransactionCount(U256), - GetBlockByNumber(Option), - GetBlockByHash(Option), - // raw json vs enum type vs into T? - RawRequest(serde_json::Value), - SendRawTransaction(Vec), // alloy_primitives::TxHash deserialization.. + Sub { id: u64, result: SubscriptionResult }, } /// The Response type which a process will get from requesting with an [`EthAction`] will be @@ -98,19 +51,41 @@ pub enum EthError { SubscriptionNotFound, } -/// The Request type which a process will get from using SubscribeLogs to subscribe -/// to a log. -/// -/// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`. -#[derive(Debug, Serialize, Deserialize)] -pub enum EthSubEvent { - Log(Log), -} - // // Internal types // +/// For static lifetimes of method strings. +/// Hopefully replaced asap by alloy-rs network abstraction. +pub fn to_static_str(method: &str) -> Option<&'static str> { + match method { + "eth_getBalance" => Some("eth_getBalance"), + "eth_sendRawTransaction" => Some("eth_sendRawTransaction"), + "eth_call" => Some("eth_call"), + "eth_getTransactionReceipt" => Some("eth_getTransactionReceipt"), + "eth_estimateGas" => Some("eth_estimateGas"), + "eth_blockNumber" => Some("eth_blockNumber"), + "eth_getBlockByHash" => Some("eth_getBlockByHash"), + "eth_getBlockByNumber" => Some("eth_getBlockByNumber"), + "eth_getTransactionByHash" => Some("eth_getTransactionByHash"), + "eth_getCode" => Some("eth_getCode"), + "eth_getStorageAt" => Some("eth_getStorageAt"), + "eth_gasPrice" => Some("eth_gasPrice"), + "eth_accounts" => Some("eth_accounts"), + "eth_hashrate" => Some("eth_hashrate"), + "eth_getLogs" => Some("eth_getLogs"), + "eth_subscribe" => Some("eth_subscribe"), + "eth_unsubscribe" => Some("eth_unsubscribe"), + // "eth_mining" => Some("eth_mining"), + // "net_version" => Some("net_version"), + // "net_peerCount" => Some("net_peerCount"), + // "net_listening" => Some("net_listening"), + // "web3_clientVersion" => Some("web3_clientVersion"), + // "web3_sha3" => Some("web3_sha3"), + _ => None, + } +} + /// Primary state object of the `eth` module pub struct RpcConnections { // todo generics when they work properly: pub struct RpcConnections, where T: Transport From 49ec4509b5575727299e9800e60b15f4041e4c7a Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Mon, 5 Feb 2024 15:39:14 -0300 Subject: [PATCH 07/26] eth: spawn threads for requests, send provider --- src/eth/provider.rs | 211 ++++++++++++++++++++------------------------ src/eth/types.rs | 7 -- 2 files changed, 94 insertions(+), 124 deletions(-) diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 017d8b49..a9287b43 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,12 +1,13 @@ use crate::eth::types::*; use crate::types::*; -use alloy_pubsub::RawSubscription; +use alloy_pubsub::{PubSubFrontend, RawSubscription}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::SubscriptionResult; use alloy_transport_ws::WsConnect; use anyhow::Result; -use std::collections::HashMap; +use dashmap::DashMap; use std::sync::Arc; +use tokio::task::JoinHandle; use url::Url; /// The ETH provider runtime process is responsible for connecting to one or more ETH RPC providers @@ -18,7 +19,7 @@ pub async fn provider( rpc_url: String, send_to_loop: MessageSender, mut recv_in_client: MessageReceiver, - print_tx: PrintSender, + _print_tx: PrintSender, ) -> Result<()> { let our = Arc::new(our); // for now, we can only handle WebSocket RPC URLs. In the future, we should @@ -51,118 +52,93 @@ pub async fn provider( let provider = alloy_providers::provider::Provider::new_with_client(client); - let mut connections = RpcConnections { - provider, - ws_provider_subscriptions: HashMap::new(), - }; + // handles of longrunning subscriptions. + let connections: DashMap<(ProcessId, u64), JoinHandle>> = DashMap::new(); - // turn into dashmap so we can share across threads + let connections = Arc::new(connections); + let provider = Arc::new(provider); while let Some(km) = recv_in_client.recv().await { - // this module only handles requests, ignores all responses - let Message::Request(req) = &km.message else { - continue; - }; - let Ok(action) = serde_json::from_slice::(&req.body) else { - continue; - }; - match handle_request( - our.clone(), - &km.rsvp.unwrap_or(km.source.clone()), - km.id, - action, - &mut connections, - &send_to_loop, - ) - .await - { - Ok(()) => {} - Err(e) => { - let _ = print_tx - .send(Printout { - verbosity: 0, - content: format!("eth: error handling request: {:?}", e), - }) - .await; - if req.expects_response.is_some() { - send_to_loop - .send(KernelMessage { - id: km.id, - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: Address { - node: our.to_string(), - process: km.source.process.clone(), - }, - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - body: serde_json::to_vec::>(&Err(e))?, - metadata: None, - capabilities: vec![], - }, - None, - )), - lazy_load_blob: None, - }) - .await?; - } + // clone Arcs + let our = our.clone(); + let send_to_loop = send_to_loop.clone(); + let provider = provider.clone(); + let connections = connections.clone(); + + tokio::spawn(async move { + if let Err(e) = handle_request( + &our, + &km, + &send_to_loop, + provider.clone(), + connections.clone(), + ) + .await + { + println!("got error: {:?}", e); } - } + }); } Err(anyhow::anyhow!("eth: fatal: message receiver closed!")) } async fn handle_request( - our: Arc, - target: &Address, - id: u64, - action: EthAction, - connections: &mut RpcConnections, + our: &str, + km: &KernelMessage, send_to_loop: &MessageSender, + provider: Arc>, + connections: Arc>>>, ) -> Result<(), EthError> { - match action { + let Message::Request(req) = &km.message else { + return Err(EthError::ProviderError( + "eth: only accepts requests".to_string(), + )); + }; + + let action = serde_json::from_slice::(&req.body).map_err(|e| { + EthError::ProviderError(format!("eth: failed to deserialize request: {:?}", e)) + })?; + + // we might want some of these in payloads.. sub items? + let return_body: EthResponse = match action { EthAction::SubscribeLogs { sub_id, kind, params, } => { - let sub_id = (target.process.clone(), sub_id); + let sub_id = (km.target.process.clone(), sub_id); let kind = serde_json::to_value(&kind).unwrap(); let params = serde_json::to_value(¶ms).unwrap(); - let id = connections - .provider + let id = provider .inner() .prepare("eth_subscribe", [kind, params]) .await .unwrap(); - let rx = connections.provider.inner().get_raw_subscription(id).await; + let target = km.source.clone(); // rsvp? + + let rx = provider.inner().get_raw_subscription(id).await; let handle = tokio::spawn(handle_subscription_stream( - our.clone(), + our.to_string(), sub_id.1.clone(), rx, - target.clone(), + target, send_to_loop.clone(), )); - connections.ws_provider_subscriptions.insert(sub_id, handle); - Ok(()) + connections.insert(sub_id, handle); + EthResponse::Ok } EthAction::UnsubscribeLogs(sub_id) => { - let sub_id = (target.process.clone(), sub_id); + let sub_id = (km.target.process.clone(), sub_id); let handle = connections - .ws_provider_subscriptions .remove(&sub_id) .ok_or(EthError::SubscriptionNotFound)?; - handle.abort(); - Ok(()) + handle.1.abort(); + EthResponse::Ok } EthAction::Request { method, params } => { let method = to_static_str(&method).ok_or(EthError::ProviderError(format!( @@ -171,51 +147,51 @@ async fn handle_request( )))?; // throw transportErrorKinds straight back to process - let ass: serde_json::Value = connections - .provider - .inner() - .prepare(method, params) - .await - .unwrap(); - // send response back to loop: - send_to_loop - .send(KernelMessage { - id, - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - body: serde_json::to_vec(&EthResponse::Request(ass)).unwrap(), - metadata: None, - capabilities: vec![], - }, - None, - )), - lazy_load_blob: None, - }) - .await - .unwrap(); - Ok(()) - } - _ => { - println!("eth: unhandled action: {:?}", action); - // will be handled soon. + let response: serde_json::Value = + provider.inner().prepare(method, params).await.unwrap(); - Ok(()) + EthResponse::Request(response) } - } + }; + + // todo: fix km.clone() and metadata.clone() + if let Some(target) = km.clone().rsvp.or_else(|| { + req.expects_response.map(|_| Address { + node: our.to_string(), + process: km.source.process.clone(), + }) + }) { + let response = KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: VFS_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&return_body).unwrap(), + metadata: req.metadata.clone(), + capabilities: vec![], + }, + None, + )), + lazy_load_blob: None, + }; + + // Send the response, handling potential errors appropriately + let _ = send_to_loop.send(response).await; + }; + Ok(()) } /// Executed as a long-lived task. The JoinHandle is stored in the `connections` map. /// This task is responsible for connecting to the ETH RPC provider and streaming logs /// for a specific subscription made by a process. async fn handle_subscription_stream( - our: Arc, + our: String, sub_id: u64, mut rx: RawSubscription, target: Address, @@ -228,12 +204,13 @@ async fn handle_subscription_stream( // return Err(EthError::ProviderError(format!("{:?}", e))); } Ok(value) => { - let event: SubscriptionResult = serde_json::from_str(value.get()).unwrap(); + let event: SubscriptionResult = serde_json::from_str(value.get()) + .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; send_to_loop .send(KernelMessage { id: rand::random(), source: Address { - node: our.to_string(), + node: our, process: ETH_PROCESS_ID.clone(), }, target: target.clone(), diff --git a/src/eth/types.rs b/src/eth/types.rs index e1f74060..76b4adcb 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -85,10 +85,3 @@ pub fn to_static_str(method: &str) -> Option<&'static str> { _ => None, } } - -/// Primary state object of the `eth` module -pub struct RpcConnections { - // todo generics when they work properly: pub struct RpcConnections, where T: Transport - pub provider: Provider, - pub ws_provider_subscriptions: HashMap<(ProcessId, u64), JoinHandle>>, -} From ae3a480c1f24580ceee9d65b1c4c7683a00873e2 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Mon, 5 Feb 2024 18:10:21 -0300 Subject: [PATCH 08/26] eth & kns: update kns to new process_lib --- Cargo.lock | 59 +- modules/kns_indexer/kns_indexer/Cargo.lock | 1034 +++++++------------- modules/kns_indexer/kns_indexer/Cargo.toml | 8 +- modules/kns_indexer/kns_indexer/src/lib.rs | 83 +- src/eth/provider.rs | 1 + src/eth/types.rs | 9 +- 6 files changed, 393 insertions(+), 801 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af56ed3b..fa3d1a72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,7 +92,7 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -103,7 +103,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-primitives", "serde", @@ -114,7 +114,7 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-eips", "alloy-json-rpc", @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "alloy-providers" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-network", "alloy-primitives", @@ -167,7 +167,7 @@ dependencies = [ [[package]] name = "alloy-pubsub" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -227,7 +227,7 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-primitives", "alloy-rpc-types", @@ -238,7 +238,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-json-rpc", "base64 0.21.7", @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -280,7 +280,7 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#2d23d57d78844e04c9ea09cf9e5aea2dccc1c639" +source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-pubsub", "alloy-transport", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -2103,9 +2103,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "fixed-hash" @@ -2483,9 +2483,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hex" @@ -2630,9 +2630,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -3264,9 +3264,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -3651,9 +3651,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.6" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", @@ -5012,13 +5012,12 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] @@ -5056,9 +5055,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", @@ -6411,9 +6410,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.36" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] diff --git a/modules/kns_indexer/kns_indexer/Cargo.lock b/modules/kns_indexer/kns_indexer/Cargo.lock index 12c57209..ffa87637 100644 --- a/modules/kns_indexer/kns_indexer/Cargo.lock +++ b/modules/kns_indexer/kns_indexer/Cargo.lock @@ -3,19 +3,36 @@ version = 3 [[package]] -name = "aho-corasick" -version = "1.1.2" +name = "addr2line" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "memchr", + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "alloy-json-rpc" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#32618e9243a761858a0843e7e55575e48fdbf500" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", + "thiserror", ] [[package]] name = "alloy-primitives" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c234f92024707f224510ff82419b2be0e1d8e1fd911defcac5a085cd7f83898" +checksum = "f4b6fb2b432ff223d513db7f908937f63c252bee0af9b82bfd25b0a5dd1eb0d8" dependencies = [ "alloy-rlp", "bytes", @@ -24,6 +41,7 @@ dependencies = [ "derive_more", "hex-literal", "itoa", + "k256", "keccak-asm", "proptest", "rand", @@ -34,14 +52,13 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc0fac0fc16baf1f63f78b47c3d24718f3619b0714076f6a02957d808d52cbef" +checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" dependencies = [ "alloy-rlp-derive", "arrayvec", "bytes", - "smol_str", ] [[package]] @@ -52,47 +69,45 @@ checksum = "1a047897373be4bbb0224c1afdabca92648dc57a9c9ef6e7b0be3aff7a859c83" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git?rev=3b1c310#3b1c3108ccd33c78abd7da8191e3744b4ae9a735" +source = "git+https://github.com/alloy-rs/alloy#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ "alloy-primitives", "alloy-rlp", - "itertools 0.12.0", - "jsonrpsee-types", + "itertools 0.12.1", "serde", "serde_json", - "serde_with", "thiserror", ] [[package]] name = "alloy-sol-macro" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970e5cf1ca089e964d4f7f7afc7c9ad642bfb1bdc695a20b0cba3b3c28954774" +checksum = "8b0b5ab0cb07c21adf9d72e988b34e8200ce648c2bba8d009183bb1c50fb1216" dependencies = [ "const-hex", "dunce", "heck", - "indexmap 2.1.0", + "indexmap", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-types" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a059d4d2c78f8f21e470772c75f9abd9ac6d48c2aaf6b278d1ead06ed9ac664" +checksum = "6c08f62ded7ce03513bfb60ef5cad4fff5d4f67eac6feb4df80426b7b9ffb06e" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -101,25 +116,26 @@ dependencies = [ ] [[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +name = "alloy-transport" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy#32618e9243a761858a0843e7e55575e48fdbf500" dependencies = [ - "libc", + "alloy-json-rpc", + "base64", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "url", + "wasm-bindgen-futures", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "ark-ff" @@ -253,14 +269,13 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "auto_impl" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -269,6 +284,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base16ct" version = "0.2.0" @@ -277,9 +307,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -287,15 +317,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "bincode" version = "1.3.3" @@ -322,15 +343,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.3.2" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -395,19 +410,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "num-traits", - "serde", - "windows-targets 0.48.5", -] - [[package]] name = "const-hex" version = "1.10.0" @@ -433,17 +435,11 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -476,41 +472,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 2.0.40", -] - -[[package]] -name = "darling_macro" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.40", -] - [[package]] name = "der" version = "0.7.8" @@ -521,16 +482,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", - "serde", -] - [[package]] name = "derivative" version = "2.2.0" @@ -634,82 +585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "ethabi" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" -dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "ethers-core" -version = "2.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f03e0bdc216eeb9e355b90cf610ef6c5bb8aca631f97b5ae9980ce34ea7878d" -dependencies = [ - "arrayvec", - "bytes", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array", - "k256", - "num_enum", - "open-fastrlp", - "rand", - "rlp", - "serde", - "serde_json", - "strum", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", + "windows-sys", ] [[package]] @@ -772,6 +648,30 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -785,15 +685,21 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + [[package]] name = "group" version = "0.13.0" @@ -805,12 +711,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.3" @@ -861,41 +761,12 @@ dependencies = [ "itoa", ] -[[package]] -name = "iana-time-zone" -version = "0.1.59" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "id-arena" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.5.0" @@ -915,24 +786,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -946,23 +799,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown", "serde", ] @@ -977,9 +819,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -992,47 +834,25 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee-types" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - [[package]] name = "k256" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", "once_cell", "sha2", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", + "signature", ] [[package]] @@ -1047,13 +867,15 @@ dependencies = [ [[package]] name = "kinode_process_lib" -version = "0.5.5" -source = "git+https://github.com/kinode-dao/process_lib?tag=v0.5.5-alpha#722f2dbfbcc4d1bf5da1fa5db137632a3cede44c" +version = "0.5.7" +source = "git+https://github.com/kinode-dao/process_lib?rev=032bd43#032bd437a6765a2735a3e93b96f1e26e91ce8af0" dependencies = [ + "alloy-json-rpc", + "alloy-primitives", "alloy-rpc-types", + "alloy-transport", "anyhow", "bincode", - "ethers-core", "http", "mime_guess", "rand", @@ -1095,9 +917,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libm" @@ -1107,9 +929,9 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" @@ -1119,9 +941,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1139,6 +961,15 @@ dependencies = [ "unicase", ] +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -1171,24 +1002,12 @@ dependencies = [ ] [[package]] -name = "num_enum" -version = "0.7.1" +name = "object" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683751d591e6d81200c39fb0d1032608b77724f34114db54f571ff1317b337c0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c11e44798ad209ccdd91fc192f0526a369a01234f7373e1b141c96d7cee4f0e" -dependencies = [ - "proc-macro-crate 2.0.1", - "proc-macro2", - "quote", - "syn 2.0.40", + "memchr", ] [[package]] @@ -1197,31 +1016,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "parity-scale-codec" version = "3.6.9" @@ -1242,7 +1036,7 @@ version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 2.0.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -1262,21 +1056,47 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.5" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ "memchr", "thiserror", "ucd-trie", ] +[[package]] +name = "pin-project" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "pin-project-lite" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkcs8" version = "0.10.2" @@ -1287,12 +1107,6 @@ dependencies = [ "spki", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1307,30 +1121,17 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", "uint", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", - "toml_edit 0.20.2", + "toml_edit", ] [[package]] @@ -1359,9 +1160,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1374,7 +1175,7 @@ checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.4.1", + "bitflags", "lazy_static", "num-traits", "rand", @@ -1394,9 +1195,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1446,38 +1247,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - [[package]] name = "regex-syntax" version = "0.8.2" @@ -1501,21 +1270,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", - "rlp-derive", "rustc-hex", ] -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rmp" version = "0.8.12" @@ -1568,6 +1325,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e666a5496a0b2186dbcd0ff6106e29e093c15591bde62c20d3842007c6978a09" +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -1589,28 +1352,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.21", ] [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - [[package]] name = "rusty-fork" version = "0.3.0" @@ -1629,30 +1386,6 @@ version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" -[[package]] -name = "scale-info" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" -dependencies = [ - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sec1" version = "0.7.3" @@ -1678,9 +1411,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "semver-parser" @@ -1693,64 +1426,35 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", "serde", ] -[[package]] -name = "serde_with" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.1.0", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.40", -] - [[package]] name = "sha2" version = "0.10.8" @@ -1762,16 +1466,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - [[package]] name = "sha3-asm" version = "0.1.0" @@ -1794,24 +1488,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "smol_str" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74212e6bbe9a4352329b2f68ba3130c15a3f26fe88ff22dbdc6cdd58fa85e99c" -dependencies = [ - "serde", -] +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "spdx" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19b32ed6d899ab23174302ff105c1577e45a06b08d4fe0a9dd13ce804bbbf71" +checksum = "62bde1398b09b9f93fc2fc9b9da86e362693e999d3a54a8ac47a99a5a73f638b" dependencies = [ "smallvec", ] @@ -1832,34 +1517,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strum" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.40", -] - [[package]] name = "subtle" version = "2.5.0" @@ -1879,9 +1536,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.40" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1890,14 +1547,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.5.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ede2e5b2c6bfac4bc0ff4499957a11725dc12a7ddb86270e827ef575892553" +checksum = "63bef2e2c735acbc06874eca3a8506f02a3c4700e6e748afc92cc2e4220e8a03" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] [[package]] @@ -1908,64 +1565,34 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", -] - -[[package]] -name = "time" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" -dependencies = [ - "deranged", - "itoa", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" -dependencies = [ - "time-core", + "syn 2.0.48", ] [[package]] @@ -1992,6 +1619,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "pin-project-lite", +] + [[package]] name = "toml_datetime" version = "0.6.3" @@ -2000,32 +1637,49 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.1.0", + "indexmap", "toml_datetime", "winnow", ] [[package]] -name = "toml_edit" -version = "0.20.2" +name = "tower" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", ] +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-core", ] @@ -2035,6 +1689,9 @@ name = "tracing-core" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] [[package]] name = "typenum" @@ -2077,9 +1734,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2148,9 +1805,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2158,24 +1815,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.89" +name = "wasm-bindgen-futures" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2183,22 +1852,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-encoder" @@ -2210,19 +1879,28 @@ dependencies = [ ] [[package]] -name = "wasm-metadata" -version = "0.10.14" +name = "wasm-encoder" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d835d67708f6374937c550ad8dd1d17c616ae009e3f00d7a0ac9f7825e78c36a" +checksum = "e09bca7d6388637d27fb5edbeab11f56bfabcef8743c55ae34370e1e5030a071" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-metadata" +version = "0.10.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c853d3809fc9fccf3bc0ad63f4f51d8eefad0bacf88f957aa991c1d9b88b016e" dependencies = [ "anyhow", - "indexmap 2.1.0", + "indexmap", "serde", "serde_derive", "serde_json", "spdx", - "wasm-encoder", - "wasmparser", + "wasm-encoder 0.41.0", + "wasmparser 0.121.0", ] [[package]] @@ -2231,26 +1909,29 @@ version = "0.118.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" dependencies = [ - "indexmap 2.1.0", - "semver 1.0.20", + "indexmap", + "semver 1.0.21", ] [[package]] -name = "windows-core" -version = "0.52.0" +name = "wasmparser" +version = "0.121.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" dependencies = [ - "windows-targets 0.52.0", + "bitflags", + "indexmap", + "semver 1.0.21", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "web-sys" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ - "windows-targets 0.48.5", + "js-sys", + "wasm-bindgen", ] [[package]] @@ -2259,22 +1940,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -2283,93 +1949,51 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.0" @@ -2378,9 +2002,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] @@ -2390,7 +2014,7 @@ name = "wit-bindgen" version = "0.16.0" source = "git+https://github.com/bytecodealliance/wit-bindgen?rev=efcc759#efcc7592cf3277bcb9be1034e48569c6d822b322" dependencies = [ - "bitflags 2.4.1", + "bitflags", "wit-bindgen-rust-macro", ] @@ -2424,7 +2048,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", "wit-bindgen-core", "wit-bindgen-rust", "wit-component", @@ -2437,29 +2061,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a35a2a9992898c9d27f1664001860595a4bc99d32dd3599d547412e17d7e2" dependencies = [ "anyhow", - "bitflags 2.4.1", - "indexmap 2.1.0", + "bitflags", + "indexmap", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder", + "wasm-encoder 0.38.1", "wasm-metadata", - "wasmparser", + "wasmparser 0.118.1", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15df6b7b28ce94b8be39d8df5cb21a08a4f3b9f33b631aedb4aa5776f785ead3" +checksum = "df4913a2219096373fd6512adead1fb77ecdaa59d7fc517972a7d30b12f625be" dependencies = [ "anyhow", "id-arena", - "indexmap 2.1.0", + "indexmap", "log", - "semver 1.0.20", + "semver 1.0.21", "serde", "serde_derive", "serde_json", @@ -2492,5 +2116,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.48", ] diff --git a/modules/kns_indexer/kns_indexer/Cargo.toml b/modules/kns_indexer/kns_indexer/Cargo.toml index 1bd118aa..d321f997 100644 --- a/modules/kns_indexer/kns_indexer/Cargo.toml +++ b/modules/kns_indexer/kns_indexer/Cargo.toml @@ -12,12 +12,12 @@ lto = true [dependencies] anyhow = "1.0" -alloy-primitives = "0.5.1" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy.git", rev = "3b1c310" } -alloy-sol-types = "0.5.1" +alloy-primitives = "0.6.2" +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy" } +alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.5.5-alpha", features = ["eth"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "032bd43" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index 6e9f48fd..ad14d706 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -6,8 +6,9 @@ use alloy_rpc_types::{ use alloy_sol_types::{sol, SolEvent}; use kinode_process_lib::{ - await_message, get_typed_state, print_to_terminal, println, set_state, Address, Message, - Request, Response, + await_message, + eth::{get_block_number, get_logs, EthResponse}, + get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; use serde::{Deserialize, Serialize}; use std::string::FromUtf8Error; @@ -38,34 +39,10 @@ pub enum EthAction { }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. UnsubscribeLogs(u64), - /// get_logs - GetLogs { filter: Filter }, - /// get_block_number - GetBlockNumber, -} - -//TEMP -/// Potential EthResponse type. -/// Can encapsulate all methods in their own response type, -/// or return generic result which can be parsed later.. -#[derive(Debug, Serialize, Deserialize)] -pub enum EthResponse { - // another possible strat, just return RpcResult, - // then try deserializing on the process_lib side. - Ok, - //Err(EthError), - Sub(SubscriptionResult), - GetLogs(Vec), - // GetBlockNumber(u64), - // GetBalance(U256), - // GetGasPrice(U256), - // Call(Vec), // alloy_primimtives::Bytes deserialization.. - // GetTransactionCount(U256), - // GetBlockByNumber(Option), - // GetBlockByHash(Option), - // // raw json vs enum type vs into T? - // RawRequest(serde_json::Value), - // SendRawTransaction(Vec), // alloy_primitives::TxHash deserialization.. + Request { + method: String, + params: serde_json::Value, + }, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -200,6 +177,24 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { block: 1, }; } + let filter = Filter::new() + .address(contract_address.unwrap().parse::().unwrap()) + .to_block(BlockNumberOrTag::Latest) + .from_block(state.block - 1) + .events(vec![ + "NodeRegistered(bytes32,bytes)", + "KeyUpdate(bytes32,bytes32)", + "IpUpdate(bytes32,uint128)", + "WsUpdate(bytes32,uint16)", + "RoutingUpdate(bytes32,bytes32[])", + ]); + // if block in state is < current_block, get logs from that part. + if state.block < get_block_number()? { + let logs = get_logs(filter.clone())?; + for log in logs { + handle_log(&our, &mut state, &log)?; + } + } // shove all state into net::net Request::new() .target((&our.node, "net", "distro", "sys")) @@ -208,26 +203,9 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { ))? .send()?; - let filter = Filter::new() - .address(contract_address.unwrap().parse::().unwrap()) - .from_block(0) - .to_block(BlockNumberOrTag::Latest) - .events(vec![ - "NodeRegistered(bytes32,bytes)", - "KeyUpdate(bytes32,bytes32)", - "IpUpdate(bytes32,uint128)", - "WsUpdate(bytes32,uint16)", - "RoutingUpdate(bytes32,bytes32[])", - ]); - - let params = Params::Logs(Box::new(filter.clone())); + let params = Params::Logs(Box::new(filter)); let kind = SubscriptionKind::Logs; - Request::new() - .target((&our.node, "eth", "distro", "sys")) - .body(serde_json::to_vec(&EthAction::GetLogs { filter })?) - .send()?; - Request::new() .target((&our.node, "eth", "distro", "sys")) .body(serde_json::to_vec(&EthAction::SubscribeLogs { @@ -299,12 +277,7 @@ fn handle_eth_message( }; match res { - EthResponse::GetLogs(logs) => { - for log in logs { - handle_log(our, state, &log)?; - } - } - EthResponse::Sub(result) => match result { + EthResponse::Sub { id, result } => match result { SubscriptionResult::Log(log) => { handle_log(our, state, &log)?; } @@ -350,7 +323,7 @@ fn handle_eth_message( fn handle_log(our: &Address, state: &mut State, log: &Log) -> anyhow::Result<()> { state.block = log.block_number.expect("expect").to::(); - let node_id: alloy_primitives::FixedBytes<32> = log.topics[1]; + let node_id = log.topics[1]; let name = match state.names.entry(node_id.to_string()) { Entry::Occupied(o) => o.into_mut(), diff --git a/src/eth/provider.rs b/src/eth/provider.rs index a9287b43..373a0809 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,5 +1,6 @@ use crate::eth::types::*; use crate::types::*; +use alloy_providers::provider::TempProvider; use alloy_pubsub::{PubSubFrontend, RawSubscription}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::SubscriptionResult; diff --git a/src/eth/types.rs b/src/eth/types.rs index 76b4adcb..d70fa737 100644 --- a/src/eth/types.rs +++ b/src/eth/types.rs @@ -1,12 +1,5 @@ -use crate::types::ProcessId; -use alloy_primitives::{Address, BlockHash, Bytes, ChainId, TxHash, B256, U256}; -use alloy_providers::provider::Provider; -use alloy_pubsub::PubSubFrontend; use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; -use alloy_rpc_types::{Block, BlockId, BlockNumberOrTag, CallRequest, Filter, Log}; use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use tokio::task::JoinHandle; /// The Request type that can be made to eth:distro:sys. Currently primitive, this /// enum will expand to support more actions in the future. @@ -62,7 +55,9 @@ pub fn to_static_str(method: &str) -> Option<&'static str> { "eth_getBalance" => Some("eth_getBalance"), "eth_sendRawTransaction" => Some("eth_sendRawTransaction"), "eth_call" => Some("eth_call"), + "eth_chainId" => Some("eth_chainId"), "eth_getTransactionReceipt" => Some("eth_getTransactionReceipt"), + "eth_getTransactionCount" => Some("eth_getTransactionCount"), "eth_estimateGas" => Some("eth_estimateGas"), "eth_blockNumber" => Some("eth_blockNumber"), "eth_getBlockByHash" => Some("eth_getBlockByHash"), From 990854b390db68226d179914f60d1c635af6b2f1 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 8 Feb 2024 12:44:57 -0300 Subject: [PATCH 09/26] remove rpc-url flag requirement draft --- src/eth/provider.rs | 8 +++----- src/main.rs | 9 ++++----- src/register.rs | 6 ------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/eth/provider.rs b/src/eth/provider.rs index 373a0809..d1cb99eb 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -1,6 +1,5 @@ use crate::eth::types::*; use crate::types::*; -use alloy_providers::provider::TempProvider; use alloy_pubsub::{PubSubFrontend, RawSubscription}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::SubscriptionResult; @@ -17,15 +16,14 @@ use url::Url; /// indexing and ETH node responsibilities. pub async fn provider( our: String, - rpc_url: String, + rpc_url: Option, // if None, bootstrap from router, can set settings later? send_to_loop: MessageSender, mut recv_in_client: MessageReceiver, _print_tx: PrintSender, ) -> Result<()> { let our = Arc::new(our); - // for now, we can only handle WebSocket RPC URLs. In the future, we should - // be able to handle HTTP too, at least. - // todo add http reqwest.. + // make this generalizable. + let rpc_url = rpc_url.unwrap(); match Url::parse(&rpc_url)?.scheme() { "http" | "https" => { return Err(anyhow::anyhow!( diff --git a/src/main.rs b/src/main.rs index 34381ddd..69473dbd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,6 @@ async fn serve_register_fe( home_directory_path: &str, our_ip: String, http_server_port: u16, - rpc_url: String, testnet: bool, ) -> (Identity, Vec, Keyfile) { // check if we have keys saved on disk, encrypted @@ -71,7 +70,7 @@ async fn serve_register_fe( let (tx, mut rx) = mpsc::channel::<(Identity, Keyfile, Vec)>(1); let (our, decoded_keyfile, encoded_keyfile) = tokio::select! { - _ = register::register(tx, kill_rx, our_ip, http_server_port, rpc_url, disk_keyfile, testnet) => { + _ = register::register(tx, kill_rx, our_ip, http_server_port, disk_keyfile, testnet) => { panic!("registration failed") } Some((our, decoded_keyfile, encoded_keyfile)) = rx.recv() => { @@ -109,7 +108,8 @@ async fn main() { ); #[cfg(not(feature = "simulation-mode"))] - let app = app.arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)").required(true)); + let app = + app.arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)").required(false)); #[cfg(feature = "simulation-mode")] let app = app @@ -141,7 +141,7 @@ async fn main() { }; #[cfg(not(feature = "simulation-mode"))] - let (rpc_url, is_detached) = (matches.get_one::("rpc").unwrap(), false); + let (rpc_url, is_detached) = (matches.get_one::("rpc").cloned(), false); #[cfg(feature = "simulation-mode")] let (rpc_url, password, network_router_port, fake_node_name, is_detached) = ( @@ -252,7 +252,6 @@ async fn main() { home_directory_path, our_ip.to_string(), http_server_port, - rpc_url.clone(), on_testnet, // true if testnet mode ) .await; diff --git a/src/register.rs b/src/register.rs index 532bd45e..c43f0690 100644 --- a/src/register.rs +++ b/src/register.rs @@ -100,7 +100,6 @@ pub async fn register( kill_rx: oneshot::Receiver, ip: String, port: u16, - rpc_url: String, keyfile: Option>, testnet: bool, ) { @@ -134,7 +133,6 @@ pub async fn register( let net_keypair = warp::any().map(move || net_keypair.clone()); let tx = warp::any().map(move || tx.clone()); let ip = warp::any().map(move || ip.clone()); - let rpc_url = warp::any().map(move || rpc_url.clone()); let static_files = warp::path("static").and(static_dir!("src/register-ui/build/static/")); @@ -199,7 +197,6 @@ pub async fn register( .and(warp::body::content_length_limit(1024 * 16)) .and(warp::body::json()) .and(ip.clone()) - .and(rpc_url.clone()) .and(tx.clone()) .and_then(handle_import_keyfile), )) @@ -208,7 +205,6 @@ pub async fn register( .and(warp::body::content_length_limit(1024 * 16)) .and(warp::body::json()) .and(ip) - .and(rpc_url) .and(tx.clone()) .and(keyfile.clone()) .and_then(handle_login), @@ -344,7 +340,6 @@ async fn handle_boot( async fn handle_import_keyfile( info: ImportKeyfileInfo, ip: String, - _rpc_url: String, sender: Arc, ) -> Result { // if keyfile was not present in node and is present from user upload @@ -408,7 +403,6 @@ async fn handle_import_keyfile( async fn handle_login( info: LoginInfo, ip: String, - _rpc_url: String, sender: Arc, encoded_keyfile: Option>, ) -> Result { From 131438b1cbc2b4f755af8c9152e02579901d5551 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Fri, 9 Feb 2024 15:01:01 -0300 Subject: [PATCH 10/26] kns_indexer: make passthrough rpc proof --- modules/kns_indexer/kns_indexer/src/lib.rs | 13 +++++++++++++ modules/kns_indexer/pkg/manifest.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/kns_indexer/kns_indexer/src/lib.rs b/modules/kns_indexer/kns_indexer/src/lib.rs index ad14d706..4d045c28 100644 --- a/modules/kns_indexer/kns_indexer/src/lib.rs +++ b/modules/kns_indexer/kns_indexer/src/lib.rs @@ -170,6 +170,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { ); // if contract address changed from a previous run, reset state if state.contract_address != contract_address { + println!("resetting state for some reason."); state = State { contract_address: contract_address.clone(), names: HashMap::new(), @@ -177,6 +178,15 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { block: 1, }; } + + // shove all state into net::net + Request::new() + .target((&our.node, "net", "distro", "sys")) + .try_body(NetActions::KnsBatchUpdate( + state.nodes.values().cloned().collect::>(), + ))? + .send()?; + let filter = Filter::new() .address(contract_address.unwrap().parse::().unwrap()) .to_block(BlockNumberOrTag::Latest) @@ -188,6 +198,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { "WsUpdate(bytes32,uint16)", "RoutingUpdate(bytes32,bytes32[])", ]); + // std::thread::sleep(std::time::Duration::from_secs(10)); // if block in state is < current_block, get logs from that part. if state.block < get_block_number()? { let logs = get_logs(filter.clone())?; @@ -203,6 +214,8 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { ))? .send()?; + set_state(&bincode::serialize(&state)?); + let params = Params::Logs(Box::new(filter)); let kind = SubscriptionKind::Logs; diff --git a/modules/kns_indexer/pkg/manifest.json b/modules/kns_indexer/pkg/manifest.json index d29393b9..531fc002 100644 --- a/modules/kns_indexer/pkg/manifest.json +++ b/modules/kns_indexer/pkg/manifest.json @@ -3,7 +3,7 @@ "process_name": "kns_indexer", "process_wasm_path": "/kns_indexer.wasm", "on_exit": "Restart", - "request_networking": false, + "request_networking": true, "request_capabilities": [ "eth:distro:sys", "http_server:distro:sys", From aefee9598d77de67b2c396f9eb7e065431cd3dfb Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Fri, 9 Feb 2024 15:01:42 -0300 Subject: [PATCH 11/26] kernel & main: eth passthrough hardcoded routers --- src/eth/provider.rs | 253 ++++++++++++++++++++++++++------------------ src/kernel/mod.rs | 96 +++++++++++++++++ src/main.rs | 9 ++ 3 files changed, 255 insertions(+), 103 deletions(-) diff --git a/src/eth/provider.rs b/src/eth/provider.rs index d1cb99eb..5cd4839b 100644 --- a/src/eth/provider.rs +++ b/src/eth/provider.rs @@ -17,45 +17,54 @@ use url::Url; pub async fn provider( our: String, rpc_url: Option, // if None, bootstrap from router, can set settings later? + public: bool, // todo, whitelists etc. send_to_loop: MessageSender, mut recv_in_client: MessageReceiver, _print_tx: PrintSender, ) -> Result<()> { let our = Arc::new(our); - // make this generalizable. - let rpc_url = rpc_url.unwrap(); - match Url::parse(&rpc_url)?.scheme() { - "http" | "https" => { - return Err(anyhow::anyhow!( - "eth: you provided a `http(s)://` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" - )); - } - "ws" | "wss" => {} - s => { - return Err(anyhow::anyhow!( - "eth: you provided a `{s:?}` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" - )); - } - } - let connector = WsConnect { - url: rpc_url.clone(), - auth: None, + // Initialize the provider conditionally based on rpc_url + // Todo: make provider support multiple transports, one direct and another passthrough. + let provider = if let Some(rpc_url) = rpc_url { + // If rpc_url is Some, proceed with URL parsing and client setup + match Url::parse(&rpc_url)?.scheme() { + "http" | "https" => { + return Err(anyhow::anyhow!( + "eth: you provided a `http(s)://` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" + )); + } + "ws" | "wss" => {} + s => { + return Err(anyhow::anyhow!( + "eth: you provided a `{s:?}` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" + )); + } + } + + let connector = WsConnect { + url: rpc_url, + auth: None, + }; + + let client = ClientBuilder::default().pubsub(connector).await?; + Some(alloy_providers::provider::Provider::new_with_client(client)) + } else { + None }; - // note, reqwest::http is an option here, although doesn't implement .get_watcher() - // polling should be an option, investigating - // let client = ClientBuilder::default().reqwest_http(Url::from_str(&rpc_url)?); - - let client = ClientBuilder::default().pubsub(connector).await?; - - let provider = alloy_providers::provider::Provider::new_with_client(client); + let provider = Arc::new(provider); // handles of longrunning subscriptions. let connections: DashMap<(ProcessId, u64), JoinHandle>> = DashMap::new(); - let connections = Arc::new(connections); - let provider = Arc::new(provider); + + // passthrough responses + let responses: DashMap = DashMap::new(); + let responses = Arc::new(responses); + + // add whitelist, logic in provider middleware? + let public = Arc::new(public); while let Some(km) = recv_in_client.recv().await { // clone Arcs @@ -63,6 +72,8 @@ pub async fn provider( let send_to_loop = send_to_loop.clone(); let provider = provider.clone(); let connections = connections.clone(); + let responses = responses.clone(); + let public = public.clone(); tokio::spawn(async move { if let Err(e) = handle_request( @@ -71,6 +82,8 @@ pub async fn provider( &send_to_loop, provider.clone(), connections.clone(), + responses.clone(), + public.clone(), ) .await { @@ -85,8 +98,10 @@ async fn handle_request( our: &str, km: &KernelMessage, send_to_loop: &MessageSender, - provider: Arc>, + provider: Arc>>, connections: Arc>>>, + responses: Arc>, + public: Arc, ) -> Result<(), EthError> { let Message::Request(req) = &km.message else { return Err(EthError::ProviderError( @@ -94,95 +109,127 @@ async fn handle_request( )); }; - let action = serde_json::from_slice::(&req.body).map_err(|e| { - EthError::ProviderError(format!("eth: failed to deserialize request: {:?}", e)) - })?; + if let Some(provider) = provider.as_ref() { + let action = serde_json::from_slice::(&req.body).map_err(|e| { + EthError::ProviderError(format!("eth: failed to deserialize request: {:?}", e)) + })?; - // we might want some of these in payloads.. sub items? - let return_body: EthResponse = match action { - EthAction::SubscribeLogs { - sub_id, - kind, - params, - } => { - let sub_id = (km.target.process.clone(), sub_id); - - let kind = serde_json::to_value(&kind).unwrap(); - let params = serde_json::to_value(¶ms).unwrap(); - - let id = provider - .inner() - .prepare("eth_subscribe", [kind, params]) - .await - .unwrap(); - - let target = km.source.clone(); // rsvp? - - let rx = provider.inner().get_raw_subscription(id).await; - let handle = tokio::spawn(handle_subscription_stream( - our.to_string(), - sub_id.1.clone(), - rx, - target, - send_to_loop.clone(), + if !*public && km.source.node != our { + return Err(EthError::ProviderError( + "eth: only accepts requests from apps".to_string(), )); - - connections.insert(sub_id, handle); - EthResponse::Ok } - EthAction::UnsubscribeLogs(sub_id) => { - let sub_id = (km.target.process.clone(), sub_id); - let handle = connections - .remove(&sub_id) - .ok_or(EthError::SubscriptionNotFound)?; - handle.1.abort(); - EthResponse::Ok - } - EthAction::Request { method, params } => { - let method = to_static_str(&method).ok_or(EthError::ProviderError(format!( - "eth: method not found: {}", - method - )))?; + // we might want some of these in payloads.. sub items? + let return_body: EthResponse = match action { + EthAction::SubscribeLogs { + sub_id, + kind, + params, + } => { + let sub_id = (km.target.process.clone(), sub_id); - // throw transportErrorKinds straight back to process - let response: serde_json::Value = - provider.inner().prepare(method, params).await.unwrap(); + let kind = serde_json::to_value(&kind).unwrap(); + let params = serde_json::to_value(¶ms).unwrap(); - EthResponse::Request(response) - } - }; + let id = provider + .inner() + .prepare("eth_subscribe", [kind, params]) + .await + .unwrap(); - // todo: fix km.clone() and metadata.clone() - if let Some(target) = km.clone().rsvp.or_else(|| { - req.expects_response.map(|_| Address { - node: our.to_string(), - process: km.source.process.clone(), - }) - }) { - let response = KernelMessage { + let target = km.rsvp.clone().unwrap_or_else(|| Address { + node: our.to_string(), + process: km.source.process.clone(), + }); + + let rx = provider.inner().get_raw_subscription(id).await; + let handle = tokio::spawn(handle_subscription_stream( + our.to_string(), + sub_id.1.clone(), + rx, + target, + send_to_loop.clone(), + )); + + connections.insert(sub_id, handle); + EthResponse::Ok + } + EthAction::UnsubscribeLogs(sub_id) => { + let sub_id = (km.target.process.clone(), sub_id); + let handle = connections + .remove(&sub_id) + .ok_or(EthError::SubscriptionNotFound)?; + + handle.1.abort(); + EthResponse::Ok + } + EthAction::Request { method, params } => { + let method = to_static_str(&method).ok_or(EthError::ProviderError(format!( + "eth: method not found: {}", + method + )))?; + + // throw transportErrorKinds straight back to process + let response: serde_json::Value = + provider.inner().prepare(method, params).await.unwrap(); + + EthResponse::Request(response) + } + }; + + // todo: fix km.clone() and metadata.clone() + if let Some(target) = km.clone().rsvp.or_else(|| { + req.expects_response.map(|_| Address { + node: our.to_string(), + process: km.source.process.clone(), + }) + }) { + let response = KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: None, + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&return_body).unwrap(), + metadata: req.metadata.clone(), + capabilities: vec![], + }, + None, + )), + lazy_load_blob: None, + }; + + // Send the response, handling potential errors appropriately + let _ = send_to_loop.send(response).await; + }; + } else { + // passthrough + // if node == our, forward to provider + // hoping that rsvp can fix the rest. + let request = KernelMessage { id: km.id, source: Address { node: our.to_string(), - process: VFS_PROCESS_ID.clone(), + process: ETH_PROCESS_ID.clone(), }, - target: target.clone(), - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - body: serde_json::to_vec(&return_body).unwrap(), - metadata: req.metadata.clone(), - capabilities: vec![], - }, - None, - )), + target: Address { + node: "jugodenaranja.os".to_string(), + process: ETH_PROCESS_ID.clone(), + }, + rsvp: Some(km.source.clone()), + message: Message::Request(req.clone()), lazy_load_blob: None, }; - // Send the response, handling potential errors appropriately - let _ = send_to_loop.send(response).await; - }; + let _ = send_to_loop.send(request).await; + } + Ok(()) } diff --git a/src/kernel/mod.rs b/src/kernel/mod.rs index 848aa158..824858e1 100644 --- a/src/kernel/mod.rs +++ b/src/kernel/mod.rs @@ -5,11 +5,31 @@ use anyhow::Result; use ring::signature; use serde::{Deserialize, Serialize}; use std::collections::HashMap; +use std::str::FromStr; use std::sync::Arc; use tokio::sync::mpsc; use tokio::task::JoinHandle; use wasmtime::{Config, Engine, WasmBacktraceDetails}; +/// TEMP IMPORT, crate::net::????? +/// Must be parsed from message pack vector. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub enum NetActions { + KnsUpdate(KnsUpdate), + KnsBatchUpdate(Vec), +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct KnsUpdate { + pub name: String, // actual username / domain name + pub owner: String, + pub node: String, // hex namehash of node + pub public_key: String, + pub ip: String, + pub port: u16, + pub routers: Vec, +} + /// Manipulate a single process. pub mod process; /// Implement the functions served to processes by `kinode.wit`. @@ -782,6 +802,82 @@ pub async fn kernel( }) .await .expect("fatal: kernel event loop died"); + // sending hard coded routers into networking for bootstrapped rpc + let kns_updates = vec![ + KnsUpdate { + name: "default-router-1.os".to_string(), + owner: "who?".to_string(), + node: "0x".to_string(), + public_key: "0xb1b1cf23c89f651aac3e5fd4decb04aa177ab0ec8ce5f1d3877b90bb6f5779db" + .to_string(), + ip: "147.135.114.167".to_string(), + port: 9002, + routers: vec![], + }, + KnsUpdate { + name: "default-router-2.os".to_string(), + owner: "who?".to_string(), + node: "0x".to_string(), + public_key: "0xab9f1a996db3a4e1dbcd31d765daedeb3af9af4f570c0968463b5be3a7d1e992" + .to_string(), + ip: "147.135.114.167".to_string(), + port: 9003, + routers: vec![], + }, + KnsUpdate { + name: "default-router-3.os".to_string(), + owner: "who?".to_string(), + node: "0x".to_string(), + public_key: "0x536e30785e64dd0349a697285af365b5ed7c4d300010139261cfc4dbdd5b254b" + .to_string(), + ip: "147.135.114.167".to_string(), + port: 9004, + routers: vec![], + }, + // I want to use ben.eth + // --rpc-node ben.eth + // first index and then change + // no-rpc + // settings -> rpc from router-01 -> ben.eth + KnsUpdate { + name: "jugodenaranja.os".to_string(), + owner: "who?".to_string(), + node: "0x".to_string(), + public_key: "0xf8a3e9667756306a0a25894a8cfe053dc9e7f34e6a61b8d65e92b79f77e05dff" + .to_string(), + ip: "this should not be parsed.".to_string(), + port: 0, + routers: vec![ + "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d".to_string(), + "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458".to_string(), + "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a".to_string(), + ], + }, + ]; + send_to_loop + .send(t::KernelMessage { + id: rand::random(), + source: t::Address { + node: our.name.clone(), + process: KERNEL_PROCESS_ID.clone(), + }, + target: t::Address { + node: our.name.clone(), + process: t::ProcessId::from_str("net:distro:sys").unwrap(), + }, + rsvp: None, + message: t::Message::Request(t::Request { + inherit: false, + expects_response: None, + body: rmp_serde::to_vec(&NetActions::KnsBatchUpdate(kns_updates)).unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .expect("fatal: kernel event loop died"); + // finally, in order to trigger the kns_indexer app to find the right // contract, queue up a message that will send the contract address // to it on boot. diff --git a/src/main.rs b/src/main.rs index 69473dbd..876fb5e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,6 +111,12 @@ async fn main() { let app = app.arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)").required(false)); + let app = app.arg( + arg!(--public "If set, allow rpc passthrough") + .default_value("false") + .value_parser(value_parser!(bool)), + ); + #[cfg(feature = "simulation-mode")] let app = app .arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)")) @@ -134,6 +140,8 @@ async fn main() { None => (8080, false), }; let on_testnet = *matches.get_one::("testnet").unwrap(); + let public = *matches.get_one::("public").unwrap(); + let contract_address = if on_testnet { register::KNS_SEPOLIA_ADDRESS } else { @@ -501,6 +509,7 @@ async fn main() { tasks.spawn(eth::provider::provider( our.name.clone(), rpc_url.clone(), + public, kernel_message_sender.clone(), eth_provider_receiver, print_sender.clone(), From 5ccd2c2dfd3bd6cd855bb99c2eda33c17ac82d5a Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Fri, 9 Feb 2024 17:03:19 -0300 Subject: [PATCH 12/26] merge new repo style --- Cargo.lock | 766 ++++++++---------- kinode/Cargo.toml | 5 + .../kns_indexer/kns_indexer/Cargo.toml | 4 +- kinode/src/eth/provider.rs | 6 +- kinode/src/register.rs | 2 +- lib/Cargo.toml | 4 +- lib/src/eth.rs | 2 - 7 files changed, 351 insertions(+), 438 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 581837a7..d78bec65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -101,12 +101,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] -<<<<<<< HEAD name = "alloy-eips" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-rlp", "serde", "thiserror", @@ -115,9 +114,9 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.2", "serde", "serde_json", "thiserror", @@ -126,26 +125,20 @@ dependencies = [ [[package]] name = "alloy-network" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-eips", "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-rlp", "serde", ] [[package]] name = "alloy-primitives" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4b6fb2b432ff223d513db7f908937f63c252bee0af9b82bfd25b0a5dd1eb0d8" -======= -name = "alloy-primitives" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c234f92024707f224510ff82419b2be0e1d8e1fd911defcac5a085cd7f83898" ->>>>>>> develop dependencies = [ "alloy-rlp", "bytes", @@ -154,32 +147,46 @@ dependencies = [ "derive_more", "hex-literal", "itoa", -<<<<<<< HEAD - "k256", - "keccak-asm", - "proptest", - "rand", -======= "keccak-asm", "proptest", "rand 0.8.5", ->>>>>>> develop "ruint", "serde", "tiny-keccak", ] [[package]] -<<<<<<< HEAD +name = "alloy-primitives" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4b6fb2b432ff223d513db7f908937f63c252bee0af9b82bfd25b0a5dd1eb0d8" +dependencies = [ + "alloy-rlp", + "bytes", + "cfg-if", + "const-hex", + "derive_more", + "hex-literal", + "itoa", + "k256", + "keccak-asm", + "proptest", + "rand 0.8.5", + "ruint", + "serde", + "tiny-keccak", +] + +[[package]] name = "alloy-providers" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-network", - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-rpc-client", "alloy-rpc-trace-types", - "alloy-rpc-types", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", "alloy-transport", "alloy-transport-http", "async-trait", @@ -192,10 +199,10 @@ dependencies = [ [[package]] name = "alloy-pubsub" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-transport", "bimap", "futures", @@ -207,8 +214,6 @@ dependencies = [ ] [[package]] -======= ->>>>>>> develop name = "alloy-rlp" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -231,13 +236,12 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD name = "alloy-rpc-client" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -255,10 +259,10 @@ dependencies = [ [[package]] name = "alloy-rpc-trace-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ - "alloy-primitives", - "alloy-rpc-types", + "alloy-primitives 0.6.2", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", "serde", "serde_json", ] @@ -266,33 +270,95 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" -======= -name = "alloy-rpc-types" -version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git?rev=3b1c310#3b1c3108ccd33c78abd7da8191e3744b4ae9a735" ->>>>>>> develop +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.6.2", "alloy-rlp", "itertools 0.12.1", -<<<<<<< HEAD "serde", "serde_json", -======= - "jsonrpsee-types", - "serde", - "serde_json", - "serde_with", ->>>>>>> develop "thiserror", ] [[package]] -<<<<<<< HEAD +name = "alloy-rpc-types" +version = "0.1.0" +source = "git+https://github.com/alloy-rs/alloy.git?rev=3b1c310#3b1c3108ccd33c78abd7da8191e3744b4ae9a735" +dependencies = [ + "alloy-primitives 0.5.4", + "alloy-rlp", + "itertools 0.12.1", + "jsonrpsee-types", + "serde", + "serde_json", + "serde_with", + "thiserror", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "970e5cf1ca089e964d4f7f7afc7c9ad642bfb1bdc695a20b0cba3b3c28954774" +dependencies = [ + "const-hex", + "dunce", + "heck", + "indexmap 2.2.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", + "syn-solidity 0.5.4", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b0b5ab0cb07c21adf9d72e988b34e8200ce648c2bba8d009183bb1c50fb1216" +dependencies = [ + "const-hex", + "dunce", + "heck", + "indexmap 2.2.2", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", + "syn-solidity 0.6.2", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-types" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a059d4d2c78f8f21e470772c75f9abd9ac6d48c2aaf6b278d1ead06ed9ac664" +dependencies = [ + "alloy-primitives 0.5.4", + "alloy-sol-macro 0.5.4", + "const-hex", + "serde", +] + +[[package]] +name = "alloy-sol-types" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c08f62ded7ce03513bfb60ef5cad4fff5d4f67eac6feb4df80426b7b9ffb06e" +dependencies = [ + "alloy-primitives 0.6.2", + "alloy-sol-macro 0.6.2", + "const-hex", + "serde", +] + +[[package]] name = "alloy-transport" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-json-rpc", "base64 0.21.7", @@ -308,7 +374,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -321,46 +387,17 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "0.1.0" -source = "git+https://github.com/alloy-rs/alloy.git#32618e9243a761858a0843e7e55575e48fdbf500" +source = "git+https://github.com/alloy-rs/alloy?rev=098ad56#098ad5657d55bbc5fe9469ede2a9ca79def738f2" dependencies = [ "alloy-pubsub", "alloy-transport", "futures", - "http", + "http 0.2.11", "serde_json", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tracing", "ws_stream_wasm", -======= -name = "alloy-sol-macro" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "970e5cf1ca089e964d4f7f7afc7c9ad642bfb1bdc695a20b0cba3b3c28954774" -dependencies = [ - "const-hex", - "dunce", - "heck", - "indexmap 2.2.2", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.48", - "syn-solidity", - "tiny-keccak", -] - -[[package]] -name = "alloy-sol-types" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a059d4d2c78f8f21e470772c75f9abd9ac6d48c2aaf6b278d1ead06ed9ac664" -dependencies = [ - "alloy-primitives", - "alloy-sol-macro", - "const-hex", - "serde", ->>>>>>> develop ] [[package]] @@ -400,15 +437,9 @@ dependencies = [ [[package]] name = "anstyle" -<<<<<<< HEAD version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" -======= -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" ->>>>>>> develop [[package]] name = "anstyle-parse" @@ -443,16 +474,14 @@ name = "anyhow" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" -<<<<<<< HEAD -======= [[package]] name = "app_store" version = "0.3.0" dependencies = [ - "alloy-primitives", - "alloy-rpc-types", - "alloy-sol-types", + "alloy-primitives 0.5.4", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=3b1c310)", + "alloy-sol-types 0.5.4", "anyhow", "bincode", "kinode_process_lib 0.5.9 (git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha)", @@ -466,7 +495,6 @@ dependencies = [ "wit-bindgen", "zip", ] ->>>>>>> develop [[package]] name = "arbitrary" @@ -585,11 +613,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", -<<<<<<< HEAD - "rand", -======= "rand 0.8.5", ->>>>>>> develop ] [[package]] @@ -599,11 +623,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", -<<<<<<< HEAD - "rand", -======= "rand 0.8.5", ->>>>>>> develop ] [[package]] @@ -658,8 +678,6 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.48", -<<<<<<< HEAD -======= ] [[package]] @@ -669,7 +687,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" dependencies = [ "autocfg 1.1.0", ->>>>>>> develop ] [[package]] @@ -724,12 +741,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] -<<<<<<< HEAD -name = "bimap" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -======= name = "beef" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -737,7 +748,12 @@ checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" dependencies = [ "serde", ] ->>>>>>> develop + +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bincode" @@ -985,9 +1001,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -1120,9 +1136,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -1130,21 +1146,21 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -1154,9 +1170,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "cloudabi" @@ -1227,9 +1243,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "const-hex" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" dependencies = [ "cfg-if", "cpufeatures", @@ -1505,9 +1521,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", @@ -1645,10 +1661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", -<<<<<<< HEAD -======= "serde", ->>>>>>> develop ] [[package]] @@ -2086,7 +2099,7 @@ dependencies = [ "serde", "serde_json", "syn 2.0.48", - "toml 0.8.9", + "toml 0.8.10", "walkdir", ] @@ -2207,7 +2220,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tracing", "tracing-futures", "url", @@ -2608,11 +2621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "stable_deref_trait", ] @@ -2671,19 +2680,20 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", -<<<<<<< HEAD - "http", - "indexmap", -======= "http 0.2.11", "indexmap 2.2.2", ->>>>>>> develop "slab", "tokio", "tokio-util", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.13.2" @@ -2756,15 +2766,9 @@ dependencies = [ [[package]] name = "hermit-abi" -<<<<<<< HEAD version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" -======= -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" ->>>>>>> develop [[package]] name = "hex" @@ -2780,8 +2784,6 @@ name = "hex-literal" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" -<<<<<<< HEAD -======= [[package]] name = "hi" @@ -2792,7 +2794,6 @@ dependencies = [ "serde_json", "wit-bindgen", ] ->>>>>>> develop [[package]] name = "hkdf" @@ -2819,8 +2820,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ "windows-sys 0.52.0", -<<<<<<< HEAD -======= ] [[package]] @@ -2833,7 +2832,6 @@ dependencies = [ "serde", "serde_json", "wit-bindgen", ->>>>>>> develop ] [[package]] @@ -2841,8 +2839,6 @@ name = "http" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -<<<<<<< HEAD -======= dependencies = [ "bytes", "fnv", @@ -2854,7 +2850,6 @@ name = "http" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" ->>>>>>> develop dependencies = [ "bytes", "fnv", @@ -3074,10 +3069,8 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -<<<<<<< HEAD -======= checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", @@ -3089,7 +3082,6 @@ dependencies = [ name = "indexmap" version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" ->>>>>>> develop checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", @@ -3159,12 +3151,12 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "fe8f25ce1159c7740ff0b9b2f5cdf4a8428742ba7c112b9f20f22cd5219c7dab" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] @@ -3233,18 +3225,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -3320,27 +3312,6 @@ name = "keccak-asm" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb8515fff80ed850aea4a1595f2e519c003e2a00a82fe168ebf5269196caf444" -<<<<<<< HEAD -dependencies = [ - "digest 0.10.7", - "sha3-asm", -] - -[[package]] -name = "kinode" -version = "0.5.2" -dependencies = [ - "aes-gcm", - "alloy-network", - "alloy-primitives", - "alloy-providers", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types", - "alloy-transport", - "alloy-transport-http", - "alloy-transport-ws", -======= dependencies = [ "digest 0.10.7", "sha3-asm", @@ -3351,7 +3322,11 @@ name = "kinode" version = "0.6.0" dependencies = [ "aes-gcm", ->>>>>>> develop + "alloy-providers", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", + "alloy-transport-ws", "anyhow", "async-trait", "base64 0.13.1", @@ -3401,7 +3376,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "url", "uuid 1.7.0", "walkdir", @@ -3423,7 +3398,7 @@ name = "kinode_process_lib" version = "0.5.9" source = "git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha#5e705086bbd10fde89e11d3e3671f6a618a875a7" dependencies = [ - "alloy-rpc-types", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=3b1c310)", "anyhow", "bincode", "ethers-core", @@ -3471,10 +3446,31 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "kinode_process_lib" +version = "0.6.0" +source = "git+https://github.com/kinode-dao/process_lib?rev=8d58cfb#8d58cfba0302681b6971cac26ea3f7e49d4602ec" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives 0.6.2", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", + "alloy-transport", + "anyhow", + "bincode", + "http 1.0.0", + "mime_guess", + "rand 0.8.5", + "serde", + "serde_json", + "thiserror", + "url", + "wit-bindgen", +] + [[package]] name = "kit" version = "0.1.0" -source = "git+https://github.com/kinode-dao/kit?rev=25b098f#25b098fab136387065d6058162d33c727d277ab8" +source = "git+https://github.com/kinode-dao/kit?rev=0c43430#0c434306fdce55e11d3309959fc4a0fe6ae28def" dependencies = [ "anyhow", "base64 0.21.7", @@ -3493,8 +3489,8 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite", - "toml 0.8.9", + "tokio-tungstenite 0.21.0", + "toml 0.8.10", "walkdir", "zip", ] @@ -3503,13 +3499,13 @@ dependencies = [ name = "kns_indexer" version = "0.2.0" dependencies = [ - "alloy-primitives", - "alloy-rpc-types", - "alloy-sol-types", + "alloy-primitives 0.6.2", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", + "alloy-sol-types 0.6.2", "anyhow", "bincode", "hex", - "kinode_process_lib 0.5.9 (git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha)", + "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?rev=8d58cfb)", "rmp-serde", "serde", "serde_json", @@ -3566,8 +3562,8 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" name = "lib" version = "0.6.0" dependencies = [ - "ethers", - "ethers-providers", + "alloy-pubsub", + "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", "lazy_static", "rand 0.8.5", "reqwest", @@ -3585,8 +3581,6 @@ name = "libc" version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" -<<<<<<< HEAD -======= [[package]] name = "libgit2-sys" @@ -3601,7 +3595,6 @@ dependencies = [ "openssl-sys", "pkg-config", ] ->>>>>>> develop [[package]] name = "libloading" @@ -3658,17 +3651,10 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "libz-sys" -version = "1.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" -======= name = "libssh2-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee" ->>>>>>> develop dependencies = [ "cc", "libc", @@ -3891,8 +3877,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -======= name = "nix" version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3904,7 +3888,6 @@ dependencies = [ ] [[package]] ->>>>>>> develop name = "nohash-hasher" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3939,25 +3922,20 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg 1.1.0", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ -<<<<<<< HEAD - "autocfg", -======= "autocfg 1.1.0", ->>>>>>> develop "libm", ] @@ -4000,11 +3978,7 @@ checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", "hashbrown 0.14.3", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "memchr", ] @@ -4245,11 +4219,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop ] [[package]] @@ -4366,8 +4336,6 @@ name = "platforms" version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" -<<<<<<< HEAD -======= [[package]] name = "pleco" @@ -4382,7 +4350,6 @@ dependencies = [ "rand 0.6.5", "rayon", ] ->>>>>>> develop [[package]] name = "poly1305" @@ -4457,8 +4424,6 @@ checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", "toml_edit 0.19.15", -<<<<<<< HEAD -======= ] [[package]] @@ -4477,25 +4442,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ "toml_edit 0.21.1", ->>>>>>> develop ] [[package]] -name = "proc-macro-crate" -version = "2.0.0" +name = "proc-macro-error" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ - "toml_edit 0.20.7", + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", ] [[package]] -name = "proc-macro-crate" -version = "3.1.0" +name = "proc-macro-error-attr" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "toml_edit 0.21.1", + "proc-macro2", + "quote", + "version_check", ] [[package]] @@ -4524,15 +4494,9 @@ dependencies = [ "bitflags 2.4.2", "lazy_static", "num-traits", -<<<<<<< HEAD - "rand", - "rand_chacha", - "rand_xorshift", -======= "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift 0.3.0", ->>>>>>> develop "regex-syntax 0.8.2", "rusty-fork", "tempfile", @@ -4675,14 +4639,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -======= name = "rand_hc" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4751,7 +4707,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ "rand_core 0.6.4", ->>>>>>> develop ] [[package]] @@ -4775,11 +4730,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -======= name = "rdrand" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4792,7 +4742,6 @@ dependencies = [ name = "redox_syscall" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" ->>>>>>> develop checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", @@ -5025,11 +4974,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "proptest", -<<<<<<< HEAD - "rand", -======= "rand 0.8.5", ->>>>>>> develop "rlp", "ruint-macro", "serde", @@ -5377,15 +5322,10 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -======= name = "serde_with" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ "base64 0.21.7", "chrono", @@ -5393,6 +5333,7 @@ dependencies = [ "indexmap 1.9.3", "indexmap 2.2.2", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -5400,9 +5341,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ "darling 0.20.5", "proc-macro2", @@ -5414,7 +5355,6 @@ dependencies = [ name = "sha1" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" ->>>>>>> develop checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", @@ -5505,11 +5445,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", -<<<<<<< HEAD - "rand_core", -======= "rand_core 0.6.4", ->>>>>>> develop ] [[package]] @@ -5561,11 +5497,7 @@ dependencies = [ "blake2", "chacha20poly1305", "curve25519-dalek", -<<<<<<< HEAD - "rand_core", -======= "rand_core 0.6.4", ->>>>>>> develop "ring 0.17.7", "rustc_version 0.4.0", "sha2", @@ -5697,6 +5629,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.25.0" @@ -5768,8 +5706,6 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -======= name = "syn-solidity" version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5782,7 +5718,18 @@ dependencies = [ ] [[package]] ->>>>>>> develop +name = "syn-solidity" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63bef2e2c735acbc06874eca3a8506f02a3c4700e6e748afc92cc2e4220e8a03" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] name = "sync_wrapper" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -5839,22 +5786,12 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -<<<<<<< HEAD version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", -======= -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", ->>>>>>> develop "rustix", "windows-sys 0.52.0", ] @@ -5876,7 +5813,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bincode", - "kinode_process_lib 0.6.0", + "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.6.0-alpha)", "rand 0.8.5", "regex", "serde", @@ -6057,10 +5994,22 @@ dependencies = [ "rustls", "tokio", "tokio-rustls", - "tungstenite", + "tungstenite 0.20.1", "webpki-roots", ] +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.21.0", +] + [[package]] name = "tokio-util" version = "0.7.10" @@ -6086,14 +6035,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.4", ] [[package]] @@ -6111,11 +6060,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "toml_datetime", "winnow", ] @@ -6126,11 +6071,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "toml_datetime", "winnow", ] @@ -6141,11 +6082,18 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap 2.2.2", "serde", "serde_spanned", "toml_datetime", @@ -6153,7 +6101,17 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD +name = "top" +version = "0.1.0" +dependencies = [ + "anyhow", + "kinode_process_lib 0.5.9 (git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha)", + "serde", + "serde_json", + "wit-bindgen", +] + +[[package]] name = "tower" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6175,19 +6133,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] -======= -name = "top" -version = "0.1.0" -dependencies = [ - "anyhow", - "kinode_process_lib 0.5.9 (git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha)", - "serde", - "serde_json", - "wit-bindgen", -] - -[[package]] ->>>>>>> develop name = "tower-service" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6274,11 +6219,7 @@ dependencies = [ "ipnet", "lazy_static", "log", -<<<<<<< HEAD - "rand", -======= "rand 0.8.5", ->>>>>>> develop "smallvec", "thiserror", "tinyvec", @@ -6312,6 +6253,25 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.0.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typenum" version = "1.17.0" @@ -6373,21 +6333,15 @@ dependencies = [ ] [[package]] -<<<<<<< HEAD -name = "unicode-width" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -======= name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" ->>>>>>> develop checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] @@ -6397,8 +6351,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -<<<<<<< HEAD -======= name = "uninstall" version = "0.1.0" dependencies = [ @@ -6410,7 +6362,6 @@ dependencies = [ ] [[package]] ->>>>>>> develop name = "universal-hash" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6558,7 +6509,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-stream", - "tokio-tungstenite", + "tokio-tungstenite 0.20.1", "tokio-util", "tower-service", "tracing", @@ -6615,9 +6566,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6625,9 +6576,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -6640,9 +6591,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -6652,9 +6603,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6662,9 +6613,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -6675,9 +6626,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-encoder" @@ -6690,35 +6641,27 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.41.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09bca7d6388637d27fb5edbeab11f56bfabcef8743c55ae34370e1e5030a071" +checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" dependencies = [ "leb128", ] [[package]] -<<<<<<< HEAD -name = "wasmparser" -version = "0.116.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" -dependencies = [ - "indexmap", -======= name = "wasm-encoder" -version = "0.41.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09bca7d6388637d27fb5edbeab11f56bfabcef8743c55ae34370e1e5030a071" +checksum = "6ce14de623d48dda4c10698c4dadae2366b5c2c8e81bad981d5a0625a5fcf68c" dependencies = [ "leb128", ] [[package]] name = "wasm-metadata" -version = "0.10.17" +version = "0.10.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c853d3809fc9fccf3bc0ad63f4f51d8eefad0bacf88f957aa991c1d9b88b016e" +checksum = "977038054fd97977d2b7889005b5f20b62fd3563f2dc8dedfb534e3fdea6b7a7" dependencies = [ "anyhow", "indexmap 2.2.2", @@ -6726,8 +6669,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.41.0", - "wasmparser 0.121.0", + "wasm-encoder 0.41.1", + "wasmparser 0.121.1", ] [[package]] @@ -6737,44 +6680,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" dependencies = [ "indexmap 2.2.2", ->>>>>>> develop "semver 1.0.21", ] [[package]] name = "wasmparser" -version = "0.121.0" +version = "0.118.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" +checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" dependencies = [ -<<<<<<< HEAD - "bitflags 2.4.2", - "indexmap", -======= "indexmap 2.2.2", "semver 1.0.21", ] [[package]] name = "wasmparser" -version = "0.121.0" +version = "0.121.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953cf6a7606ab31382cb1caa5ae403e77ba70c7f8e12eeda167e7040d42bfda8" +checksum = "99ffe16b4aa1ebab8724f61c9ee38cd5481c89caf10bf1a5af9eab8f0c2e6c05" dependencies = [ "bitflags 2.4.2", "indexmap 2.2.2", ->>>>>>> develop "semver 1.0.21", ] [[package]] name = "wasmprinter" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e32c13c59fdc64d3f6998a1d52eb1d362b6904a88b754190ccb85661ad577a" +checksum = "b4a76a9228f2e6653f0b3d912b2f3a9b6ac79c690e5642c9ee2dfd914c545cf0" dependencies = [ "anyhow", - "wasmparser 0.121.0", + "wasmparser 0.121.1", ] [[package]] @@ -6790,11 +6727,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "libc", "log", "object", @@ -6921,11 +6854,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "log", "object", "serde", @@ -7014,22 +6943,14 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "libc", "log", "mach", "memfd", "memoffset", "paste", -<<<<<<< HEAD - "rand", -======= "rand 0.8.5", ->>>>>>> develop "rustix", "sptr", "wasm-encoder 0.36.2", @@ -7126,11 +7047,7 @@ checksum = "4b804dfd3d0c0d6d37aa21026fe7772ba1a769c89ee4f5c4f13b82d91d75216f" dependencies = [ "anyhow", "heck", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "wit-parser", ] @@ -7151,31 +7068,31 @@ dependencies = [ [[package]] name = "wast" -version = "70.0.2" +version = "71.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3d5061300042ff5065123dae1e27d00c03f567d34a2937c8472255148a216dc" +checksum = "a10dad39ea4623ed4c304fb42bd455eca6d212f7e5e0cb59681fed7e4d128a2e" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.41.0", + "wasm-encoder 0.41.1", ] [[package]] name = "wat" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afd7357b6cc46d46a2509c43dcb1dd4131dafbf4e75562d87017b5a05ffad2d6" +checksum = "b724419d3bffeff174745b924f6ed053095ac58f9ae72e87d2e0f8ef6df6df96" dependencies = [ - "wast 70.0.2", + "wast 71.0.0", ] [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -7419,9 +7336,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] @@ -7444,8 +7361,6 @@ checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" dependencies = [ "bitflags 2.4.2", "windows-sys 0.52.0", -<<<<<<< HEAD -======= ] [[package]] @@ -7510,22 +7425,17 @@ dependencies = [ "wasm-metadata", "wasmparser 0.118.1", "wit-parser", ->>>>>>> develop ] [[package]] name = "wit-parser" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df4913a2219096373fd6512adead1fb77ecdaa59d7fc517972a7d30b12f625be" +checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", -<<<<<<< HEAD - "indexmap", -======= "indexmap 2.2.2", ->>>>>>> develop "log", "semver 1.0.21", "serde", diff --git a/kinode/Cargo.toml b/kinode/Cargo.toml index eaf59b10..ed140848 100644 --- a/kinode/Cargo.toml +++ b/kinode/Cargo.toml @@ -26,6 +26,11 @@ simulation-mode = [] [dependencies] aes-gcm = "0.10.2" +alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56" } +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56" } +alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56", features = ["ws"]} +alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56" } +alloy-providers = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56" } anyhow = "1.0.71" async-trait = "0.1.71" base64 = "0.13" diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index a7b23579..f7bfb61b 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -7,11 +7,11 @@ edition = "2021" [dependencies] anyhow = "1.0" alloy-primitives = "0.6.2" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy" } +alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56"} alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "032bd43" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "8d58cfb" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index 5cd4839b..6c6a8cb0 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -1,11 +1,11 @@ -use crate::eth::types::*; -use crate::types::*; use alloy_pubsub::{PubSubFrontend, RawSubscription}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::SubscriptionResult; use alloy_transport_ws::WsConnect; use anyhow::Result; use dashmap::DashMap; +use lib::types::core::*; +use lib::types::eth::*; use std::sync::Arc; use tokio::task::JoinHandle; use url::Url; @@ -47,7 +47,7 @@ pub async fn provider( auth: None, }; - let client = ClientBuilder::default().pubsub(connector).await?; + let client = ClientBuilder::default().ws(connector).await?; Some(alloy_providers::provider::Provider::new_with_client(client)) } else { None diff --git a/kinode/src/register.rs b/kinode/src/register.rs index 181ce37f..09f1e920 100644 --- a/kinode/src/register.rs +++ b/kinode/src/register.rs @@ -262,7 +262,7 @@ async fn get_unencrypted_info(keyfile: Option>) -> Result Date: Mon, 12 Feb 2024 16:11:10 -0300 Subject: [PATCH 13/26] eth: better types and errors --- Cargo.lock | 9 +- .../kns_indexer/kns_indexer/Cargo.toml | 3 +- .../kns_indexer/kns_indexer/src/lib.rs | 56 ++++------- kinode/src/eth/provider.rs | 92 ++++++++++++------- lib/src/eth.rs | 39 +++++--- 5 files changed, 107 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d78bec65..dfc45e4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -484,7 +484,7 @@ dependencies = [ "alloy-sol-types 0.5.4", "anyhow", "bincode", - "kinode_process_lib 0.5.9 (git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha)", + "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?rev=1e14a03)", "rand 0.8.5", "serde", "serde_json", @@ -3398,10 +3398,8 @@ name = "kinode_process_lib" version = "0.5.9" source = "git+https://github.com/kinode-dao/process_lib?tag=v0.5.9-alpha#5e705086bbd10fde89e11d3e3671f6a618a875a7" dependencies = [ - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=3b1c310)", "anyhow", "bincode", - "ethers-core", "http 1.0.0", "mime_guess", "rand 0.8.5", @@ -3449,7 +3447,7 @@ dependencies = [ [[package]] name = "kinode_process_lib" version = "0.6.0" -source = "git+https://github.com/kinode-dao/process_lib?rev=8d58cfb#8d58cfba0302681b6971cac26ea3f7e49d4602ec" +source = "git+https://github.com/kinode-dao/process_lib?rev=1e14a03#1e14a03e3e274f0bc7f16a08d81c7583589b12be" dependencies = [ "alloy-json-rpc", "alloy-primitives 0.6.2", @@ -3500,12 +3498,11 @@ name = "kns_indexer" version = "0.2.0" dependencies = [ "alloy-primitives 0.6.2", - "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=098ad56)", "alloy-sol-types 0.6.2", "anyhow", "bincode", "hex", - "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?rev=8d58cfb)", + "kinode_process_lib 0.6.0 (git+https://github.com/kinode-dao/process_lib?rev=1e14a03)", "rmp-serde", "serde", "serde_json", diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index f7bfb61b..ccc552c5 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -7,11 +7,10 @@ edition = "2021" [dependencies] anyhow = "1.0" alloy-primitives = "0.6.2" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "098ad56"} alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "8d58cfb" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1e14a03" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index 9dbf882f..a8b37091 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -1,24 +1,19 @@ -use alloy_primitives::Address as EthAddress; -use alloy_rpc_types::{ - pubsub::{Params, SubscriptionKind, SubscriptionResult}, - BlockNumberOrTag, Filter, Log, -}; use alloy_sol_types::{sol, SolEvent}; use kinode_process_lib::{ await_message, - eth::{get_block_number, get_logs, EthResponse}, + eth::{ + get_block_number, get_logs, Address as EthAddress, BlockNumberOrTag, EthAction, EthMessage, + EthResponse, Filter, Log, Params, SubscriptionKind, SubscriptionResult, + }, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; use serde::{Deserialize, Serialize}; -use std::string::FromUtf8Error; -use std::{ - collections::{ - hash_map::{Entry, HashMap}, - BTreeMap, - }, - str::FromStr, +use std::collections::{ + hash_map::{Entry, HashMap}, + BTreeMap, }; +use std::string::FromUtf8Error; wit_bindgen::generate!({ path: "wit", @@ -28,23 +23,6 @@ wit_bindgen::generate!({ }, }); -//TEMP -#[derive(Debug, Serialize, Deserialize)] -pub enum EthAction { - /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. - SubscribeLogs { - sub_id: u64, - kind: SubscriptionKind, - params: Params, - }, - /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. - UnsubscribeLogs(u64), - Request { - method: String, - params: serde_json::Value, - }, -} - #[derive(Clone, Debug, Serialize, Deserialize)] struct State { // what contract this state pertains to @@ -221,10 +199,9 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { Request::new() .target((&our.node, "eth", "distro", "sys")) - .body(serde_json::to_vec(&EthAction::SubscribeLogs { - sub_id: 8, - kind, - params, + .body(serde_json::to_vec(&EthMessage { + id: 8, + action: EthAction::SubscribeLogs { kind, params }, })?) .send()?; @@ -285,17 +262,16 @@ fn handle_eth_message( pending_requests: &mut BTreeMap>, body: &[u8], ) -> anyhow::Result<()> { - let Ok(res) = serde_json::from_slice::(body) else { + let Ok(res) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; - match res { - EthResponse::Sub { id, result } => match result { - SubscriptionResult::Log(log) => { + match res.action { + EthAction::Sub { result } => { + if let SubscriptionResult::Log(log) = result { handle_log(our, state, &log)?; } - _ => {} - }, + } _ => {} } diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index 6c6a8cb0..8f8639de 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -87,8 +87,10 @@ pub async fn provider( ) .await { - println!("got error: {:?}", e); - } + let _ = send_to_loop + .send(make_error_message(our.to_string(), km, e)) + .await; + }; }); } Err(anyhow::anyhow!("eth: fatal: message receiver closed!")) @@ -104,30 +106,24 @@ async fn handle_request( public: Arc, ) -> Result<(), EthError> { let Message::Request(req) = &km.message else { - return Err(EthError::ProviderError( + return Err(EthError::InvalidMethod( "eth: only accepts requests".to_string(), )); }; if let Some(provider) = provider.as_ref() { - let action = serde_json::from_slice::(&req.body).map_err(|e| { - EthError::ProviderError(format!("eth: failed to deserialize request: {:?}", e)) + let ethmsg = serde_json::from_slice::(&req.body).map_err(|e| { + EthError::InvalidMethod(format!("eth: failed to deserialize request: {:?}", e)) })?; if !*public && km.source.node != our { - return Err(EthError::ProviderError( - "eth: only accepts requests from apps".to_string(), - )); + return Err(EthError::PermissionDenied("not on the list.".to_string())); } // we might want some of these in payloads.. sub items? - let return_body: EthResponse = match action { - EthAction::SubscribeLogs { - sub_id, - kind, - params, - } => { - let sub_id = (km.target.process.clone(), sub_id); + let return_body: EthResponse = match ethmsg.action { + EthAction::SubscribeLogs { kind, params } => { + let sub_id = (km.target.process.clone(), ethmsg.id); let kind = serde_json::to_value(&kind).unwrap(); let params = serde_json::to_value(¶ms).unwrap(); @@ -136,7 +132,7 @@ async fn handle_request( .inner() .prepare("eth_subscribe", [kind, params]) .await - .unwrap(); + .map_err(|e| EthError::TransportError(e.to_string()))?; let target = km.rsvp.clone().unwrap_or_else(|| Address { node: our.to_string(), @@ -155,8 +151,8 @@ async fn handle_request( connections.insert(sub_id, handle); EthResponse::Ok } - EthAction::UnsubscribeLogs(sub_id) => { - let sub_id = (km.target.process.clone(), sub_id); + EthAction::UnsubscribeLogs => { + let sub_id = (km.target.process.clone(), ethmsg.id); let handle = connections .remove(&sub_id) .ok_or(EthError::SubscriptionNotFound)?; @@ -165,16 +161,20 @@ async fn handle_request( EthResponse::Ok } EthAction::Request { method, params } => { - let method = to_static_str(&method).ok_or(EthError::ProviderError(format!( - "eth: method not found: {}", - method - )))?; + let method = to_static_str(&method).ok_or(EthError::InvalidMethod(method))?; - // throw transportErrorKinds straight back to process - let response: serde_json::Value = - provider.inner().prepare(method, params).await.unwrap(); + let response: serde_json::Value = provider + .inner() + .prepare(method, params) + .await + .map_err(|e| EthError::TransportError(e.to_string()))?; - EthResponse::Request(response) + EthResponse::Response { value: response } + } + EthAction::Sub { .. } => { + return Err(EthError::InvalidMethod( + "eth: provider doesn't accept sub resultss".to_string(), + )) } }; @@ -247,11 +247,12 @@ async fn handle_subscription_stream( Err(e) => { println!("got an error from the subscription stream: {:?}", e); // TODO should we stop the subscription here? - // return Err(EthError::ProviderError(format!("{:?}", e))); + // return Err(EthError::TransportError??(format!("{:?}", e))); } Ok(value) => { - let event: SubscriptionResult = serde_json::from_str(value.get()) - .map_err(|e| EthError::ProviderError(format!("{:?}", e)))?; + let event: SubscriptionResult = serde_json::from_str(value.get()).map_err(|_| { + EthError::RpcError("eth: failed to deserialize subscription result".to_string()) + })?; send_to_loop .send(KernelMessage { id: rand::random(), @@ -264,9 +265,9 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&EthResponse::Sub { + body: serde_json::to_vec(&EthMessage { id: sub_id, - result: event, + action: EthAction::Sub { result: event }, }) .unwrap(), metadata: None, @@ -278,5 +279,32 @@ async fn handle_subscription_stream( .unwrap(); } } - Err(EthError::SubscriptionClosed) + Err(EthError::SubscriptionClosed(sub_id)) +} + +// todo, always send errors or no? general runtime question for other modules too. +fn make_error_message(our_node: String, km: KernelMessage, error: EthError) -> KernelMessage { + let source = km.rsvp.unwrap_or_else(|| Address { + node: our_node.clone(), + process: km.source.process.clone(), + }); + KernelMessage { + id: km.id, + source: Address { + node: our_node, + process: ETH_PROCESS_ID.clone(), + }, + target: source, + rsvp: None, + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&EthResponse::Err(error)).unwrap(), + metadata: None, + capabilities: vec![], + }, + None, + )), + lazy_load_blob: None, + } } diff --git a/lib/src/eth.rs b/lib/src/eth.rs index d70fa737..696af2e9 100644 --- a/lib/src/eth.rs +++ b/lib/src/eth.rs @@ -1,8 +1,17 @@ use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; use serde::{Deserialize, Serialize}; -/// The Request type that can be made to eth:distro:sys. Currently primitive, this -/// enum will expand to support more actions in the future. +/// The Message type that can be made to eth:distro:sys. The id is used to match the response, +/// if you're not doing send_and_await. +/// +/// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`. +#[derive(Debug, Serialize, Deserialize)] +pub struct EthMessage { + pub id: u64, + pub action: EthAction, +} + +/// The Action and Request type that can be made to eth:distro:sys. /// /// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`. #[derive(Debug, Serialize, Deserialize)] @@ -10,38 +19,44 @@ pub enum EthAction { /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. /// Logs come in as alloy_rpc_types::pubsub::SubscriptionResults SubscribeLogs { - sub_id: u64, kind: SubscriptionKind, params: Params, }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. - UnsubscribeLogs(u64), + UnsubscribeLogs, /// Raw request. Used by kinode_process_lib. Request { method: String, params: serde_json::Value, }, + /// Incoming subscription update. + Sub { result: SubscriptionResult }, } #[derive(Debug, Serialize, Deserialize)] pub enum EthResponse { Ok, - Request(serde_json::Value), + Response { value: serde_json::Value }, Err(EthError), - Sub { id: u64, result: SubscriptionResult }, } -/// The Response type which a process will get from requesting with an [`EthAction`] will be +/// The Response type which a process will get from requesting with an [`EthMessage`] will be /// of the form `Result<(), EthError>`, serialized and deserialized using `serde_json::to_vec` /// and `serde_json::from_slice`. #[derive(Debug, Serialize, Deserialize)] pub enum EthError { - /// The ethers provider threw an error when trying to subscribe - /// (contains ProviderError serialized to debug string) - ProviderError(String), - SubscriptionClosed, + /// Underlying transport error + TransportError(String), + /// Subscription closed + SubscriptionClosed(u64), /// The subscription ID was not found, so we couldn't unsubscribe. SubscriptionNotFound, + /// Invalid method + InvalidMethod(String), + /// Permission denied + PermissionDenied(String), + /// Internal RPC error + RpcError(String), } // @@ -49,7 +64,7 @@ pub enum EthError { // /// For static lifetimes of method strings. -/// Hopefully replaced asap by alloy-rs network abstraction. +/// Replaced soon by alloy-rs network abstraction. pub fn to_static_str(method: &str) -> Option<&'static str> { match method { "eth_getBalance" => Some("eth_getBalance"), From 4e1a7980112d4fc2547aa3d306a2631e39c5df6c Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Mon, 12 Feb 2024 17:26:38 -0300 Subject: [PATCH 14/26] app_store: update --- .../packages/app_store/app_store/Cargo.toml | 7 +- .../packages/app_store/app_store/src/lib.rs | 93 ++++++++++++++++--- .../packages/app_store/app_store/src/types.rs | 2 +- 3 files changed, 85 insertions(+), 17 deletions(-) diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index f8e18d15..5ea0916c 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -5,12 +5,11 @@ edition = "2021" [dependencies] -alloy-primitives = "0.5.1" -alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy.git", rev = "3b1c310" } -alloy-sol-types = "0.5.1" +alloy-primitives = "0.6.2" +alloy-sol-types = "0.6.2" anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", tag = "v0.5.9-alpha", features = ["eth"] } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1e14a03" } rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 96bb5901..63e1930d 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -1,4 +1,6 @@ -use kinode_process_lib::eth::{EthAction, EthAddress, EthSubEvent, SubscribeLogsRequest}; +use kinode_process_lib::eth::{ + get_logs, Address as EthAddress, EthAction, EthMessage, Filter, Params, SubscriptionResult, +}; use kinode_process_lib::http::{bind_http_path, serve_ui, HttpServerRequest}; use kinode_process_lib::kernel_types as kt; use kinode_process_lib::*; @@ -56,7 +58,7 @@ pub enum Req { RemoteRequest(RemoteRequest), FTWorkerCommand(FTWorkerCommand), FTWorkerResult(FTWorkerResult), - Eth(EthSubEvent), + Eth(EthMessage), Http(HttpServerRequest), } @@ -108,14 +110,51 @@ fn init(our: Address) { let mut requested_packages: HashMap = HashMap::new(); - // subscribe to events on the app store contract - SubscribeLogsRequest::new(1) // subscription id 1 + // get past logs, subscribe to new ones. //todotimeout?errors?//future responses? + // // doing manual send also possible + let filter = Filter::new() .address(EthAddress::from_str(&state.contract_address).unwrap()) .from_block(state.last_saved_block - 1) - .events(EVENTS) + .events(EVENTS); + + let logs = get_logs(filter.clone()); + + if let Ok(logs) = logs { + for log in logs { + state.ingest_listings_contract_event(log); + } + } + + // sub for future logs too. + Request::new() + .target((&our.node, "eth", "distro", "sys")) + .body( + serde_json::to_vec(&EthMessage { + id: 1, + action: EthAction::SubscribeLogs { + kind: eth::SubscriptionKind::Logs, + params: Params::Logs(Box::new(filter)), + }, + }) + .unwrap(), + ) .send() .unwrap(); + // Request::new() + // .target(("our", "eth", "distro", "sys")) + // .body( + // serde_json::to_vec(&EthMessage { + // id: 1, + // action: EthAction::Request { + // method: "eth_getLogs".to_string(), + // params: serde_json::to_value((filter,)).unwrap(), + // }, + // }) + // .unwrap(), + // ) + // .send(); + loop { match await_message() { Err(send_error) => { @@ -178,7 +217,9 @@ fn handle_message( if source.node() != our.node() || source.process != "eth:distro:sys" { return Err(anyhow::anyhow!("eth sub event from weird addr: {source}")); } - handle_eth_sub_event(&mut state, e)?; + if let EthAction::Sub { result } = e.action { + handle_eth_sub_event(&mut state, result)?; + } } Req::Http(incoming) => { if source.node() != our.node() @@ -322,13 +363,41 @@ fn handle_local_request( *state = State::new(CONTRACT_ADDRESS.to_string()).unwrap(); // kill our old subscription and build a new one. Request::to(("our", "eth", "distro", "sys")) - .body(serde_json::to_vec(&EthAction::UnsubscribeLogs(1)).unwrap()) + .body( + serde_json::to_vec(&EthMessage { + id: 1, + action: EthAction::UnsubscribeLogs, + }) + .unwrap(), + ) .send() .unwrap(); - SubscribeLogsRequest::new(1) // subscription id 1 + + let filter = Filter::new() .address(EthAddress::from_str(&state.contract_address).unwrap()) .from_block(state.last_saved_block - 1) - .events(EVENTS) + .events(EVENTS); + + let logs = get_logs(filter.clone()); + + if let Ok(logs) = logs { + for log in logs { + state.ingest_listings_contract_event(log); + } + } + + Request::new() + .target((&our.node, "eth", "distro", "sys")) + .body( + serde_json::to_vec(&EthMessage { + id: 1, + action: EthAction::SubscribeLogs { + kind: eth::SubscriptionKind::Logs, + params: Params::Logs(Box::new(filter)), + }, + }) + .unwrap(), + ) .send() .unwrap(); LocalResponse::RebuiltIndex @@ -470,11 +539,11 @@ fn handle_ft_worker_result(body: &[u8], context: &[u8]) -> anyhow::Result<()> { Ok(()) } -fn handle_eth_sub_event(state: &mut State, event: EthSubEvent) -> anyhow::Result<()> { - let EthSubEvent::Log(log) = event else { +fn handle_eth_sub_event(state: &mut State, event: SubscriptionResult) -> anyhow::Result<()> { + let SubscriptionResult::Log(log) = event else { return Err(anyhow::anyhow!("app store: got non-log event")); }; - state.ingest_listings_contract_event(log) + state.ingest_listings_contract_event(*log) } fn fetch_package_manifest(package: &PackageId) -> anyhow::Result> { diff --git a/kinode/packages/app_store/app_store/src/types.rs b/kinode/packages/app_store/app_store/src/types.rs index 3e9504f6..71abed8d 100644 --- a/kinode/packages/app_store/app_store/src/types.rs +++ b/kinode/packages/app_store/app_store/src/types.rs @@ -1,5 +1,5 @@ -use alloy_rpc_types::Log; use alloy_sol_types::{sol, SolEvent}; +use kinode_process_lib::eth::Log; use kinode_process_lib::kernel_types as kt; use kinode_process_lib::{println, *}; use serde::{Deserialize, Serialize}; From 2449393ca6fee2db3050aa46a102ce60ac1c9582 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Mon, 12 Feb 2024 18:05:08 -0300 Subject: [PATCH 15/26] remove ethers dep --- kinode/Cargo.toml | 2 -- kinode/src/http/client.rs | 2 +- kinode/src/main.rs | 2 +- kinode/src/net/utils.rs | 14 +++++--- kinode/src/register.rs | 68 --------------------------------------- 5 files changed, 11 insertions(+), 77 deletions(-) diff --git a/kinode/Cargo.toml b/kinode/Cargo.toml index ed140848..14284735 100644 --- a/kinode/Cargo.toml +++ b/kinode/Cargo.toml @@ -45,8 +45,6 @@ crossterm = { version = "0.26.1", features = ["event-stream", "bracketed-paste"] dashmap = "5.5.3" digest = "0.10" elliptic-curve = { version = "0.13.8", features = ["ecdh"] } -ethers = "2.0.13" -ethers-providers = "2.0.13" flate2 = "1.0" futures = "0.3" generic-array = "0.14" diff --git a/kinode/src/http/client.rs b/kinode/src/http/client.rs index ca8e86a4..cb693855 100644 --- a/kinode/src/http/client.rs +++ b/kinode/src/http/client.rs @@ -1,8 +1,8 @@ use anyhow::Result; use dashmap::DashMap; -use ethers_providers::StreamExt; use futures::stream::{SplitSink, SplitStream}; use futures::SinkExt; +use futures::StreamExt; use http::header::{HeaderMap, HeaderName, HeaderValue}; use std::collections::HashMap; use std::sync::Arc; diff --git a/kinode/src/main.rs b/kinode/src/main.rs index cd9c9d4a..ddb0205d 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -24,7 +24,7 @@ mod state; mod terminal; mod timer; mod vfs; - +// const EVENT_LOOP_CHANNEL_CAPACITY: usize = 10_000; const EVENT_LOOP_DEBUG_CHANNEL_CAPACITY: usize = 50; const TERMINAL_CHANNEL_CAPACITY: usize = 32; diff --git a/kinode/src/net/utils.rs b/kinode/src/net/utils.rs index c14036e9..69fbe3c8 100644 --- a/kinode/src/net/utils.rs +++ b/kinode/src/net/utils.rs @@ -273,10 +273,12 @@ pub fn validate_routing_request( &signature::ED25519, hex::decode(strip_0x(&their_id.networking_key))?, ); - their_networking_key.verify( - [&routing_request.target, our_name].concat().as_bytes(), - &routing_request.signature, - )?; + their_networking_key + .verify( + [&routing_request.target, our_name].concat().as_bytes(), + &routing_request.signature, + ) + .map_err(|e| anyhow!("their_networking_key.verify failed: {:?}", e))?; if routing_request.target == routing_request.source { return Err(anyhow!("can't route to self")); } @@ -296,7 +298,9 @@ pub fn validate_handshake( &signature::ED25519, hex::decode(strip_0x(&their_id.networking_key))?, ); - their_networking_key.verify(their_static_key, &handshake.signature)?; + their_networking_key + .verify(their_static_key, &handshake.signature) + .map_err(|e| anyhow!("their_networking_key.verify handshake failed: {:?}", e))?; Ok(()) } diff --git a/kinode/src/register.rs b/kinode/src/register.rs index 09f1e920..8b5b5d19 100644 --- a/kinode/src/register.rs +++ b/kinode/src/register.rs @@ -1,6 +1,4 @@ use aes_gcm::aead::KeyInit; -use ethers::prelude::{abigen, namehash, Address as EthAddress, Provider, U256}; -use ethers_providers::Ws; use hmac::Hmac; use jwt::SignWithKey; use ring::rand::SystemRandom; @@ -21,14 +19,6 @@ use warp::{ use crate::keygen; use lib::types::core::*; -// Human readable ABI -abigen!( - KNSRegistry, - r"[ - function ws(uint256 node) external view returns (bytes32,uint32,uint16,bytes32[]) -]" -); - type RegistrationSender = mpsc::Sender<(Identity, Keyfile, Vec)>; pub const KNS_SEPOLIA_ADDRESS: &str = "0x3807fBD692Aa5c96F1D8D7c59a1346a885F40B1C"; @@ -557,61 +547,3 @@ async fn success_response( Ok(response) } - -async fn _networking_info_valid(rpc_url: String, ip: String, ws_port: u16, our: &Identity) -> bool { - // check if Identity for this username has correct networking keys, - // if not, prompt user to reset them. - let Ok(ws_rpc) = Provider::::connect(rpc_url.clone()).await else { - return false; - }; - let Ok(kns_address): Result = KNS_SEPOLIA_ADDRESS.parse() else { - return false; - }; - let contract = KNSRegistry::new(kns_address, ws_rpc.into()); - let node_id: U256 = namehash(&our.name).as_bytes().into(); - let Ok((chain_pubkey, chain_ip, chain_port, chain_routers)) = contract.ws(node_id).call().await - else { - return false; - }; - - // double check that routers match on-chain information - let namehashed_routers: Vec<[u8; 32]> = our - .allowed_routers - .clone() - .into_iter() - .map(|name| { - let hash = namehash(&name); - let mut result = [0u8; 32]; - result.copy_from_slice(hash.as_bytes()); - result - }) - .collect(); - - let current_ip = match _ip_to_number(&ip) { - Ok(ip_num) => ip_num, - Err(_) => { - return false; - } - }; - - let Ok(networking_key_bytes) = _hex_string_to_u8_array(&our.networking_key) else { - return false; - }; - - let address_match = chain_ip == current_ip && chain_port == ws_port; - let routers_match = chain_routers == namehashed_routers; - - let routing_match = if chain_ip == 0 { - routers_match - } else { - address_match - }; - let pubkey_match = chain_pubkey == networking_key_bytes; - - // double check that keys match on-chain information - if !routing_match || !pubkey_match { - return false; - } - - true -} From 2780785e6cae1cf578291fd3c845e3c1b3be28d9 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Tue, 13 Feb 2024 12:06:10 -0300 Subject: [PATCH 16/26] kns & app_store: refactor eth subs --- .../packages/app_store/app_store/Cargo.toml | 2 +- .../packages/app_store/app_store/src/lib.rs | 66 +++---------------- .../kns_indexer/kns_indexer/Cargo.toml | 2 +- .../kns_indexer/kns_indexer/src/lib.rs | 19 ++---- 4 files changed, 15 insertions(+), 74 deletions(-) diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index 5ea0916c..106e8fe6 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -9,7 +9,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1e14a03" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1d60995" } rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 63e1930d..8342896a 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -1,5 +1,6 @@ use kinode_process_lib::eth::{ - get_logs, Address as EthAddress, EthAction, EthMessage, Filter, Params, SubscriptionResult, + get_logs, subscribe, unsubscribe, Address as EthAddress, EthAction, EthMessage, Filter, Params, + SubscriptionResult, }; use kinode_process_lib::http::{bind_http_path, serve_ui, HttpServerRequest}; use kinode_process_lib::kernel_types as kt; @@ -110,14 +111,13 @@ fn init(our: Address) { let mut requested_packages: HashMap = HashMap::new(); - // get past logs, subscribe to new ones. //todotimeout?errors?//future responses? - // // doing manual send also possible + // get past logs, subscribe to new ones. let filter = Filter::new() .address(EthAddress::from_str(&state.contract_address).unwrap()) .from_block(state.last_saved_block - 1) .events(EVENTS); - let logs = get_logs(filter.clone()); + let logs = get_logs(&filter); if let Ok(logs) = logs { for log in logs { @@ -125,35 +125,7 @@ fn init(our: Address) { } } - // sub for future logs too. - Request::new() - .target((&our.node, "eth", "distro", "sys")) - .body( - serde_json::to_vec(&EthMessage { - id: 1, - action: EthAction::SubscribeLogs { - kind: eth::SubscriptionKind::Logs, - params: Params::Logs(Box::new(filter)), - }, - }) - .unwrap(), - ) - .send() - .unwrap(); - - // Request::new() - // .target(("our", "eth", "distro", "sys")) - // .body( - // serde_json::to_vec(&EthMessage { - // id: 1, - // action: EthAction::Request { - // method: "eth_getLogs".to_string(), - // params: serde_json::to_value((filter,)).unwrap(), - // }, - // }) - // .unwrap(), - // ) - // .send(); + subscribe(1, filter).unwrap(); loop { match await_message() { @@ -362,44 +334,22 @@ fn handle_local_request( LocalRequest::RebuildIndex => { *state = State::new(CONTRACT_ADDRESS.to_string()).unwrap(); // kill our old subscription and build a new one. - Request::to(("our", "eth", "distro", "sys")) - .body( - serde_json::to_vec(&EthMessage { - id: 1, - action: EthAction::UnsubscribeLogs, - }) - .unwrap(), - ) - .send() - .unwrap(); + unsubscribe(1).unwrap(); let filter = Filter::new() .address(EthAddress::from_str(&state.contract_address).unwrap()) .from_block(state.last_saved_block - 1) .events(EVENTS); - let logs = get_logs(filter.clone()); + let logs = get_logs(&filter); if let Ok(logs) = logs { for log in logs { state.ingest_listings_contract_event(log); } } + subscribe(1, filter).unwrap(); - Request::new() - .target((&our.node, "eth", "distro", "sys")) - .body( - serde_json::to_vec(&EthMessage { - id: 1, - action: EthAction::SubscribeLogs { - kind: eth::SubscriptionKind::Logs, - params: Params::Logs(Box::new(filter)), - }, - }) - .unwrap(), - ) - .send() - .unwrap(); LocalResponse::RebuiltIndex } } diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index ccc552c5..70653125 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -10,7 +10,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1e14a03" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1d60995" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index a8b37091..389384da 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -3,8 +3,8 @@ use alloy_sol_types::{sol, SolEvent}; use kinode_process_lib::{ await_message, eth::{ - get_block_number, get_logs, Address as EthAddress, BlockNumberOrTag, EthAction, EthMessage, - EthResponse, Filter, Log, Params, SubscriptionKind, SubscriptionResult, + get_block_number, get_logs, subscribe, Address as EthAddress, BlockNumberOrTag, EthAction, + EthMessage, EthResponse, Filter, Log, Params, SubscriptionKind, SubscriptionResult, }, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; @@ -176,10 +176,10 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { "WsUpdate(bytes32,uint16)", "RoutingUpdate(bytes32,bytes32[])", ]); - // std::thread::sleep(std::time::Duration::from_secs(10)); + // if block in state is < current_block, get logs from that part. if state.block < get_block_number()? { - let logs = get_logs(filter.clone())?; + let logs = get_logs(&filter)?; for log in logs { handle_log(&our, &mut state, &log)?; } @@ -194,16 +194,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { set_state(&bincode::serialize(&state)?); - let params = Params::Logs(Box::new(filter)); - let kind = SubscriptionKind::Logs; - - Request::new() - .target((&our.node, "eth", "distro", "sys")) - .body(serde_json::to_vec(&EthMessage { - id: 8, - action: EthAction::SubscribeLogs { kind, params }, - })?) - .send()?; + subscribe(1, filter)?; let mut pending_requests: BTreeMap> = BTreeMap::new(); From d9a6fa8380cfa8d3430fbe57023b455bba2bdd6e Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Tue, 13 Feb 2024 14:41:01 -0300 Subject: [PATCH 17/26] move routers into default json file --- kinode/src/kernel/mod.rs | 72 ++-------------------------------------- kinode/src/main.rs | 24 +++++++++++++- kinode/src/net/mod.rs | 2 +- 3 files changed, 26 insertions(+), 72 deletions(-) diff --git a/kinode/src/kernel/mod.rs b/kinode/src/kernel/mod.rs index 23fd5fe4..8ca9f602 100644 --- a/kinode/src/kernel/mod.rs +++ b/kinode/src/kernel/mod.rs @@ -9,24 +9,6 @@ use tokio::sync::mpsc; use tokio::task::JoinHandle; use wasmtime::{Config, Engine, WasmBacktraceDetails}; -/// TEMP IMPORT, crate::net::????? -/// Must be parsed from message pack vector. -#[derive(Clone, Debug, Serialize, Deserialize)] -pub enum NetActions { - KnsUpdate(KnsUpdate), - KnsBatchUpdate(Vec), -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct KnsUpdate { - pub name: String, // actual username / domain name - pub owner: String, - pub node: String, // hex namehash of node - pub public_key: String, - pub ip: String, - pub port: u16, - pub routers: Vec, -} use lib::types::core::{self as t, STATE_PROCESS_ID, VFS_PROCESS_ID}; /// Manipulate a single process. @@ -690,6 +672,7 @@ pub async fn kernel( home_directory_path: String, contract_address: String, runtime_extensions: Vec<(t::ProcessId, t::MessageSender, bool)>, + routers: Vec, ) -> Result<()> { let mut config = Config::new(); config.cache_config_load_default().unwrap(); @@ -846,57 +829,6 @@ pub async fn kernel( .await .expect("fatal: kernel event loop died"); // sending hard coded routers into networking for bootstrapped rpc - let kns_updates = vec![ - KnsUpdate { - name: "default-router-1.os".to_string(), - owner: "who?".to_string(), - node: "0x".to_string(), - public_key: "0xb1b1cf23c89f651aac3e5fd4decb04aa177ab0ec8ce5f1d3877b90bb6f5779db" - .to_string(), - ip: "147.135.114.167".to_string(), - port: 9002, - routers: vec![], - }, - KnsUpdate { - name: "default-router-2.os".to_string(), - owner: "who?".to_string(), - node: "0x".to_string(), - public_key: "0xab9f1a996db3a4e1dbcd31d765daedeb3af9af4f570c0968463b5be3a7d1e992" - .to_string(), - ip: "147.135.114.167".to_string(), - port: 9003, - routers: vec![], - }, - KnsUpdate { - name: "default-router-3.os".to_string(), - owner: "who?".to_string(), - node: "0x".to_string(), - public_key: "0x536e30785e64dd0349a697285af365b5ed7c4d300010139261cfc4dbdd5b254b" - .to_string(), - ip: "147.135.114.167".to_string(), - port: 9004, - routers: vec![], - }, - // I want to use ben.eth - // --rpc-node ben.eth - // first index and then change - // no-rpc - // settings -> rpc from router-01 -> ben.eth - KnsUpdate { - name: "jugodenaranja.os".to_string(), - owner: "who?".to_string(), - node: "0x".to_string(), - public_key: "0xf8a3e9667756306a0a25894a8cfe053dc9e7f34e6a61b8d65e92b79f77e05dff" - .to_string(), - ip: "this should not be parsed.".to_string(), - port: 0, - routers: vec![ - "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d".to_string(), - "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458".to_string(), - "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a".to_string(), - ], - }, - ]; send_to_loop .send(t::KernelMessage { id: rand::random(), @@ -912,7 +844,7 @@ pub async fn kernel( message: t::Message::Request(t::Request { inherit: false, expects_response: None, - body: rmp_serde::to_vec(&NetActions::KnsBatchUpdate(kns_updates)).unwrap(), + body: rmp_serde::to_vec(&crate::net::NetActions::KnsBatchUpdate(routers)).unwrap(), metadata: None, capabilities: vec![], }), diff --git a/kinode/src/main.rs b/kinode/src/main.rs index ddb0205d..a0feb761 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -24,7 +24,7 @@ mod state; mod terminal; mod timer; mod vfs; -// + const EVENT_LOOP_CHANNEL_CAPACITY: usize = 10_000; const EVENT_LOOP_DEBUG_CHANNEL_CAPACITY: usize = 50; const TERMINAL_CHANNEL_CAPACITY: usize = 32; @@ -45,6 +45,9 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); #[cfg(not(feature = "simulation-mode"))] const REVEAL_IP: bool = true; +/// default routers as a fallbac +const DEFAULT_ROUTERS: &str = include_str!("../default_routers.json"); + async fn serve_register_fe( home_directory_path: &str, our_ip: String, @@ -384,6 +387,24 @@ async fn main() { } }; + // read in default routers .json file + type KnsUpdate = crate::net::KnsUpdate; + let routers: Vec = + match fs::read_to_string(format!("{}/.routers", home_directory_path)).await { + Ok(contents) => serde_json::from_str(&contents).unwrap(), + Err(_) => { + let routers: Vec = serde_json::from_str(DEFAULT_ROUTERS).unwrap(); + // should we dump them into a .routers file? + // fs::write( + // format!("{}/.routers", home_directory_path), + // serde_json::to_string(&routers).unwrap(), + // ) + // .await + // .unwrap(); + routers + } + }; + // the boolean flag determines whether the runtime module is *public* or not, // where public means that any process can always message it. #[allow(unused_mut)] @@ -464,6 +485,7 @@ async fn main() { home_directory_path.clone(), contract_address.to_string(), runtime_extensions, + routers, )); #[cfg(not(feature = "simulation-mode"))] tasks.spawn(net::networking( diff --git a/kinode/src/net/mod.rs b/kinode/src/net/mod.rs index 6e733903..a565759c 100644 --- a/kinode/src/net/mod.rs +++ b/kinode/src/net/mod.rs @@ -19,7 +19,7 @@ mod types; #[cfg(not(feature = "simulation-mode"))] mod utils; #[cfg(not(feature = "simulation-mode"))] -use crate::net::{types::*, utils::*}; +pub use crate::net::{types::*, utils::*}; #[cfg(not(feature = "simulation-mode"))] use lib::types::core::*; From a1373d2f965b5b218f3778519fdcc4d41c50d997 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Tue, 13 Feb 2024 15:22:43 -0300 Subject: [PATCH 18/26] eth types slight update --- .../packages/app_store/app_store/Cargo.toml | 2 +- .../packages/app_store/app_store/src/lib.rs | 10 +++---- .../kns_indexer/kns_indexer/Cargo.toml | 2 +- .../kns_indexer/kns_indexer/src/lib.rs | 15 ++++------- kinode/src/eth/provider.rs | 25 +++++++++-------- lib/src/eth.rs | 27 ++++++++----------- 6 files changed, 34 insertions(+), 47 deletions(-) diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index 106e8fe6..d8e4d866 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -9,7 +9,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1d60995" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "9231881" } rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 8342896a..b923d5d6 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -1,5 +1,5 @@ use kinode_process_lib::eth::{ - get_logs, subscribe, unsubscribe, Address as EthAddress, EthAction, EthMessage, Filter, Params, + get_logs, subscribe, unsubscribe, Address as EthAddress, EthAction, EthSub, Filter, Params, SubscriptionResult, }; use kinode_process_lib::http::{bind_http_path, serve_ui, HttpServerRequest}; @@ -59,7 +59,7 @@ pub enum Req { RemoteRequest(RemoteRequest), FTWorkerCommand(FTWorkerCommand), FTWorkerResult(FTWorkerResult), - Eth(EthMessage), + Eth(EthSub), Http(HttpServerRequest), } @@ -185,13 +185,11 @@ fn handle_message( Req::FTWorkerResult(r) => { println!("app store: got weird ft_worker result: {r:?}"); } - Req::Eth(e) => { + Req::Eth(sub) => { if source.node() != our.node() || source.process != "eth:distro:sys" { return Err(anyhow::anyhow!("eth sub event from weird addr: {source}")); } - if let EthAction::Sub { result } = e.action { - handle_eth_sub_event(&mut state, result)?; - } + handle_eth_sub_event(&mut state, sub.result)?; } Req::Http(incoming) => { if source.node() != our.node() diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index 70653125..664b7df3 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -10,7 +10,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "1d60995" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "9231881" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index 389384da..19898f86 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -3,8 +3,8 @@ use alloy_sol_types::{sol, SolEvent}; use kinode_process_lib::{ await_message, eth::{ - get_block_number, get_logs, subscribe, Address as EthAddress, BlockNumberOrTag, EthAction, - EthMessage, EthResponse, Filter, Log, Params, SubscriptionKind, SubscriptionResult, + get_block_number, get_logs, subscribe, Address as EthAddress, BlockNumberOrTag, EthSub, + Filter, Log, SubscriptionResult, }, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; @@ -253,17 +253,12 @@ fn handle_eth_message( pending_requests: &mut BTreeMap>, body: &[u8], ) -> anyhow::Result<()> { - let Ok(res) = serde_json::from_slice::(body) else { + let Ok(res) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; - match res.action { - EthAction::Sub { result } => { - if let SubscriptionResult::Log(log) = result { - handle_log(our, state, &log)?; - } - } - _ => {} + if let SubscriptionResult::Log(log) = res.result { + handle_log(our, state, &log)?; } // check the pending_requests btreemap to see if there are any requests that diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index 8f8639de..d4c50acb 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -112,7 +112,7 @@ async fn handle_request( }; if let Some(provider) = provider.as_ref() { - let ethmsg = serde_json::from_slice::(&req.body).map_err(|e| { + let action = serde_json::from_slice::(&req.body).map_err(|e| { EthError::InvalidMethod(format!("eth: failed to deserialize request: {:?}", e)) })?; @@ -121,9 +121,13 @@ async fn handle_request( } // we might want some of these in payloads.. sub items? - let return_body: EthResponse = match ethmsg.action { - EthAction::SubscribeLogs { kind, params } => { - let sub_id = (km.target.process.clone(), ethmsg.id); + let return_body: EthResponse = match action { + EthAction::SubscribeLogs { + sub_id, + kind, + params, + } => { + let sub_id = (km.target.process.clone(), sub_id); let kind = serde_json::to_value(&kind).unwrap(); let params = serde_json::to_value(¶ms).unwrap(); @@ -151,8 +155,8 @@ async fn handle_request( connections.insert(sub_id, handle); EthResponse::Ok } - EthAction::UnsubscribeLogs => { - let sub_id = (km.target.process.clone(), ethmsg.id); + EthAction::UnsubscribeLogs(sub_id) => { + let sub_id = (km.target.process.clone(), sub_id); let handle = connections .remove(&sub_id) .ok_or(EthError::SubscriptionNotFound)?; @@ -171,11 +175,6 @@ async fn handle_request( EthResponse::Response { value: response } } - EthAction::Sub { .. } => { - return Err(EthError::InvalidMethod( - "eth: provider doesn't accept sub resultss".to_string(), - )) - } }; // todo: fix km.clone() and metadata.clone() @@ -265,9 +264,9 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&EthMessage { + body: serde_json::to_vec(&EthSub { id: sub_id, - action: EthAction::Sub { result: event }, + result: event, }) .unwrap(), metadata: None, diff --git a/lib/src/eth.rs b/lib/src/eth.rs index 696af2e9..b91af0f5 100644 --- a/lib/src/eth.rs +++ b/lib/src/eth.rs @@ -1,16 +1,6 @@ use alloy_rpc_types::pubsub::{Params, SubscriptionKind, SubscriptionResult}; use serde::{Deserialize, Serialize}; -/// The Message type that can be made to eth:distro:sys. The id is used to match the response, -/// if you're not doing send_and_await. -/// -/// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`. -#[derive(Debug, Serialize, Deserialize)] -pub struct EthMessage { - pub id: u64, - pub action: EthAction, -} - /// The Action and Request type that can be made to eth:distro:sys. /// /// Will be serialized and deserialized using `serde_json::to_vec` and `serde_json::from_slice`. @@ -19,20 +9,28 @@ pub enum EthAction { /// Subscribe to logs with a custom filter. ID is to be used to unsubscribe. /// Logs come in as alloy_rpc_types::pubsub::SubscriptionResults SubscribeLogs { + sub_id: u64, kind: SubscriptionKind, params: Params, }, /// Kill a SubscribeLogs subscription of a given ID, to stop getting updates. - UnsubscribeLogs, + UnsubscribeLogs(u64), /// Raw request. Used by kinode_process_lib. Request { method: String, params: serde_json::Value, }, - /// Incoming subscription update. - Sub { result: SubscriptionResult }, +} +/// Incoming subscription update. +#[derive(Debug, Serialize, Deserialize)] +pub struct EthSub { + pub id: u64, + pub result: SubscriptionResult, } +/// The Response type which a process will get from requesting with an [`EthAction`] will be +/// of the form `Result<(), EthError>`, serialized and deserialized using `serde_json::to_vec` +/// and `serde_json::from_slice`. #[derive(Debug, Serialize, Deserialize)] pub enum EthResponse { Ok, @@ -40,9 +38,6 @@ pub enum EthResponse { Err(EthError), } -/// The Response type which a process will get from requesting with an [`EthMessage`] will be -/// of the form `Result<(), EthError>`, serialized and deserialized using `serde_json::to_vec` -/// and `serde_json::from_slice`. #[derive(Debug, Serialize, Deserialize)] pub enum EthError { /// Underlying transport error From 2eea02e34af946bb4e4543b5c63fd22d4b74d01b Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Wed, 14 Feb 2024 13:39:00 -0300 Subject: [PATCH 19/26] eth: passthrough through local --- kinode/src/eth/provider.rs | 280 ++++++++++++++++++++++++++++--------- kinode/src/main.rs | 7 - 2 files changed, 211 insertions(+), 76 deletions(-) diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index d4c50acb..d83aa8eb 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -1,3 +1,4 @@ +use alloy_providers::provider::Provider; use alloy_pubsub::{PubSubFrontend, RawSubscription}; use alloy_rpc_client::ClientBuilder; use alloy_rpc_types::pubsub::SubscriptionResult; @@ -6,6 +7,7 @@ use anyhow::Result; use dashmap::DashMap; use lib::types::core::*; use lib::types::eth::*; +use std::str::FromStr; use std::sync::Arc; use tokio::task::JoinHandle; use url::Url; @@ -48,7 +50,7 @@ pub async fn provider( }; let client = ClientBuilder::default().ws(connector).await?; - Some(alloy_providers::provider::Provider::new_with_client(client)) + Some(Provider::new_with_client(client)) } else { None }; @@ -59,10 +61,6 @@ pub async fn provider( let connections: DashMap<(ProcessId, u64), JoinHandle>> = DashMap::new(); let connections = Arc::new(connections); - // passthrough responses - let responses: DashMap = DashMap::new(); - let responses = Arc::new(responses); - // add whitelist, logic in provider middleware? let public = Arc::new(public); @@ -72,17 +70,15 @@ pub async fn provider( let send_to_loop = send_to_loop.clone(); let provider = provider.clone(); let connections = connections.clone(); - let responses = responses.clone(); let public = public.clone(); tokio::spawn(async move { - if let Err(e) = handle_request( + if let Err(e) = handle_message( &our, &km, &send_to_loop, provider.clone(), connections.clone(), - responses.clone(), public.clone(), ) .await @@ -96,13 +92,171 @@ pub async fn provider( Err(anyhow::anyhow!("eth: fatal: message receiver closed!")) } -async fn handle_request( +async fn handle_message( our: &str, km: &KernelMessage, send_to_loop: &MessageSender, - provider: Arc>>, + provider: Arc>>, + connections: Arc>>>, + public: Arc, +) -> Result<(), EthError> { + match &km.message { + Message::Request(req) => { + if km.source.node == our { + if let Some(provider) = provider.as_ref() { + handle_local_request(our, km, send_to_loop, provider, connections, public) + .await? + } else { + // we have no provider, let's send this request to someone who has one. + let request = KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: Address { + node: "jugodenaranja.os".to_string(), + process: ETH_PROCESS_ID.clone(), + }, + rsvp: Some(km.source.clone()), + message: Message::Request(req.clone()), + lazy_load_blob: None, + }; + + let _ = send_to_loop.send(request).await; + } + } else { + // either someone asking us for rpc, or we are passing through a sub event. + handle_remote_request(our, km, send_to_loop, provider, connections, public).await? + } + } + Message::Response(_) => { + // handle passthrough responses, send to rsvp. + if km.source.process == ProcessId::from_str("eth:distro:sys").unwrap() { + if let Some(rsvp) = &km.rsvp { + let _ = send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: rsvp.clone(), + rsvp: None, + message: km.message.clone(), + lazy_load_blob: None, + }) + .await; + } + } + } + } + Ok(()) +} + +async fn handle_local_request( + our: &str, + km: &KernelMessage, + send_to_loop: &MessageSender, + provider: &Provider, + connections: Arc>>>, + public: Arc, +) -> Result<(), EthError> { + let Message::Request(req) = &km.message else { + return Err(EthError::InvalidMethod( + "eth: only accepts requests".to_string(), + )); + }; + let action = serde_json::from_slice::(&req.body).map_err(|e| { + EthError::InvalidMethod(format!("eth: failed to deserialize request: {:?}", e)) + })?; + + // we might want some of these in payloads.. sub items? + let return_body: EthResponse = match action { + EthAction::SubscribeLogs { + sub_id, + kind, + params, + } => { + let sub_id = (km.target.process.clone(), sub_id); + + let kind = serde_json::to_value(&kind).unwrap(); + let params = serde_json::to_value(¶ms).unwrap(); + + let id = provider + .inner() + .prepare("eth_subscribe", [kind, params]) + .await + .map_err(|e| EthError::TransportError(e.to_string()))?; + + let rx = provider.inner().get_raw_subscription(id).await; + let handle = tokio::spawn(handle_subscription_stream( + our.to_string(), + sub_id.1.clone(), + rx, + km.source.clone(), + km.rsvp.clone(), + send_to_loop.clone(), + )); + + connections.insert(sub_id, handle); + EthResponse::Ok + } + EthAction::UnsubscribeLogs(sub_id) => { + let sub_id = (km.target.process.clone(), sub_id); + let handle = connections + .remove(&sub_id) + .ok_or(EthError::SubscriptionNotFound)?; + + handle.1.abort(); + EthResponse::Ok + } + EthAction::Request { method, params } => { + let method = to_static_str(&method).ok_or(EthError::InvalidMethod(method))?; + + let response: serde_json::Value = provider + .inner() + .prepare(method, params) + .await + .map_err(|e| EthError::TransportError(e.to_string()))?; + println!("got a normal request! "); + EthResponse::Response { value: response } + } + }; + + let response = KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: km.source.clone(), + rsvp: None, + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&return_body).unwrap(), + metadata: req.metadata.clone(), + capabilities: vec![], + }, + None, + )), + lazy_load_blob: None, + }; + + let _ = send_to_loop.send(response).await; + + Ok(()) +} + +// here we are either processing another nodes request. +// or we are passing through an ethSub Request.. +async fn handle_remote_request( + our: &str, + km: &KernelMessage, + send_to_loop: &MessageSender, + provider: Arc>>, connections: Arc>>>, - responses: Arc>, public: Arc, ) -> Result<(), EthError> { let Message::Request(req) = &km.message else { @@ -112,15 +266,17 @@ async fn handle_request( }; if let Some(provider) = provider.as_ref() { + // we need some sort of agreement perhaps on rpc providing. + // even with an agreement, fake ethsubevents could be sent to us. + // light clients could verify blocks perhaps... + if !*public { + return Err(EthError::PermissionDenied("not on the list.".to_string())); + } + let action = serde_json::from_slice::(&req.body).map_err(|e| { EthError::InvalidMethod(format!("eth: failed to deserialize request: {:?}", e)) })?; - if !*public && km.source.node != our { - return Err(EthError::PermissionDenied("not on the list.".to_string())); - } - - // we might want some of these in payloads.. sub items? let return_body: EthResponse = match action { EthAction::SubscribeLogs { sub_id, @@ -138,17 +294,13 @@ async fn handle_request( .await .map_err(|e| EthError::TransportError(e.to_string()))?; - let target = km.rsvp.clone().unwrap_or_else(|| Address { - node: our.to_string(), - process: km.source.process.clone(), - }); - let rx = provider.inner().get_raw_subscription(id).await; let handle = tokio::spawn(handle_subscription_stream( our.to_string(), sub_id.1.clone(), rx, - target, + km.target.clone(), + km.rsvp.clone(), send_to_loop.clone(), )); @@ -177,58 +329,48 @@ async fn handle_request( } }; - // todo: fix km.clone() and metadata.clone() - if let Some(target) = km.clone().rsvp.or_else(|| { - req.expects_response.map(|_| Address { - node: our.to_string(), - process: km.source.process.clone(), - }) - }) { - let response = KernelMessage { - id: km.id, - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: target.clone(), - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - body: serde_json::to_vec(&return_body).unwrap(), - metadata: req.metadata.clone(), - capabilities: vec![], - }, - None, - )), - lazy_load_blob: None, - }; - - // Send the response, handling potential errors appropriately - let _ = send_to_loop.send(response).await; - }; - } else { - // passthrough - // if node == our, forward to provider - // hoping that rsvp can fix the rest. - let request = KernelMessage { + let response = KernelMessage { id: km.id, source: Address { node: our.to_string(), process: ETH_PROCESS_ID.clone(), }, - target: Address { - node: "jugodenaranja.os".to_string(), - process: ETH_PROCESS_ID.clone(), - }, - rsvp: Some(km.source.clone()), - message: Message::Request(req.clone()), + target: km.source.clone(), + rsvp: km.rsvp.clone(), + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&return_body).unwrap(), + metadata: req.metadata.clone(), + capabilities: vec![], + }, + None, + )), lazy_load_blob: None, }; - let _ = send_to_loop.send(request).await; + let _ = send_to_loop.send(response).await; + } else { + // We do not have a provider, this is a reply for a request made by us. + if let Ok(eth_sub) = serde_json::from_slice::(&req.body) { + // forward... + if let Some(target) = km.rsvp.clone() { + let _ = send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: target, + rsvp: None, + message: Message::Request(req.clone()), + lazy_load_blob: None, + }) + .await; + } + } } - Ok(()) } @@ -240,15 +382,15 @@ async fn handle_subscription_stream( sub_id: u64, mut rx: RawSubscription, target: Address, + rsvp: Option
, send_to_loop: MessageSender, ) -> Result<(), EthError> { match rx.recv().await { Err(e) => { - println!("got an error from the subscription stream: {:?}", e); - // TODO should we stop the subscription here? - // return Err(EthError::TransportError??(format!("{:?}", e))); + return Err(EthError::SubscriptionClosed(sub_id))?; } Ok(value) => { + // this should not return in case of one failed event? let event: SubscriptionResult = serde_json::from_str(value.get()).map_err(|_| { EthError::RpcError("eth: failed to deserialize subscription result".to_string()) })?; @@ -260,7 +402,7 @@ async fn handle_subscription_stream( process: ETH_PROCESS_ID.clone(), }, target: target.clone(), - rsvp: None, + rsvp: rsvp.clone(), message: Message::Request(Request { inherit: false, expects_response: None, diff --git a/kinode/src/main.rs b/kinode/src/main.rs index a0feb761..c960bab3 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -394,13 +394,6 @@ async fn main() { Ok(contents) => serde_json::from_str(&contents).unwrap(), Err(_) => { let routers: Vec = serde_json::from_str(DEFAULT_ROUTERS).unwrap(); - // should we dump them into a .routers file? - // fs::write( - // format!("{}/.routers", home_directory_path), - // serde_json::to_string(&routers).unwrap(), - // ) - // .await - // .unwrap(); routers } }; From 091ca7fc8368566782047be1316ded04b6312b43 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Wed, 14 Feb 2024 16:04:05 -0300 Subject: [PATCH 20/26] eth: add --rpcnode flag and handlers --- kinode/default_routers.json | 42 ++++++++++++ kinode/src/eth/provider.rs | 131 +++++++++++++++++++++--------------- kinode/src/main.rs | 72 ++++++++++++++------ lib/src/eth.rs | 5 ++ 4 files changed, 175 insertions(+), 75 deletions(-) create mode 100644 kinode/default_routers.json diff --git a/kinode/default_routers.json b/kinode/default_routers.json new file mode 100644 index 00000000..bfaaba15 --- /dev/null +++ b/kinode/default_routers.json @@ -0,0 +1,42 @@ +[ + { + "name": "default-router-1.os", + "owner": "dr. who", + "node": "0x", + "public_key": "0xb1b1cf23c89f651aac3e5fd4decb04aa177ab0ec8ce5f1d3877b90bb6f5779db", + "ip": "147.135.114.167", + "port": 9002, + "routers": [] + }, + { + "name": "default-router-2.os", + "owner": "foo", + "node": "0x", + "public_key": "0xab9f1a996db3a4e1dbcd31d765daedeb3af9af4f570c0968463b5be3a7d1e992", + "ip": "147.135.114.167", + "port": 9003, + "routers": [] + }, + { + "name": "default-router-s3.os", + "owner": "bar", + "node": "0x", + "public_key": "0x536e30785e64dd0349a697285af365b5ed7c4d300010139261cfc4dbdd5b254b", + "ip": "147.135.114.167", + "port": 9004, + "routers": [] + }, + { + "name": "jugodenaranja.os", + "owner": "ass", + "node": "0x", + "public_key": "0xf8a3e9667756306a0a25894a8cfe053dc9e7f34e6a61b8d65e92b79f77e05dff", + "ip": "0.0.0.0", + "port": 0, + "routers": [ + "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d", + "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458", + "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a" + ] + } +] \ No newline at end of file diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index d83aa8eb..fc00a249 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -12,14 +12,21 @@ use std::sync::Arc; use tokio::task::JoinHandle; use url::Url; +/// Provider config. Can currently be a node or a ws provider instance. +/// Future: add chainId configs, several nodes and fallbacks. +pub enum ProviderConfig { + Node(String), + Provider(Provider), +} + /// The ETH provider runtime process is responsible for connecting to one or more ETH RPC providers /// and using them to service indexing requests from other apps. This could also be done by a wasm /// app, but in the future, this process will hopefully expand in scope to perform more complex /// indexing and ETH node responsibilities. pub async fn provider( our: String, - rpc_url: Option, // if None, bootstrap from router, can set settings later? - public: bool, // todo, whitelists etc. + provider_node: ProviderInput, + public: bool, send_to_loop: MessageSender, mut recv_in_client: MessageReceiver, _print_tx: PrintSender, @@ -28,34 +35,32 @@ pub async fn provider( // Initialize the provider conditionally based on rpc_url // Todo: make provider support multiple transports, one direct and another passthrough. - let provider = if let Some(rpc_url) = rpc_url { - // If rpc_url is Some, proceed with URL parsing and client setup - match Url::parse(&rpc_url)?.scheme() { - "http" | "https" => { - return Err(anyhow::anyhow!( - "eth: you provided a `http(s)://` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" - )); - } - "ws" | "wss" => {} - s => { - return Err(anyhow::anyhow!( - "eth: you provided a `{s:?}` Ethereum RPC, but only `ws(s)://` is supported. Please try again with a `ws(s)://` provider" - )); + let provider_config = match provider_node { + ProviderInput::WS(rpc_url) => { + // Validate and parse the WebSocket URL + match Url::parse(&rpc_url)?.scheme() { + "ws" | "wss" => { + let connector = WsConnect { + url: rpc_url, + auth: None, + }; + let client = ClientBuilder::default().ws(connector).await?; + ProviderConfig::Provider(Provider::new_with_client(client)) + } + _ => { + return Err(anyhow::anyhow!( + "Only `ws://` or `wss://` URLs are supported." + )) + } } } - - let connector = WsConnect { - url: rpc_url, - auth: None, - }; - - let client = ClientBuilder::default().ws(connector).await?; - Some(Provider::new_with_client(client)) - } else { - None + ProviderInput::Node(node_id) => { + // Directly use the node ID + ProviderConfig::Node(node_id) + } }; - let provider = Arc::new(provider); + let provider_config = Arc::new(provider_config); // handles of longrunning subscriptions. let connections: DashMap<(ProcessId, u64), JoinHandle>> = DashMap::new(); @@ -68,7 +73,7 @@ pub async fn provider( // clone Arcs let our = our.clone(); let send_to_loop = send_to_loop.clone(); - let provider = provider.clone(); + let provider_config = provider_config.clone(); let connections = connections.clone(); let public = public.clone(); @@ -77,7 +82,7 @@ pub async fn provider( &our, &km, &send_to_loop, - provider.clone(), + provider_config.clone(), connections.clone(), public.clone(), ) @@ -96,38 +101,54 @@ async fn handle_message( our: &str, km: &KernelMessage, send_to_loop: &MessageSender, - provider: Arc>>, + provider_config: Arc, connections: Arc>>>, public: Arc, ) -> Result<(), EthError> { match &km.message { Message::Request(req) => { - if km.source.node == our { - if let Some(provider) = provider.as_ref() { - handle_local_request(our, km, send_to_loop, provider, connections, public) - .await? - } else { - // we have no provider, let's send this request to someone who has one. - let request = KernelMessage { - id: km.id, - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: Address { - node: "jugodenaranja.os".to_string(), - process: ETH_PROCESS_ID.clone(), - }, - rsvp: Some(km.source.clone()), - message: Message::Request(req.clone()), - lazy_load_blob: None, - }; + match &*provider_config { + ProviderConfig::Node(node) => { + if km.source.node == our { + // we have no provider, let's send this request to someone who has one. + let request = KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: Address { + node: "jugodenaranja.os".to_string(), + process: ETH_PROCESS_ID.clone(), + }, + rsvp: Some(km.source.clone()), + message: Message::Request(req.clone()), + lazy_load_blob: None, + }; - let _ = send_to_loop.send(request).await; + let _ = send_to_loop.send(request).await; + } else { + // either someone asking us for rpc, or we are passing through a sub event. + handle_remote_request(our, km, send_to_loop, None, connections, public) + .await? + } + } + ProviderConfig::Provider(provider) => { + if km.source.node == our { + handle_local_request(our, km, send_to_loop, &provider, connections, public) + .await? + } else { + handle_remote_request( + our, + km, + send_to_loop, + Some(provider), + connections, + public, + ) + .await? + } } - } else { - // either someone asking us for rpc, or we are passing through a sub event. - handle_remote_request(our, km, send_to_loop, provider, connections, public).await? } } Message::Response(_) => { @@ -255,7 +276,7 @@ async fn handle_remote_request( our: &str, km: &KernelMessage, send_to_loop: &MessageSender, - provider: Arc>>, + provider: Option<&Provider>, connections: Arc>>>, public: Arc, ) -> Result<(), EthError> { @@ -265,7 +286,7 @@ async fn handle_remote_request( )); }; - if let Some(provider) = provider.as_ref() { + if let Some(provider) = provider { // we need some sort of agreement perhaps on rpc providing. // even with an agreement, fake ethsubevents could be sent to us. // light clients could verify blocks perhaps... diff --git a/kinode/src/main.rs b/kinode/src/main.rs index c960bab3..aaa37515 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -2,6 +2,7 @@ use anyhow::Result; use clap::{arg, value_parser, Command}; +use rand::seq::SliceRandom; use std::env; use std::sync::Arc; use tokio::sync::{mpsc, oneshot}; @@ -111,14 +112,14 @@ async fn main() { ); #[cfg(not(feature = "simulation-mode"))] - let app = - app.arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)").required(false)); - - let app = app.arg( - arg!(--public "If set, allow rpc passthrough") - .default_value("false") - .value_parser(value_parser!(bool)), - ); + let app = app + .arg(arg!(--rpc "Ethereum RPC endpoint (must be wss://)").required(false)) + .arg(arg!(--rpcnode "RPC node provider must be a valid address").required(false)) + .arg( + arg!(--public "If set, allow rpc passthrough") + .default_value("false") + .value_parser(value_parser!(bool)), + ); #[cfg(feature = "simulation-mode")] let app = app @@ -177,8 +178,50 @@ async fn main() { } } + // default routers + type KnsUpdate = crate::net::KnsUpdate; + let routers: Vec = + match fs::read_to_string(format!("{}/.routers", home_directory_path)).await { + Ok(contents) => serde_json::from_str(&contents).unwrap(), + Err(_) => { + let routers: Vec = serde_json::from_str(DEFAULT_ROUTERS).unwrap(); + routers + } + }; + + println!("wtf here are the matches: {:?}", matches); #[cfg(not(feature = "simulation-mode"))] let (rpc_url, is_detached) = (matches.get_one::("rpc").cloned(), false); + #[cfg(not(feature = "simulation-mode"))] + let (rpc_node, _is_detached) = (matches.get_one::("rpcnode").cloned(), false); + + type ProviderInput = lib::eth::ProviderInput; + let eth_provider: ProviderInput; + + match (rpc_url, rpc_node) { + (Some(url), Some(_)) => { + println!("passed both node and url for rpc, using url."); + eth_provider = ProviderInput::WS(url); + } + (Some(url), None) => { + eth_provider = ProviderInput::WS(url); + } + (None, Some(node)) => { + println!("trying to use node for rpc: {}", node); + eth_provider = ProviderInput::Node(node); + } + (None, None) => { + let random_router = routers.choose(&mut rand::thread_rng()).unwrap(); + let default_router = random_router.name.clone(); + + println!( + "no rpc provided, using a default router: {}", + default_router + ); + + eth_provider = ProviderInput::Node(default_router); + } + } #[cfg(feature = "simulation-mode")] let (rpc_url, password, network_router_port, fake_node_name, is_detached) = ( @@ -387,17 +430,6 @@ async fn main() { } }; - // read in default routers .json file - type KnsUpdate = crate::net::KnsUpdate; - let routers: Vec = - match fs::read_to_string(format!("{}/.routers", home_directory_path)).await { - Ok(contents) => serde_json::from_str(&contents).unwrap(), - Err(_) => { - let routers: Vec = serde_json::from_str(DEFAULT_ROUTERS).unwrap(); - routers - } - }; - // the boolean flag determines whether the runtime module is *public* or not, // where public means that any process can always message it. #[allow(unused_mut)] @@ -550,7 +582,7 @@ async fn main() { #[cfg(not(feature = "simulation-mode"))] tasks.spawn(eth::provider::provider( our.name.clone(), - rpc_url.clone(), + eth_provider, public, kernel_message_sender.clone(), eth_provider_receiver, diff --git a/lib/src/eth.rs b/lib/src/eth.rs index b91af0f5..041bfec2 100644 --- a/lib/src/eth.rs +++ b/lib/src/eth.rs @@ -90,3 +90,8 @@ pub fn to_static_str(method: &str) -> Option<&'static str> { _ => None, } } + +pub enum ProviderInput { + WS(String), + Node(String), +} From b2b8e5d8ccc15d758d055bb9af586dd45136a39b Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Wed, 14 Feb 2024 16:21:47 -0300 Subject: [PATCH 21/26] print remove --- kinode/packages/app_store/app_store/src/types.rs | 1 + kinode/src/eth/provider.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/kinode/packages/app_store/app_store/src/types.rs b/kinode/packages/app_store/app_store/src/types.rs index c76d6191..18ca512b 100644 --- a/kinode/packages/app_store/app_store/src/types.rs +++ b/kinode/packages/app_store/app_store/src/types.rs @@ -1,3 +1,4 @@ +use crate::LocalRequest; use alloy_sol_types::{sol, SolEvent}; use kinode_process_lib::eth::Log; use kinode_process_lib::kernel_types as kt; diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index fc00a249..f05ea989 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -240,7 +240,6 @@ async fn handle_local_request( .prepare(method, params) .await .map_err(|e| EthError::TransportError(e.to_string()))?; - println!("got a normal request! "); EthResponse::Response { value: response } } }; From bcd68fdf6b4ab44bd08867042f587337e8db1112 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 15 Feb 2024 15:11:32 -0300 Subject: [PATCH 22/26] cli printfix2 --- kinode/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kinode/src/main.rs b/kinode/src/main.rs index aaa37515..b080f07c 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -189,7 +189,6 @@ async fn main() { } }; - println!("wtf here are the matches: {:?}", matches); #[cfg(not(feature = "simulation-mode"))] let (rpc_url, is_detached) = (matches.get_one::("rpc").cloned(), false); #[cfg(not(feature = "simulation-mode"))] @@ -207,7 +206,7 @@ async fn main() { eth_provider = ProviderInput::WS(url); } (None, Some(node)) => { - println!("trying to use node for rpc: {}", node); + println!("trying to use remote node for rpc: {}", node); eth_provider = ProviderInput::Node(node); } (None, None) => { From 9d9ea85d2fac0b0dd3d8ec83dcf6478365f60714 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 15 Feb 2024 16:42:32 -0300 Subject: [PATCH 23/26] eth: review1 --- ...lt_routers.json => default_providers.json} | 13 -------- kinode/packages/kns_indexer/pkg/manifest.json | 2 +- kinode/src/eth/provider.rs | 2 +- kinode/src/kernel/mod.rs | 9 ++++-- kinode/src/main.rs | 31 +++++++++---------- lib/src/eth.rs | 5 +-- 6 files changed, 25 insertions(+), 37 deletions(-) rename kinode/{default_routers.json => default_providers.json} (61%) diff --git a/kinode/default_routers.json b/kinode/default_providers.json similarity index 61% rename from kinode/default_routers.json rename to kinode/default_providers.json index bfaaba15..964698df 100644 --- a/kinode/default_routers.json +++ b/kinode/default_providers.json @@ -25,18 +25,5 @@ "ip": "147.135.114.167", "port": 9004, "routers": [] - }, - { - "name": "jugodenaranja.os", - "owner": "ass", - "node": "0x", - "public_key": "0xf8a3e9667756306a0a25894a8cfe053dc9e7f34e6a61b8d65e92b79f77e05dff", - "ip": "0.0.0.0", - "port": 0, - "routers": [ - "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d", - "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458", - "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a" - ] } ] \ No newline at end of file diff --git a/kinode/packages/kns_indexer/pkg/manifest.json b/kinode/packages/kns_indexer/pkg/manifest.json index 531fc002..d29393b9 100644 --- a/kinode/packages/kns_indexer/pkg/manifest.json +++ b/kinode/packages/kns_indexer/pkg/manifest.json @@ -3,7 +3,7 @@ "process_name": "kns_indexer", "process_wasm_path": "/kns_indexer.wasm", "on_exit": "Restart", - "request_networking": true, + "request_networking": false, "request_capabilities": [ "eth:distro:sys", "http_server:distro:sys", diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index f05ea989..eb58f6f6 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -36,7 +36,7 @@ pub async fn provider( // Initialize the provider conditionally based on rpc_url // Todo: make provider support multiple transports, one direct and another passthrough. let provider_config = match provider_node { - ProviderInput::WS(rpc_url) => { + ProviderInput::Ws(rpc_url) => { // Validate and parse the WebSocket URL match Url::parse(&rpc_url)?.scheme() { "ws" | "wss" => { diff --git a/kinode/src/kernel/mod.rs b/kinode/src/kernel/mod.rs index 8ca9f602..78a88109 100644 --- a/kinode/src/kernel/mod.rs +++ b/kinode/src/kernel/mod.rs @@ -672,7 +672,7 @@ pub async fn kernel( home_directory_path: String, contract_address: String, runtime_extensions: Vec<(t::ProcessId, t::MessageSender, bool)>, - routers: Vec, + default_pki_entries: Vec, ) -> Result<()> { let mut config = Config::new(); config.cache_config_load_default().unwrap(); @@ -828,7 +828,7 @@ pub async fn kernel( }) .await .expect("fatal: kernel event loop died"); - // sending hard coded routers into networking for bootstrapped rpc + // sending hard coded pki entries into networking for bootstrapped rpc send_to_loop .send(t::KernelMessage { id: rand::random(), @@ -844,7 +844,10 @@ pub async fn kernel( message: t::Message::Request(t::Request { inherit: false, expects_response: None, - body: rmp_serde::to_vec(&crate::net::NetActions::KnsBatchUpdate(routers)).unwrap(), + body: rmp_serde::to_vec(&crate::net::NetActions::KnsBatchUpdate( + default_pki_entries, + )) + .unwrap(), metadata: None, capabilities: vec![], }), diff --git a/kinode/src/main.rs b/kinode/src/main.rs index b080f07c..e5794e3c 100644 --- a/kinode/src/main.rs +++ b/kinode/src/main.rs @@ -46,8 +46,8 @@ const VERSION: &str = env!("CARGO_PKG_VERSION"); #[cfg(not(feature = "simulation-mode"))] const REVEAL_IP: bool = true; -/// default routers as a fallbac -const DEFAULT_ROUTERS: &str = include_str!("../default_routers.json"); +/// default routers as a eth-provider fallback +const DEFAULT_PROVIDERS: &str = include_str!("../default_providers.json"); async fn serve_register_fe( home_directory_path: &str, @@ -178,14 +178,14 @@ async fn main() { } } - // default routers + // default eth providers/routers type KnsUpdate = crate::net::KnsUpdate; - let routers: Vec = - match fs::read_to_string(format!("{}/.routers", home_directory_path)).await { + let default_pki_entries: Vec = + match fs::read_to_string(format!("{}/.default_providers", home_directory_path)).await { Ok(contents) => serde_json::from_str(&contents).unwrap(), Err(_) => { - let routers: Vec = serde_json::from_str(DEFAULT_ROUTERS).unwrap(); - routers + let defaults: Vec = serde_json::from_str(DEFAULT_PROVIDERS).unwrap(); + defaults } }; @@ -200,25 +200,22 @@ async fn main() { match (rpc_url, rpc_node) { (Some(url), Some(_)) => { println!("passed both node and url for rpc, using url."); - eth_provider = ProviderInput::WS(url); + eth_provider = ProviderInput::Ws(url); } (Some(url), None) => { - eth_provider = ProviderInput::WS(url); + eth_provider = ProviderInput::Ws(url); } (None, Some(node)) => { println!("trying to use remote node for rpc: {}", node); eth_provider = ProviderInput::Node(node); } (None, None) => { - let random_router = routers.choose(&mut rand::thread_rng()).unwrap(); - let default_router = random_router.name.clone(); + let random_provider = default_pki_entries.choose(&mut rand::thread_rng()).unwrap(); + let default_provider = random_provider.name.clone(); - println!( - "no rpc provided, using a default router: {}", - default_router - ); + println!("no rpc provided, using a default: {}", default_provider); - eth_provider = ProviderInput::Node(default_router); + eth_provider = ProviderInput::Node(default_provider); } } @@ -509,7 +506,7 @@ async fn main() { home_directory_path.clone(), contract_address.to_string(), runtime_extensions, - routers, + default_pki_entries, )); #[cfg(not(feature = "simulation-mode"))] tasks.spawn(net::networking( diff --git a/lib/src/eth.rs b/lib/src/eth.rs index 041bfec2..a000637f 100644 --- a/lib/src/eth.rs +++ b/lib/src/eth.rs @@ -21,7 +21,8 @@ pub enum EthAction { params: serde_json::Value, }, } -/// Incoming subscription update. + +/// Incoming Request for subscription updates that processes will receive. #[derive(Debug, Serialize, Deserialize)] pub struct EthSub { pub id: u64, @@ -92,6 +93,6 @@ pub fn to_static_str(method: &str) -> Option<&'static str> { } pub enum ProviderInput { - WS(String), + Ws(String), Node(String), } From 4ef0d654ea64ca9bef3c43ffdda6900b34656a1e Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 15 Feb 2024 18:13:00 -0300 Subject: [PATCH 24/26] ethsub result type --- .../packages/app_store/app_store/Cargo.toml | 2 +- .../packages/app_store/app_store/src/lib.rs | 11 ++- .../kns_indexer/kns_indexer/Cargo.toml | 2 +- .../kns_indexer/kns_indexer/src/lib.rs | 10 ++- kinode/src/eth/provider.rs | 77 ++++++++++++------- lib/src/eth.rs | 13 +++- 6 files changed, 77 insertions(+), 38 deletions(-) diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index d8e4d866..0fe63e6c 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -9,7 +9,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "9231881" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "ad17eaa" } rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 287f8681..e773004c 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -1,5 +1,6 @@ use kinode_process_lib::eth::{ - get_logs, subscribe, unsubscribe, Address as EthAddress, EthSub, Filter, SubscriptionResult, + get_logs, subscribe, unsubscribe, Address as EthAddress, EthSub, EthSubResult, Filter, + SubscriptionResult, }; use kinode_process_lib::http::{bind_http_path, serve_ui, HttpServerRequest}; use kinode_process_lib::kernel_types as kt; @@ -58,7 +59,7 @@ pub enum Req { RemoteRequest(RemoteRequest), FTWorkerCommand(FTWorkerCommand), FTWorkerResult(FTWorkerResult), - Eth(EthSub), + Eth(EthSubResult), Http(HttpServerRequest), } @@ -184,11 +185,13 @@ fn handle_message( Req::FTWorkerResult(r) => { println!("app store: got weird ft_worker result: {r:?}"); } - Req::Eth(sub) => { + Req::Eth(eth_result) => { if source.node() != our.node() || source.process != "eth:distro:sys" { return Err(anyhow::anyhow!("eth sub event from weird addr: {source}")); } - handle_eth_sub_event(our, &mut state, sub.result)?; + if let Ok(EthSub { result, .. }) = eth_result { + handle_eth_sub_event(our, &mut state, result)?; + } } Req::Http(incoming) => { if source.node() != our.node() diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index 664b7df3..ee9f411b 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -10,7 +10,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "9231881" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "ad17eaa" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index 19898f86..ca98d3fa 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -4,7 +4,7 @@ use kinode_process_lib::{ await_message, eth::{ get_block_number, get_logs, subscribe, Address as EthAddress, BlockNumberOrTag, EthSub, - Filter, Log, SubscriptionResult, + EthSubResult, Filter, Log, SubscriptionResult, }, get_typed_state, print_to_terminal, println, set_state, Address, Message, Request, Response, }; @@ -253,12 +253,14 @@ fn handle_eth_message( pending_requests: &mut BTreeMap>, body: &[u8], ) -> anyhow::Result<()> { - let Ok(res) = serde_json::from_slice::(body) else { + let Ok(eth_result) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; - if let SubscriptionResult::Log(log) = res.result { - handle_log(our, state, &log)?; + if let Ok(EthSub { result, .. }) = eth_result { + if let SubscriptionResult::Log(log) = result { + handle_log(our, state, &log)?; + } } // check the pending_requests btreemap to see if there are any requests that diff --git a/kinode/src/eth/provider.rs b/kinode/src/eth/provider.rs index eb58f6f6..4c56e761 100644 --- a/kinode/src/eth/provider.rs +++ b/kinode/src/eth/provider.rs @@ -243,28 +243,29 @@ async fn handle_local_request( EthResponse::Response { value: response } } }; - - let response = KernelMessage { - id: km.id, - source: Address { - node: our.to_string(), - process: ETH_PROCESS_ID.clone(), - }, - target: km.source.clone(), - rsvp: None, - message: Message::Response(( - Response { - inherit: false, - body: serde_json::to_vec(&return_body).unwrap(), - metadata: req.metadata.clone(), - capabilities: vec![], - }, - None, - )), - lazy_load_blob: None, - }; - - let _ = send_to_loop.send(response).await; + if let Some(_) = req.expects_response { + let _ = send_to_loop + .send(KernelMessage { + id: km.id, + source: Address { + node: our.to_string(), + process: ETH_PROCESS_ID.clone(), + }, + target: km.source.clone(), + rsvp: km.rsvp.clone(), + message: Message::Response(( + Response { + inherit: false, + body: serde_json::to_vec(&return_body).unwrap(), + metadata: req.metadata.clone(), + capabilities: vec![], + }, + None, + )), + lazy_load_blob: None, + }) + .await; + } Ok(()) } @@ -407,10 +408,33 @@ async fn handle_subscription_stream( ) -> Result<(), EthError> { match rx.recv().await { Err(e) => { - return Err(EthError::SubscriptionClosed(sub_id))?; + let error = Err(EthError::SubscriptionClosed(sub_id))?; + let _ = send_to_loop + .send(KernelMessage { + id: rand::random(), + source: Address { + node: our, + process: ETH_PROCESS_ID.clone(), + }, + target: target.clone(), + rsvp: rsvp.clone(), + message: Message::Request(Request { + inherit: false, + expects_response: None, + body: serde_json::to_vec(&EthSubResult::Err(EthSubError { + id: sub_id, + error: e.to_string(), + })) + .unwrap(), + metadata: None, + capabilities: vec![], + }), + lazy_load_blob: None, + }) + .await + .unwrap(); } Ok(value) => { - // this should not return in case of one failed event? let event: SubscriptionResult = serde_json::from_str(value.get()).map_err(|_| { EthError::RpcError("eth: failed to deserialize subscription result".to_string()) })?; @@ -426,10 +450,10 @@ async fn handle_subscription_stream( message: Message::Request(Request { inherit: false, expects_response: None, - body: serde_json::to_vec(&EthSub { + body: serde_json::to_vec(&EthSubResult::Ok(EthSub { id: sub_id, result: event, - }) + })) .unwrap(), metadata: None, capabilities: vec![], @@ -443,7 +467,6 @@ async fn handle_subscription_stream( Err(EthError::SubscriptionClosed(sub_id)) } -// todo, always send errors or no? general runtime question for other modules too. fn make_error_message(our_node: String, km: KernelMessage, error: EthError) -> KernelMessage { let source = km.rsvp.unwrap_or_else(|| Address { node: our_node.clone(), diff --git a/lib/src/eth.rs b/lib/src/eth.rs index a000637f..e36564b9 100644 --- a/lib/src/eth.rs +++ b/lib/src/eth.rs @@ -22,13 +22,24 @@ pub enum EthAction { }, } -/// Incoming Request for subscription updates that processes will receive. +/// Incoming Result type for subscription updates or errors that processes will receive. +pub type EthSubResult = Result; + +/// Incoming Request type for subscription updates. #[derive(Debug, Serialize, Deserialize)] pub struct EthSub { pub id: u64, pub result: SubscriptionResult, } +/// Incoming Request for subscription errors that processes will receive. +/// If your subscription is closed unexpectedly, you will receive this. +#[derive(Debug, Serialize, Deserialize)] +pub struct EthSubError { + pub id: u64, + pub error: String, +} + /// The Response type which a process will get from requesting with an [`EthAction`] will be /// of the form `Result<(), EthError>`, serialized and deserialized using `serde_json::to_vec` /// and `serde_json::from_slice`. From cac63650abb274bceedf62277c3223fdba7ef299 Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 15 Feb 2024 19:06:36 -0300 Subject: [PATCH 25/26] add default provider nodehashes, resubs --- kinode/default_providers.json | 12 ++++++------ kinode/packages/app_store/app_store/src/lib.rs | 2 ++ .../packages/kns_indexer/kns_indexer/src/lib.rs | 17 ++++++++++++----- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/kinode/default_providers.json b/kinode/default_providers.json index 964698df..571526b8 100644 --- a/kinode/default_providers.json +++ b/kinode/default_providers.json @@ -1,8 +1,8 @@ [ { "name": "default-router-1.os", - "owner": "dr. who", - "node": "0x", + "owner": "", + "node": "0xb35eb347deb896bc3fb6132a07fca1601f83462385ed11e835c24c33ba4ef73d", "public_key": "0xb1b1cf23c89f651aac3e5fd4decb04aa177ab0ec8ce5f1d3877b90bb6f5779db", "ip": "147.135.114.167", "port": 9002, @@ -10,8 +10,8 @@ }, { "name": "default-router-2.os", - "owner": "foo", - "node": "0x", + "owner": "", + "node": "0xd827ae579fafa604af79fbed977e8abe048497f10885c6473dfd343a3b7b4458", "public_key": "0xab9f1a996db3a4e1dbcd31d765daedeb3af9af4f570c0968463b5be3a7d1e992", "ip": "147.135.114.167", "port": 9003, @@ -19,8 +19,8 @@ }, { "name": "default-router-s3.os", - "owner": "bar", - "node": "0x", + "owner": "", + "node": "0x96e36331c8f0882f2c0c46c13b15d812def04fe8606d503bc0e2be39db26486a", "public_key": "0x536e30785e64dd0349a697285af365b5ed7c4d300010139261cfc4dbdd5b254b", "ip": "147.135.114.167", "port": 9004, diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index e773004c..c39f1f20 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -191,6 +191,8 @@ fn handle_message( } if let Ok(EthSub { result, .. }) = eth_result { handle_eth_sub_event(our, &mut state, result)?; + } else { + println!("app store: got eth sub error: {eth_result:?}"); } } Req::Http(incoming) => { diff --git a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs index ca98d3fa..fdd67343 100644 --- a/kinode/packages/kns_indexer/kns_indexer/src/lib.rs +++ b/kinode/packages/kns_indexer/kns_indexer/src/lib.rs @@ -194,7 +194,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { set_state(&bincode::serialize(&state)?); - subscribe(1, filter)?; + subscribe(1, filter.clone())?; let mut pending_requests: BTreeMap> = BTreeMap::new(); @@ -210,7 +210,7 @@ fn main(our: Address, mut state: State) -> anyhow::Result<()> { }; if source.process == "eth:distro:sys" { - handle_eth_message(&our, &mut state, &mut pending_requests, &body)?; + handle_eth_message(&our, &mut state, &mut pending_requests, &body, &filter)?; } else { let Ok(request) = serde_json::from_slice::(&body) else { println!("kns_indexer: got invalid message"); @@ -252,14 +252,21 @@ fn handle_eth_message( state: &mut State, pending_requests: &mut BTreeMap>, body: &[u8], + filter: &Filter, ) -> anyhow::Result<()> { let Ok(eth_result) = serde_json::from_slice::(body) else { return Err(anyhow::anyhow!("kns_indexer: got invalid message")); }; - if let Ok(EthSub { result, .. }) = eth_result { - if let SubscriptionResult::Log(log) = result { - handle_log(our, state, &log)?; + match eth_result { + Ok(EthSub { result, .. }) => { + if let SubscriptionResult::Log(log) = result { + handle_log(our, state, &log)?; + } + } + Err(e) => { + println!("kns_indexer: got sub error, resubscribing.. {:?}", e.error); + subscribe(1, filter.clone())?; } } From 7019ce57db72f92645088f088c39e281aa1c9e0c Mon Sep 17 00:00:00 2001 From: bitful-pannul Date: Thu, 15 Feb 2024 19:57:46 -0300 Subject: [PATCH 26/26] merge process_lib da-metadata work --- kinode/packages/app_store/app_store/Cargo.toml | 2 +- kinode/packages/kns_indexer/kns_indexer/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kinode/packages/app_store/app_store/Cargo.toml b/kinode/packages/app_store/app_store/Cargo.toml index 0fe63e6c..9bf8629e 100644 --- a/kinode/packages/app_store/app_store/Cargo.toml +++ b/kinode/packages/app_store/app_store/Cargo.toml @@ -9,7 +9,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" anyhow = "1.0" bincode = "1.3.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "ad17eaa" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "d7511c2" } rand = "0.8" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml index ee9f411b..3d6e30f1 100644 --- a/kinode/packages/kns_indexer/kns_indexer/Cargo.toml +++ b/kinode/packages/kns_indexer/kns_indexer/Cargo.toml @@ -10,7 +10,7 @@ alloy-primitives = "0.6.2" alloy-sol-types = "0.6.2" bincode = "1.3.3" hex = "0.4.3" -kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "ad17eaa" } +kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib", rev = "d7511c2" } rmp-serde = "1.1.2" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0"