diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c7a82c62..de684ff7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,6 +69,5 @@ jobs: - name: Pull nodes run: ./pull_nodes.sh - # TODO: Remove the `--no-fail-fast` flag once #141 is fixed - name: cargo test - run: cargo test --locked --all-features --workspace --no-fail-fast + run: cargo test --locked --all-features --workspace diff --git a/Cargo.lock b/Cargo.lock index 08fb713a..362a3887 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,11 +14,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli", ] [[package]] @@ -27,7 +27,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "gimli 0.27.3", + "gimli", ] [[package]] @@ -45,6 +45,15 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "aes" version = "0.6.0" @@ -56,6 +65,18 @@ dependencies = [ "cipher 0.2.5", ] +[[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 0.3.0", +] + [[package]] name = "aes" version = "0.8.3" @@ -73,11 +94,25 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" dependencies = [ - "aead", + "aead 0.3.2", "aes 0.6.0", "cipher 0.2.5", "ctr 0.6.0", - "ghash", + "ghash 0.3.1", + "subtle", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.8.0", + "ghash 0.4.4", "subtle", ] @@ -208,9 +243,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" [[package]] name = "array-bytes" @@ -266,9 +301,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", "event-listener", @@ -294,11 +329,23 @@ dependencies = [ "async-lock", "async-task", "concurrent-queue", - "fastrand", + "fastrand 1.9.0", "futures-lite", "slab", ] +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock", + "autocfg", + "blocking", + "futures-lite", +] + [[package]] name = "async-global-executor" version = "2.3.1" @@ -360,6 +407,18 @@ dependencies = [ "event-listener", ] +[[package]] +name = "async-net" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4051e67316bc7eff608fe723df5d32ed639946adcd69e07df41fd42a7b411f1f" +dependencies = [ + "async-io", + "autocfg", + "blocking", + "futures-lite", +] + [[package]] name = "async-process" version = "1.7.0" @@ -441,13 +500,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -463,9 +522,9 @@ dependencies = [ [[package]] name = "asynchronous-codec" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a0daa378f5fd10634e44b0a29b2a87b890657658e072a30d6f26e57ddee182" +checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ "bytes", "futures-sink", @@ -474,6 +533,12 @@ dependencies = [ "pin-project-lite 0.2.10", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "atomic-waker" version = "1.1.1" @@ -594,6 +659,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes 0.11.0", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -700,7 +774,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" dependencies = [ "arrayvec 0.4.12", - "constant_time_eq", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq 0.2.6", ] [[package]] @@ -752,7 +837,7 @@ dependencies = [ "async-lock", "async-task", "atomic-waker", - "fastrand", + "fastrand 1.9.0", "futures-lite", "log", ] @@ -778,6 +863,15 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -834,18 +928,18 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -858,7 +952,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.17", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -879,6 +973,31 @@ 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 = "chacha20poly1305" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +dependencies = [ + "aead 0.4.3", + "chacha20", + "cipher 0.3.0", + "poly1305", + "zeroize", +] + [[package]] name = "chrono" version = "0.4.26" @@ -904,6 +1023,15 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.4.4" @@ -916,9 +1044,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -927,9 +1055,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", @@ -939,14 +1067,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -962,7 +1090,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b30a84aab436fcb256a2ab3c80663d8aec686e6bae12827bb05fef3e1e439c9f" dependencies = [ "bincode", - "bs58", + "bs58 0.4.0", "coins-core", "digest 0.10.7", "getrandom 0.2.10", @@ -985,7 +1113,7 @@ dependencies = [ "getrandom 0.2.10", "hmac 0.12.1", "once_cell", - "pbkdf2 0.12.1", + "pbkdf2 0.12.2", "rand 0.8.5", "sha2 0.10.7", "thiserror", @@ -999,7 +1127,7 @@ checksum = "9b949a1c63fb7eb591eb7ba438746326aedf0ae843e51ec92ba6bec5bb382c4f" dependencies = [ "base64 0.21.2", "bech32 0.7.3", - "bs58", + "bs58 0.4.0", "digest 0.10.7", "generic-array 0.14.7", "hex 0.4.3", @@ -1033,15 +1161,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b076e143e1d9538dde65da30f8481c2a6c44040edb8e02b9bf1351edb92ce3" dependencies = [ "lazy_static", - "nom", + "nom 5.1.3", "serde", ] [[package]] name = "const-oid" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6340df57935414636969091153f35f68d9f00bbc8fb4a9c6054706c213e6c6bc" +checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" [[package]] name = "const_fn" @@ -1055,6 +1183,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "containers-api" version = "0.8.0" @@ -1079,13 +1213,19 @@ dependencies = [ "url", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "cookie" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" dependencies = [ - "aes-gcm", + "aes-gcm 0.8.0", "base64 0.13.1", "hkdf", "hmac 0.10.1", @@ -1138,9 +1278,9 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-entity" -version = "0.92.1" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e39cfc857e7e539aa623e03bb6bec11f54aef3dfdef41adcfa7b594af3b54" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] @@ -1274,6 +1414,15 @@ dependencies = [ "cipher 0.2.5", ] +[[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" @@ -1309,6 +1458,20 @@ dependencies = [ "zeroize", ] +[[package]] +name = "curve25519-dalek" +version = "4.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d4ba9852b42210c7538b75484f9daa0655e9a3ac04f693747bb0f02cf3cfe16" +dependencies = [ + "cfg-if", + "fiat-crypto", + "packed_simd_2", + "platforms", + "subtle", + "zeroize", +] + [[package]] name = "curve25519-dalek-ng" version = "4.1.1" @@ -1334,12 +1497,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0558d22a7b463ed0241e993f76f09f30b126687447751a8638587b864e4b3944" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" dependencies = [ - "darling_core 0.20.1", - "darling_macro 0.20.1", + "darling_core 0.20.3", + "darling_macro 0.20.3", ] [[package]] @@ -1358,16 +1521,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8bfa2e259f8ee1ce5e97824a3c55ec4404a0d772ca7fa96bf19f0752a046eb" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -1383,26 +1546,26 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.1" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a358ff9f12ec09c3e61fef9b5a9902623a695a46a917b07f269bff1445611a" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ - "darling_core 0.20.1", + "darling_core 0.20.3", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "dashmap" -version = "5.4.0" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" +checksum = "6943ae99c34386c84a470c499d3414f66502a41340aa895406e0d2e4a207b91d" dependencies = [ "cfg-if", - "hashbrown 0.12.3", + "hashbrown 0.14.0", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core", ] [[package]] @@ -1453,8 +1616,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", ] @@ -1593,15 +1758,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" +checksum = "304e6508efa593091e97a9abbc10f90aa7ca635b6d2784feff3c89d41dd12272" [[package]] name = "ecdsa" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der", "digest 0.10.7", @@ -1650,9 +1815,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" @@ -1731,15 +1896,15 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f94c0e13118e7d7533271f754a168ae8400e6a1cc043f2bfd53cc7290f1a1de3" +checksum = "da96524cc884f6558f1769b6c46686af2fe8e8b4cd253bd5a3cdba8181b8e070" dependencies = [ "serde", ] @@ -1837,9 +2002,9 @@ dependencies = [ [[package]] name = "ethers" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a58ce802c65cf3d0756dee5a61094a92cde53c1583b246e9ee5b37226c7fc15" +checksum = "96b4026b97da8281276744741fac7eb385da905f6093c583331fa2953fdd4253" dependencies = [ "ethers-addressbook", "ethers-contract", @@ -1853,9 +2018,9 @@ dependencies = [ [[package]] name = "ethers-addressbook" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b856b7b8ff5c961093cb8efe151fbcce724b451941ce20781de11a531ccd578" +checksum = "edcb6ffefc230d8c42874c51b28dc11dbb8de50b27a8fdf92648439d6baa68dc" dependencies = [ "ethers-core", "once_cell", @@ -1865,14 +2030,15 @@ dependencies = [ [[package]] name = "ethers-contract" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e066a0d9cfc70c454672bf16bb433b0243427420076dc5b2f49c448fb5a10628" +checksum = "0d4719a44c3d37ab07c6dea99ab174068d8c35e441b60b6c20ce4e48357273e8" dependencies = [ "ethers-contract-abigen", "ethers-contract-derive", "ethers-core", "ethers-providers", + "ethers-signers", "futures-util", "hex 0.4.3", "once_cell", @@ -1884,9 +2050,9 @@ dependencies = [ [[package]] name = "ethers-contract-abigen" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c113e3e86b6bc16d98484b2c3bb2d01d6fed9f489fe2e592e5cc87c3024d616b" +checksum = "155ea1b84d169d231317ed86e307af6f2bed6b40dd17e5e94bc84da21cadb21c" dependencies = [ "Inflector", "dunce", @@ -1901,16 +2067,16 @@ dependencies = [ "reqwest", "serde", "serde_json", - "syn 2.0.23", + "syn 2.0.27", "toml", "walkdir", ] [[package]] name = "ethers-contract-derive" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3fb5adee25701c79ec58fcf2c63594cd8829bc9ad6037ff862d5a111101ed2" +checksum = "8567ff196c4a37c1a8c90ec73bda0ad2062e191e4f0a6dc4d943e2ec4830fc88" dependencies = [ "Inflector", "ethers-contract-abigen", @@ -1919,14 +2085,14 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "ethers-core" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6da5fa198af0d3be20c19192df2bd9590b92ce09a8421e793bec8851270f1b05" +checksum = "60ca2514feb98918a0a31de7e1983c29f2267ebf61b2dc5d4294f91e5b866623" dependencies = [ "arrayvec 0.7.4", "bytes", @@ -1944,8 +2110,8 @@ dependencies = [ "rlp", "serde", "serde_json", - "strum", - "syn 2.0.23", + "strum 0.25.0", + "syn 2.0.27", "tempfile", "thiserror", "tiny-keccak", @@ -1954,13 +2120,13 @@ dependencies = [ [[package]] name = "ethers-etherscan" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ebb401ba97c6f5af278c2c9936c4546cad75dec464b439ae6df249906f4caa" +checksum = "22b3a8269d3df0ed6364bc05b4735b95f4bf830ce3aef87d5e760fb0e93e5b91" dependencies = [ "ethers-core", "reqwest", - "semver 1.0.17", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -1969,9 +2135,9 @@ dependencies = [ [[package]] name = "ethers-middleware" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740f4a773c19dd6d6a68c8c2e0996c096488d38997d524e21dc612c55da3bd24" +checksum = "e0c339aad74ae5c451d27e0e49c7a3c7d22620b119b4f9291d7aa21f72d7f366" dependencies = [ "async-trait", "auto_impl", @@ -1996,9 +2162,9 @@ dependencies = [ [[package]] name = "ethers-providers" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b498fd2a6c019d023e43e83488cd1fb0721f299055975aa6bac8dbf1e95f2c" +checksum = "b411b119f1cf0efb69e2190883dee731251882bb21270f893ee9513b3a697c48" dependencies = [ "async-trait", "auto_impl", @@ -2032,9 +2198,9 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c4b7e15f212fa7cc2e1251868320221d4ff77a3d48068e69f47ce1c491df2d" +checksum = "4864d387456a9c09a1157fa10e1528b29d90f1d859443acf06a1b23365fb518c" dependencies = [ "async-trait", "coins-bip32", @@ -2051,9 +2217,9 @@ dependencies = [ [[package]] name = "ethers-solc" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81c89f121595cf8959e746045bb8b25a6a38d72588561e1a3b7992fc213f674" +checksum = "7a6c2b9625a2c639d46625f88acc2092a3cb35786c37f7c2128b3ca20f639b3c" dependencies = [ "cfg-if", "dunce", @@ -2067,7 +2233,7 @@ dependencies = [ "path-slash", "rayon", "regex", - "semver 1.0.17", + "semver 1.0.18", "serde", "serde_json", "solang-parser", @@ -2117,6 +2283,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "femme" version = "2.2.1" @@ -2143,6 +2315,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + [[package]] name = "filetime" version = "0.2.21" @@ -2222,6 +2400,17 @@ name = "frame-metadata" version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "frame-metadata" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -2300,7 +2489,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ - "fastrand", + "fastrand 1.9.0", "futures-core", "futures-io", "memchr", @@ -2327,7 +2516,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -2430,17 +2619,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" dependencies = [ "opaque-debug 0.3.0", - "polyval", + "polyval 0.4.5", ] [[package]] -name = "gimli" -version = "0.26.2" +name = "ghash" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" dependencies = [ - "fallible-iterator", - "stable_deref_trait", + "opaque-debug 0.3.0", + "polyval 0.5.3", ] [[package]] @@ -2448,6 +2637,11 @@ name = "gimli" version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +dependencies = [ + "fallible-iterator", + "indexmap 1.9.3", + "stable_deref_trait", +] [[package]] name = "glob" @@ -2499,9 +2693,9 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" [[package]] name = "hash256-std-hasher" @@ -2526,12 +2720,18 @@ name = "hashbrown" version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] [[package]] name = "hashbrown" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +dependencies = [ + "serde", +] [[package]] name = "hashers" @@ -2765,7 +2965,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.3", + "rustls 0.21.5", "tokio", "tokio-rustls 0.24.1", ] @@ -2887,6 +3087,12 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + [[package]] name = "infer" version = "0.2.3" @@ -2920,6 +3126,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "intx" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" + [[package]] name = "io-lifetimes" version = "1.0.11" @@ -2944,7 +3156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.3", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -2959,9 +3171,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -3118,9 +3330,9 @@ dependencies = [ [[package]] name = "lalrpop" -version = "0.19.12" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" +checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8" dependencies = [ "ascii-canvas", "bit-set", @@ -3131,7 +3343,7 @@ dependencies = [ "lalrpop-util", "petgraph", "regex", - "regex-syntax 0.6.29", + "regex-syntax 0.7.4", "string_cache", "term", "tiny-keccak", @@ -3140,9 +3352,9 @@ dependencies = [ [[package]] name = "lalrpop-util" -version = "0.19.12" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" +checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d" [[package]] name = "lazy_static" @@ -3169,6 +3381,12 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libm" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" + [[package]] name = "libm" version = "0.2.7" @@ -3261,6 +3479,12 @@ dependencies = [ "value-bag", ] +[[package]] +name = "lru" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718e8fae447df0c7e1ba7f5189829e63fd536945c8988d61444c19039f16b670" + [[package]] name = "mach" version = "0.3.2" @@ -3305,9 +3529,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.6.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -3323,20 +3547,13 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ "hash-db", - "hashbrown 0.12.3", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -3377,6 +3594,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -3397,12 +3620,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "nanoid" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + [[package]] name = "nodrop" version = "0.1.14" @@ -3426,6 +3664,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -3438,9 +3686,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" dependencies = [ "num-bigint", "num-complex", @@ -3515,9 +3763,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -3550,7 +3798,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -3564,12 +3812,12 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] @@ -3650,11 +3898,21 @@ dependencies = [ "sha2 0.10.7", ] +[[package]] +name = "packed_simd_2" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +dependencies = [ + "cfg-if", + "libm 0.1.4", +] + [[package]] name = "parity-scale-codec" -version = "3.6.3" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec 0.7.4", "bitvec 1.0.1", @@ -3667,9 +3925,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.3" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3677,29 +3935,12 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parity-wasm" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" - [[package]] name = "parking" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -3707,28 +3948,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.16", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", @@ -3750,9 +3977,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "path-slash" @@ -3783,9 +4010,9 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac 0.12.1", @@ -3856,7 +4083,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -3894,7 +4121,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -3931,6 +4158,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "polling" version = "2.8.0" @@ -3947,6 +4180,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "poly1305" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +dependencies = [ + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash", +] + [[package]] name = "polyval" version = "0.4.5" @@ -3958,6 +4202,18 @@ dependencies = [ "universal-hash", ] +[[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 0.3.0", + "universal-hash", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3972,12 +4228,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92139198957b410250d43fad93e630d956499a625c527eda65175c8680f83387" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -4045,9 +4301,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -4063,9 +4319,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -4206,34 +4462,34 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1641819477c319ef452a075ac34a4be92eb9ba09f6841f62d594d50fdcf0bf6b" +checksum = "61ef7e18e8841942ddb1cf845054f8008410030a3997875d9e49b7a363063df1" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bf53dad9b6086826722cdc99140793afd9f62faa14a1ad07eb4f955e7a7216" +checksum = "2dfaf0c85b766276c797f3791f5bc6d5bd116b41d53049af2789666b0c0bc9fa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] name = "regex" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.0", - "regex-syntax 0.7.3", + "regex-automata 0.3.3", + "regex-syntax 0.7.4", ] [[package]] @@ -4247,13 +4503,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.3", + "regex-syntax 0.7.4", ] [[package]] @@ -4264,9 +4520,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" @@ -4291,7 +4547,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.10", - "rustls 0.21.3", + "rustls 0.21.5", "rustls-pemfile", "serde", "serde_json", @@ -4326,7 +4582,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", @@ -4409,6 +4665,7 @@ version = "0.4.0" dependencies = [ "anyhow", "rosetta-core", + "subxt", ] [[package]] @@ -4435,6 +4692,7 @@ dependencies = [ "anyhow", "rosetta-core", "serde", + "subxt", ] [[package]] @@ -4458,9 +4716,10 @@ dependencies = [ "anyhow", "bech32 0.9.1", "blake2-rfc", - "bs58", + "bs58 0.4.0", "ecdsa", "ed25519-dalek", + "ethers", "hex 0.4.3", "hmac 0.12.1", "k256", @@ -4471,8 +4730,10 @@ dependencies = [ "schnorrkel 0.10.2", "sha2 0.10.7", "sha3", + "sp-core", "ss58-registry", "substrate-bip39", + "thiserror", ] [[package]] @@ -4503,11 +4764,11 @@ dependencies = [ "futures", "hex 0.4.3", "log", + "nanoid", "rosetta-core", "rosetta-docker", "serde", "serde_json", - "sled", "tide", "tokio", "tokio-retry", @@ -4613,7 +4874,7 @@ version = "0.4.0" dependencies = [ "anyhow", "blake2-rfc", - "bs58", + "bs58 0.4.0", "parity-scale-codec", "rosetta-config-polkadot", "rosetta-core", @@ -4692,7 +4953,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver 1.0.18", ] [[package]] @@ -4725,9 +4986,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno", @@ -4763,13 +5024,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.3" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", - "rustls-webpki 0.101.1", + "rustls-webpki 0.101.2", "sct 0.7.0", ] @@ -4806,9 +5067,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" dependencies = [ "ring", "untrusted", @@ -4816,15 +5077,26 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ruzstd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +dependencies = [ + "byteorder", + "thiserror-core", + "twox-hash", +] [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salsa20" @@ -4879,16 +5151,60 @@ dependencies = [ [[package]] name = "scale-decode" -version = "0.4.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +checksum = "f0459d00b0dbd2e765009924a78ef36b2ff7ba116292d732f00eb0ed8e465d15" dependencies = [ "parity-scale-codec", + "primitive-types", "scale-bits", + "scale-decode-derive", "scale-info", + "smallvec", + "thiserror", +] + +[[package]] +name = "scale-decode-derive" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4391f0dfbb6690f035f6d2a15d6a12f88cc5395c36bcc056db07ffa2a90870ec" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-encode" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0401b7cdae8b8aa33725f3611a051358d5b32887ecaa0fda5953a775b2d4d76" +dependencies = [ + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-encode-derive", + "scale-info", + "smallvec", "thiserror", ] +[[package]] +name = "scale-encode-derive" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "316e0fb10ec0fee266822bd641bab5e332a4ab80ef8c5b5ff35e5401a394f5a6" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-info" version = "2.9.0" @@ -4917,15 +5233,18 @@ dependencies = [ [[package]] name = "scale-value" -version = "0.6.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +checksum = "f2096d36e94ce9bf87d8addb752423b6b19730dc88edd7cc452bb2b90573f7a7" dependencies = [ + "base58", + "blake2", "either", - "frame-metadata", + "frame-metadata 15.1.0", "parity-scale-codec", "scale-bits", "scale-decode", + "scale-encode", "scale-info", "serde", "thiserror", @@ -4989,9 +5308,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" @@ -5027,9 +5346,9 @@ dependencies = [ [[package]] name = "sec1" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct", "der", @@ -5077,9 +5396,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -5090,9 +5409,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -5109,9 +5428,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -5136,31 +5455,31 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.167" +version = "1.0.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" +checksum = "76dc28c9523c5d70816e393136b86d48909cfb27cecaa902d338c19ed47164dc" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a16be4fe5320ade08736447e3198294a5ea9a6d44dde6f35f0a5e06859c427a" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.167" +version = "1.0.176" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" +checksum = "a4e7b8c5dc823e3b90651ff1d3808419cd14e5ad76de04feaf37da114e7a306f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -5174,9 +5493,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", @@ -5228,7 +5547,7 @@ dependencies = [ "serde", "serde_json", "serde_with_macros", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -5237,10 +5556,10 @@ version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" dependencies = [ - "darling 0.20.1", + "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -5339,9 +5658,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -5397,26 +5716,124 @@ dependencies = [ ] [[package]] -name = "sled" -version = "0.34.7" +name = "smallvec" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f96b4737c2ce5987354855aed3797279def4ebf734436c6aa4552cf8e169935" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" + +[[package]] +name = "smol" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ - "crc32fast", - "crossbeam-epoch", - "crossbeam-utils", - "fs2", - "fxhash", - "libc", + "async-channel", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-net", + "async-process", + "blocking", + "futures-lite", +] + +[[package]] +name = "smoldot" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cce5e2881b30bad7ef89f383a816ad0b22c45915911f28499026de4a76d20ee" +dependencies = [ + "arrayvec 0.7.4", + "async-lock", + "atomic", + "base64 0.21.2", + "bip39", + "blake2-rfc", + "bs58 0.5.0", + "crossbeam-queue", + "derive_more", + "ed25519-zebra", + "either", + "event-listener", + "fnv", + "futures-channel", + "futures-util", + "hashbrown 0.14.0", + "hex 0.4.3", + "hmac 0.12.1", + "itertools", + "libsecp256k1", + "merlin 3.0.0", + "no-std-net", + "nom 7.1.3", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel 0.10.2", + "serde", + "serde_json", + "sha2 0.10.7", + "siphasher", + "slab", + "smallvec", + "smol", + "snow", + "soketto", + "tiny-keccak", + "twox-hash", + "wasmi", +] + +[[package]] +name = "smoldot-light" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2f7b4687b83ff244ef6137735ed5716ad37dcdf3ee16c4eb1a32fb9808fa47" +dependencies = [ + "async-lock", + "blake2-rfc", + "derive_more", + "either", + "event-listener", + "fnv", + "futures-channel", + "futures-util", + "hashbrown 0.14.0", + "hex 0.4.3", + "itertools", "log", - "parking_lot 0.11.2", + "lru", + "parking_lot", + "rand 0.8.5", + "serde", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", ] [[package]] -name = "smallvec" -version = "1.11.0" +name = "snow" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "5ccba027ba85743e09d15c03296797cad56395089b832b48b5a5217880f57733" +dependencies = [ + "aes-gcm 0.9.4", + "blake2", + "chacha20poly1305", + "curve25519-dalek 4.0.0-rc.1", + "rand_core 0.6.4", + "rustc_version 0.4.0", + "sha2 0.10.7", + "subtle", +] [[package]] name = "socket2" @@ -5445,9 +5862,9 @@ dependencies = [ [[package]] name = "solang-parser" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a94494913728908efa7a25a2dd2e4f037e714897985c24273c40596638ed909" +checksum = "9c792fe9fae2a2f716846f214ca10d5a1e21133e0bf36cef34bcc4a852467b21" dependencies = [ "itertools", "lalrpop", @@ -5459,9 +5876,9 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "17.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f08604ba4bd856311946722958711a08bded5c929e1227f7a697c58deb09468" +checksum = "899492ea547816d5dfe9a5a2ecc32f65a7110805af6da3380aa4902371b31dc2" dependencies = [ "parity-scale-codec", "scale-info", @@ -5473,9 +5890,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "12.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7796939f2e3b68a3b9410ea17a2063b78038cd366f57fa772dd3be0798bd3412" +checksum = "bb6020576e544c6824a51d651bc8df8e6ab67cd59f1c9ac09868bb81a5199ded" dependencies = [ "integer-sqrt", "num-traits", @@ -5488,15 +5905,15 @@ dependencies = [ [[package]] name = "sp-core" -version = "16.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c96dc3debbe5c22ebf18f99e6a53199efe748e6e584a1902adb88cbad66ae7c" +checksum = "f18d9e2f67d8661f9729f35347069ac29d92758b59135176799db966947a7336" dependencies = [ "array-bytes", - "base58", "bitflags 1.3.2", "blake2", "bounded-collections", + "bs58 0.4.0", "dyn-clonable", "ed25519-zebra", "futures", @@ -5508,7 +5925,8 @@ dependencies = [ "log", "merlin 2.0.1", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -5532,11 +5950,11 @@ dependencies = [ [[package]] name = "sp-core-hashing" -version = "6.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc2d1947252b7a4e403b0a260f596920443742791765ec111daa2bbf98eff25" +checksum = "2ee599a8399448e65197f9a6cee338ad192e9023e35e31f22382964c3c174c68" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.7", @@ -5547,20 +5965,20 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66fb9dc63d54de7d7bed62a505b6e0bd66c122525ea1abb348f6564717c3df2d" +checksum = "c7f531814d2f16995144c74428830ccf7d94ff4a7749632b83ad8199b181140c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "sp-externalities" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57052935c9c9b070ea6b339ef0da3bf241b7e065fc37f9c551669ee83ecfc3c1" +checksum = "a0f71c671e01a8ca60da925d43a1b351b69626e268b8837f8371e320cf1dd100" dependencies = [ "environmental", "parity-scale-codec", @@ -5570,9 +5988,9 @@ dependencies = [ [[package]] name = "sp-io" -version = "17.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578959f9a7e44fd2dd96e8b8bc893cea04fcd7c00a4ffbb0b91c5013899dd02b" +checksum = "9d597e35a9628fe7454b08965b2442e3ec0f264b0a90d41328e87422cec02e99" dependencies = [ "bytes", "ed25519", @@ -5581,6 +5999,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -5596,28 +6015,25 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "18.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc13a168cdc15e185db5cbe8644e3eaafa534e229593768b3044b60bea00fc8c" +checksum = "4673405248580504a8bc4e09615ab25ccb182dfaccd27e000fda9dcb2ca1dab1" dependencies = [ "lazy_static", "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.22.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480dbd54b281c638209fbcfce69902b82a0a1af0e22219d46825eadced3136b6" +checksum = "9be3cdd67cc1d9c1db17c5cbc4ec4924054a8437009d167f21f6590797e4aa45" dependencies = [ - "async-trait", "futures", - "merlin 2.0.1", "parity-scale-codec", - "parking_lot 0.12.1", - "schnorrkel 0.9.1", + "parking_lot", "sp-core", "sp-externalities", "thiserror", @@ -5625,9 +6041,9 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abed79c3d5b3622f65ab065676addd9923b9b122cd257df23e2757ce487c6d2" +checksum = "ebd2de46003fa8212426838ca71cd42ee36a26480ba9ffea983506ce03131033" dependencies = [ "backtrace", "lazy_static", @@ -5636,9 +6052,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "18.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ab2fd44668d3e8674e2253a43852857a47d49be7db737e98bf157e4bcebefd" +checksum = "21c5bfc764a1a8259d7e8f7cfd22c84006275a512c958d3ff966c92151e134d5" dependencies = [ "either", "hash256-std-hasher", @@ -5659,9 +6075,9 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "13.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb7707246cee4967a8cc71e3ef0e82f562e8b1020606447a6a12b99c7c1b443" +checksum = "6e676128182f90015e916f806cba635c8141e341e7abbc45d25525472e1bbce8" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -5678,27 +6094,27 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "9.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2773c90e5765847c5e8b4a24b553d38a9ca52ded47c142cfcfb7948f42827af9" +checksum = "a5d5bd5566fe5633ec48dfa35ab152fd29f8a577c21971e1c6db9f28afb9bbb9" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "sp-state-machine" -version = "0.22.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c957b8b4c252507c12674948db427c5e34fd1760ce256922f1ec5f89f781a4f" +checksum = "9ef45d31f9e7ac648f8899a0cd038a3608f8499028bff55b6c799702592325b6" dependencies = [ "hash-db", "log", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot", "rand 0.8.5", "smallvec", "sp-core", @@ -5712,15 +6128,15 @@ dependencies = [ [[package]] name = "sp-std" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0ee286f98455272f64ac5bb1384ff21ac029fbb669afbaf48477faff12760e" +checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" [[package]] name = "sp-storage" -version = "11.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c20cb0c562d1a159ecb2c7ca786828c81e432c535474967d2df3a484977cea4" +checksum = "94294be83f11d4958cfea89ed5798f0b6605f5defc3a996948848458abbcc18e" dependencies = [ "impl-serde", "parity-scale-codec", @@ -5732,9 +6148,9 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "8.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46bd547da89a9cda69b4ce4c91a5b7e1f86915190d83cd407b715d0c6bac042" +checksum = "357f7591980dd58305956d32f8f6646d0a8ea9ea0e7e868e46f53b68ddf00cec" dependencies = [ "parity-scale-codec", "sp-std", @@ -5745,18 +6161,18 @@ dependencies = [ [[package]] name = "sp-trie" -version = "16.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8efbe5b6d29a18fea7c2f52e0098135f2f864b31d335d5105b40a349866ba874" +checksum = "48e4eeb7ef23f79eba8609db79ef9cef242f994f1f87a3c0387b4b5f177fda74" dependencies = [ "ahash 0.8.3", "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.1", + "parking_lot", "scale-info", "schnellru", "sp-core", @@ -5769,24 +6185,23 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "10.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbc05650b6338808892a7b04f0c56bb1f7f928bfa9ac58e0af2c1e5bef33229" +checksum = "a19c122609ca5d8246be6386888596320d03c7bc880959eaa2c36bcd5acd6846" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", "sp-std", - "wasmi", "wasmtime", ] [[package]] name = "sp-weights" -version = "14.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ebab7696f915aa548494aef3ca8d15217baf10458fe6edb87e60587a47de358" +checksum = "45d084c735544f70625b821c3acdbc7a2fc1893ca98b85f1942631284692c75b" dependencies = [ "parity-scale-codec", "scale-info", @@ -5804,6 +6219,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.2" @@ -5907,7 +6328,7 @@ checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "phf_shared 0.10.0", "precomputed-hash", ] @@ -5924,7 +6345,16 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +dependencies = [ + "strum_macros 0.25.1", ] [[package]] @@ -5940,6 +6370,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum_macros" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.27", +] + [[package]] name = "substrate-bip39" version = "0.4.4" @@ -5967,24 +6410,24 @@ checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" [[package]] name = "subxt" -version = "0.27.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54639dba6a113584083968b6a8f457dedae612abe1bd214762101ca29f12e332" +checksum = "0ba02ada83ba2640c46e200a1758cc83ce876a16326d2c52ca5db41b7d6645ce" dependencies = [ "base58", "blake2", "derivative", - "frame-metadata", + "either", + "frame-metadata 16.0.0", "futures", - "getrandom 0.2.10", "hex 0.4.3", "impl-serde", "jsonrpsee", "parity-scale-codec", - "parking_lot 0.12.1", "primitive-types", "scale-bits", "scale-decode", + "scale-encode", "scale-info", "scale-value", "serde", @@ -5992,6 +6435,7 @@ dependencies = [ "sp-core", "sp-core-hashing", "sp-runtime", + "subxt-lightclient", "subxt-macro", "subxt-metadata", "thiserror", @@ -6000,47 +6444,64 @@ dependencies = [ [[package]] name = "subxt-codegen" -version = "0.27.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e86cb719003f1cedf2710a6e55ca4c37aba4c989bbd3b81dd1c52af9e4827e" +checksum = "3213eb04567e710aa253b94de74337c7b663eea52114805b8723129763282779" dependencies = [ - "darling 0.14.4", - "frame-metadata", + "frame-metadata 16.0.0", "heck", "hex 0.4.3", "jsonrpsee", "parity-scale-codec", - "proc-macro-error", "proc-macro2", "quote", "scale-info", "subxt-metadata", - "syn 1.0.109", + "syn 2.0.27", + "thiserror", "tokio", ] +[[package]] +name = "subxt-lightclient" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a235bedd0e460c110e5341d919ec3a27f9be3dd4c1c944daad8a9b54d396d" +dependencies = [ + "futures", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "subxt-macro" -version = "0.27.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c08de402a78c4c06c3ee3702c80e519efdcb65911348e018b6998d04404916" +checksum = "cfda460cc5f701785973382c589e9bb12c23bb8d825bfc3ac547b7c672aba1c0" dependencies = [ - "darling 0.14.4", + "darling 0.20.3", "proc-macro-error", "subxt-codegen", - "syn 1.0.109", + "syn 2.0.27", ] [[package]] name = "subxt-metadata" -version = "0.27.1" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2593ab5f53435e6352675af4f9851342607f37785d84c7a3fb3139550d3c35f0" +checksum = "0283bd02163913fbd0a5153d0b179533e48b239b953fa4e43baa27c73f18861c" dependencies = [ - "frame-metadata", + "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", "sp-core-hashing", + "thiserror", ] [[package]] @@ -6144,7 +6605,7 @@ dependencies = [ "home", "once_cell", "reqwest", - "semver 1.0.17", + "semver 1.0.18", "serde", "serde_json", "sha2 0.10.7", @@ -6166,9 +6627,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -6183,9 +6644,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" +checksum = "ec96d2ffad078296368d46ff1cb309be1c23c513b4ab0e22a45de0185275ac96" dependencies = [ "filetime", "libc", @@ -6194,21 +6655,20 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.8" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.37.23", + "rustix 0.38.4", "windows-sys 0.48.0", ] @@ -6234,22 +6694,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] +[[package]] +name = "thiserror-core" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d97345f6437bb2004cd58819d8a9ef8e36cdd7661c2abc4bbde0a7c40d9f497" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6312,16 +6792,16 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", "num_threads", "serde", "time-core", - "time-macros 0.2.9", + "time-macros 0.2.10", ] [[package]] @@ -6342,9 +6822,9 @@ dependencies = [ [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -6417,7 +6897,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite 0.2.10", "signal-hook-registry", "socket2", @@ -6433,7 +6913,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6464,7 +6944,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.3", + "rustls 0.21.5", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.10", "tokio", ] @@ -6476,7 +6967,7 @@ checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" dependencies = [ "futures-util", "log", - "rustls 0.21.3", + "rustls 0.21.5", "tokio", "tokio-rustls 0.24.1", "tungstenite", @@ -6521,9 +7012,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -6558,7 +7049,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -6640,12 +7131,12 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.24.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -6653,9 +7144,9 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ "hash-db", ] @@ -6679,7 +7170,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.3", + "rustls 0.21.5", "sha1 0.10.5", "thiserror", "url", @@ -6734,9 +7225,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -6853,7 +7344,7 @@ checksum = "bbc5ad0d9d26b2c49a5ab7da76c3e79d3ee37e7821799f8223fcb8f2f391a2e7" dependencies = [ "anyhow", "rustversion", - "time 0.3.22", + "time 0.3.23", ] [[package]] @@ -6928,7 +7419,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -6962,7 +7453,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6975,52 +7466,60 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmi" -version = "0.13.2" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" +checksum = "e51fb5c61993e71158abf5bb863df2674ca3ec39ed6471c64f07aeaf751d67b4" dependencies = [ - "parity-wasm", - "wasmi-validation", + "intx", + "smallvec", + "spin 0.9.8", + "wasmi_arena", "wasmi_core", + "wasmparser-nostd", ] [[package]] -name = "wasmi-validation" -version = "0.5.0" +name = "wasmi_arena" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" [[package]] name = "wasmi_core" -version = "0.2.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" +checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" dependencies = [ "downcast-rs", - "libm", - "memory_units", - "num-rational", + "libm 0.2.7", "num-traits", + "paste", ] [[package]] name = "wasmparser" -version = "0.96.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde01ade41ab9a5d10ec8ed0bb954238cf8625b5cd5a13093d6de2ad9c2be1a" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", "url", ] +[[package]] +name = "wasmparser-nostd" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +dependencies = [ + "indexmap-nostd", +] + [[package]] name = "wasmtime" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ffcc607adc9da024e87ca814592d4bc67f5c5b58e488f5608d5734a1ebc23e" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -7028,7 +7527,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -7038,30 +7537,30 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cb5dc4d79cd7b2453c395f64e9013d2ad90bd083be556d5565cb224ebe8d57" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-environ" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9350c919553cddf14f78f9452119c8004d7ef6bfebb79a41a21819ed0c5604d8" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -7071,52 +7570,52 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ba5779ea786386432b94c9fc9ad5597346c319e8239db0d98d5be5cc109a7e" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", "serde", "target-lexicon", "wasmtime-environ", "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9841a44c82c74101c10ad4f215392761a2523b3c6c838597962bdb6de75fdb3" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "once_cell", ] [[package]] name = "wasmtime-jit-icache-coherence" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4356c2493002da3b111d470c2ecea65a3017009afce8adc46eaa5758739891" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ "cfg-if", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-runtime" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26efea7a790fcf430e663ba2519f0ab6eb8980adf8b0c58c62b727da77c2ec" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -7126,21 +7625,21 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.6.5", + "memoffset 0.8.0", "paste", "rand 0.8.5", "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "5.0.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e1e4f66a2b9a114f9def450ab9971828c968db6ea6fccd613724b771fa4913" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -7245,21 +7744,6 @@ dependencies = [ "windows-targets 0.48.1", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -7394,9 +7878,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.8" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" +checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" dependencies = [ "memchr", ] @@ -7455,9 +7939,9 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "yap" -version = "0.7.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" +checksum = "e2a7eb6d82a11e4d0b8e6bda8347169aff4ccd8235d039bba7c47482d977dcf7" [[package]] name = "zeroize" @@ -7476,7 +7960,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.27", ] [[package]] @@ -7488,14 +7972,14 @@ dependencies = [ "aes 0.8.3", "byteorder", "bzip2", - "constant_time_eq", + "constant_time_eq 0.1.5", "crc32fast", "crossbeam-utils", "flate2", "hmac 0.12.1", "pbkdf2 0.11.0", "sha1 0.10.5", - "time 0.3.22", + "time 0.3.23", "zstd", ] diff --git a/build_connectors.sh b/build_connectors.sh index 9876f29d..e4b92aae 100755 --- a/build_connectors.sh +++ b/build_connectors.sh @@ -1,20 +1,122 @@ -#!/bin/sh -cargo build -p rosetta-server-bitcoin --target x86_64-unknown-linux-musl --release -mkdir -p target/release/bitcoin/bin -cp target/x86_64-unknown-linux-musl/release/rosetta-server-bitcoin target/release/bitcoin/bin -docker build target/release/bitcoin -f chains/bitcoin/Dockerfile -t analoglabs/connector-bitcoin:latest - -cargo build -p rosetta-server-ethereum --target x86_64-unknown-linux-musl --release -mkdir -p target/release/ethereum/bin -cp target/x86_64-unknown-linux-musl/release/rosetta-server-ethereum target/release/ethereum/bin -docker build target/release/ethereum -f chains/ethereum/Dockerfile -t analoglabs/connector-ethereum:latest - -cargo build -p rosetta-server-polkadot --target x86_64-unknown-linux-musl --release -mkdir -p target/release/polkadot/bin -cp target/x86_64-unknown-linux-musl/release/rosetta-server-polkadot target/release/polkadot/bin -docker build target/release/polkadot -f chains/polkadot/Dockerfile -t analoglabs/connector-polkadot:latest - -cargo build -p rosetta-server-astar --target x86_64-unknown-linux-musl --release -mkdir -p target/release/astar/bin -cp target/x86_64-unknown-linux-musl/release/rosetta-server-astar target/release/astar/bin -docker build target/release/astar -f chains/astar/Dockerfile -t analoglabs/connector-astar:latest +#!/usr/bin/env bash +set -e + +# Check for 'git' and abort if it is not available. +git --version > /dev/null 2>&1 || { echo >&2 "ERROR - requires 'git' to get commit hash and tag."; exit 1; } + +REGISTRY_PATH="docker.io/analoglabs" +VCS_REF="$(git rev-parse HEAD)" +IMAGE_TAG="latest" + +# Check for 'uname' and abort if it is not available. +uname -v > /dev/null 2>&1 || { echo >&2 "ERROR - requires 'uname' to identify the platform."; exit 1; } + +# Check for 'docker' and abort if it is not running. +docker info > /dev/null 2>&1 || { echo >&2 "ERROR - requires 'docker', please start docker and try again."; exit 1; } + +# Check for 'rustup' and abort if it is not available. +rustup -V > /dev/null 2>&1 || { echo >&2 "ERROR - requires 'rustup' for compile the binaries"; exit 1; } + +# Detect host architecture +case "$(uname -m)" in + x86_64) + rustTarget='x86_64-unknown-linux-musl' + muslLinker='x86_64-linux-musl-gcc' + ;; + arm64|aarch64) + rustTarget='aarch64-unknown-linux-musl' + muslLinker='aarch64-linux-musl-gcc' + ;; + *) + echo >&2 "ERROR - unsupported architecture: $(uname -m)" + exit 1 + ;; +esac + +# Check if the musl linker is installed +"$muslLinker" --version > /dev/null 2>&1 || { echo >&2 "ERROR - requires '$muslLinker' linker for compile"; exit 1; } + +# Check if the rust target is installed +if ! rustup target list | grep -q "$rustTarget"; then + echo "Installing the musl target with rustup '$rustTarget'" + rustup target add "$rustTarget" +fi + +# Detect host operating system +case $(uname -s) in + # macOS + Darwin) + buildArgs=( + --release + --target "$rustTarget" + --config "target.$rustTarget.linker='$muslLinker'" + --config "env.CC_$rustTarget='$muslLinker'" + ) + ;; + # Linux + Linux) + buildArgs=( + --release + --target "$rustTarget" + ) + ;; + *) + echo >&2 "ERROR - unsupported or unidentified operating system: $(uname -s)" + exit 1 + ;; +esac + +# Build all Connectors +cargo build \ + -p rosetta-server-bitcoin \ + -p rosetta-server-polkadot \ + -p rosetta-server-ethereum \ + -p rosetta-server-astar \ + "${buildArgs[@]}" || exit 1 + +# Move binaries +mkdir -p target/release/{bitcoin,ethereum,polkadot,astar}/bin +cp "target/$rustTarget/release/rosetta-server-bitcoin" target/release/bitcoin/bin +cp "target/$rustTarget/release/rosetta-server-ethereum" target/release/ethereum/bin +cp "target/$rustTarget/release/rosetta-server-polkadot" target/release/polkadot/bin +cp "target/$rustTarget/release/rosetta-server-astar" target/release/astar/bin + +# Build Bitcoin Connector +docker build target/release/bitcoin \ + -f chains/bitcoin/Dockerfile \ + -t analoglabs/connector-bitcoin \ + --build-arg "REGISTRY_PATH=$REGISTRY_PATH" \ + --build-arg "VCS_REF=$VCS_REF" \ + --build-arg "BUILD_DATE=$(date +%Y%m%d)" \ + --build-arg "IMAGE_VERSION=$IMAGE_TAG" \ + --no-cache + +# Build Ethereum Connector +docker build target/release/ethereum \ + -f chains/ethereum/Dockerfile \ + -t analoglabs/connector-ethereum \ + --build-arg "REGISTRY_PATH=$REGISTRY_PATH" \ + --build-arg "VCS_REF=$VCS_REF" \ + --build-arg "BUILD_DATE=$(date +%Y%m%d)" \ + --build-arg "IMAGE_VERSION=$IMAGE_TAG" \ + --no-cache + +# Build Polkadot Connector +docker build target/release/polkadot \ + -f chains/polkadot/Dockerfile \ + -t analoglabs/connector-polkadot \ + --build-arg "REGISTRY_PATH=$REGISTRY_PATH" \ + --build-arg "VCS_REF=$VCS_REF" \ + --build-arg "BUILD_DATE=$(date +%Y%m%d)" \ + --build-arg "IMAGE_VERSION=$IMAGE_TAG" \ + --no-cache + +# Build Astar Connector +docker build target/release/astar \ + -f chains/astar/Dockerfile \ + -t analoglabs/connector-astar \ + --build-arg "REGISTRY_PATH=$REGISTRY_PATH" \ + --build-arg "VCS_REF=$VCS_REF" \ + --build-arg "BUILD_DATE=$(date +%Y%m%d)" \ + --build-arg "IMAGE_VERSION=$IMAGE_TAG" \ + --no-cache diff --git a/chains/astar/Dockerfile b/chains/astar/Dockerfile index b40a2902..21ae7275 100644 --- a/chains/astar/Dockerfile +++ b/chains/astar/Dockerfile @@ -1,3 +1,24 @@ +ARG REGISTRY_PATH +ARG IMAGE_VERSION +ARG VCS_REF +ARG BUILD_DATE + FROM scratch + +# metadata +LABEL summary="Analog’s connectors for astar parachain" \ + name="${REGISTRY_PATH}/connector-astar" \ + version="${IMAGE_VERSION}" \ + description="Astar chain connector" \ + one.analog.image.vendor="Analog One Foundation" \ + one.analog.image.source="https://github.com/Analog-Labs/chain-connectors/blob/${VCS_REF}/\ +chains/astar/Dockerfile" \ + one.analog.image.revision="${VCS_REF}" \ + one.analog.image.created="${BUILD_DATE}" + COPY bin/rosetta-server-astar rosetta-server-astar + +# check if executable works in this container +RUN ["/rosetta-server-astar", "--help"] + ENTRYPOINT ["/rosetta-server-astar"] diff --git a/chains/astar/config/Cargo.toml b/chains/astar/config/Cargo.toml index 0fa38ab8..0a490066 100644 --- a/chains/astar/config/Cargo.toml +++ b/chains/astar/config/Cargo.toml @@ -9,3 +9,4 @@ description = "Polkadot configuration." [dependencies] anyhow = "1.0.69" rosetta-core = { version = "0.4.0", path = "../../../rosetta-core" } +subxt = "0.30" diff --git a/chains/astar/config/res/astar-dev.scale b/chains/astar/config/res/astar-dev.scale new file mode 100644 index 00000000..7124fa3d Binary files /dev/null and b/chains/astar/config/res/astar-dev.scale differ diff --git a/chains/astar/config/src/lib.rs b/chains/astar/config/src/lib.rs index 84bd47fd..9751d16d 100644 --- a/chains/astar/config/src/lib.rs +++ b/chains/astar/config/src/lib.rs @@ -5,6 +5,12 @@ use rosetta_core::{ }; use std::sync::Arc; +// Generate an interface that we can use from the node's metadata. +pub mod metadata { + #[subxt::subxt(runtime_metadata_path = "res/astar-dev.scale")] + pub mod dev {} +} + pub fn config(network: &str) -> Result { anyhow::ensure!(network == "dev"); Ok(BlockchainConfig { @@ -19,14 +25,14 @@ pub fn config(network: &str) -> Result { currency_symbol: "ASTR", currency_decimals: 18, node_uri: NodeUri::parse("ws://127.0.0.1:9944")?, - node_image: "staketechnologies/astar-collator:latest", + node_image: "staketechnologies/astar-collator:v5.15.0", node_command: Arc::new(|network, port| { vec![ "astar-collator".into(), format!("--chain={network}"), "--rpc-cors=all".into(), - "--ws-external".into(), - format!("--ws-port={port}"), + "--rpc-external".into(), + format!("--rpc-port={port}"), "--alice".into(), "--tmp".into(), "--enable-evm-rpc".into(), diff --git a/chains/astar/server/Cargo.toml b/chains/astar/server/Cargo.toml index 3094c3db..ecc5e7ad 100644 --- a/chains/astar/server/Cargo.toml +++ b/chains/astar/server/Cargo.toml @@ -11,20 +11,20 @@ anyhow = "1.0.69" async-std = { version = "1.12.0", features = ["tokio1"] } async-trait = "0.1.66" ethers = "2.0.7" +hex = "0.4.3" parity-scale-codec = "3.4.0" rosetta-config-astar = { version = "0.4.0", path = "../config" } rosetta-config-ethereum = { version = "0.4.0", path = "../../ethereum/config" } rosetta-server = { version = "0.4.0", path = "../../../rosetta-server" } rosetta-server-ethereum = { version = "0.4.0", path = "../../ethereum/server" } serde_json = "1.0.94" -sp-core = { version = "16.0.0", default-features = false, features = ["blake2", "std"] } -sp-keyring = "18.0.0" -subxt = "0.27.1" +sp-core = { version = "21.0.0", default-features = false, features = ["blake2", "std"] } +sp-keyring = "24.0.0" +subxt = { version = "0.30", features = ["substrate-compat"] } tokio = { version = "1.26.0", features = ["rt-multi-thread", "macros"] } [dev-dependencies] ethers-solc = "2.0.1" -hex = "0.4.3" rosetta-client = { version = "0.4.0", path = "../../../rosetta-client" } rosetta-docker = { version = "0.4.0", path = "../../../rosetta-docker" } rosetta-server = { version = "0.4.0", path = "../../../rosetta-server", features = ["tests"] } diff --git a/chains/astar/server/src/lib.rs b/chains/astar/server/src/lib.rs index 256f6dbf..4a54b891 100644 --- a/chains/astar/server/src/lib.rs +++ b/chains/astar/server/src/lib.rs @@ -1,7 +1,12 @@ -use anyhow::Result; +use anyhow::{Context, Result}; use ethers::prelude::*; +use parity_scale_codec::Decode; +use rosetta_config_astar::metadata::{ + dev as astar_metadata, + dev::runtime_types::{frame_system::AccountInfo, pallet_balances::types::AccountData}, +}; use rosetta_config_ethereum::{EthereumMetadata, EthereumMetadataParams}; -use rosetta_server::crypto::address::Address; +use rosetta_server::crypto::address::{Address, AddressFormat}; use rosetta_server::crypto::PublicKey; use rosetta_server::types::{ Block, BlockIdentifier, CallRequest, Coin, PartialBlockIdentifier, Transaction, @@ -10,10 +15,53 @@ use rosetta_server::types::{ use rosetta_server::{BlockchainClient, BlockchainConfig}; use rosetta_server_ethereum::EthereumClient; use serde_json::Value; +use sp_core::crypto::Ss58AddressFormat; +use subxt::{ + dynamic::Value as SubtxValue, rpc::types::BlockNumber, tx::PairSigner, utils::AccountId32, + OnlineClient, PolkadotConfig, +}; pub struct AstarClient { client: EthereumClient, - addr: String, + ws_client: OnlineClient, +} + +impl AstarClient { + async fn account_info( + &self, + address: &Address, + maybe_block: Option<&BlockIdentifier>, + ) -> Result>> { + let account: AccountId32 = address + .address() + .parse() + .map_err(|err| anyhow::anyhow!("{}", err)) + .context("invalid address")?; + + // Build a dynamic storage query to iterate account information. + let storage_query = + subxt::dynamic::storage("System", "Account", vec![SubtxValue::from_bytes(account)]); + + let block_hash = { + let block_number = maybe_block.map(|block| BlockNumber::from(block.index)); + self.ws_client + .rpc() + .block_hash(block_number) + .await? + .ok_or_else(|| anyhow::anyhow!("no block hash found"))? + }; + + let account_info = self + .ws_client + .storage() + .at(block_hash) + .fetch(&storage_query) + .await? + .ok_or_else(|| anyhow::anyhow!("account not found"))?; + + >>::decode(&mut account_info.encoded()) + .map_err(|_| anyhow::anyhow!("invalid format")) + } } #[async_trait::async_trait] @@ -27,17 +75,22 @@ impl BlockchainClient for AstarClient { async fn new(config: BlockchainConfig, addr: &str) -> Result { // TODO: Fix this hack, need to support multiple addresses per node - let ethereum_uri = if let Some(addr_without_scheme) = addr.strip_prefix("ws://") { - format!("http://{addr_without_scheme}") + let (http_uri, ws_uri) = if let Some(addr_without_scheme) = addr.strip_prefix("ws://") { + (format!("http://{addr_without_scheme}"), addr.to_string()) } else if let Some(addr_without_scheme) = addr.strip_prefix("wss://") { - format!("https://{addr_without_scheme}") + (format!("https://{addr_without_scheme}"), addr.to_string()) + } else if let Some(addr_without_scheme) = addr.strip_prefix("http://") { + (addr.to_string(), format!("ws://{addr_without_scheme}")) + } else if let Some(addr_without_scheme) = addr.strip_prefix("https://") { + (addr.to_string(), format!("wss://{addr_without_scheme}")) } else { - addr.to_string() + (format!("http://{addr}"), format!("ws://{addr}")) }; - let client = EthereumClient::new(config, ethereum_uri.as_str()).await?; + let ethereum_client = EthereumClient::new(config, http_uri.as_str()).await?; + let substrate_client = OnlineClient::::from_url(ws_uri.as_str()).await?; Ok(Self { - client, - addr: addr.into(), + client: ethereum_client, + ws_client: substrate_client, }) } @@ -58,7 +111,26 @@ impl BlockchainClient for AstarClient { } async fn balance(&self, address: &Address, block: &BlockIdentifier) -> Result { - self.client.balance(address, block).await + let balance = match address.format() { + AddressFormat::Ss58(_) => { + let account_info = self.account_info(address, Some(block)).await?; + account_info.data.free + } + AddressFormat::Eip55 => { + // Frontier `eth_getBalance` returns the reducible_balance instead the free balance: + // https://github.com/paritytech/frontier/blob/polkadot-v0.9.43/frame/evm/src/lib.rs#L853-L855 + // using substrate to get the free balance + let address = address + .evm_to_ss58(Ss58AddressFormat::custom(42)) + .map_err(|err| anyhow::anyhow!("{}", err))?; + let account_info = self.account_info(&address, Some(block)).await?; + account_info.data.free + } + _ => { + return Err(anyhow::anyhow!("invalid address format")); + } + }; + Ok(balance) } async fn coins(&self, address: &Address, block: &BlockIdentifier) -> Result> { @@ -66,37 +138,25 @@ impl BlockchainClient for AstarClient { } async fn faucet(&self, address: &Address, value: u128) -> Result> { - use parity_scale_codec::{Decode, Encode}; - use sp_keyring::AccountKeyring; - use subxt::tx::{PairSigner, StaticTxPayload}; - use subxt::utils::{AccountId32, MultiAddress}; - use subxt::{OnlineClient, PolkadotConfig}; - - #[derive(Decode, Encode, Debug)] - pub struct Transfer { - pub dest: MultiAddress, - #[codec(compact)] - pub value: u128, - } + // convert address + let dest = { + let address: H160 = address.address().parse()?; + let mut data = [0u8; 24]; + data[0..4].copy_from_slice(b"evm:"); + data[4..24].copy_from_slice(&address[..]); + let hash = sp_core::hashing::blake2_256(&data); + AccountId32::from(Into::<[u8; 32]>::into(hash)) + }; - let client = OnlineClient::::from_url(&self.addr).await?; + // Build the transfer transaction + let balance_transfer_tx = astar_metadata::tx().balances().transfer(dest.into(), value); + let alice = sp_keyring::AccountKeyring::Alice.pair(); + let signer = PairSigner::::new(alice); - // convert address - let address: H160 = address.address().parse()?; - let mut data = [0u8; 24]; - data[0..4].copy_from_slice(b"evm:"); - data[4..24].copy_from_slice(&address[..]); - let hash = sp_core::hashing::blake2_256(&data); - let address = AccountId32::from(Into::<[u8; 32]>::into(hash)); - // - - let signer = PairSigner::::new(AccountKeyring::Alice.pair()); - let dest: MultiAddress = MultiAddress::Id(address); - let tx = StaticTxPayload::new("Balances", "transfer", Transfer { dest, value }, [0; 32]) - .unvalidated(); - let hash = client + let hash = self + .ws_client .tx() - .sign_and_submit_then_watch_default(&tx, &signer) + .sign_and_submit_then_watch_default(&balance_transfer_tx, &signer) .await? .wait_for_finalized_success() .await? @@ -122,10 +182,10 @@ impl BlockchainClient for AstarClient { async fn block_transaction( &self, - block: &BlockIdentifier, + block_identifier: &BlockIdentifier, tx: &TransactionIdentifier, ) -> Result { - self.client.block_transaction(block, tx).await + self.client.block_transaction(block_identifier, tx).await } async fn call(&self, req: &CallRequest) -> Result { @@ -174,18 +234,6 @@ mod tests { rosetta_server::tests::construction(config).await } - #[tokio::test] - async fn test_find_transaction() -> Result<()> { - let config = rosetta_config_astar::config("dev")?; - rosetta_server::tests::find_transaction(config).await - } - - #[tokio::test] - async fn test_list_transactions() -> Result<()> { - let config = rosetta_config_astar::config("dev")?; - rosetta_server::tests::list_transactions(config).await - } - fn compile_snippet(source: &str) -> Result> { let solc = Solc::default(); let source = format!("contract Contract {{ {source} }}"); @@ -215,7 +263,7 @@ mod tests { async fn test_smart_contract() -> Result<()> { let config = rosetta_config_astar::config("dev")?; - let env = Env::new("smart-contract", config.clone()).await?; + let env = Env::new("astar-smart-contract", config.clone()).await?; let faucet = 100 * u128::pow(10, config.currency_decimals); let wallet = env.ephemeral_wallet()?; @@ -249,7 +297,7 @@ mod tests { async fn test_smart_contract_view() -> Result<()> { let config = rosetta_config_astar::config("dev")?; - let env = Env::new("smart-contract-view", config.clone()).await?; + let env = Env::new("astar-smart-contract-view", config.clone()).await?; let faucet = 100 * u128::pow(10, config.currency_decimals); let wallet = env.ephemeral_wallet()?; diff --git a/chains/bitcoin/Dockerfile b/chains/bitcoin/Dockerfile index acfc2232..07b72665 100644 --- a/chains/bitcoin/Dockerfile +++ b/chains/bitcoin/Dockerfile @@ -1,3 +1,24 @@ +ARG REGISTRY_PATH +ARG IMAGE_VERSION +ARG VCS_REF +ARG BUILD_DATE + FROM scratch + +# metadata +LABEL summary="Analog’s connectors for bitcoin network" \ + name="${REGISTRY_PATH}/connector-bitcoin" \ + version="${IMAGE_VERSION}" \ + description="Bitcoin chain connector" \ + one.analog.image.vendor="Analog One Foundation" \ + one.analog.image.source="https://github.com/Analog-Labs/chain-connectors/blob/${VCS_REF}/\ +chains/bitcoin/Dockerfile" \ + one.analog.image.revision="${VCS_REF}" \ + one.analog.image.created="${BUILD_DATE}" + COPY bin/rosetta-server-bitcoin rosetta-server-bitcoin + +# check if executable works in this container +RUN ["/rosetta-server-bitcoin", "--help"] + ENTRYPOINT ["/rosetta-server-bitcoin"] diff --git a/chains/ethereum/Dockerfile b/chains/ethereum/Dockerfile index 83ecc419..d811bc17 100644 --- a/chains/ethereum/Dockerfile +++ b/chains/ethereum/Dockerfile @@ -1,3 +1,24 @@ +ARG REGISTRY_PATH +ARG IMAGE_VERSION +ARG VCS_REF +ARG BUILD_DATE + FROM scratch + +# metadata +LABEL summary="Analog’s connectors for ethereum network" \ + name="${REGISTRY_PATH}/connector-ethereum" \ + version="${IMAGE_VERSION}" \ + description="Ethereum chain connector" \ + one.analog.image.vendor="Analog One Foundation" \ + one.analog.image.source="https://github.com/Analog-Labs/chain-connectors/blob/${VCS_REF}/\ +chains/ethereum/Dockerfile" \ + one.analog.image.revision="${VCS_REF}" \ + one.analog.image.created="${BUILD_DATE}" + COPY bin/rosetta-server-ethereum rosetta-server-ethereum + +# check if executable works in this container +RUN ["/rosetta-server-ethereum", "--help"] + ENTRYPOINT ["/rosetta-server-ethereum"] diff --git a/chains/ethereum/config/src/lib.rs b/chains/ethereum/config/src/lib.rs index 02b43288..200269fa 100644 --- a/chains/ethereum/config/src/lib.rs +++ b/chains/ethereum/config/src/lib.rs @@ -23,6 +23,7 @@ pub fn config(network: &str) -> Result { node_command: Arc::new(|_network, port| { vec![ "--dev".into(), + "--dev.period=1".into(), "--ipcdisable".into(), "--http".into(), "--http.addr=0.0.0.0".into(), diff --git a/chains/ethereum/server/src/lib.rs b/chains/ethereum/server/src/lib.rs index 5ed6be0c..e84dace0 100644 --- a/chains/ethereum/server/src/lib.rs +++ b/chains/ethereum/server/src/lib.rs @@ -107,6 +107,7 @@ impl BlockchainClient for EthereumClient { .client .send_transaction(tx, None) .await? + .confirmations(2) .await? .unwrap() .transaction_hash @@ -155,6 +156,7 @@ impl BlockchainClient for EthereumClient { .client .send_raw_transaction(Bytes(tx)) .await? + .confirmations(2) .await? .context("Failed to get transaction receipt")? .transaction_hash @@ -381,18 +383,6 @@ mod tests { rosetta_server::tests::construction(config).await } - #[tokio::test] - async fn test_find_transaction() -> Result<()> { - let config = rosetta_config_ethereum::config("dev")?; - rosetta_server::tests::find_transaction(config).await - } - - #[tokio::test] - async fn test_list_transactions() -> Result<()> { - let config = rosetta_config_ethereum::config("dev")?; - rosetta_server::tests::list_transactions(config).await - } - fn compile_snippet(source: &str) -> Result> { let solc = Solc::default(); let source = format!("contract Contract {{ {source} }}"); @@ -422,7 +412,7 @@ mod tests { async fn test_smart_contract() -> Result<()> { let config = rosetta_config_ethereum::config("dev")?; - let env = Env::new("smart-contract", config.clone()).await?; + let env = Env::new("ethereum-smart-contract", config.clone()).await?; let faucet = 100 * u128::pow(10, config.currency_decimals); let wallet = env.ephemeral_wallet()?; @@ -456,7 +446,7 @@ mod tests { async fn test_smart_contract_view() -> Result<()> { let config = rosetta_config_ethereum::config("dev")?; - let env = Env::new("smart-contract-view", config.clone()).await?; + let env = Env::new("ethereum-smart-contract-view", config.clone()).await?; let faucet = 100 * u128::pow(10, config.currency_decimals); let wallet = env.ephemeral_wallet()?; diff --git a/chains/polkadot/Dockerfile b/chains/polkadot/Dockerfile index 88c1ab4e..714b5d20 100644 --- a/chains/polkadot/Dockerfile +++ b/chains/polkadot/Dockerfile @@ -1,3 +1,24 @@ +ARG REGISTRY_PATH +ARG IMAGE_VERSION +ARG VCS_REF +ARG BUILD_DATE + FROM scratch + +# metadata +LABEL summary="Analog’s connectors for polkadot network" \ + name="${REGISTRY_PATH}/connector-polkadot" \ + version="${IMAGE_VERSION}" \ + description="Polkadot chain connector" \ + one.analog.image.vendor="Analog One Foundation" \ + one.analog.image.source="https://github.com/Analog-Labs/chain-connectors/blob/${VCS_REF}/\ +chains/polkadot/Dockerfile" \ + one.analog.image.revision="${VCS_REF}" \ + one.analog.image.created="${BUILD_DATE}" + COPY bin/rosetta-server-polkadot rosetta-server-polkadot + +# check if executable works in this container +RUN ["/rosetta-server-polkadot", "--help"] + ENTRYPOINT ["/rosetta-server-polkadot"] diff --git a/chains/polkadot/config/Cargo.toml b/chains/polkadot/config/Cargo.toml index 0eb0c9cc..a489da84 100644 --- a/chains/polkadot/config/Cargo.toml +++ b/chains/polkadot/config/Cargo.toml @@ -10,3 +10,4 @@ description = "Polkadot configuration." anyhow = "1.0.69" rosetta-core = { version = "0.4.0", path = "../../../rosetta-core" } serde = { version = "1.0.153", features = ["derive"] } +subxt = "0.30" diff --git a/chains/polkadot/config/res/polkadot-v9430.scale b/chains/polkadot/config/res/polkadot-v9430.scale new file mode 100644 index 00000000..6a5c3ea9 Binary files /dev/null and b/chains/polkadot/config/res/polkadot-v9430.scale differ diff --git a/chains/polkadot/config/src/lib.rs b/chains/polkadot/config/src/lib.rs index c2b15fcf..9c6ef800 100644 --- a/chains/polkadot/config/src/lib.rs +++ b/chains/polkadot/config/src/lib.rs @@ -5,6 +5,12 @@ use rosetta_core::{BlockchainConfig, NodeUri}; use serde::{Deserialize, Serialize}; use std::sync::Arc; +// Generate an interface that we can use from the node's metadata. +pub mod metadata { + #[subxt::subxt(runtime_metadata_path = "res/polkadot-v9430.scale")] + pub mod dev {} +} + pub fn config(network: &str) -> Result { let (network, kusama) = match network { "dev" => ("dev", false), @@ -31,15 +37,18 @@ pub fn config(network: &str) -> Result { currency_symbol: if kusama { "KSM" } else { "DOT" }, currency_decimals: if kusama { 12 } else { 10 }, node_uri: NodeUri::parse("ws://127.0.0.1:9944")?, - node_image: "parity/polkadot:v0.9.37", + node_image: "parity/polkadot:v1.0.0", node_command: Arc::new(|network, port| { + let chain = if network == "dev" { + "--dev".to_string() + } else { + format!("--chain={network}") + }; vec![ - format!("--chain={network}"), - "--rpc-cors=all".into(), - "--ws-external".into(), - format!("--ws-port={port}"), + chain, + "--rpc-external".into(), + format!("--rpc-port={port}"), "--alice".into(), - "--tmp".into(), ] }), node_additional_ports: &[], diff --git a/chains/polkadot/server/Cargo.toml b/chains/polkadot/server/Cargo.toml index fc359134..991dd410 100644 --- a/chains/polkadot/server/Cargo.toml +++ b/chains/polkadot/server/Cargo.toml @@ -17,8 +17,8 @@ rosetta-server = { version = "0.4.0", path = "../../../rosetta-server" } scale-info = "2.3.1" serde = { version = "1.0.153", features = ["derive"] } serde_json = "1.0.94" -sp-keyring = "18.0.0" -subxt = "0.27.1" +sp-keyring = "24.0" +subxt = { version = "0.30", features = ["substrate-compat"] } tokio = { version = "1.26.0", features = ["rt-multi-thread", "macros"] } [dev-dependencies] diff --git a/chains/polkadot/server/src/block.rs b/chains/polkadot/server/src/block.rs index a38299c9..bd77dfaf 100644 --- a/chains/polkadot/server/src/block.rs +++ b/chains/polkadot/server/src/block.rs @@ -5,17 +5,18 @@ use rosetta_server::types::{ }; use rosetta_server::BlockchainConfig; use serde_json::{json, Value}; -use subxt::blocks::Extrinsic; -use subxt::config::Hasher; -use subxt::events::EventDetails; -use subxt::ext::scale_value::scale::TypeId; -use subxt::ext::scale_value::{Composite, Primitive, ValueDef}; -use subxt::utils::H256; -use subxt::{Config, OnlineClient}; +use subxt::{ + blocks::ExtrinsicDetails, + config::Hasher, + events::EventDetails, + ext::scale_value::{scale::TypeId, Composite, Primitive, ValueDef}, + utils::H256, + Config, OnlineClient, +}; pub async fn get_transaction>( config: &BlockchainConfig, - extrinsic: &Extrinsic<'_, T, OnlineClient>, + extrinsic: &ExtrinsicDetails>, ) -> Result { let events = extrinsic.events().await?; let mut operations = vec![]; @@ -24,8 +25,8 @@ pub async fn get_transaction>( let event_parsed_data = get_operation_data(config, &event)?; let mut fields = vec![]; - for field in event.event_metadata().fields().iter() { - fields.push(json!({"name": field.name(), "type": field.type_name()})); + for field in event.event_metadata().variant.fields.iter() { + fields.push(json!({"name": field.name, "type": field.type_name})); } let op_metadata = Value::Array(fields); @@ -92,9 +93,9 @@ pub async fn get_transaction>( }) } -fn get_operation_data( +fn get_operation_data>( config: &BlockchainConfig, - event: &EventDetails, + event: &EventDetails, ) -> Result { let pallet_name = event.pallet_name(); let event_name = event.variant_name(); diff --git a/chains/polkadot/server/src/call.rs b/chains/polkadot/server/src/call.rs index ed92aa5f..249fb9b3 100644 --- a/chains/polkadot/server/src/call.rs +++ b/chains/polkadot/server/src/call.rs @@ -6,11 +6,12 @@ use scale_info::{ }; use serde_json::Value; use serde_json::{Map, Value as SerdeValue}; -use subxt::dynamic::Value as SubxtValue; -use subxt::ext::frame_metadata::StorageEntryType; -use subxt::ext::scale_value::scale::TypeId; -use subxt::ext::scale_value::{self, BitSequence, ValueDef}; -use subxt::{OnlineClient, PolkadotConfig as GenericConfig}; +use subxt::{ + dynamic::Value as SubxtValue, + ext::scale_value::{self, scale::TypeId, BitSequence, ValueDef}, + metadata::types::StorageEntryType, + OnlineClient, PolkadotConfig as GenericConfig, +}; pub fn dynamic_constant_req( subxt: &OnlineClient, @@ -32,13 +33,17 @@ pub async fn dynamic_storage_req( ) -> Result { let metadata = subxt.metadata(); let types = metadata.types(); - let pallet = metadata.pallet(pallet_name)?; - - let storage_metadata = pallet.storage(storage_name)?; + let pallet = metadata + .pallet_by_name(pallet_name) + .ok_or_else(|| anyhow::anyhow!("pallet not found"))?; + let storage_metadata = pallet + .storage() + .and_then(|s| s.entry_by_name(storage_name)) + .ok_or_else(|| anyhow::anyhow!("storage not found"))?; - let storage_type = storage_metadata.ty.clone(); + let storage_type = storage_metadata.entry_type().clone(); let type_id = match storage_type { - StorageEntryType::Map { key, .. } => Some(key.id), + StorageEntryType::Map { key_ty, .. } => Some(key_ty), _ => None, }; let params = if let Some(id) = type_id { @@ -61,7 +66,7 @@ pub async fn dynamic_storage_req( let data = subxt .storage() - .at(None) + .at_latest() .await? .fetch_or_default(&storage_address) .await?; diff --git a/chains/polkadot/server/src/lib.rs b/chains/polkadot/server/src/lib.rs index 174c4dac..5c1b28a9 100644 --- a/chains/polkadot/server/src/lib.rs +++ b/chains/polkadot/server/src/lib.rs @@ -1,6 +1,8 @@ use anyhow::{Context, Result}; use parity_scale_codec::{Decode, Encode}; -use rosetta_config_polkadot::{PolkadotMetadata, PolkadotMetadataParams}; +use rosetta_config_polkadot::{ + metadata::dev as polkadot_metadata, PolkadotMetadata, PolkadotMetadataParams, +}; use rosetta_server::crypto::address::Address; use rosetta_server::crypto::PublicKey; use rosetta_server::types::{ @@ -12,13 +14,13 @@ use serde_json::Value; use sp_keyring::AccountKeyring; use std::time::Duration; use subxt::config::{Hasher, Header}; -use subxt::metadata::DecodeStaticType; -use subxt::rpc::types::BlockNumber; -use subxt::storage::address::{StorageHasher, StorageMapKey, Yes}; -use subxt::storage::StaticStorageAddress; -use subxt::tx::{PairSigner, StaticTxPayload, SubmittableExtrinsic}; -use subxt::utils::{AccountId32, MultiAddress, H256}; -use subxt::{Config, OnlineClient, PolkadotConfig}; +use subxt::{ + dynamic::Value as SubtxValue, + rpc::types::BlockNumber, + tx::{PairSigner, SubmittableExtrinsic}, + utils::{AccountId32, MultiAddress}, + Config, OnlineClient, PolkadotConfig, +}; mod block; mod call; @@ -33,45 +35,37 @@ impl PolkadotClient { async fn account_info( &self, address: &Address, - block: Option<&BlockIdentifier>, + maybe_block: Option<&BlockIdentifier>, ) -> Result> { - let address: AccountId32 = address + let account: AccountId32 = address .address() .parse() .map_err(|err| anyhow::anyhow!("{}", err)) .context("invalid address")?; - let hash = self.client.metadata().storage_hash("System", "Account")?; - let key = StaticStorageAddress::< - DecodeStaticType>, - Yes, - Yes, - Yes, - >::new( - "System", - "Account", - vec![StorageMapKey::new( - &address, - StorageHasher::Blake2_128Concat, - )], - hash, - ); - - let block = if let Some(block) = block { - let block = hex::decode(&block.hash)? - .try_into() - .map_err(|_| anyhow::anyhow!("invalid block"))?; - Some(H256(block)) - } else { - None + + // Build a dynamic storage query to iterate account information. + let storage_query = + subxt::dynamic::storage("System", "Account", vec![SubtxValue::from_bytes(account)]); + + let block_hash = { + let block_number = maybe_block.map(|block| BlockNumber::from(block.index)); + self.client + .rpc() + .block_hash(block_number) + .await? + .ok_or_else(|| anyhow::anyhow!("no block hash found"))? }; + let account_info = self .client .storage() - .at(block) + .at(block_hash) + .fetch(&storage_query) .await? - .fetch_or_default(&key) - .await?; - Ok(account_info) + .ok_or_else(|| anyhow::anyhow!("account not found"))?; + + AccountInfo::decode(&mut account_info.encoded()) + .map_err(|_| anyhow::anyhow!("invalid format")) } } @@ -141,9 +135,11 @@ impl BlockchainClient for PolkadotClient { .map_err(|err| anyhow::anyhow!("{}", err)) .context("invalid address")?; let signer = PairSigner::::new(AccountKeyring::Alice.pair()); - let dest: MultiAddress = MultiAddress::Id(address); - let tx = StaticTxPayload::new("Balances", "transfer", Transfer { dest, value }, [0; 32]) - .unvalidated(); + + let tx = polkadot_metadata::tx() + .balances() + .transfer(address.into(), value); + let hash = self .client .tx() @@ -164,10 +160,17 @@ impl BlockchainClient for PolkadotClient { let account_info = self.account_info(&address, None).await?; let runtime = self.client.runtime_version(); let metadata = self.client.metadata(); - let pallet = metadata.pallet(¶ms.pallet_name)?; + let pallet = metadata + .pallet_by_name(¶ms.pallet_name) + .ok_or_else(|| anyhow::anyhow!("pallet not found"))?; let pallet_index = pallet.index(); - let call_index = pallet.call_index(¶ms.call_name)?; - let call_hash = metadata.call_hash(¶ms.pallet_name, ¶ms.call_name)?; + let call_variant = pallet + .call_variant_by_name(¶ms.call_name) + .ok_or_else(|| anyhow::anyhow!("call name not found"))?; + let call_index = call_variant.index; + let call_hash = pallet + .call_hash(¶ms.call_name) + .ok_or_else(|| anyhow::anyhow!("call hash not found"))?; let genesis_hash = self.client.genesis_hash().0; Ok(PolkadotMetadata { nonce: account_info.nonce, @@ -200,22 +203,19 @@ impl BlockchainClient for PolkadotClient { .await? .context("block not found")? }; - let block = self.client.blocks().at(Some(block_hash)).await?; - let timestamp_now_address = - StaticStorageAddress::, Yes, Yes, ()>::new( - "Timestamp", - "Now", - vec![], - [0; 32], - ) - .unvalidated(); + + let block = self.client.blocks().at(block_hash).await?; + + // Build timestamp query + let timestamp_now_query = polkadot_metadata::storage().timestamp().now(); + let timestamp = block .storage() - .fetch_or_default(×tamp_now_address) + .fetch_or_default(×tamp_now_query) .await?; let body = block.body().await?; let mut transactions = vec![]; - for extrinsic in body.extrinsics() { + for extrinsic in body.extrinsics().iter().filter_map(Result::ok) { let transaction = crate::block::get_transaction(self.config(), &extrinsic).await?; transactions.push(transaction); } @@ -241,15 +241,11 @@ impl BlockchainClient for PolkadotClient { ) -> Result { let block_hash = block_identifier.hash.parse()?; let transaction_hash = transaction_identifier.hash.parse()?; - let body = self - .client - .blocks() - .at(Some(block_hash)) - .await? - .body() - .await?; + let body = self.client.blocks().at(block_hash).await?.body().await?; let extrinsic = body .extrinsics() + .iter() + .filter_map(Result::ok) .find(|extrinsic| { ::Hasher::hash_of(&extrinsic.bytes()) == transaction_hash }) @@ -340,16 +336,4 @@ mod tests { let config = rosetta_config_polkadot::config("dev")?; rosetta_server::tests::construction(config).await } - - #[tokio::test] - async fn test_find_transaction() -> Result<()> { - let config = rosetta_config_polkadot::config("dev")?; - rosetta_server::tests::find_transaction(config).await - } - - #[tokio::test] - async fn test_list_transactions() -> Result<()> { - let config = rosetta_config_polkadot::config("dev")?; - rosetta_server::tests::list_transactions(config).await - } } diff --git a/docker-compose.yml b/docker-compose.yml index 42a93f7e..2fbb86e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,10 +5,6 @@ volumes: ethereum-volume: polkadot-volume: astar-volume: - bitcoin-connector-volume: - ethereum-connector-volume: - polkadot-connector-volume: - astar-connector-volume: services: bitcoin: @@ -44,8 +40,8 @@ services: - "ethereum-volume:/root" polkadot: - image: "parity/polkadot:v0.9.37" - command: "--chain dev --rpc-cors all --ws-external --alice --blocks-pruning archive --state-pruning archive --base-path /polkadot" + image: "parity/polkadot:v1.0.0" + command: "--dev --rpc-external --rpc-port=9944 --alice --blocks-pruning archive --state-pruning archive --base-path /polkadot" expose: - "9944" user: root @@ -61,11 +57,10 @@ services: - "polkadot-volume:/polkadot" astar: - image: "staketechnologies/astar-collator:latest" - command: "astar-collator --chain dev --ws-port 9994 --rpc-port 9995 --rpc-cors all --ws-external --alice --blocks-pruning archive --state-pruning archive --base-path /polkadot" + image: "staketechnologies/astar-collator:v5.15.0" + command: "astar-collator --chain dev --rpc-port=9994 --rpc-cors=all --rpc-external --alice --tmp --enable-evm-rpc --base-path /astar" expose: - "9994" - - "9995" user: root ulimits: nofile: @@ -81,55 +76,35 @@ services: connector-bitcoin: image: "analoglabs/connector-bitcoin" - command: "--network regtest --addr 0.0.0.0:8080 --node-addr bitcoin:18443 --path /data" + command: "--network regtest --addr 0.0.0.0:8080 --node-addr http://bitcoin:18443" ports: - "8080:8080" depends_on: - bitcoin - volumes: - - "bitcoin-connector-volume:/data" connector-ethereum: image: "analoglabs/connector-ethereum" - command: "--network dev --addr 0.0.0.0:8081 --node-addr ethereum:8545 --path /data" + command: "--network dev --addr 0.0.0.0:8081 --node-addr http://ethereum:8545" ports: - "8081:8081" depends_on: - ethereum - volumes: - - "ethereum-connector-volume:/data" connector-polkadot: image: "analoglabs/connector-polkadot" - command: "--network dev --addr 0.0.0.0:8082 --node-addr polkadot:9944 --path /data" + command: "--network dev --addr 0.0.0.0:8082 --node-addr ws://polkadot:9944" ports: - "8082:8082" depends_on: - polkadot - volumes: - - "polkadot-connector-volume:/data" # TODO: need to do a proper health check restart: always connector-astar: image: "analoglabs/connector-astar" - command: "--network dev --addr 0.0.0.0:8083 --node-addr astar:9994 --path /data" + command: "--network dev --addr 0.0.0.0:8083 --node-addr ws://astar:9994" ports: - "8083:8083" depends_on: - astar - volumes: - - "astar-connector-volume:/data" - # TODO: need to do a proper health check restart: always - - - explorer: - image: "analoglabs/rosetta-explorer" - ports: - - "3000:3000" - depends_on: - - connector-bitcoin - - connector-ethereum - - connector-polkadot - - connector-astar diff --git a/pull_nodes.sh b/pull_nodes.sh index dc7956e7..6fb681e6 100755 --- a/pull_nodes.sh +++ b/pull_nodes.sh @@ -1,4 +1,7 @@ +#!/usr/bin/env bash +set -e + docker image pull ruimarinho/bitcoin-core:23 docker image pull ethereum/client-go:v1.10.26 -docker image pull parity/polkadot:v0.9.37 -docker image pull staketechnologies/astar-collator:latest +docker image pull parity/polkadot:v1.0.0 +docker image pull staketechnologies/astar-collator:v5.15.0 diff --git a/rosetta-crypto/Cargo.toml b/rosetta-crypto/Cargo.toml index f3ddce91..9d72c29f 100644 --- a/rosetta-crypto/Cargo.toml +++ b/rosetta-crypto/Cargo.toml @@ -13,6 +13,7 @@ blake2-rfc = "0.2.18" bs58 = "0.4.0" ecdsa = { version = "0.16.0", features = ["arithmetic"] } ed25519-dalek = "1.0.1" +ethers = "2.0.7" hex = "0.4.3" hmac = "0.12.1" k256 = "0.13.0" @@ -22,8 +23,10 @@ rust-bip39 = "1.0.0" schnorrkel = "0.10.2" sha2 = "0.10.6" sha3 = "0.10.6" +sp-core = { version = "21.0.0", default-features = false, features = ["blake2", "std"] } ss58-registry = "1.39.0" substrate-bip39 = "0.4.4" +thiserror = "1.0" [dev-dependencies] bs58 = "0.4.0" diff --git a/rosetta-crypto/src/address/mod.rs b/rosetta-crypto/src/address/mod.rs index 7d88d90c..6d4a7d50 100644 --- a/rosetta-crypto/src/address/mod.rs +++ b/rosetta-crypto/src/address/mod.rs @@ -1,6 +1,12 @@ //! Support for various blockchain address formats. use crate::bip32::DerivedPublicKey; +use crate::error::AddressError; use crate::PublicKey; +use ethers::types::H160; +use sp_core::{ + crypto::{AccountId32, Ss58Codec}, + hashing::blake2_256, +}; mod bech32; mod eip55; @@ -54,6 +60,41 @@ impl Address { Self::new(format, address) } + /// Converts an EVM address to its corresponding SS58 address. + /// reference: https://github.com/polkadot-js/common/blob/v12.3.2/packages/util-crypto/src/address/evmToAddress.ts + pub fn evm_to_ss58(&self, ss58format: Ss58AddressFormat) -> Result { + if self.format != AddressFormat::Eip55 { + return Err(AddressError::InvalidAddressFormat); + } + let address: H160 = self + .address + .parse() + .map_err(|_| AddressError::FailedToDecodeAddress)?; + let mut data = [0u8; 24]; + data[0..4].copy_from_slice(b"evm:"); + data[4..24].copy_from_slice(&address[..]); + let hash = blake2_256(&data); + Ok(Self { + format: AddressFormat::Ss58(ss58format), + address: ss58::ss58_encode(ss58format, &hash), + }) + } + + /// Converts an SS58 address to its corresponding EVM address. + /// reference: https://github.com/polkadot-js/common/blob/v12.3.2/packages/util-crypto/src/address/addressToEvm.ts#L13 + pub fn ss58_to_evm(&self) -> Result { + if !matches!(self.format, AddressFormat::Ss58(_)) { + return Err(AddressError::InvalidAddressFormat); + } + let ss58_addr = ::from_string(&self.address) + .map_err(|_| AddressError::FailedToDecodeAddress)?; + let bytes: [u8; 32] = ss58_addr.into(); + Ok(Self { + format: AddressFormat::Eip55, + address: hex::encode(&bytes[0..20]), + }) + } + /// Returns the format of the address. pub fn format(&self) -> AddressFormat { self.format diff --git a/rosetta-crypto/src/error.rs b/rosetta-crypto/src/error.rs new file mode 100644 index 00000000..db6d9a55 --- /dev/null +++ b/rosetta-crypto/src/error.rs @@ -0,0 +1,11 @@ +use thiserror::Error; + +/// Errors that can occur while converting or parsing addresses. +#[derive(Debug, Error, PartialEq)] +pub enum AddressError { + #[error("Invalid address format")] + InvalidAddressFormat, + + #[error("Failed to decode address")] + FailedToDecodeAddress, +} diff --git a/rosetta-crypto/src/lib.rs b/rosetta-crypto/src/lib.rs index 6a139ad9..1d31c513 100644 --- a/rosetta-crypto/src/lib.rs +++ b/rosetta-crypto/src/lib.rs @@ -14,6 +14,7 @@ pub mod address; pub mod bip32; pub use bip39; pub mod bip44; +mod error; /// Signing algorithm. #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] diff --git a/rosetta-docker/src/lib.rs b/rosetta-docker/src/lib.rs index a25b58a6..04bedde9 100644 --- a/rosetta-docker/src/lib.rs +++ b/rosetta-docker/src/lib.rs @@ -263,7 +263,6 @@ impl<'a> EnvBuilder<'a> { format!("--network={}", config.network), format!("--addr=0.0.0.0:{}", config.connector_port), format!("--node-addr={}", config.node_uri.with_host(link.as_str())), - "--path=/data".into(), ]) .auto_remove(true) .attach_stdout(true) diff --git a/rosetta-server/Cargo.toml b/rosetta-server/Cargo.toml index fa64c342..0575e6c9 100644 --- a/rosetta-server/Cargo.toml +++ b/rosetta-server/Cargo.toml @@ -7,7 +7,7 @@ repository = "https://github.com/analog-labs/chain-connectors" description = "Generic rosetta server implementation." [features] -tests = ["futures", "rosetta-docker"] +tests = ["futures", "rosetta-docker", "nanoid"] [dependencies] anyhow = "1.0.69" @@ -17,11 +17,11 @@ femme = "2.2.1" futures = { version = "0.3.26", optional = true } hex = "0.4.3" log = "0.4.17" +nanoid = { version = "0.4.0", optional = true } rosetta-core = { version = "0.4.0", path = "../rosetta-core" } rosetta-docker = { version = "0.4.0", path = "../rosetta-docker", optional = true } serde = "1.0.153" serde_json = "1.0.94" -sled = "0.34.7" tide = { version = "0.16.0", default-features = false, features = ["h1-server", "logger"] } tokio = { version = "1.26.0", features = ["full"] } tokio-retry = "0.3" diff --git a/rosetta-server/src/indexer.rs b/rosetta-server/src/indexer.rs deleted file mode 100644 index c9ee783a..00000000 --- a/rosetta-server/src/indexer.rs +++ /dev/null @@ -1,402 +0,0 @@ -use crate::types::{ - AccountIdentifier, Block, BlockTransaction, CoinIdentifier, Currency, Operator, - PartialBlockIdentifier, SearchTransactionsRequest, SearchTransactionsResponse, Transaction, - TransactionIdentifier, -}; -use crate::BlockchainClient; -use anyhow::Result; -use std::ops::Deref; -use std::path::Path; - -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub struct TransactionRef { - pub block_index: u64, - pub transaction_index: u32, -} - -impl TransactionRef { - fn new(block_index: u64, transaction_index: u32) -> Self { - Self { - block_index, - transaction_index, - } - } - - fn to_bytes(self) -> [u8; 12] { - let mut buf = [0; 12]; - buf[..8].copy_from_slice(&self.block_index.to_be_bytes()[..]); - buf[8..].copy_from_slice(&self.transaction_index.to_be_bytes()[..]); - buf - } - - fn from_bytes(bytes: &[u8]) -> Self { - let mut block_index = [0; 8]; - block_index.copy_from_slice(&bytes[..8]); - let block_index = u64::from_be_bytes(block_index); - let mut transaction_index = [0; 4]; - transaction_index.copy_from_slice(&bytes[8..]); - let transaction_index = u32::from_be_bytes(transaction_index); - Self::new(block_index, transaction_index) - } -} - -#[derive(Clone, Debug)] -pub struct TransactionTable { - tree: sled::Tree, -} - -impl TransactionTable { - pub fn new(tree: sled::Tree) -> Self { - Self { tree } - } - - pub fn height(&self) -> Result { - Ok(if let Some(height) = self.tree.get([])? { - u64::from_be_bytes(height[..].try_into()?) - } else { - 0 - }) - } - - pub fn set_height(&self, height: u64) -> Result<()> { - self.tree.insert([], &height.to_be_bytes())?; - Ok(()) - } - - pub fn iter(&self) -> impl Iterator> { - self.tree - .iter() - .values() - .map(|res| Ok(TransactionRef::from_bytes(&res?))) - } - - pub fn get(&self, tx: &TransactionIdentifier) -> Result> { - Ok(self - .tree - .get(hex::decode(&tx.hash)?)? - .map(|value| TransactionRef::from_bytes(&value))) - } - - pub fn insert(&self, tx: &TransactionIdentifier, tx_ref: &TransactionRef) -> Result<()> { - self.tree - .insert(hex::decode(&tx.hash)?, &tx_ref.to_bytes()[..])?; - Ok(()) - } - - pub fn len(&self) -> usize { - self.tree.len() - } - - #[allow(unused)] - pub fn remove(&self, tx: &TransactionIdentifier) -> Result<()> { - self.tree.remove(hex::decode(&tx.hash)?)?; - Ok(()) - } -} - -#[derive(Clone, Debug)] -pub struct AccountTable { - tree: sled::Tree, -} - -impl AccountTable { - pub fn new(tree: sled::Tree) -> Self { - Self { tree } - } - - pub fn get(&self, account: &AccountIdentifier) -> impl Iterator> { - let address_len = account.address.as_bytes().len(); - self.tree - .scan_prefix(account.address.as_bytes()) - .keys() - .map(move |key| Ok(TransactionRef::from_bytes(&key?[address_len..]))) - } - - pub fn insert(&self, account: &AccountIdentifier, tx: &TransactionRef) -> Result<()> { - self.tree.insert(account_table_key(account, tx), &[])?; - Ok(()) - } - - pub fn len(&self, account: &AccountIdentifier) -> usize { - self.tree - .scan_prefix(account.address.as_bytes()) - .keys() - .count() - } - - #[allow(unused)] - pub fn remove(&self, account: &AccountIdentifier, tx: &TransactionRef) -> Result<()> { - self.tree.remove(account_table_key(account, tx))?; - Ok(()) - } -} - -fn account_table_key(account: &AccountIdentifier, tx: &TransactionRef) -> Vec { - let address_len = account.address.as_bytes().len(); - let mut key = Vec::with_capacity(address_len + 12); - key.extend(account.address.as_bytes()); - key.extend(tx.to_bytes()); - key -} - -#[derive(Clone)] -pub struct Indexer { - transaction_table: TransactionTable, - account_table: AccountTable, - client: C, -} - -impl Deref for Indexer { - type Target = C; - - fn deref(&self) -> &Self::Target { - &self.client - } -} - -impl Indexer { - pub fn new(db: &Path, client: C) -> Result { - let db = sled::open(db)?; - let transaction_table = TransactionTable::new(db.open_tree("transaction_table")?); - let account_table = AccountTable::new(db.open_tree("account_table")?); - Ok(Self { - transaction_table, - account_table, - client, - }) - } - - async fn block_by_index(&self, index: u64) -> Result { - self.client - .block(&PartialBlockIdentifier { - index: Some(index), - hash: None, - }) - .await - } - - async fn get(&self, tx: &TransactionRef) -> Result> { - let block = self.block_by_index(tx.block_index).await?; - Ok( - if let Some(transaction) = block - .transactions - .get(tx.transaction_index as usize) - .cloned() - { - Some(BlockTransaction { - block_identifier: block.block_identifier.clone(), - transaction, - }) - } else { - None - }, - ) - } - - async fn transaction(&self, tx: &TransactionIdentifier) -> Result> { - if let Some(tx) = self.transaction_table.get(tx)? { - self.get(&tx).await - } else { - Ok(None) - } - } - - pub async fn sync(&self) -> Result<()> { - let synced_height = self.transaction_table.height()?; - let current_height = self.client.current_block().await?.index; - for block_index in (synced_height + 1)..current_height + 1 { - let block = self.block_by_index(block_index).await?; - for (transaction_index, transaction) in block.transactions.iter().enumerate() { - let tx = TransactionRef::new(block_index, transaction_index as _); - self.transaction_table - .insert(&transaction.transaction_identifier, &tx)?; - for op in &transaction.operations { - if let Some(account) = op.account.as_ref() { - self.account_table.insert(account, &tx)?; - } - } - } - log::info!("indexed blocks to {}", block_index); - self.transaction_table.set_height(block_index)?; - } - Ok(()) - } - - pub async fn search( - &self, - req: &SearchTransactionsRequest, - ) -> Result { - let height = self.transaction_table.height()?; - let max_block = req.max_block.unwrap_or(height as _) as u64; - let mut offset = req.offset.unwrap_or(0); - let limit = std::cmp::min(req.limit.unwrap_or(100), 1000) as usize; - let account = if let Some(account) = &req.account_identifier { - Some(account.clone()) - } else { - req.address.as_ref().map(|address| AccountIdentifier { - address: address.clone(), - sub_account: None, - metadata: None, - }) - }; - let matcher = Matcher { - op: req.operator.unwrap_or(Operator::And), - status: req.status.as_deref(), - r#type: req.r#type.as_deref(), - success: req.success, - currency: req.currency.as_ref(), - coin: req.coin_identifier.as_ref(), - }; - - let mut transactions = Vec::with_capacity(limit as _); - let (next_offset, total_count) = if let Some(tx) = req.transaction_identifier.as_ref() { - let total_count = if let Some(tx) = self.transaction(tx).await? { - if matcher.matches(&tx.transaction) { - transactions.push(tx); - } - 1 - } else { - 0 - }; - (None, total_count) - } else if let Some(account) = account.as_ref() { - let mut block: Option = None; - for tx in self.account_table.get(account).skip(offset as usize) { - let tx = tx?; - let cached = block - .as_ref() - .map(|block| block.block_identifier.index == tx.block_index) - .unwrap_or_default(); - if !cached { - if tx.block_index > max_block { - break; - } - block = Some(self.block_by_index(tx.block_index).await?); - } - let block = block.as_ref().unwrap(); - offset += 1; - if let Some(tx) = block.transactions.get(tx.transaction_index as usize) { - if matcher.matches(tx) { - transactions.push(BlockTransaction { - block_identifier: block.block_identifier.clone(), - transaction: tx.clone(), - }); - if transactions.len() >= limit { - break; - } - } - } - } - (Some(offset), self.account_table.len(account)) - } else { - let mut block: Option = None; - for tx in self.transaction_table.iter().skip(offset as usize) { - let tx = tx?; - let cached = block - .as_ref() - .map(|block| block.block_identifier.index == tx.block_index) - .unwrap_or_default(); - if !cached { - if tx.block_index > max_block { - break; - } - block = Some(self.block_by_index(tx.block_index).await?); - } - let block = block.as_ref().unwrap(); - offset += 1; - if let Some(tx) = block.transactions.get(tx.transaction_index as usize) { - if matcher.matches(tx) { - transactions.push(BlockTransaction { - block_identifier: block.block_identifier.clone(), - transaction: tx.clone(), - }); - if transactions.len() >= limit { - break; - } - } - } - } - (Some(offset), self.transaction_table.len()) - }; - Ok(SearchTransactionsResponse { - transactions, - total_count: total_count as _, - next_offset, - }) - } -} - -struct Matcher<'a> { - op: Operator, - r#type: Option<&'a str>, - status: Option<&'a str>, - currency: Option<&'a Currency>, - coin: Option<&'a CoinIdentifier>, - success: Option, -} - -impl<'a> Matcher<'a> { - fn matches(&self, tx: &Transaction) -> bool { - let mut matches_success = false; - if let Some(success) = self.success { - matches_success = success == is_success(tx); - } - let mut matches_type = false; - let mut matches_status = false; - let mut matches_currency = false; - let mut matches_coin = false; - for op in &tx.operations { - if let Some(ty) = self.r#type { - if ty == op.r#type { - matches_type = true; - } - } - if let Some(status) = self.status { - if let Some(op_status) = op.status.as_deref() { - if status == op_status { - matches_status = true; - } - } - } - if let Some(currency) = self.currency { - if let Some(amount) = op.amount.as_ref() { - if currency == &amount.currency { - matches_currency = true; - } - } - } - if let Some(coin) = self.coin { - if let Some(coin_change) = op.coin_change.as_ref() { - if coin == &coin_change.coin_identifier { - matches_coin = true; - } - } - } - } - match self.op { - Operator::And => { - (matches_success || self.success.is_none()) - && (matches_type || self.r#type.is_none()) - && (matches_status || self.status.is_none()) - && (matches_currency || self.currency.is_none()) - && (matches_coin || self.coin.is_none()) - } - Operator::Or => { - matches_success - || matches_type - || matches_status - || matches_currency - || matches_coin - } - } - } -} - -// TODO: is this really correct? -fn is_success(tx: &Transaction) -> bool { - if let Some(op) = tx.operations.last() { - !op.r#type.to_lowercase().contains("fail") - } else { - false - } -} diff --git a/rosetta-server/src/lib.rs b/rosetta-server/src/lib.rs index f4e3e664..19c808a8 100644 --- a/rosetta-server/src/lib.rs +++ b/rosetta-server/src/lib.rs @@ -1,4 +1,3 @@ -use crate::indexer::Indexer; use anyhow::Result; use clap::Parser; use rosetta_core::crypto::address::Address; @@ -9,10 +8,9 @@ use rosetta_core::types::{ BlockTransactionResponse, CallRequest, CallResponse, ConstructionMetadataRequest, ConstructionMetadataResponse, ConstructionSubmitRequest, MetadataRequest, NetworkIdentifier, NetworkListResponse, NetworkOptionsResponse, NetworkRequest, NetworkStatusResponse, - SearchTransactionsRequest, TransactionIdentifier, TransactionIdentifierResponse, Version, + TransactionIdentifier, TransactionIdentifierResponse, Version, }; use std::net::SocketAddr; -use std::path::PathBuf; use std::sync::Arc; use std::time::Duration; use tide::http::headers::HeaderValue; @@ -25,8 +23,6 @@ use tokio_retry::{ pub use rosetta_core::*; -mod indexer; - #[derive(Parser)] struct Opts { #[clap(long)] @@ -35,8 +31,6 @@ struct Opts { addr: SocketAddr, #[clap(long)] node_addr: String, - #[clap(long)] - path: PathBuf, } pub async fn main() -> Result<()> { @@ -65,8 +59,6 @@ pub async fn main() -> Result<()> { .await? }; - let indexer = Arc::new(Indexer::new(&opts.path, client)?); - let cors = CorsMiddleware::new() .allow_methods("POST".parse::().unwrap()) .allow_origin(Origin::from("*")) @@ -74,16 +66,7 @@ pub async fn main() -> Result<()> { let mut app = tide::new(); app.with(tide::log::LogMiddleware::new()); app.with(cors); - app.at("/").nest(server(indexer.clone())); - - tokio::task::spawn(async move { - loop { - tokio::time::sleep(Duration::from_secs(10)).await; - if let Err(err) = indexer.sync().await { - log::error!("{}", err); - } - } - }); + app.at("/").nest(server(Arc::new(client))); log::info!("listening on {}", &opts.addr); app.listen(opts.addr).await?; @@ -91,7 +74,7 @@ pub async fn main() -> Result<()> { Ok(()) } -type State = Arc>; +type State = Arc; fn server(client: State) -> tide::Server> { let config = client.config(); @@ -113,7 +96,6 @@ fn server(client: State) -> tide::Server> { app.at("/network/list").post(network_list); app.at("/network/options").post(network_options); app.at("/network/status").post(network_status); - app.at("/search/transactions").post(search_transactions); // unsupported app.at("/mempool").post(unsupported); app.at("/mempool/transaction").post(unsupported); @@ -352,19 +334,6 @@ async fn block_transaction(mut req: Request>) -> t ok(&response) } -async fn search_transactions(mut req: Request>) -> tide::Result { - let request: SearchTransactionsRequest = req.body_json().await?; - let config = req.state().config(); - if !is_network_supported(&request.network_identifier, config) { - return Error::UnsupportedNetwork.to_result(); - } - let response = match req.state().search(&request).await { - Ok(response) => response, - Err(err) => return Error::RpcError(err).to_result(), - }; - ok(&response) -} - async fn call(mut req: Request>) -> tide::Result { let request: CallRequest = req.body_json().await?; let config = req.state().config(); @@ -450,11 +419,19 @@ impl Error { #[cfg(feature = "tests")] pub mod tests { use super::*; - use futures::stream::StreamExt; + use nanoid::nanoid; use rosetta_docker::Env; + fn env_id() -> String { + nanoid!( + 10, + &['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f',] + ) + } + pub async fn network_list(config: BlockchainConfig) -> Result<()> { - let env = Env::new("network-list", config.clone()).await?; + let env_id = env_id(); + let env = Env::new(&format!("{env_id}-network-list"), config.clone()).await?; let client = env.connector()?; let networks = client.network_list().await?; @@ -468,7 +445,8 @@ pub mod tests { } pub async fn network_options(config: BlockchainConfig) -> Result<()> { - let env = Env::new("network-options", config.clone()).await?; + let env_id = env_id(); + let env = Env::new(&format!("{env_id}-network-options"), config.clone()).await?; let client = env.node::().await?; let version = client.node_version().await?; @@ -482,7 +460,8 @@ pub mod tests { } pub async fn network_status(config: BlockchainConfig) -> Result<()> { - let env = Env::new("network-status", config.clone()).await?; + let env_id = env_id(); + let env = Env::new(&format!("{env_id}-network-status"), config.clone()).await?; let client = env.node::().await?; let genesis = client.genesis_block().clone(); @@ -498,7 +477,8 @@ pub mod tests { } pub async fn account(config: BlockchainConfig) -> Result<()> { - let env = Env::new("account", config.clone()).await?; + let env_id = env_id(); + let env = Env::new(&format!("{env_id}-account"), config.clone()).await?; let value = 100 * u128::pow(10, config.currency_decimals); let wallet = env.ephemeral_wallet()?; @@ -513,7 +493,8 @@ pub mod tests { } pub async fn construction(config: BlockchainConfig) -> Result<()> { - let env = Env::new("construction", config.clone()).await?; + let env_id = env_id(); + let env = Env::new(&format!("{env_id}-construction"), config.clone()).await?; let faucet = 100 * u128::pow(10, config.currency_decimals); let value = u128::pow(10, config.currency_decimals); @@ -528,63 +509,4 @@ pub mod tests { env.shutdown().await?; Ok(()) } - - pub async fn find_transaction(config: BlockchainConfig) -> Result<()> { - let env = Env::new("find-transaction", config.clone()).await?; - - let faucet = 100 * u128::pow(10, config.currency_decimals); - let value = u128::pow(10, config.currency_decimals); - let alice = env.ephemeral_wallet()?; - alice.faucet(faucet).await?; - - let bob = env.ephemeral_wallet()?; - let tx_id = alice.transfer(bob.account(), value).await?; - - let tx = alice.transaction(tx_id.clone()).await?; - assert_eq!(tx.transaction.transaction_identifier, tx_id); - - env.shutdown().await?; - Ok(()) - } - - pub async fn list_transactions(config: BlockchainConfig) -> Result<()> { - let env = Env::new("list-transactions", config.clone()).await?; - - let faucet = 100 * u128::pow(10, config.currency_decimals); - let value = u128::pow(10, config.currency_decimals); - let alice = env.ephemeral_wallet()?; - alice.faucet(faucet).await?; - - let bob = env.ephemeral_wallet()?; - alice.transfer(bob.account(), value).await?; - alice.transfer(bob.account(), value).await?; - alice.transfer(bob.account(), value).await?; - - tokio::time::sleep(Duration::from_secs(1)).await; - - let mut stream = bob.transactions(1); - let mut count = 0; - while let Some(res) = stream.next().await { - let transactions = res?; - assert_eq!(transactions.len(), 1); - assert_eq!(stream.total_count(), Some(3)); - count += 1; - assert!(count <= 3); - } - assert_eq!(count, 3); - - let mut stream = bob.transactions(10); - let mut count = 0; - while let Some(res) = stream.next().await { - let transactions = res?; - assert_eq!(transactions.len(), 3); - assert_eq!(stream.total_count(), Some(3)); - count += 1; - assert!(count <= 1); - } - assert_eq!(count, 1); - - env.shutdown().await?; - Ok(()) - } }