Merge pull request #382 from kinode-dao/bp/update-eth

update alloy deps
This commit is contained in:
doria 2024-06-08 03:04:04 +09:00 committed by GitHub
commit e57c97ea64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 479 additions and 332 deletions

578
Cargo.lock generated
View File

@ -90,15 +90,52 @@ version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
[[package]]
name = "alloy"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-contract",
"alloy-core",
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-network",
"alloy-provider",
"alloy-pubsub",
"alloy-rpc-client",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-signer",
"alloy-signer-wallet",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-transport-http",
"alloy-transport-ws",
"reqwest 0.12.4",
]
[[package]]
name = "alloy-chains"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03fd095a9d70f4b1c5c102c84a4c782867a5c6416dbf6dcd42a63e7c7a89d3c8"
dependencies = [
"num_enum",
"strum",
]
[[package]] [[package]]
name = "alloy-consensus" name = "alloy-consensus"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-network", "alloy-primitives",
"alloy-primitives 0.6.4",
"alloy-rlp", "alloy-rlp",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"c-kzg",
"serde",
] ]
[[package]] [[package]]
@ -107,9 +144,9 @@ version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa" source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [ dependencies = [
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
"alloy-serde", "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"c-kzg", "c-kzg",
"serde", "serde",
"sha2", "sha2",
@ -118,28 +155,44 @@ dependencies = [
[[package]] [[package]]
name = "alloy-contract" name = "alloy-contract"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-dyn-abi", "alloy-dyn-abi",
"alloy-json-abi", "alloy-json-abi",
"alloy-primitives 0.6.4", "alloy-network",
"alloy-providers", "alloy-primitives",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-provider",
"alloy-sol-types 0.6.4", "alloy-pubsub",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-sol-types",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"futures",
"futures-util",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "alloy-dyn-abi" name = "alloy-core"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2919acdad13336bc5dc26b636cdd6892c2f27fb0d4a58320a00c2713cf6a4e9a" checksum = "31b8b8d8c4e84449ce8f310ed48e09ce38b8290b163e3d0df68ea445a9ccce3a"
dependencies = [
"alloy-dyn-abi",
"alloy-json-abi",
"alloy-primitives",
"alloy-sol-types",
]
[[package]]
name = "alloy-dyn-abi"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd2404399cb1b50572758e66e9b4bf088e5a3df9007be7126456c7e50af935f"
dependencies = [ dependencies = [
"alloy-json-abi", "alloy-json-abi",
"alloy-primitives 0.6.4", "alloy-primitives",
"alloy-sol-type-parser", "alloy-sol-type-parser",
"alloy-sol-types 0.6.4", "alloy-sol-types",
"const-hex", "const-hex",
"itoa", "itoa",
"serde", "serde",
@ -150,12 +203,15 @@ dependencies = [
[[package]] [[package]]
name = "alloy-eips" name = "alloy-eips"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-primitives 0.6.4", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"c-kzg",
"once_cell",
"serde", "serde",
"thiserror", "sha2",
] ]
[[package]] [[package]]
@ -163,31 +219,42 @@ name = "alloy-eips"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa" source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
"alloy-serde", "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"c-kzg", "c-kzg",
"once_cell", "once_cell",
"serde", "serde",
] ]
[[package]]
name = "alloy-genesis"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-primitives",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "alloy-genesis" name = "alloy-genesis"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa" source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-serde", "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"serde", "serde",
] ]
[[package]] [[package]]
name = "alloy-json-abi" name = "alloy-json-abi"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24ed0f2a6c3a1c947b4508522a53a190dba8f94dcd4e3e1a5af945a498e78f2f" checksum = "7c3abf6446a292e19853aaca43590eeb48bf435dfd2c74200259e8f4872f6ce3"
dependencies = [ dependencies = [
"alloy-primitives 0.6.4", "alloy-primitives",
"alloy-sol-type-parser", "alloy-sol-type-parser",
"serde", "serde",
"serde_json", "serde_json",
@ -196,12 +263,13 @@ dependencies = [
[[package]] [[package]]
name = "alloy-json-rpc" name = "alloy-json-rpc"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-primitives 0.6.4", "alloy-primitives",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
"tracing",
] ]
[[package]] [[package]]
@ -209,7 +277,7 @@ name = "alloy-json-rpc"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa" source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -219,91 +287,91 @@ dependencies = [
[[package]] [[package]]
name = "alloy-network" name = "alloy-network"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-primitives 0.6.4", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-rlp", "alloy-primitives",
"serde", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
] "alloy-signer",
"alloy-sol-types",
[[package]]
name = "alloy-primitives"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "600d34d8de81e23b6d909c094e23b3d357e01ca36b78a8c5424c501eedbe86f0"
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-primitives"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99bbad0a6b588ef4aec1b5ddbbfdacd9ef04e00b979617765b03174318ee1f3a"
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?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [
"alloy-network",
"alloy-primitives 0.6.4",
"alloy-rpc-client",
"alloy-rpc-trace-types",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-transport-http",
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"reqwest 0.11.27", "futures-utils-wasm",
"serde",
"thiserror", "thiserror",
] ]
[[package]]
name = "alloy-primitives"
version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5277af0cbcc483ee6ad2c1e818090b5928d27f04fd6580680f31c1cf8068bcc2"
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-provider"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-chains",
"alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-network",
"alloy-primitives",
"alloy-pubsub",
"alloy-rpc-client",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-rpc-types-trace",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-transport-http",
"alloy-transport-ws",
"async-stream",
"async-trait",
"auto_impl",
"dashmap",
"futures",
"futures-utils-wasm",
"lru",
"pin-project",
"reqwest 0.12.4",
"serde",
"serde_json",
"tokio",
"tracing",
"url",
]
[[package]] [[package]]
name = "alloy-pubsub" name = "alloy-pubsub"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-primitives 0.6.4", "alloy-primitives",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"bimap", "bimap",
"futures", "futures",
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
"tokio-stream",
"tower", "tower",
"tracing", "tracing",
] ]
@ -333,42 +401,38 @@ dependencies = [
[[package]] [[package]]
name = "alloy-rpc-client" name = "alloy-rpc-client"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-primitives 0.6.4", "alloy-primitives",
"alloy-pubsub", "alloy-pubsub",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-transport-http", "alloy-transport-http",
"alloy-transport-ws", "alloy-transport-ws",
"futures", "futures",
"pin-project", "pin-project",
"reqwest 0.11.27", "reqwest 0.12.4",
"serde", "serde",
"serde_json", "serde_json",
"tokio",
"tokio-stream",
"tower", "tower",
"tracing", "tracing",
"url", "url",
] ]
[[package]]
name = "alloy-rpc-trace-types"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08"
dependencies = [
"alloy-primitives 0.6.4",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "alloy-rpc-types" name = "alloy-rpc-types"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-primitives 0.6.4", "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-primitives",
"alloy-rlp", "alloy-rlp",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-sol-types",
"itertools 0.12.1", "itertools 0.12.1",
"serde", "serde",
"serde_json", "serde_json",
@ -382,23 +446,45 @@ source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e4
dependencies = [ dependencies = [
"alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-eips 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-genesis", "alloy-genesis 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
"alloy-serde", "alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-sol-types 0.7.0", "alloy-sol-types",
"itertools 0.12.1", "itertools 0.12.1",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
] ]
[[package]]
name = "alloy-rpc-types-trace"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-primitives",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-serde 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"serde",
"serde_json",
]
[[package]]
name = "alloy-serde"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-primitives",
"serde",
"serde_json",
]
[[package]] [[package]]
name = "alloy-serde" name = "alloy-serde"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa" source = "git+https://github.com/alloy-rs/alloy.git?rev=cad7935#cad7935d69f433e45d190902e58b1c996b35adfa"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"serde", "serde",
"serde_json", "serde_json",
] ]
@ -406,98 +492,99 @@ dependencies = [
[[package]] [[package]]
name = "alloy-signer" name = "alloy-signer"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-network", "alloy-primitives",
"alloy-primitives 0.6.4",
"async-trait", "async-trait",
"auto_impl", "auto_impl",
"elliptic-curve", "elliptic-curve",
"k256", "k256",
"thiserror",
]
[[package]]
name = "alloy-signer-wallet"
version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [
"alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-network",
"alloy-primitives",
"alloy-signer",
"async-trait",
"k256",
"rand 0.8.5", "rand 0.8.5",
"thiserror", "thiserror",
] ]
[[package]] [[package]]
name = "alloy-sol-macro" name = "alloy-sol-macro"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e86ec0a47740b20bc5613b8712d0d321d031c4efc58e9645af96085d5cccfc27" checksum = "30708a79919b082f2692423c8cc72fc250477e4a2ecb0d4a7244cd3cdb299965"
dependencies = [ dependencies = [
"const-hex", "alloy-sol-macro-expander",
"dunce", "alloy-sol-macro-input",
"heck 0.4.1",
"indexmap",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.60",
"syn-solidity 0.6.4",
"tiny-keccak",
] ]
[[package]] [[package]]
name = "alloy-sol-macro" name = "alloy-sol-macro-expander"
version = "0.7.0" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "452d929748ac948a10481fff4123affead32c553cf362841c5103dd508bdfc16" checksum = "1c7a679ac01774ab7e00a567a918d4231ae692c5c8cedaf4e16956c3116d7896"
dependencies = [ dependencies = [
"alloy-json-abi",
"alloy-sol-macro-input", "alloy-sol-macro-input",
"const-hex", "const-hex",
"heck 0.4.1", "heck 0.5.0",
"indexmap", "indexmap",
"proc-macro-error", "proc-macro-error",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.60", "syn 2.0.60",
"syn-solidity 0.7.0", "syn-solidity",
"tiny-keccak", "tiny-keccak",
] ]
[[package]] [[package]]
name = "alloy-sol-macro-input" name = "alloy-sol-macro-input"
version = "0.7.0" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df64e094f6d2099339f9e82b5b38440b159757b6920878f28316243f8166c8d1" checksum = "356da0c2228aa6675a5faaa08a3e4061b967f924753983d72b9a18d9a3fad44e"
dependencies = [ dependencies = [
"alloy-json-abi",
"const-hex", "const-hex",
"dunce", "dunce",
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"serde_json",
"syn 2.0.60", "syn 2.0.60",
"syn-solidity 0.7.0", "syn-solidity",
] ]
[[package]] [[package]]
name = "alloy-sol-type-parser" name = "alloy-sol-type-parser"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0045cc89524e1451ccf33e8581355b6027ac7c6e494bb02959d4213ad0d8e91d" checksum = "81fd4783b0a5840479013e9ce960d2eb7b3be381f722e0fe3d1f7c3bb6bd4ebd"
dependencies = [ dependencies = [
"winnow 0.6.6", "winnow 0.6.6",
] ]
[[package]] [[package]]
name = "alloy-sol-types" name = "alloy-sol-types"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad09ec5853fa700d12d778ad224dcdec636af424d29fad84fb9a2f16a5b0ef09" checksum = "6eb5e6234c0b62514992589fe1578f64d418dbc8ef5cd1ab2d7f2f568f599698"
dependencies = [ dependencies = [
"alloy-primitives 0.6.4", "alloy-json-abi",
"alloy-sol-macro 0.6.4", "alloy-primitives",
"const-hex", "alloy-sol-macro",
"serde",
]
[[package]]
name = "alloy-sol-types"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43bc2d6dfc2a19fd56644494479510f98b1ee929e04cf0d4aa45e98baa3e545b"
dependencies = [
"alloy-primitives 0.7.0",
"alloy-sol-macro 0.7.0",
"const-hex", "const-hex",
"serde", "serde",
] ]
@ -505,11 +592,12 @@ dependencies = [
[[package]] [[package]]
name = "alloy-transport" name = "alloy-transport"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"base64 0.21.7", "base64 0.22.0",
"futures-util", "futures-util",
"futures-utils-wasm",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror",
@ -540,23 +628,24 @@ dependencies = [
[[package]] [[package]]
name = "alloy-transport-http" name = "alloy-transport-http"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"reqwest 0.11.27", "reqwest 0.12.4",
"serde_json", "serde_json",
"tower", "tower",
"tracing",
"url", "url",
] ]
[[package]] [[package]]
name = "alloy-transport-ws" name = "alloy-transport-ws"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/alloy-rs/alloy?rev=6f8ebb4#6f8ebb45afca1a201a11d421ec46db0f7a1d8d08" source = "git+https://github.com/alloy-rs/alloy?rev=05f8162#05f81621e2edd9781e5f95b2fe2489ed979dd0be"
dependencies = [ dependencies = [
"alloy-pubsub", "alloy-pubsub",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"futures", "futures",
"http 0.2.12", "http 0.2.12",
"serde_json", "serde_json",
@ -645,8 +734,8 @@ checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519"
name = "app_store" name = "app_store"
version = "0.3.1" version = "0.3.1"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-sol-types 0.7.0", "alloy-sol-types",
"anyhow", "anyhow",
"bincode", "bincode",
"kinode_process_lib 0.8.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.8.0)", "kinode_process_lib 0.8.0 (git+https://github.com/kinode-dao/process_lib?tag=v0.8.0)",
@ -806,6 +895,28 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "async-stream"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51"
dependencies = [
"async-stream-impl",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-stream-impl"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.60",
]
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.80" version = "0.1.80"
@ -2667,7 +2778,7 @@ dependencies = [
"httpdate", "httpdate",
"itoa", "itoa",
"pin-project-lite", "pin-project-lite",
"socket2 0.4.10", "socket2 0.5.7",
"tokio", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
@ -3022,7 +3133,6 @@ dependencies = [
"elliptic-curve", "elliptic-curve",
"once_cell", "once_cell",
"sha2", "sha2",
"signature",
] ]
[[package]] [[package]]
@ -3072,19 +3182,10 @@ name = "kinode"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"aes-gcm", "aes-gcm",
"alloy-consensus 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy",
"alloy-contract", "alloy-primitives",
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-sol-macro",
"alloy-network", "alloy-sol-types",
"alloy-primitives 0.6.4",
"alloy-providers",
"alloy-pubsub",
"alloy-rpc-client",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)",
"alloy-signer",
"alloy-sol-macro 0.6.4",
"alloy-sol-types 0.6.4",
"alloy-transport-ws",
"anyhow", "anyhow",
"async-trait", "async-trait",
"base64 0.22.0", "base64 0.22.0",
@ -3159,7 +3260,7 @@ version = "0.8.0"
source = "git+https://github.com/kinode-dao/process_lib?tag=v0.8.0#95a4b042939b760d58c4c4c4eb92f43e813fc1d2" source = "git+https://github.com/kinode-dao/process_lib?tag=v0.8.0#95a4b042939b760d58c4c4c4eb92f43e813fc1d2"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"anyhow", "anyhow",
@ -3181,7 +3282,7 @@ version = "0.8.0"
source = "git+https://github.com/kinode-dao/process_lib.git?rev=7eb3a04#7eb3a04f9be79d1cc3a52fa460faeea7ba3008ed" source = "git+https://github.com/kinode-dao/process_lib.git?rev=7eb3a04#7eb3a04f9be79d1cc3a52fa460faeea7ba3008ed"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)", "alloy-transport 0.1.0 (git+https://github.com/alloy-rs/alloy.git?rev=cad7935)",
"anyhow", "anyhow",
@ -3236,8 +3337,8 @@ dependencies = [
name = "kns_indexer" name = "kns_indexer"
version = "0.3.0" version = "0.3.0"
dependencies = [ dependencies = [
"alloy-primitives 0.7.0", "alloy-primitives",
"alloy-sol-types 0.7.0", "alloy-sol-types",
"anyhow", "anyhow",
"bincode", "bincode",
"hex", "hex",
@ -3270,8 +3371,8 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67"
name = "lib" name = "lib"
version = "0.8.0" version = "0.8.0"
dependencies = [ dependencies = [
"alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-json-rpc 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=6f8ebb4)", "alloy-rpc-types 0.1.0 (git+https://github.com/alloy-rs/alloy?rev=05f8162)",
"anyhow", "anyhow",
"kit", "kit",
"lazy_static", "lazy_static",
@ -3417,6 +3518,15 @@ version = "0.4.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
[[package]]
name = "lru"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc"
dependencies = [
"hashbrown 0.14.3",
]
[[package]] [[package]]
name = "lz4-sys" name = "lz4-sys"
version = "1.9.4" version = "1.9.4"
@ -3701,6 +3811,26 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "num_enum"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845"
dependencies = [
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.60",
]
[[package]] [[package]]
name = "object" name = "object"
version = "0.32.2" version = "0.32.2"
@ -4600,9 +4730,9 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746"
[[package]] [[package]]
name = "ruint" name = "ruint"
version = "1.12.1" version = "1.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f308135fef9fc398342da5472ce7c484529df23743fb7c734e0f3d472971e62" checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286"
dependencies = [ dependencies = [
"alloy-rlp", "alloy-rlp",
"ark-ff 0.3.0", "ark-ff 0.3.0",
@ -4624,9 +4754,9 @@ dependencies = [
[[package]] [[package]]
name = "ruint-macro" name = "ruint-macro"
version = "1.2.0" version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f86854cf50259291520509879a5c294c3c9a4c334e9ff65071c51e42ef1e2343" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18"
[[package]] [[package]]
name = "rusqlite" name = "rusqlite"
@ -4740,6 +4870,12 @@ dependencies = [
"untrusted", "untrusted",
] ]
[[package]]
name = "rustversion"
version = "1.0.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
[[package]] [[package]]
name = "rusty-fork" name = "rusty-fork"
version = "0.3.0" version = "0.3.0"
@ -5183,6 +5319,28 @@ version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
[[package]]
name = "strum"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29"
dependencies = [
"strum_macros",
]
[[package]]
name = "strum_macros"
version = "0.26.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be"
dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.60",
]
[[package]] [[package]]
name = "subtle" name = "subtle"
version = "2.5.0" version = "2.5.0"
@ -5213,21 +5371,9 @@ dependencies = [
[[package]] [[package]]
name = "syn-solidity" name = "syn-solidity"
version = "0.6.4" version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb3d0961cd53c23ea94eeec56ba940f636f6394788976e9f16ca5ee0aca7464a" checksum = "e6fe08d08d84f2c0a77f1e7c46518789d745c2e87a2721791ed7c3c9bc78df28"
dependencies = [
"paste",
"proc-macro2",
"quote",
"syn 2.0.60",
]
[[package]]
name = "syn-solidity"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4497156948bd342b52038035a6fa514a89626e37af9d2c52a5e8d8ebcc7ee479"
dependencies = [ dependencies = [
"paste", "paste",
"proc-macro2", "proc-macro2",
@ -5473,6 +5619,18 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "tokio-stream"
version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af"
dependencies = [
"futures-core",
"pin-project-lite",
"tokio",
"tokio-util",
]
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.20.1" version = "0.20.1"

View File

@ -26,19 +26,25 @@ simulation-mode = []
[dependencies] [dependencies]
aes-gcm = "0.10.3" aes-gcm = "0.10.3"
alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } alloy = { git = "https://github.com/alloy-rs/alloy", rev = "05f8162", features = [
alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "consensus",
alloy-pubsub = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "contract",
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "json-rpc",
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "network",
alloy-rpc-client = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4", features = ["ws"]} "provider-ws",
alloy-transport-ws = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "providers",
alloy-providers = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "pubsub",
alloy-network = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "rpc-client-ws",
alloy-primitives = "0.6.2" "rpc-client",
alloy-sol-macro = "0.6.2" "rpc-types-eth",
alloy-sol-types = "0.6.2" "rpc-types",
alloy-signer = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } "signer-wallet",
"signers",
] }
alloy-primitives = "0.7.5"
alloy-sol-macro = "0.7.5"
alloy-sol-types = "0.7.5"
anyhow = "1.0.71" anyhow = "1.0.71"
async-trait = "0.1.71" async-trait = "0.1.71"
base64 = "0.22.0" base64 = "0.22.0"

View File

@ -1,8 +1,7 @@
use alloy_json_rpc::RpcError; use alloy::providers::{Provider, ProviderBuilder, RootProvider};
use alloy_providers::provider::Provider; use alloy::pubsub::PubSubFrontend;
use alloy_pubsub::PubSubFrontend; use alloy::rpc::client::WsConnect;
use alloy_rpc_client::ClientBuilder; use alloy::rpc::json_rpc::RpcError;
use alloy_transport_ws::WsConnect;
use anyhow::Result; use anyhow::Result;
use dashmap::DashMap; use dashmap::DashMap;
use lib::types::core::*; use lib::types::core::*;
@ -42,7 +41,7 @@ struct ActiveProviders {
struct UrlProvider { struct UrlProvider {
pub trusted: bool, pub trusted: bool,
pub url: String, pub url: String,
pub pubsub: Option<Provider<PubSubFrontend>>, pub pubsub: Option<RootProvider<PubSubFrontend>>,
} }
#[derive(Debug)] #[derive(Debug)]
@ -612,17 +611,13 @@ async fn fulfill_request(
} }
} }
}; };
match pubsub.inner().prepare(method, params.clone()).await { match pubsub.raw_request(method.into(), params.clone()).await {
Ok(value) => { Ok(value) => {
let successful_provider = aps.urls.remove(index); let successful_provider = aps.urls.remove(index);
aps.urls.insert(0, successful_provider); aps.urls.insert(0, successful_provider);
return EthResponse::Response { value }; return EthResponse::Response { value };
} }
Err(rpc_error) => { Err(rpc_error) => {
// if rpc_error is of type ErrResponse, return to user!
if let RpcError::ErrorResp(err) = rpc_error {
return EthResponse::Err(EthError::RpcError(err));
}
verbose_print( verbose_print(
print_tx, print_tx,
&format!( &format!(
@ -631,6 +626,10 @@ async fn fulfill_request(
), ),
) )
.await; .await;
// if rpc_error is of type ErrResponse, return to user!
if let RpcError::ErrorResp(err) = rpc_error {
return EthResponse::Err(EthError::RpcError(err));
}
// this provider failed and needs to be reset // this provider failed and needs to be reset
url_provider.pubsub = None; url_provider.pubsub = None;
} }
@ -858,16 +857,14 @@ async fn handle_eth_config_action(
async fn activate_url_provider(provider: &mut UrlProvider) -> Result<()> { async fn activate_url_provider(provider: &mut UrlProvider) -> Result<()> {
match Url::parse(&provider.url)?.scheme() { match Url::parse(&provider.url)?.scheme() {
"ws" | "wss" => { "ws" | "wss" => {
let connector = WsConnect { let ws = WsConnect::new(provider.url.to_string());
url: provider.url.to_string(),
auth: None,
};
let client = tokio::time::timeout( let client = tokio::time::timeout(
std::time::Duration::from_secs(10), std::time::Duration::from_secs(10),
ClientBuilder::default().ws(connector), ProviderBuilder::new().on_ws(ws),
) )
.await??; .await??;
provider.pubsub = Some(Provider::new_with_client(client)); provider.pubsub = Some(client);
Ok(()) Ok(())
} }
_ => Err(anyhow::anyhow!( _ => Err(anyhow::anyhow!(

View File

@ -1,6 +1,6 @@
use crate::eth::*; use crate::eth::*;
use alloy_pubsub::RawSubscription; use alloy::pubsub::RawSubscription;
use alloy_rpc_types::pubsub::SubscriptionResult; use alloy::rpc::types::eth::pubsub::SubscriptionResult;
/// cleans itself up when the subscription is closed or fails. /// cleans itself up when the subscription is closed or fails.
pub async fn create_new_subscription( pub async fn create_new_subscription(
@ -212,12 +212,11 @@ async fn build_subscription(
let kind = serde_json::to_value(&kind).unwrap(); let kind = serde_json::to_value(&kind).unwrap();
let params = serde_json::to_value(&params).unwrap(); let params = serde_json::to_value(&params).unwrap();
match pubsub match pubsub
.inner() .subscribe::<[serde_json::Value; 2], SubscriptionResult>([kind, params])
.prepare("eth_subscribe", [kind, params])
.await .await
{ {
Ok(id) => { Ok(sub) => {
let rx = pubsub.inner().get_raw_subscription(id).await; let rx = sub.into_raw();
let successful_provider = aps.urls.remove(index); let successful_provider = aps.urls.remove(index);
aps.urls.insert(0, successful_provider); aps.urls.insert(0, successful_provider);
return Ok(Ok(rx)); return Ok(Ok(rx));

View File

@ -2,7 +2,6 @@ use alloy_sol_macro::sol;
use sha3::{Digest, Keccak256}; use sha3::{Digest, Keccak256};
sol! { sol! {
#[sol(rpc)]
contract RegisterHelpers { contract RegisterHelpers {
function register( function register(
bytes calldata _name, bytes calldata _name,

View File

@ -1,12 +1,11 @@
use alloy_consensus::TxLegacy; use alloy::network::{eip2718::Encodable2718, EthereumSigner, TransactionBuilder};
use alloy_network::{Transaction, TxKind}; use alloy::providers::{Provider, ProviderBuilder, RootProvider};
use alloy::pubsub::PubSubFrontend;
use alloy::rpc::client::WsConnect;
use alloy::rpc::types::eth::{TransactionInput, TransactionRequest};
use alloy::signers::wallet::LocalWallet;
use alloy_primitives::{Address, Bytes, FixedBytes, B256, U256}; use alloy_primitives::{Address, Bytes, FixedBytes, B256, U256};
use alloy_providers::provider::{Provider, TempProvider};
use alloy_rpc_client::ClientBuilder;
use alloy_rpc_types::request::{TransactionInput, TransactionRequest};
use alloy_signer::{LocalWallet, Signer, SignerSync};
use alloy_sol_types::{SolCall, SolValue}; use alloy_sol_types::{SolCall, SolValue};
use alloy_transport_ws::WsConnect;
use lib::core::{Identity, NodeRouting}; use lib::core::{Identity, NodeRouting};
use std::str::FromStr; use std::str::FromStr;
@ -31,17 +30,17 @@ pub async fn register_local(
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80",
)?; )?;
let wallet_address = wallet.address();
let signer: EthereumSigner = wallet.into();
let dotdev = Address::from_str(FAKE_DOTDEV)?; let dotdev = Address::from_str(FAKE_DOTDEV)?;
let kns = Address::from_str(KNS_ADDRESS)?; let kns = Address::from_str(KNS_ADDRESS)?;
let endpoint = format!("ws://localhost:{}", fakechain_port); let endpoint = format!("ws://localhost:{}", fakechain_port);
let ws = WsConnect { let ws = WsConnect::new(endpoint);
url: endpoint,
auth: None,
};
let client = ClientBuilder::default().ws(ws).await?; let provider: RootProvider<PubSubFrontend> = ProviderBuilder::default().on_ws(ws).await?;
let provider = Provider::new_with_client(client);
let fqdn = dns_encode_fqdn(name); let fqdn = dns_encode_fqdn(name);
let namehash = encode_namehash(name); let namehash = encode_namehash(name);
@ -73,10 +72,10 @@ pub async fn register_local(
.abi_encode(); .abi_encode();
let exists_tx = TransactionRequest::default() let exists_tx = TransactionRequest::default()
.to(Some(dotdev)) .to(dotdev)
.input(TransactionInput::new(exists_call.into())); .input(TransactionInput::new(exists_call.into()));
let exists = provider.call(exists_tx, None).await; let exists = provider.call(&exists_tx).await;
let (call_input, to) = match exists { let (call_input, to) = match exists {
Err(_e) => { Err(_e) => {
@ -106,33 +105,40 @@ pub async fn register_local(
}; };
let multicall = multicallCall { let multicall = multicallCall {
data: vec![set_ip.abi_encode(), set_key.abi_encode()], data: vec![
Bytes::from(set_ip.abi_encode()),
Bytes::from(set_key.abi_encode()),
],
} }
.abi_encode(); .abi_encode();
(multicall, kns) (multicall, kns)
} }
}; };
let nonce = provider let nonce = provider.get_transaction_count(wallet_address).await?;
.get_transaction_count(wallet.address(), None)
.await?;
let mut tx = TxLegacy { let input = TransactionInput {
to: TxKind::Call(to), input: Some(call_input.into()),
nonce: nonce.to::<u64>(),
input: call_input.into(),
chain_id: Some(31337),
gas_limit: 3000000,
gas_price: 100000000000,
..Default::default() ..Default::default()
}; };
let sig = wallet.sign_transaction_sync(&mut tx)?; let tx = TransactionRequest::default()
let signed_tx = tx.into_signed(sig); .to(to)
let mut buf = vec![]; .input(input)
signed_tx.encode_signed(&mut buf); .nonce(nonce)
.with_chain_id(31337)
.with_gas_limit(500_000)
.with_max_priority_fee_per_gas(1_000_000_000)
.with_max_fee_per_gas(20_000_000_000);
let _tx_hash = provider.send_raw_transaction(buf.into()).await?; // Build the transaction using the `EthereumSigner` with the provided signer.
let tx_envelope = tx.build(&signer).await?;
// Encode the transaction using EIP-2718 encoding.
let tx_encoded = tx_envelope.encoded_2718();
// Send the raw transaction and retrieve the transaction receipt.
let _tx_hash = provider.send_raw_transaction(&tx_encoded).await?;
Ok(()) Ok(())
} }
@ -146,25 +152,16 @@ pub async fn assign_ws_local_helper(
) -> Result<(), anyhow::Error> { ) -> Result<(), anyhow::Error> {
let kns = Address::from_str(KNS_ADDRESS)?; let kns = Address::from_str(KNS_ADDRESS)?;
let endpoint = format!("ws://localhost:{}", fakechain_port); let endpoint = format!("ws://localhost:{}", fakechain_port);
let ws = WsConnect::new(endpoint);
let ws = WsConnect { let provider: RootProvider<PubSubFrontend> = ProviderBuilder::default().on_ws(ws).await?;
url: endpoint,
auth: None,
};
let client = ClientBuilder::default().ws(ws).await?;
let provider = Provider::new_with_client(client);
let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name)); let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name));
let ip_call = ipCall { _0: namehash }.abi_encode(); let ip_call = ipCall { _0: namehash }.abi_encode();
let tx_input = TransactionInput::new(Bytes::from(ip_call)); let tx_input = TransactionInput::new(Bytes::from(ip_call));
let tx = TransactionRequest { let tx = TransactionRequest::default().to(kns).input(tx_input);
to: Some(kns),
input: tx_input,
..Default::default()
};
let Ok(ip_data) = provider.call(tx, None).await else { let Ok(ip_data) = provider.call(&tx).await else {
return Err(anyhow::anyhow!("Failed to fetch node IP data from PKI")); return Err(anyhow::anyhow!("Failed to fetch node IP data from PKI"));
}; };

View File

@ -1,14 +1,13 @@
use crate::keygen; use crate::keygen;
use crate::KNS_ADDRESS; use crate::KNS_ADDRESS;
use alloy::providers::{Provider, ProviderBuilder, RootProvider};
use alloy::pubsub::PubSubFrontend;
use alloy::rpc::client::WsConnect;
use alloy::rpc::types::eth::{TransactionInput, TransactionRequest};
use alloy_primitives::{Address as EthAddress, Bytes, FixedBytes, U256}; use alloy_primitives::{Address as EthAddress, Bytes, FixedBytes, U256};
use alloy_providers::provider::{Provider, TempProvider};
use alloy_pubsub::PubSubFrontend;
use alloy_rpc_client::ClientBuilder;
use alloy_rpc_types::request::{TransactionInput, TransactionRequest};
use alloy_signer::Signature; use alloy_signer::Signature;
use alloy_sol_macro::sol; use alloy_sol_macro::sol;
use alloy_sol_types::{SolCall, SolValue}; use alloy_sol_types::{SolCall, SolValue};
use alloy_transport_ws::WsConnect;
use base64::{engine::general_purpose::STANDARD as base64_standard, Engine}; use base64::{engine::general_purpose::STANDARD as base64_standard, Engine};
use lib::types::core::*; use lib::types::core::*;
use ring::rand::SystemRandom; use ring::rand::SystemRandom;
@ -254,7 +253,7 @@ pub async fn register(
.await; .await;
} }
pub async fn connect_to_provider(maybe_rpc: Option<String>) -> Provider<PubSubFrontend> { pub async fn connect_to_provider(maybe_rpc: Option<String>) -> RootProvider<PubSubFrontend> {
// This ETH provider uses public rpc endpoints to verify registration signatures. // This ETH provider uses public rpc endpoints to verify registration signatures.
let url = if let Some(rpc_url) = maybe_rpc { let url = if let Some(rpc_url) = maybe_rpc {
rpc_url rpc_url
@ -265,12 +264,10 @@ pub async fn connect_to_provider(maybe_rpc: Option<String>) -> Provider<PubSubFr
"Connecting to Optimism RPC at {url}\n\ "Connecting to Optimism RPC at {url}\n\
Specify a different RPC URL with the --rpc flag." Specify a different RPC URL with the --rpc flag."
); );
let ws = WsConnect::new(url);
// this fails occasionally in certain networking environments. i'm not sure why. // this fails occasionally in certain networking environments. i'm not sure why.
// frustratingly, the exact same call does not fail in the eth module. more investigation needed. // frustratingly, the exact same call does not fail in the eth module. more investigation needed.
let Ok(client) = ClientBuilder::default() let Ok(client) = ProviderBuilder::new().on_ws(ws).await else {
.ws(WsConnect { url, auth: None })
.await
else {
panic!( panic!(
"Error: runtime could not connect to ETH RPC.\n\ "Error: runtime could not connect to ETH RPC.\n\
This is necessary in order to verify node identity onchain.\n\ This is necessary in order to verify node identity onchain.\n\
@ -280,7 +277,7 @@ pub async fn connect_to_provider(maybe_rpc: Option<String>) -> Provider<PubSubFr
}; };
println!("Connected to Optimism RPC"); println!("Connected to Optimism RPC");
Provider::new_with_client(client) client
} }
async fn get_unencrypted_info(keyfile: Option<Vec<u8>>) -> Result<impl Reply, Rejection> { async fn get_unencrypted_info(keyfile: Option<Vec<u8>>) -> Result<impl Reply, Rejection> {
@ -350,7 +347,7 @@ async fn handle_boot(
our: Arc<Identity>, our: Arc<Identity>,
networking_keypair: Arc<Vec<u8>>, networking_keypair: Arc<Vec<u8>>,
kns_address: EthAddress, kns_address: EthAddress,
provider: Arc<Provider<PubSubFrontend>>, provider: Arc<RootProvider<PubSubFrontend>>,
) -> Result<impl Reply, Rejection> { ) -> Result<impl Reply, Rejection> {
let mut our = our.as_ref().clone(); let mut our = our.as_ref().clone();
@ -379,13 +376,13 @@ async fn handle_boot(
} }
let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name)); let namehash = FixedBytes::<32>::from_slice(&keygen::namehash(&our.name));
let tld_call = nodesCall { _0: namehash }.abi_encode(); let tld_call = nodesCall { _0: namehash }.abi_encode();
let tx_input = TransactionInput::new(Bytes::from(tld_call)); let tx_input = TransactionInput::new(Bytes::from(tld_call));
let tx = TransactionRequest {
to: Some(kns_address), let tx = TransactionRequest::default()
input: tx_input, .to(kns_address)
..Default::default() .input(tx_input);
};
// this call can fail if the indexer has not caught up to the transaction // this call can fail if the indexer has not caught up to the transaction
// that just got confirmed on our frontend. for this reason, we retry // that just got confirmed on our frontend. for this reason, we retry
@ -394,7 +391,7 @@ async fn handle_boot(
let mut attempts = 0; let mut attempts = 0;
let mut tld_result = Err(()); let mut tld_result = Err(());
while attempts < 5 { while attempts < 5 {
match provider.call(tx.clone(), None).await { match provider.call(&tx).await {
Ok(tld) => { Ok(tld) => {
tld_result = Ok(tld); tld_result = Ok(tld);
break; break;
@ -428,13 +425,11 @@ async fn handle_boot(
} }
.abi_encode(); .abi_encode();
let tx_input = TransactionInput::new(Bytes::from(auth_call)); let tx_input = TransactionInput::new(Bytes::from(auth_call));
let tx = TransactionRequest { let tx = TransactionRequest::default()
to: Some(tld_address), .to(tld_address)
input: tx_input, .input(tx_input);
..Default::default()
};
let Ok(authed) = provider.call(tx, None).await else { let Ok(authed) = provider.call(&tx).await else {
return Ok(warp::reply::with_status( return Ok(warp::reply::with_status(
warp::reply::json(&"Failed to fetch associated address for username"), warp::reply::json(&"Failed to fetch associated address for username"),
StatusCode::INTERNAL_SERVER_ERROR, StatusCode::INTERNAL_SERVER_ERROR,
@ -503,7 +498,7 @@ async fn handle_import_keyfile(
tcp_networking_port: (u16, bool), tcp_networking_port: (u16, bool),
sender: Arc<RegistrationSender>, sender: Arc<RegistrationSender>,
kns_address: EthAddress, kns_address: EthAddress,
provider: Arc<Provider<PubSubFrontend>>, provider: Arc<RootProvider<PubSubFrontend>>,
) -> Result<impl Reply, Rejection> { ) -> Result<impl Reply, Rejection> {
// if keyfile was not present in node and is present from user upload // if keyfile was not present in node and is present from user upload
let encoded_keyfile = match base64_standard.decode(info.keyfile.clone()) { let encoded_keyfile = match base64_standard.decode(info.keyfile.clone()) {
@ -573,7 +568,7 @@ async fn handle_login(
sender: Arc<RegistrationSender>, sender: Arc<RegistrationSender>,
encoded_keyfile: Option<Vec<u8>>, encoded_keyfile: Option<Vec<u8>>,
kns_address: EthAddress, kns_address: EthAddress,
provider: Arc<Provider<PubSubFrontend>>, provider: Arc<RootProvider<PubSubFrontend>>,
) -> Result<impl Reply, Rejection> { ) -> Result<impl Reply, Rejection> {
if encoded_keyfile.is_none() { if encoded_keyfile.is_none() {
return Ok(warp::reply::with_status( return Ok(warp::reply::with_status(
@ -701,7 +696,7 @@ async fn confirm_change_network_keys(
pub async fn assign_routing( pub async fn assign_routing(
our: &mut Identity, our: &mut Identity,
kns_address: EthAddress, kns_address: EthAddress,
provider: Arc<Provider<PubSubFrontend>>, provider: Arc<RootProvider<PubSubFrontend>>,
ws_networking_port: (u16, bool), ws_networking_port: (u16, bool),
tcp_networking_port: (u16, bool), tcp_networking_port: (u16, bool),
) -> anyhow::Result<()> { ) -> anyhow::Result<()> {
@ -709,13 +704,11 @@ pub async fn assign_routing(
let ip_call = ipCall { _0: namehash }.abi_encode(); let ip_call = ipCall { _0: namehash }.abi_encode();
let key_call = keyCall { _0: namehash }.abi_encode(); let key_call = keyCall { _0: namehash }.abi_encode();
let tx_input = TransactionInput::new(Bytes::from(ip_call)); let tx_input = TransactionInput::new(Bytes::from(ip_call));
let tx = TransactionRequest { let tx = TransactionRequest::default()
to: Some(kns_address), .to(kns_address)
input: tx_input, .input(tx_input);
..Default::default()
};
let Ok(ip_data) = provider.call(tx, None).await else { let Ok(ip_data) = provider.call(&tx).await else {
return Err(anyhow::anyhow!("Failed to fetch node IP data from PKI")); return Err(anyhow::anyhow!("Failed to fetch node IP data from PKI"));
}; };
@ -725,13 +718,11 @@ pub async fn assign_routing(
}; };
let key_tx_input = TransactionInput::new(Bytes::from(key_call)); let key_tx_input = TransactionInput::new(Bytes::from(key_call));
let key_tx = TransactionRequest { let key_tx = TransactionRequest::default()
to: Some(kns_address), .to(kns_address)
input: key_tx_input, .input(key_tx_input);
..Default::default()
};
let Ok(public_key) = provider.call(key_tx, None).await else { let Ok(public_key) = provider.call(&key_tx).await else {
return Err(anyhow::anyhow!("Failed to fetch node key from PKI")); return Err(anyhow::anyhow!("Failed to fetch node key from PKI"));
}; };

View File

@ -17,8 +17,8 @@ reqwest = { version = "0.12.4", features = ["blocking"] }
tokio = "1.28" tokio = "1.28"
[dependencies] [dependencies]
alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } alloy-rpc-types = { git = "https://github.com/alloy-rs/alloy", rev = "05f8162" }
alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "6f8ebb4" } alloy-json-rpc = { git = "https://github.com/alloy-rs/alloy", rev = "05f8162" }
lazy_static = "1.4.0" lazy_static = "1.4.0"
rand = "0.8.4" rand = "0.8.4"
ring = "0.17.8" ring = "0.17.8"