diff --git a/Cargo.lock b/Cargo.lock index 68742b764..ccf1db43b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -511,7 +511,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" dependencies = [ "alloy-rlp-derive", - "arrayvec", + "arrayvec 0.7.6", "bytes", ] @@ -796,7 +796,7 @@ checksum = "e3412d52bb97c6c6cc27ccc28d4e6e8cf605469101193b50b0bd5813b1f990b5" dependencies = [ "alloy-primitives", "alloy-rlp", - "arrayvec", + "arrayvec 0.7.6", "derive_more 2.0.1", "nybbles", "serde", @@ -1107,6 +1107,29 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + [[package]] name = "ark-bls12-381" version = "0.5.0" @@ -1172,7 +1195,7 @@ dependencies = [ "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.5", "itertools 0.13.0", "num-bigint 0.4.6", "num-integer", @@ -1180,6 +1203,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-ff" version = "0.3.0" @@ -1228,7 +1263,7 @@ dependencies = [ "ark-ff-macros 0.5.0", "ark-serialize 0.5.0", "ark-std 0.5.0", - "arrayvec", + "arrayvec 0.7.6", "digest 0.10.7", "educe", "itertools 0.13.0", @@ -1331,7 +1366,7 @@ dependencies = [ "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.5", ] [[package]] @@ -1393,7 +1428,7 @@ checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" dependencies = [ "ark-serialize-derive 0.5.0", "ark-std 0.5.0", - "arrayvec", + "arrayvec 0.7.6", "digest 0.10.7", "num-bigint 0.4.6", ] @@ -1450,12 +1485,60 @@ dependencies = [ "rand 0.8.5", ] +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9501da18569b2afe0eb934fb7afd5a247d238b94116155af4dd068f319adfe6d" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha 0.3.1", + "sha2 0.10.9", + "w3f-ring-proof", + "zeroize", +] + +[[package]] +name = "array-bytes" +version = "6.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" + [[package]] name = "arrayref" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -1489,7 +1572,7 @@ dependencies = [ "asn1-rs-derive", "asn1-rs-impl", "displaydoc", - "nom", + "nom 7.1.3", "num-traits", "rusticata-macros", "thiserror 1.0.69", @@ -1795,6 +1878,12 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "atomic-take" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8ab6b55fe97976e46f91ddbed8d147d966475dc29b2032757ba47e02376fbc3" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -1968,6 +2057,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + [[package]] name = "base64" version = "0.12.3" @@ -2031,6 +2126,17 @@ dependencies = [ "zip", ] +[[package]] +name = "binary-merkle-tree" +version = "16.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95c9f6900c9fd344d53fbdfb36e1343429079d73f4168c8ef48884bf15616dbd" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", +] + [[package]] name = "bincode" version = "1.3.3" @@ -2040,6 +2146,17 @@ dependencies = [ "serde", ] +[[package]] +name = "bip39" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d193de1f7487df1914d3a568b772458861d33f9c54249612cc2893d6915054" +dependencies = [ + "bitcoin_hashes 0.13.0", + "serde", + "unicode-normalization", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -2070,12 +2187,28 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin-io" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative 0.1.2", +] + [[package]] name = "bitcoin_hashes" version = "0.14.0" @@ -2083,7 +2216,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", - "hex-conservative", + "hex-conservative 0.2.1", ] [[package]] @@ -2123,6 +2256,27 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq 0.1.5", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" +dependencies = [ + "arrayref", + "arrayvec 0.7.6", + "constant_time_eq 0.3.1", +] + [[package]] name = "blake3" version = "1.8.2" @@ -2130,7 +2284,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.7.6", "cc", "cfg-if 1.0.0", "constant_time_eq 0.3.1", @@ -2312,6 +2466,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bounded-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee8eddd066a8825ec5570528e6880471210fd5d88cb6abbe1cfdd51ca249c33" +dependencies = [ + "jam-codec", + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "brotli" version = "8.0.0" @@ -2767,7 +2934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -2797,6 +2964,12 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -2902,6 +3075,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" +[[package]] +name = "convert_case" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb402b8d4c85569410425650ce3eddc7d698ed96d39a73f941b08fb63082f1e7" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -3034,6 +3216,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.21" @@ -3079,6 +3270,21 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + [[package]] name = "ctr" version = "0.9.2" @@ -3130,6 +3336,7 @@ dependencies = [ "fiat-crypto", "rustc_version 0.4.1", "subtle", + "zeroize", ] [[package]] @@ -3359,6 +3566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -3370,7 +3578,7 @@ checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ "asn1-rs", "displaydoc", - "nom", + "nom 7.1.3", "num-bigint 0.4.6", "num-traits", "rusticata-macros", @@ -3403,6 +3611,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "derive-where" version = "1.5.0" @@ -3473,6 +3692,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ + "convert_case 0.7.1", "proc-macro2", "quote", "syn 2.0.101", @@ -3551,7 +3771,7 @@ dependencies = [ "aes", "aes-gcm", "alloy-rlp", - "arrayvec", + "arrayvec 0.7.6", "ctr", "delay_map", "enr 0.12.1", @@ -3569,7 +3789,7 @@ dependencies = [ "socket2 0.4.10", "tokio", "tracing", - "uint", + "uint 0.9.5", "zeroize", ] @@ -3607,6 +3827,33 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "docify" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a772b62b1837c8f060432ddcc10b17aae1453ef17617a99bc07789252d2a5896" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e6be249b0a462a14784a99b19bf35a667bb5e09de611738bb7362fa4c95ff7" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.101", + "termcolor", + "toml 0.8.22", + "walkdir", +] + [[package]] name = "docker_credential" version = "1.3.1" @@ -3618,6 +3865,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dtoa" version = "1.0.10" @@ -3723,6 +3976,22 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "ed25519-zebra" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" +dependencies = [ + "curve25519-dalek 4.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "ed25519 2.2.3", + "hashbrown 0.15.5", + "pkcs8", + "rand_core 0.6.4", + "sha2 0.10.9", + "subtle", + "zeroize", +] + [[package]] name = "educe" version = "0.6.0" @@ -3944,6 +4213,12 @@ dependencies = [ "log", ] +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + [[package]] name = "equivalent" version = "1.0.2" @@ -3957,7 +4232,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3984,7 +4259,7 @@ dependencies = [ "hmac 0.12.1", "pbkdf2 0.11.0", "rand 0.8.5", - "scrypt", + "scrypt 0.10.0", "serde", "serde_json", "sha2 0.10.9", @@ -4007,7 +4282,7 @@ dependencies = [ "serde_json", "sha3", "thiserror 1.0.69", - "uint", + "uint 0.9.5", ] [[package]] @@ -4018,9 +4293,9 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] @@ -4033,12 +4308,12 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom", "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "primitive-types 0.12.2", "scale-info", - "uint", + "uint 0.9.5", ] [[package]] @@ -4185,7 +4460,7 @@ version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "bytes", "cargo_metadata", "chrono", @@ -4378,6 +4653,21 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "expander" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" +dependencies = [ + "blake2", + "file-guard", + "fs-err", + "prettyplease 0.2.34", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "eyre" version = "0.6.12" @@ -4409,7 +4699,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -4420,7 +4710,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", ] @@ -4462,6 +4752,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "file-guard" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "filetime" version = "0.2.25" @@ -4577,6 +4877,43 @@ dependencies = [ "percent-encoding 2.3.1", ] +[[package]] +name = "frame-decode" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c470df86cf28818dd3cd2fc4667b80dbefe2236c722c3dc1d09e7c6c82d6dfcd" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-encode", + "scale-info", + "scale-type-resolver", + "sp-crypto-hashing", + "thiserror 2.0.12", +] + +[[package]] +name = "frame-metadata" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8c26fcb0454397c522c05fdad5380c4e622f8a875638af33bff5a320d1fc965" +dependencies = [ + "cfg-if 1.0.0", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "fs2" version = "0.4.3" @@ -4820,12 +5157,22 @@ dependencies = [ ] [[package]] -name = "ghash" -version = "0.5.1" +name = "getrandom_or_panic" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "opaque-debug", + "rand 0.8.5", + "rand_core 0.6.4", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", "polyval", ] @@ -5061,6 +5408,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + [[package]] name = "hash32" version = "0.2.1" @@ -5097,13 +5459,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", "foldhash 0.1.5", + "serde", ] [[package]] @@ -5222,7 +5585,7 @@ dependencies = [ "helios-common", "helios-verifiable-api-client", "hex", - "jsonrpsee", + "jsonrpsee 0.19.0", "openssl", "parking_lot 0.12.3", "reqwest 0.12.15", @@ -5402,13 +5765,19 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-conservative" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", ] [[package]] @@ -6038,6 +6407,26 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + [[package]] name = "impl-rlp" version = "0.3.0" @@ -6056,6 +6445,15 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.3" @@ -6091,7 +6489,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.5", "serde", ] @@ -6135,6 +6533,15 @@ dependencies = [ "web-sys", ] +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + [[package]] name = "integration-tests" version = "0.1.0" @@ -6234,7 +6641,7 @@ checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" dependencies = [ "hermit-abi 0.5.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6303,6 +6710,34 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +[[package]] +name = "jam-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb948eace373d99de60501a02fb17125d30ac632570de20dccc74370cdd611b9" +dependencies = [ + "arrayvec 0.7.6", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "jam-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "jam-codec-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319af585c4c8a6b5552a52b7787a1ab3e4d59df7614190b1f85b9b842488789d" +dependencies = [ + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "jni" version = "0.21.1" @@ -6395,17 +6830,29 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5f3783308bddc49d0218307f66a09330c106fbd792c58bac5c8dc294fdd0f98" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", + "jsonrpsee-client-transport 0.19.0", + "jsonrpsee-core 0.19.0", "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types", + "jsonrpsee-types 0.19.0", "jsonrpsee-wasm-client", - "jsonrpsee-ws-client", + "jsonrpsee-ws-client 0.19.0", "tracing", ] +[[package]] +name = "jsonrpsee" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e281ae70cc3b98dac15fced3366a880949e65fc66e345ce857a5682d152f3e62" +dependencies = [ + "jsonrpsee-client-transport 0.24.10", + "jsonrpsee-core 0.24.10", + "jsonrpsee-types 0.24.10", + "jsonrpsee-ws-client 0.24.10", +] + [[package]] name = "jsonrpsee-client-transport" version = "0.19.0" @@ -6416,10 +6863,10 @@ dependencies = [ "futures-util", "gloo-net", "http 0.2.12", - "jsonrpsee-core", + "jsonrpsee-core 0.19.0", "pin-project", "rustls-native-certs 0.6.3", - "soketto", + "soketto 0.7.1", "thiserror 1.0.69", "tokio", "tokio-rustls 0.24.1", @@ -6428,6 +6875,29 @@ dependencies = [ "webpki-roots 0.24.0", ] +[[package]] +name = "jsonrpsee-client-transport" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4280b709ac3bb5e16cf3bad5056a0ec8df55fa89edfe996361219aadc2c7ea" +dependencies = [ + "base64 0.22.1", + "futures-util", + "http 1.3.1", + "jsonrpsee-core 0.24.10", + "pin-project", + "rustls 0.23.26", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto 0.8.1", + "thiserror 1.0.69", + "tokio", + "tokio-rustls 0.26.2", + "tokio-util", + "tracing", + "url 2.5.4", +] + [[package]] name = "jsonrpsee-core" version = "0.19.0" @@ -6442,13 +6912,13 @@ dependencies = [ "futures-util", "globset", "hyper 0.14.32", - "jsonrpsee-types", + "jsonrpsee-types 0.19.0", "parking_lot 0.12.3", "rand 0.8.5", "rustc-hash 1.1.0", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "thiserror 1.0.69", "tokio", "tokio-stream", @@ -6456,6 +6926,26 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "jsonrpsee-core" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "348ee569eaed52926b5e740aae20863762b16596476e943c9e415a6479021622" +dependencies = [ + "async-trait", + "futures-timer", + "futures-util", + "jsonrpsee-types 0.24.10", + "pin-project", + "rustc-hash 2.1.1", + "serde", + "serde_json", + "thiserror 1.0.69", + "tokio", + "tokio-stream", + "tracing", +] + [[package]] name = "jsonrpsee-http-client" version = "0.19.0" @@ -6465,8 +6955,8 @@ dependencies = [ "async-trait", "hyper 0.14.32", "hyper-rustls 0.24.2", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.19.0", + "jsonrpsee-types 0.19.0", "serde", "serde_json", "thiserror 1.0.69", @@ -6496,11 +6986,11 @@ checksum = "6e79d78cfd5abd8394da10753723093c3ff64391602941c9c4b1d80a3414fd53" dependencies = [ "futures-util", "hyper 0.14.32", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.19.0", + "jsonrpsee-types 0.19.0", "serde", "serde_json", - "soketto", + "soketto 0.7.1", "tokio", "tokio-stream", "tokio-util", @@ -6522,15 +7012,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-types" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0f05e0028e55b15dbd2107163b3c744cd3bb4474f193f95d9708acbf5677e44" +dependencies = [ + "http 1.3.1", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "jsonrpsee-wasm-client" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fe953c2801356f214d3f4051f786b3d11134512a46763ee8c39a9e3fa2cc1c0" dependencies = [ - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.19.0", + "jsonrpsee-core 0.19.0", + "jsonrpsee-types 0.19.0", ] [[package]] @@ -6540,9 +7042,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c71b2597ec1c958c6d5bc94bb61b44d74eb28e69dc421731ab0035706f13882" dependencies = [ "http 0.2.12", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.19.0", + "jsonrpsee-core 0.19.0", + "jsonrpsee-types 0.19.0", +] + +[[package]] +name = "jsonrpsee-ws-client" +version = "0.24.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78fc744f17e7926d57f478cf9ca6e1ee5d8332bf0514860b1a3cdf1742e614cc" +dependencies = [ + "http 1.3.1", + "jsonrpsee-client-transport 0.24.10", + "jsonrpsee-core 0.24.10", + "jsonrpsee-types 0.24.10", + "url 2.5.4", ] [[package]] @@ -6593,6 +7108,16 @@ dependencies = [ "sha3-asm", ] +[[package]] +name = "keccak-hash" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1b8590eb6148af2ea2d75f38e7d29f5ca970d5a4df456b3ef19b8b415d0264" +dependencies = [ + "primitive-types 0.13.1", + "tiny-keccak", +] + [[package]] name = "lalrpop" version = "0.20.2" @@ -7143,7 +7668,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.5", ] [[package]] @@ -7152,7 +7677,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.5", ] [[package]] @@ -7262,6 +7787,17 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memory-db" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e300c54e3239a86f9c61cc63ab0f03862eb40b1c6e065dc6fd6ceaeff6da93d" +dependencies = [ + "foldhash 0.1.5", + "hash-db", + "hashbrown 0.15.5", +] + [[package]] name = "memory_units" version = "0.4.0" @@ -7420,6 +7956,7 @@ dependencies = [ "ciborium", "clap", "deadpool-redis", + "ed25519-zebra", "ethabi", "futures-util", "google-datastore1", @@ -7450,7 +7987,7 @@ dependencies = [ "opentelemetry-appender-tracing", "opentelemetry-otlp", "opentelemetry_sdk", - "prometheus", + "prometheus 0.14.0", "rand 0.8.5", "redis", "reqwest 0.11.27", @@ -7465,6 +8002,12 @@ dependencies = [ "solana-client", "solana-sdk", "solana-transaction-status", + "sp-core", + "sp-runtime", + "sp-state-machine", + "sp-trie", + "subxt", + "subxt-signer", "sysinfo", "test-log", "thiserror 1.0.69", @@ -7512,6 +8055,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "multiaddr" version = "0.17.1" @@ -8625,6 +9174,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -8641,6 +9196,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + [[package]] name = "nonzero_ext" version = "0.3.0" @@ -8761,6 +9325,16 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec 0.7.6", + "itoa", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -8852,7 +9426,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.3.0", "proc-macro2", "quote", "syn 2.0.101", @@ -8993,7 +9567,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "auto_impl", "bytes", "ethereum-types", @@ -9194,15 +9768,29 @@ dependencies = [ "group", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" -version = "3.7.4" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ - "arrayvec", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", + "bytes", "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", @@ -9212,9 +9800,9 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.7.4" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -9312,6 +9900,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" @@ -9332,7 +9931,7 @@ checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", "hmac 0.12.1", - "password-hash", + "password-hash 0.4.2", "sha2 0.10.9", ] @@ -9344,6 +9943,7 @@ checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac 0.12.1", + "password-hash 0.5.0", ] [[package]] @@ -9378,6 +9978,15 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "1.0.1" @@ -9560,6 +10169,43 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polkavm-common" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a5794b695626ba70d29e66e3f4f4835767452a6723f3a0bc20884b07088fe8" + +[[package]] +name = "polkavm-derive" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95282a203ae1f6828a04ff334145c3f6dc718bba6d3959805d273358b45eab93" +dependencies = [ + "polkavm-derive-impl-macro", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6069dc7995cde6e612b868a02ce48b54397c6d2582bd1b97b63aabbe962cd779" +dependencies = [ + "polkavm-common", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581d34cafec741dc5ffafbb341933c205b6457f3d76257a9d99fb56687219c91" +dependencies = [ + "polkavm-derive-impl", + "syn 2.0.101", +] + [[package]] name = "polling" version = "2.8.0" @@ -9677,7 +10323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" dependencies = [ "fixed-hash 0.7.0", - "uint", + "uint 0.9.5", ] [[package]] @@ -9687,11 +10333,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", + "scale-info", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec 0.7.1", + "impl-num-traits", + "impl-serde 0.5.0", "scale-info", - "uint", + "uint 0.10.0", ] [[package]] @@ -9770,9 +10430,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.95" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -9792,24 +10452,38 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.14.0" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ca5326d8d0b950a9acd87e6a3f94745394f62e4dae1b1ee22b2bc0c394af43a" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", "memchr", "parking_lot 0.12.3", - "protobuf", - "thiserror 2.0.12", + "thiserror 1.0.69", ] [[package]] -name = "prometheus-client" -version = "0.19.0" +name = "prometheus" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" +checksum = "3ca5326d8d0b950a9acd87e6a3f94745394f62e4dae1b1ee22b2bc0c394af43a" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "memchr", + "parking_lot 0.12.3", + "protobuf", + "thiserror 2.0.12", +] + +[[package]] +name = "prometheus-client" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", @@ -10013,7 +10687,7 @@ dependencies = [ "once_cell", "socket2 0.5.9", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10253,6 +10927,26 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "regex" version = "1.11.1" @@ -10608,7 +11302,7 @@ version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b57d4bd9e6b5fe469da5452a8a137bc2d030a3cd47c46908efc615bbc699da" dependencies = [ - "ark-bls12-381", + "ark-bls12-381 0.5.0", "ark-bn254 0.5.0", "ark-ec 0.5.0", "ark-ff 0.5.0", @@ -10858,7 +11552,7 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" dependencies = [ - "nom", + "nom 7.1.3", ] [[package]] @@ -10885,7 +11579,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.4.15", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -10898,7 +11592,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.9.4", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -11036,7 +11730,7 @@ dependencies = [ "security-framework 3.2.0", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -11095,6 +11789,12 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ruzstd" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ff0cc5e135c8870a775d3320910cd9b564ec036b4dc0b8741629020be63f01" + [[package]] name = "rw-stream-sink" version = "0.3.0" @@ -11130,16 +11830,85 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-bits" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27243ab0d2d6235072b017839c5f0cd1a3b1ce45c0f7a715363b0c7d36c76c94" +dependencies = [ + "parity-scale-codec", + "scale-info", + "scale-type-resolver", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d6ed61699ad4d54101ab5a817169259b5b0efc08152f8632e61482d8a27ca3d" +dependencies = [ + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode-derive", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-decode-derive" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cb245f7fdb489e7ba43a616cbd34427fe3ba6fe0edc1d0d250085e6c84f3ec" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "scale-encode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64901733157f9d25ef86843bd783eda439fac7efb0ad5a615d12d2cf3a29464b" +dependencies = [ + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-encode-derive", + "scale-type-resolver", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-encode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a3993a13b4eafa89350604672c8757b7ea84c7c5947d4b3691e3169c96379b" +dependencies = [ + "darling 0.20.11", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "scale-info" version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ + "bitvec", "cfg-if 1.0.0", "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", + "serde", ] [[package]] @@ -11154,6 +11923,48 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" +dependencies = [ + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-typegen" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c61b6b706a3eaad63b506ab50a1d2319f817ae01cf753adcc3f055f9f0fcd6" +dependencies = [ + "proc-macro2", + "quote", + "scale-info", + "syn 2.0.101", + "thiserror 2.0.12", +] + +[[package]] +name = "scale-value" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884aab179aba344c67ddcd1d7dd8e3f8fee202f2e570d97ec34ec8688442a5b3" +dependencies = [ + "base58", + "blake2", + "either", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-type-resolver", + "serde", + "thiserror 2.0.12", + "yap", +] + [[package]] name = "schannel" version = "0.1.27" @@ -11187,6 +11998,36 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "schnellru" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" +dependencies = [ + "ahash", + "cfg-if 1.0.0", + "hashbrown 0.13.2", +] + +[[package]] +name = "schnorrkel" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9fcb6c2e176e86ec703e22560d99d65a5ee9056ae45a08e13e84ebf796296f" +dependencies = [ + "aead", + "arrayref", + "arrayvec 0.7.6", + "curve25519-dalek 4.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom_or_panic", + "merlin", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.9", + "subtle", + "zeroize", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -11205,6 +12046,18 @@ dependencies = [ "sha2 0.10.9", ] +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "password-hash 0.5.0", + "pbkdf2 0.12.2", + "salsa20", + "sha2 0.10.9", +] + [[package]] name = "sct" version = "0.7.1" @@ -11261,7 +12114,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.14.0", "rand 0.8.5", "secp256k1-sys 0.10.1", "serde", @@ -11273,7 +12126,7 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c3c81b43dc2d8877c216a3fccf76677ee1ebccd429566d3e67447290d0c42b2" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.14.0", "rand 0.9.1", "secp256k1-sys 0.11.0", ] @@ -11314,6 +12167,24 @@ dependencies = [ "cc", ] +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "secrecy" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e891af845473308773346dc847b2c23ee78fe442e0472ac50e22a18a93d3ae5a" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -11699,6 +12570,12 @@ version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + [[package]] name = "simple_asn1" version = "0.6.3" @@ -11780,6 +12657,96 @@ dependencies = [ "futures-lite 2.6.0", ] +[[package]] +name = "smoldot" +version = "0.19.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16e5723359f0048bf64bfdfba64e5732a56847d42c4fd3fe56f18280c813413" +dependencies = [ + "arrayvec 0.7.6", + "async-lock 3.4.0", + "atomic-take", + "base64 0.22.1", + "bip39", + "blake2-rfc", + "bs58 0.5.1", + "chacha20", + "crossbeam-queue", + "derive_more 2.0.1", + "ed25519-zebra", + "either", + "event-listener 5.4.0", + "fnv", + "futures-lite 2.6.0", + "futures-util", + "hashbrown 0.15.5", + "hex", + "hmac 0.12.1", + "itertools 0.14.0", + "libm", + "libsecp256k1 0.7.2", + "merlin", + "nom 8.0.0", + "num-bigint 0.4.6", + "num-rational 0.4.2", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "poly1305", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel", + "serde", + "serde_json", + "sha2 0.10.9", + "sha3", + "siphasher 1.0.1", + "slab", + "smallvec", + "soketto 0.8.1", + "twox-hash 2.1.2", + "wasmi", + "x25519-dalek 2.0.1", + "zeroize", +] + +[[package]] +name = "smoldot-light" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bba9e591716567d704a8252feeb2f1261a286e1e2cbdd4e49e9197c34a14e2" +dependencies = [ + "async-channel 2.3.1", + "async-lock 3.4.0", + "base64 0.22.1", + "blake2-rfc", + "bs58 0.5.1", + "derive_more 2.0.1", + "either", + "event-listener 5.4.0", + "fnv", + "futures-channel", + "futures-lite 2.6.0", + "futures-util", + "hashbrown 0.15.5", + "hex", + "itertools 0.14.0", + "log", + "lru 0.12.5", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "serde", + "serde_json", + "siphasher 1.0.1", + "slab", + "smol", + "smoldot", + "zeroize", +] + [[package]] name = "snap" version = "1.1.1" @@ -11839,6 +12806,21 @@ dependencies = [ "sha-1", ] +[[package]] +name = "soketto" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e859df029d160cb88608f5d7df7fb4753fd20fdfb4de5644f3d8b8440841721" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha1", +] + [[package]] name = "solana-account" version = "2.2.1" @@ -14059,10 +15041,340 @@ dependencies = [ ] [[package]] -name = "spin" -version = "0.5.2" +name = "sp-application-crypto" +version = "43.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "e6067f30cf3fb9270471cf24a65d73b33330f32573abab2d97196f83fc076de0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", +] + +[[package]] +name = "sp-arithmetic" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f4755af7cc57f4a2a830e134b403fc832caa5d93dacb970ffc7ac717f38c40" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "38.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707602208776d0e19d4269bb3f68c5306cacbdfabbb2e4d8d499af7b907bb0a3" +dependencies = [ + "ark-vrf", + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58 0.5.1", + "dyn-clone", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde 0.5.0", + "itertools 0.11.0", + "k256", + "libsecp256k1 0.7.2", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot 0.12.3", + "paste", + "primitive-types 0.13.1", + "rand 0.8.5", + "scale-info", + "schnorrkel", + "secp256k1 0.28.2", + "secrecy 0.8.0", + "serde", + "sha2 0.10.9", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.9", + "sha3", + "twox-hash 1.6.3", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "sp-externalities" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage", +] + +[[package]] +name = "sp-io" +version = "43.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2059e3b338c0174e8dc9e144cc7e612165ca4c960c3a23c6c99c29ef34768f" +dependencies = [ + "bytes", + "docify", + "ed25519-dalek 2.1.1", + "libsecp256k1 0.7.2", + "log", + "parity-scale-codec", + "polkavm-derive", + "rustversion", + "secp256k1 0.28.2", + "sp-core", + "sp-crypto-hashing", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-tracing", + "sp-trie", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5c0b829014afc22e992be2c198f2677592db43267fc218e9f3207dbbfb6fbb" +dependencies = [ + "parity-scale-codec", + "parking_lot 0.12.3", + "sp-core", + "sp-externalities", +] + +[[package]] +name = "sp-panic-handler" +version = "13.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8b52e69a577cbfdea62bfaf16f59eb884422ce98f78b5cd8d9bf668776bced1" +dependencies = [ + "backtrace", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "44.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee57bb77e94c26306501426ac82aca401bb80ee2279ecdba148f68e76cf58247" +dependencies = [ + "binary-merkle-tree", + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-trie", + "sp-weights", + "tracing", + "tuplex", +] + +[[package]] +name = "sp-runtime-interface" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efdc2bc2adbfb9b4396ae07c7d94db20414d2351608e29e1f44e4f643b387c70" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04178084ae654b3924934a56943ee73e3562db4d277e948393561b08c3b5b5fe" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.3.0", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "sp-state-machine" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "042677239cca40eb6a0d70e0b220f5693516f59853c2d678de471a79652cd16e" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot 0.12.3", + "rand 0.8.5", + "smallvec", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-trie", + "thiserror 1.0.69", + "tracing", + "trie-db", +] + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" + +[[package]] +name = "sp-storage" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +dependencies = [ + "impl-serde 0.5.0", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + +[[package]] +name = "sp-tracing" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c7372456c39cc81e15befe54d0caab8378f2b30fd34d1bcb5f0f56631c6b6e" +dependencies = [ + "parity-scale-codec", + "regex", + "tracing", + "tracing-core", + "tracing-subscriber 0.3.20", +] + +[[package]] +name = "sp-trie" +version = "41.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2a05942903900c23aaa5fded094fa8186523e646ae8874bff3fce74985d0e5" +dependencies = [ + "ahash", + "foldhash 0.1.5", + "hash-db", + "hashbrown 0.15.5", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot 0.12.3", + "rand 0.8.5", + "scale-info", + "schnellru", + "sp-core", + "sp-externalities", + "substrate-prometheus-endpoint", + "thiserror 1.0.69", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-wasm-interface" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd177d0658f3df0492f28bd39d665133a7868db5aa66c8642c949b6265430719" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + +[[package]] +name = "sp-weights" +version = "33.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb3f1b1373a0926b44ddabfa55a608ea78c20ee356f35575c031db2f0202545" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic", + "sp-debug-derive", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spin" @@ -14447,6 +15759,21 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "ss58-registry" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + [[package]] name = "ssz_types" version = "0.11.0" @@ -14588,12 +15915,236 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.9", + "zeroize", +] + +[[package]] +name = "substrate-prometheus-endpoint" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23e4bc8e910a312820d589047ab683928b761242dbe31dee081fbdb37cbe0be" +dependencies = [ + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "log", + "prometheus 0.13.4", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "subtle" version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "subxt" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddbf938ac1d86a361a84709a71cdbae5d87f370770b563651d1ec052eed9d0b4" +dependencies = [ + "async-trait", + "derive-where", + "either", + "frame-metadata", + "futures", + "hex", + "jsonrpsee 0.24.10", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-crypto-hashing", + "subxt-core", + "subxt-lightclient", + "subxt-macro", + "subxt-metadata", + "subxt-rpcs", + "thiserror 2.0.12", + "tokio", + "tokio-util", + "tracing", + "url 2.5.4", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "subxt-codegen" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c250ad8cd102d40ae47977b03295a2ff791375f30ddc7474d399fb56efb793b" +dependencies = [ + "heck 0.5.0", + "parity-scale-codec", + "proc-macro2", + "quote", + "scale-info", + "scale-typegen", + "subxt-metadata", + "syn 2.0.101", + "thiserror 2.0.12", +] + +[[package]] +name = "subxt-core" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5705c5b420294524e41349bf23c6b11aa474ce731de7317f4153390e1927f702" +dependencies = [ + "base58", + "blake2", + "derive-where", + "frame-decode", + "frame-metadata", + "hashbrown 0.14.5", + "hex", + "impl-serde 0.5.0", + "keccak-hash", + "parity-scale-codec", + "primitive-types 0.13.1", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-crypto-hashing", + "subxt-metadata", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "subxt-lightclient" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e02732a6c9ae46bc282c1a741b3d3e494021b3e87e7e92cfb3620116d92911" +dependencies = [ + "futures", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror 2.0.12", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "subxt-macro" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501bf358698f5ab02a6199a1fcd3f1b482e2f5b6eb5d185411e6a74a175ec8e8" +dependencies = [ + "darling 0.20.11", + "parity-scale-codec", + "proc-macro-error2", + "quote", + "scale-typegen", + "subxt-codegen", + "subxt-metadata", + "subxt-utils-fetchmetadata", + "syn 2.0.101", +] + +[[package]] +name = "subxt-metadata" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01fb7c0bfafad78dda7084c6a2444444744af3bbf7b2502399198b9b4c20eddf" +dependencies = [ + "frame-decode", + "frame-metadata", + "hashbrown 0.14.5", + "parity-scale-codec", + "scale-info", + "sp-crypto-hashing", + "thiserror 2.0.12", +] + +[[package]] +name = "subxt-rpcs" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab68a9c20ecedb0cb7d62d64f884e6add91bb70485783bf40aa8eac5c389c6e0" +dependencies = [ + "derive-where", + "frame-metadata", + "futures", + "hex", + "impl-serde 0.5.0", + "jsonrpsee 0.24.10", + "parity-scale-codec", + "primitive-types 0.13.1", + "serde", + "serde_json", + "subxt-core", + "subxt-lightclient", + "thiserror 2.0.12", + "tokio-util", + "tracing", + "url 2.5.4", +] + +[[package]] +name = "subxt-signer" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fb6463f7f46817043de9f20ba11f485ee474378fcdbe4150aa849274523bd1c" +dependencies = [ + "base64 0.22.1", + "bip39", + "cfg-if 1.0.0", + "crypto_secretbox", + "hex", + "hmac 0.12.1", + "parity-scale-codec", + "pbkdf2 0.12.2", + "regex", + "schnorrkel", + "scrypt 0.11.0", + "secp256k1 0.30.0", + "secrecy 0.10.3", + "serde", + "serde_json", + "sha2 0.10.9", + "sp-crypto-hashing", + "subxt-core", + "thiserror 2.0.12", + "zeroize", +] + +[[package]] +name = "subxt-utils-fetchmetadata" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e450f6812a653c5a3e63a079aa3b60a3f4c362722753c3222286eaa1800f9002" +dependencies = [ + "hex", + "parity-scale-codec", + "thiserror 2.0.12", +] + [[package]] name = "superstruct" version = "0.7.0" @@ -14792,7 +16343,7 @@ dependencies = [ "getrandom 0.3.2", "once_cell", "rustix 1.0.5", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -15375,6 +16926,7 @@ dependencies = [ "sharded-slab", "smallvec", "thread_local", + "time", "tracing", "tracing-core", "tracing-log", @@ -15406,6 +16958,27 @@ dependencies = [ "syn 2.0.101", ] +[[package]] +name = "trie-db" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c0670ab45a6b7002c7df369fee950a27cf29ae0474343fd3a15aa15f691e7a6" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + [[package]] name = "trust-dns-proto" version = "0.22.0" @@ -15479,6 +17052,30 @@ dependencies = [ "webpki-roots 0.24.0", ] +[[package]] +name = "tuplex" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "676ac81d5454c4dcf37955d34fa8626ede3490f744b86ca14a7b90168d2a08aa" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" + [[package]] name = "typenum" version = "1.18.0" @@ -15503,6 +17100,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unarray" version = "0.1.4" @@ -15538,9 +17147,9 @@ checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-normalization" -version = "0.1.24" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -15728,6 +17337,74 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "w3f-bls" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", + "arrayref", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.9", + "sha3", + "zeroize", +] + +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core 0.6.4", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + [[package]] name = "wait-timeout" version = "0.2.1" @@ -15869,6 +17546,56 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmi" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19af97fcb96045dd1d6b4d23e2b4abdbbe81723dbc5c9f016eb52145b320063" +dependencies = [ + "arrayvec 0.7.6", + "multi-stash", + "smallvec", + "spin 0.9.8", + "wasmi_collections", + "wasmi_core", + "wasmi_ir", + "wasmparser", +] + +[[package]] +name = "wasmi_collections" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e80d6b275b1c922021939d561574bf376613493ae2b61c6963b15db0e8813562" + +[[package]] +name = "wasmi_core" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8c51482cc32d31c2c7ff211cd2bedd73c5bd057ba16a2ed0110e7a96097c33" +dependencies = [ + "downcast-rs", + "libm", +] + +[[package]] +name = "wasmi_ir" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e431a14c186db59212a88516788bd68ed51f87aa1e08d1df742522867b5289a" +dependencies = [ + "wasmi_core", +] + +[[package]] +name = "wasmparser" +version = "0.221.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d06bfa36ab3ac2be0dee563380147a5b81ba10dd8885d7fbbc9eb574be67d185" +dependencies = [ + "bitflags 2.10.0", +] + [[package]] name = "wasmtimer" version = "0.2.1" @@ -16000,7 +17727,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -16481,6 +18208,8 @@ source = "git+https://github.com/dalek-cryptography/curve25519-dalek?rev=5b7082b dependencies = [ "curve25519-dalek 4.1.3 (git+https://github.com/dalek-cryptography/curve25519-dalek?rev=5b7082bbc8e0b2106ab0d956064f61fa0f393cdc)", "rand_core 0.6.4", + "serde", + "zeroize", ] [[package]] @@ -16494,7 +18223,7 @@ dependencies = [ "data-encoding", "der-parser", "lazy_static", - "nom", + "nom 7.1.3", "oid-registry", "rusticata-macros", "thiserror 1.0.69", @@ -16523,6 +18252,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" +[[package]] +name = "yap" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfe269e7b803a5e8e20cbd97860e136529cd83bf2c9c6d37b142467e7e1f051f" + [[package]] name = "yasna" version = "0.5.2" diff --git a/chain-signatures/crypto/src/kdf.rs b/chain-signatures/crypto/src/kdf.rs index 2c31ce993..0cc2da2a6 100644 --- a/chain-signatures/crypto/src/kdf.rs +++ b/chain-signatures/crypto/src/kdf.rs @@ -19,6 +19,7 @@ pub enum Chain { Ethereum, Solana, Bitcoin, + Hydration, } impl Chain { @@ -28,6 +29,7 @@ impl Chain { Chain::Ethereum => "0x1", Chain::Solana => "0x800001f5", Chain::Bitcoin => "bip122:000000000019d6689c085ae165831e93", + Chain::Hydration => "polkadot:2034", } } @@ -37,6 +39,7 @@ impl Chain { Chain::Ethereum => "eip155:1", Chain::Solana => "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", Chain::Bitcoin => "bip122:000000000019d6689c085ae165831e93", + Chain::Hydration => "polkadot:2034", } } } @@ -90,6 +93,11 @@ pub fn derive_epsilon_sol(key_version: u32, sender: &str, path: &str) -> Scalar keccak(derivation_path.as_bytes()) } +pub fn derive_epsilon_hydration(key_version: u32, sender: &str, path: &str) -> Scalar { + let derivation_path = derivation_path(key_version, Chain::Hydration, sender, path); + keccak(derivation_path.as_bytes()) +} + pub fn derive_key(public_key: PublicKey, epsilon: Scalar) -> PublicKey { (::ProjectivePoint::GENERATOR * epsilon + public_key).to_affine() } diff --git a/chain-signatures/node/Cargo.toml b/chain-signatures/node/Cargo.toml index 657585b9c..4112a95c0 100644 --- a/chain-signatures/node/Cargo.toml +++ b/chain-signatures/node/Cargo.toml @@ -39,7 +39,13 @@ opentelemetry-appender-tracing = "0.29.1" alloy-signer-local = "1.0.38" alloy-sol-types = "1.4.1" helios = { git = "https://github.com/a16z/helios", rev = "e1f9a50f73d7af6f6ae4acf2b663d04aab6adb19" } - +ed25519-zebra = { version = "4.1", default-features = false, features = ["alloc"] } +subxt = { version = "0.44", default-features = false, features = ["jsonrpsee","native","unstable-light-client"] } +sp-core = { version = "38.1", default-features = false, features = ["std"] } +sp-runtime = { version = "44.0.0", default-features = false, features = ["std"] } +sp-trie = { version = "41.1.0", default-features = false, features = ["std"] } +sp-state-machine = { version = "0.48", default-features = false, features = ["std"] } +subxt-signer = "0.44" # workspace dependencies alloy.workspace = true diff --git a/chain-signatures/node/src/backlog/mod.rs b/chain-signatures/node/src/backlog/mod.rs index 12610b3ff..16663e658 100644 --- a/chain-signatures/node/src/backlog/mod.rs +++ b/chain-signatures/node/src/backlog/mod.rs @@ -741,7 +741,7 @@ mod tests { fn create_test_tx(id: u8, status: PendingRequestStatus) -> BidirectionalTx { BidirectionalTx { id: BidirectionalTxId(B256::from([id; 32])), - sender: Pubkey::new_unique(), + sender: [0u8; 32], serialized_transaction: vec![1, 2, 3], source_chain: Chain::Solana, target_chain: Chain::Ethereum, @@ -781,20 +781,22 @@ mod tests { Chain::Ethereum, sign_id_eth, BacklogTransaction::Bidirectional(tx_eth.clone()), - SignRequestType::SignBidirectional(SignBidirectionalEvent { - sender: Default::default(), - serialized_transaction: vec![], - dest: "ethereum".to_string(), - caip2_id: "eip155:1".to_string(), - key_version: 0, - deposit: 0, - path: "".to_string(), - algo: "".to_string(), - params: "".to_string(), - program_id, - output_deserialization_schema: vec![], - respond_serialization_schema: vec![], - }), + SignRequestType::SignBidirectional( + crate::indexer_common::SignBidirectionalEvent::Solana(SignBidirectionalEvent { + sender: Default::default(), + serialized_transaction: vec![], + dest: "ethereum".to_string(), + caip2_id: "eip155:1".to_string(), + key_version: 0, + deposit: 0, + path: "".to_string(), + algo: "".to_string(), + params: "".to_string(), + program_id, + output_deserialization_schema: vec![], + respond_serialization_schema: vec![], + }), + ), ) .await; backlog @@ -802,20 +804,22 @@ mod tests { Chain::Solana, sign_id_sol, BacklogTransaction::Bidirectional(tx_sol.clone()), - SignRequestType::SignBidirectional(SignBidirectionalEvent { - sender: Default::default(), - serialized_transaction: vec![], - dest: "solana".to_string(), - caip2_id: "solana:5eykt4UsFY6PZFX8nTM1".to_string(), - key_version: 0, - deposit: 0, - path: "".to_string(), - algo: "".to_string(), - params: "".to_string(), - program_id, - output_deserialization_schema: vec![], - respond_serialization_schema: vec![], - }), + SignRequestType::SignBidirectional( + crate::indexer_common::SignBidirectionalEvent::Solana(SignBidirectionalEvent { + sender: Default::default(), + serialized_transaction: vec![], + dest: "solana".to_string(), + caip2_id: "solana:5eykt4UsFY6PZFX8nTM1".to_string(), + key_version: 0, + deposit: 0, + path: "".to_string(), + algo: "".to_string(), + params: "".to_string(), + program_id, + output_deserialization_schema: vec![], + respond_serialization_schema: vec![], + }), + ), ) .await; backlog @@ -823,20 +827,22 @@ mod tests { Chain::NEAR, sign_id_near, BacklogTransaction::Bidirectional(tx_near.clone()), - SignRequestType::SignBidirectional(SignBidirectionalEvent { - sender: Default::default(), - serialized_transaction: vec![], - dest: "near".to_string(), - caip2_id: "near:mainnet".to_string(), - key_version: 0, - deposit: 0, - path: "".to_string(), - algo: "".to_string(), - params: "".to_string(), - program_id, - output_deserialization_schema: vec![], - respond_serialization_schema: vec![], - }), + SignRequestType::SignBidirectional( + crate::indexer_common::SignBidirectionalEvent::Solana(SignBidirectionalEvent { + sender: Default::default(), + serialized_transaction: vec![], + dest: "near".to_string(), + caip2_id: "near:mainnet".to_string(), + key_version: 0, + deposit: 0, + path: "".to_string(), + algo: "".to_string(), + params: "".to_string(), + program_id, + output_deserialization_schema: vec![], + respond_serialization_schema: vec![], + }), + ), ) .await; diff --git a/chain-signatures/node/src/cli.rs b/chain-signatures/node/src/cli.rs index 79a0594ef..07ec85d25 100644 --- a/chain-signatures/node/src/cli.rs +++ b/chain-signatures/node/src/cli.rs @@ -12,7 +12,7 @@ use crate::rpc::{ContractStateWatcher, NearClient, RpcExecutor}; use crate::storage::app_data_storage; use crate::storage::checkpoint_storage::CheckpointStorage; use crate::storage::triple_storage::TriplePair; -use crate::{indexer, indexer_eth, indexer_sol, logs, mesh, storage, web}; +use crate::{indexer, indexer_eth, indexer_hydration, indexer_sol, logs, mesh, storage, web}; use clap::Parser; use deadpool_redis::Runtime; @@ -64,6 +64,9 @@ pub enum Cli { /// Solana Indexer options #[clap(flatten)] sol: indexer_sol::SolArgs, + /// Hydration Indexer options + #[clap(flatten)] + hydration: indexer_hydration::HydrationArgs, /// NEAR requests options #[clap(flatten)] indexer_options: indexer::Options, @@ -106,6 +109,7 @@ impl Cli { sign_sk, eth, sol, + hydration, indexer_options, my_address, storage_options, @@ -152,6 +156,7 @@ impl Cli { args.extend(eth.into_str_args()); args.extend(sol.into_str_args()); + args.extend(hydration.into_str_args()); args.extend(indexer_options.into_str_args()); args.extend(storage_options.into_str_args()); args.extend(log_options.into_str_args()); @@ -175,6 +180,7 @@ pub async fn run(cmd: Cli) -> anyhow::Result<()> { sign_sk, eth, sol, + hydration, indexer_options, my_address, storage_options, @@ -264,11 +270,13 @@ pub async fn run(cmd: Cli) -> anyhow::Result<()> { let eth = eth.into_config(); let sol = sol.into_config(); + let hydration = hydration.into_config(); let network = NetworkConfig { cipher_sk, sign_sk }; let near_client = NearClient::new(&near_rpc, &my_address, &network, &mpc_contract_id, signer); - let (rpc_channel, rpc) = RpcExecutor::new(&near_client, ð, &sol, backlog.clone()); + let (rpc_channel, rpc) = + RpcExecutor::new(&near_client, ð, &sol, &hydration, backlog.clone()).await; let (sync_channel, sync) = SyncTask::new( &client, @@ -370,6 +378,15 @@ pub async fn run(cmd: Cli) -> anyhow::Result<()> { tokio::spawn(indexer_sol::run( sol, + sign_tx.clone(), + account_id.clone(), + backlog.clone(), + contract_watcher.clone(), + mesh_state.clone(), + client.clone(), + )); + tokio::spawn(indexer_hydration::run( + hydration, sign_tx, account_id, backlog, diff --git a/chain-signatures/node/src/indexer_common.rs b/chain-signatures/node/src/indexer_common.rs new file mode 100644 index 000000000..76209c78c --- /dev/null +++ b/chain-signatures/node/src/indexer_common.rs @@ -0,0 +1,453 @@ +use crate::backlog::Backlog; +use crate::backlog::BacklogTransaction; +use crate::backlog::SignTx; +use crate::indexer_hydration::{ + HydrationRespondBidirectionalEvent, HydrationSignBidirectionalRequestedEvent, + HydrationSignatureRespondedEvent, +}; +use crate::mesh::wait_threshold_active; +use crate::mesh::MeshState; +use crate::node_client::NodeClient; +use crate::protocol::Chain; +use crate::protocol::IndexedSignRequest; +use crate::protocol::Sign; +use crate::protocol::SignRequestType; +use crate::rpc::ContractStateWatcher; +use crate::sign_bidirectional::BidirectionalTx; +use crate::sign_bidirectional::BidirectionalTxId; +use crate::sign_bidirectional::PendingRequestStatus; +use anchor_lang::prelude::Pubkey; +use k256::Scalar; +use mpc_primitives::SignId; +use mpc_primitives::Signature; +use near_account_id::AccountId; +use std::str::FromStr; +use std::time::Duration; +use tokio::sync::mpsc; +use tokio::sync::watch; + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum SignBidirectionalEvent { + Solana(signet_program::SignBidirectionalEvent), + Hydration(HydrationSignBidirectionalRequestedEvent), +} + +impl SignBidirectionalEvent { + pub fn sender(&self) -> [u8; 32] { + match self { + SignBidirectionalEvent::Solana(event) => event.sender.to_bytes(), + SignBidirectionalEvent::Hydration(event) => event.sender, + } + } + + pub(crate) fn sender_string(&self) -> anyhow::Result { + crate::indexer_common::sender_string(self.sender(), self.source_chain()) + } + + pub(crate) fn source_chain(&self) -> Chain { + match self { + SignBidirectionalEvent::Solana(_) => Chain::Solana, + SignBidirectionalEvent::Hydration(_) => Chain::Hydration, + } + } + + pub fn path(&self) -> String { + match self { + SignBidirectionalEvent::Solana(event) => event.path.clone(), + SignBidirectionalEvent::Hydration(event) => event.path.clone(), + } + } + + pub fn dest(&self) -> String { + match self { + SignBidirectionalEvent::Solana(event) => event.dest.clone(), + SignBidirectionalEvent::Hydration(event) => event.dest.clone(), + } + } + + pub(crate) fn algo(&self) -> String { + match self { + SignBidirectionalEvent::Solana(event) => event.algo.clone(), + SignBidirectionalEvent::Hydration(event) => event.algo.clone(), + } + } + + pub fn params(&self) -> String { + match self { + SignBidirectionalEvent::Solana(event) => event.params.clone(), + SignBidirectionalEvent::Hydration(event) => event.params.clone(), + } + } + + pub fn output_deserialization_schema(&self) -> Vec { + match self { + SignBidirectionalEvent::Solana(event) => event.output_deserialization_schema.clone(), + SignBidirectionalEvent::Hydration(event) => event.output_deserialization_schema.clone(), + } + } + + pub fn respond_serialization_schema(&self) -> Vec { + match self { + SignBidirectionalEvent::Solana(event) => event.respond_serialization_schema.clone(), + SignBidirectionalEvent::Hydration(event) => event.respond_serialization_schema.clone(), + } + } + + pub fn key_version(&self) -> u32 { + match self { + SignBidirectionalEvent::Solana(event) => event.key_version, + SignBidirectionalEvent::Hydration(event) => event.key_version, + } + } + + pub(crate) fn deposit(&self) -> u64 { + match self { + SignBidirectionalEvent::Solana(event) => event.deposit, + SignBidirectionalEvent::Hydration(event) => event.deposit, + } + } + + pub fn serialized_transaction(&self) -> Vec { + match self { + SignBidirectionalEvent::Solana(event) => event.serialized_transaction.clone(), + SignBidirectionalEvent::Hydration(event) => event.serialized_transaction.clone(), + } + } + + pub fn caip2_id(&self) -> String { + match self { + SignBidirectionalEvent::Solana(event) => event.caip2_id.clone(), + SignBidirectionalEvent::Hydration(event) => event.caip2_id.clone(), + } + } + + pub fn epsilon(&self) -> anyhow::Result { + match self { + SignBidirectionalEvent::Solana(_) => Ok(mpc_crypto::kdf::derive_epsilon_sol( + self.key_version(), + &self.sender_string()?, + &self.path(), + )), + SignBidirectionalEvent::Hydration(_) => Ok(mpc_crypto::kdf::derive_epsilon_hydration( + self.key_version(), + &self.sender_string()?, + &self.path(), + )), + } + } +} + +pub enum RespondBidirectionalEvent { + Solana(signet_program::RespondBidirectionalEvent), + Hydration(HydrationRespondBidirectionalEvent), +} + +impl RespondBidirectionalEvent { + pub fn request_id(&self) -> [u8; 32] { + match self { + RespondBidirectionalEvent::Solana(event) => event.request_id, + RespondBidirectionalEvent::Hydration(event) => event.request_id, + } + } + + pub fn responder(&self) -> [u8; 32] { + match self { + RespondBidirectionalEvent::Solana(event) => event.responder.to_bytes(), + RespondBidirectionalEvent::Hydration(event) => event.responder, + } + } + + pub fn serialized_output(&self) -> Vec { + match self { + RespondBidirectionalEvent::Solana(event) => event.serialized_output.clone(), + RespondBidirectionalEvent::Hydration(event) => event.serialized_output.clone(), + } + } + + pub fn signature(&self) -> Signature { + match self { + RespondBidirectionalEvent::Solana(event) => { + crate::indexer_sol::to_mpc_signature(event.signature.clone()).unwrap() + } + RespondBidirectionalEvent::Hydration(event) => event.signature.clone(), + } + } + + pub fn source_chain(&self) -> Chain { + match self { + RespondBidirectionalEvent::Solana(_) => Chain::Solana, + RespondBidirectionalEvent::Hydration(_) => Chain::Hydration, + } + } +} + +pub enum SignatureRespondedEvent { + Solana(signet_program::SignatureRespondedEvent), + Hydration(HydrationSignatureRespondedEvent), +} + +impl SignatureRespondedEvent { + pub fn source_chain(&self) -> Chain { + match self { + SignatureRespondedEvent::Solana(_) => Chain::Solana, + SignatureRespondedEvent::Hydration(_) => Chain::Hydration, + } + } + + pub fn request_id(&self) -> [u8; 32] { + match self { + SignatureRespondedEvent::Solana(event) => event.request_id, + SignatureRespondedEvent::Hydration(event) => event.request_id, + } + } + + pub fn signature(&self) -> Signature { + match self { + SignatureRespondedEvent::Solana(event) => { + crate::indexer_sol::to_mpc_signature(event.signature.clone()).unwrap() + } + SignatureRespondedEvent::Hydration(event) => event.signature.clone(), + } + } +} + +pub(crate) trait SignatureEvent: std::fmt::Debug { + fn generate_request_id(&self) -> [u8; 32]; + fn generate_sign_request( + &self, + entropy: [u8; 32], + total_timeout: Duration, + ) -> anyhow::Result; + fn source_chain(&self) -> Chain; + fn sender_string(&self) -> String; +} + +pub(crate) type SignatureEventBox = Box; + +pub(crate) async fn process_sign_event( + sign_event: SignatureEventBox, + entropy: [u8; 32], + sign_tx: mpsc::Sender, + node_near_account_id: AccountId, + total_timeout: Duration, + backlog: Backlog, +) -> anyhow::Result<()> { + let sign_request = sign_event.generate_sign_request(entropy, total_timeout)?; + + // Insert the transaction into the backlog when we first see the sign request + let sign_id = sign_request.id; + let sign_request_type = sign_request.sign_request_type.clone(); + + // Create the appropriate BacklogTransaction based on the sign request type + let backlog_tx = match &sign_request_type { + SignRequestType::Sign => BacklogTransaction::Sign(SignTx { + request_id: sign_id.request_id, + source_chain: sign_event.source_chain(), + key_version: sign_request.args.key_version, + status: PendingRequestStatus::AwaitingResponse, + }), + SignRequestType::SignBidirectional(_event) => { + // For bidirectional requests, start with a Sign transaction + // The protocol will advance it to Bidirectional after generating the signature + BacklogTransaction::Sign(SignTx { + request_id: sign_id.request_id, + source_chain: sign_event.source_chain(), + key_version: sign_request.args.key_version, + status: PendingRequestStatus::AwaitingResponse, + }) + } + _ => anyhow::bail!("Unexpected sign request type"), + }; + + backlog + .insert( + sign_event.source_chain(), + sign_id, + backlog_tx, + sign_request_type, + ) + .await; + + if let Err(err) = sign_tx.send(Sign::Request(sign_request)).await { + // TODO: handle error to ensure 100% success rate + let chain = sign_event.source_chain(); + tracing::error!(?err, chain = %chain, "Failed to send {} sign request into queue", chain.as_str()); + } else { + crate::metrics::requests::NUM_SIGN_REQUESTS + .with_label_values(&[ + sign_event.source_chain().as_str(), + node_near_account_id.as_str(), + ]) + .inc(); + } + + Ok(()) +} + +pub(crate) async fn recover_backlog( + backlog: &Backlog, + contract_watcher: &mut ContractStateWatcher, + mesh_state: &mut watch::Receiver, + node_client: &NodeClient, + source_chain: Chain, +) { + // Recover backlog before doing anything. + // Wait for threshold to be available + let threshold = contract_watcher.wait_threshold().await; + if threshold > 0 { + wait_threshold_active(mesh_state, threshold).await; + + let mesh_state = mesh_state.borrow().clone(); + backlog + .recover(&mesh_state, node_client, threshold, &[source_chain]) + .await; + } +} + +pub(crate) async fn process_respond_event( + respond_event: SignatureRespondedEvent, + sign_tx: mpsc::Sender, + contract_watcher: &mut ContractStateWatcher, + backlog: &Backlog, +) -> anyhow::Result<()> { + let sign_id = SignId::new(respond_event.request_id()); + + let source_chain = respond_event.source_chain(); + + let Some(sign_type) = backlog.sign_type(source_chain, &sign_id).await else { + anyhow::bail!( + "sign type not found for respond event (may have already been processed): {sign_id:?}" + ) + }; + + let event = match sign_type { + SignRequestType::SignBidirectional(event) => event, + SignRequestType::Sign => { + tracing::info!(?sign_id, "sign request completed successfully"); + backlog.remove(source_chain, &sign_id).await; + if let Err(err) = sign_tx.send(Sign::Completion(sign_id)).await { + anyhow::bail!("failed to send completion for respond event: {err:?}"); + } + return Ok(()); + } + SignRequestType::RespondBidirectional(_) => { + anyhow::bail!("RespondBidirectional received respond event?: {sign_id:?}") + } + }; + + tracing::info!(?sign_id, "bidirectional processing initial respond event"); + let target_chain = Chain::from_str(&event.dest()) + .map_err(|err| anyhow::anyhow!("unable to parse target chain from dest: {err:?}")); + let target_chain = match target_chain { + Ok(chain) => chain, + Err(_) => Chain::Ethereum, + }; + + let Some(BacklogTransaction::Sign(_)) = backlog.get(source_chain, &sign_id).await else { + anyhow::bail!("bidirectional tx not found for advancement: {sign_id:?}"); + }; + + let mpc_sig = respond_event.signature(); + + // Sign and hash the transaction to get the correct tx_id and nonce + let (signed_tx_hash, nonce) = crate::sign_bidirectional::sign_and_hash_transaction( + &event.serialized_transaction(), + mpc_sig, + )?; + + let tx_id = BidirectionalTxId(signed_tx_hash.into()); + + // Get the MPC public key and derive the from_address + let root_public_key = contract_watcher.wait_public_key().await; + let epsilon = event.epsilon()?; + let from_address = crate::sign_bidirectional::derive_user_address(root_public_key, epsilon); + + let bidirectional_tx = BidirectionalTx { + id: tx_id, + sender: event.sender(), + serialized_transaction: event.serialized_transaction(), + source_chain, + target_chain, + caip2_id: event.caip2_id(), + key_version: event.key_version(), + deposit: event.deposit(), + path: event.path(), + algo: event.algo(), + dest: event.dest(), + params: event.params(), + output_deserialization_schema: event.output_deserialization_schema(), + respond_serialization_schema: event.respond_serialization_schema(), + request_id: respond_event.request_id(), + from_address, + nonce, + status: PendingRequestStatus::AwaitingResponse, + }; + + tracing::info!( + ?sign_id, + ?tx_id, + nonce = ?bidirectional_tx.nonce, + from_address = ?bidirectional_tx.from_address, + "bidirectional tx details before advancement", + ); + + match backlog + .advance(source_chain, sign_id, bidirectional_tx) + .await + { + Ok(_) => { + tracing::info!( + ?sign_id, + ?tx_id, + ?target_chain, + "advance bidirectional tx to execution successful" + ); + } + Err(err) => { + tracing::error!( + ?sign_id, + ?tx_id, + ?target_chain, + ?err, + "advance bidirectional tx to execution failed" + ); + } + } + + Ok(()) +} + +pub(crate) async fn process_respond_bidirectional_event( + event: RespondBidirectionalEvent, + sign_tx: mpsc::Sender, + backlog: &Backlog, +) -> anyhow::Result<()> { + let sign_id = SignId::new(event.request_id()); + tracing::info!(?sign_id, "processing RespondBidirectionalEvent"); + if backlog + .remove(event.source_chain(), &sign_id) + .await + .is_some() + { + tracing::info!(?sign_id, "bidirectional tx completed"); + } else { + tracing::warn!(?sign_id, "bidirectional tx not found on completion"); + } + + if let Err(err) = sign_tx.send(Sign::Completion(sign_id)).await { + anyhow::bail!( + "failed to send completion for respond bidirectional: {err:?} for sign id: {sign_id:?}" + ) + }; + Ok(()) +} + +pub(crate) fn sender_string(sender: [u8; 32], source_chain: Chain) -> anyhow::Result { + match source_chain { + Chain::Solana => Ok(Pubkey::new_from_array(sender).to_string()), + Chain::Hydration => Ok(crate::indexer_hydration::ss58_address_from_account32( + sender, + )), + _ => anyhow::bail!("Unsupported chain: {source_chain}"), + } +} diff --git a/chain-signatures/node/src/indexer_eth/mod.rs b/chain-signatures/node/src/indexer_eth/mod.rs index 31deb233f..b81b97d57 100644 --- a/chain-signatures/node/src/indexer_eth/mod.rs +++ b/chain-signatures/node/src/indexer_eth/mod.rs @@ -2,7 +2,6 @@ pub mod indexer_eth_direct_rpc; pub mod indexer_eth_helios; use crate::backlog::Backlog; -use crate::mesh::wait_threshold_active; use crate::mesh::MeshState; use crate::node_client::NodeClient; use crate::protocol::{Chain, IndexedSignRequest, Sign, SignRequestType}; @@ -721,8 +720,8 @@ impl EthereumIndexer { pub async fn run(self) { let backlog = self.backlog; - let contract_watcher = self.contract_watcher; - let mesh_state = self.mesh_state; + let mut contract_watcher = self.contract_watcher; + let mut mesh_state = self.mesh_state; let node_client = self.node_client; let app_data_storage = self.app_data_storage; let client = self.client; @@ -730,7 +729,14 @@ impl EthereumIndexer { let sign_tx = self.sign_tx; let node_near_account_id = self.node_near_account_id; - Self::recover_backlog(&backlog, contract_watcher, mesh_state, node_client).await; + crate::indexer_common::recover_backlog( + &backlog, + &mut contract_watcher, + &mut mesh_state, + &node_client, + Chain::Ethereum, + ) + .await; let last_processed_block = Self::get_last_processed_block(&app_data_storage).await; @@ -1090,7 +1096,15 @@ impl EthereumIndexer { serialized_output, total_timeout, ) { - Ok(sign_request) => respond_requests.push(sign_request), + Ok(sign_request) => { + tracing::info!( + ?tx_id, + ?sign_id, + ?sign_request, + "sign_request from serialized output" + ); + respond_requests.push(sign_request); + } Err(err) => tracing::warn!( ?tx_id, ?sign_id, @@ -1418,25 +1432,6 @@ impl EthereumIndexer { } } - async fn recover_backlog( - backlog: &Backlog, - mut contract_watcher: ContractStateWatcher, - mut mesh_state: watch::Receiver, - node_client: NodeClient, - ) { - // Recover backlog before doing anything. - // Wait for threshold to be available - let threshold = contract_watcher.wait_threshold().await; - if threshold > 0 { - wait_threshold_active(&mut mesh_state, threshold).await; - - let mesh_state = mesh_state.borrow().clone(); - backlog - .recover(&mesh_state, &node_client, threshold, &[Chain::Ethereum]) - .await; - } - } - async fn get_last_processed_block(app_data_storage: &AppDataStorage) -> Option { app_data_storage .last_processed_block_eth() diff --git a/chain-signatures/node/src/indexer_hydration/artifacts/hydration_metadata.scale b/chain-signatures/node/src/indexer_hydration/artifacts/hydration_metadata.scale new file mode 100644 index 000000000..68331d320 Binary files /dev/null and b/chain-signatures/node/src/indexer_hydration/artifacts/hydration_metadata.scale differ diff --git a/chain-signatures/node/src/indexer_hydration/mod.rs b/chain-signatures/node/src/indexer_hydration/mod.rs new file mode 100644 index 000000000..b40cff0b6 --- /dev/null +++ b/chain-signatures/node/src/indexer_hydration/mod.rs @@ -0,0 +1,739 @@ +#![allow(missing_docs)] + +use crate::backlog::Backlog; +use crate::indexer_common::SignatureEvent; +use crate::indexer_sol::MAX_SECP256K1_SCALAR; +use crate::mesh::MeshState; +use crate::node_client::NodeClient; +use crate::protocol::{Chain, IndexedSignRequest, Sign, SignRequestType}; +use crate::rpc::ContractStateWatcher; +use crate::sign_bidirectional::hash_rlp_data; +use alloy_sol_types::SolValue; +use anyhow::{anyhow, Result}; +use ethabi::{encode, Token}; +use hydration::runtime_types::pallet_signet::pallet::Signature as HydrationSignature; +use k256::elliptic_curve::sec1::FromEncodedPoint; +use k256::{AffinePoint, EncodedPoint, FieldBytes, Scalar}; +use mpc_crypto::ScalarExt as _; +use mpc_primitives::Signature; +use mpc_primitives::{SignArgs, SignId, LATEST_MPC_KEY_VERSION}; +use near_account_id::AccountId; +use sha3::{Digest, Keccak256}; +use sp_core::crypto::{AccountId32 as SpAccountId32, Ss58AddressFormatRegistry, Ss58Codec}; +use sp_core::{twox_128, H256}; +use sp_runtime::traits::BlakeTwo256; +use sp_state_machine::read_proof_check; +use sp_trie::StorageProof; +use std::convert::TryInto; +use std::fmt; +use std::time::Duration; +use std::time::Instant; +use subxt::backend::{legacy::LegacyRpcMethods, rpc::RpcClient}; +use subxt::config::HashFor; +use subxt::{client::OnlineClient, SubstrateConfig}; +use tokio::sync::mpsc; +use tokio::sync::watch; + +/// Configures Hydration indexer. +#[derive(Debug, Clone, clap::Parser)] +#[group(id = "indexer_hydration_options")] +pub struct HydrationArgs { + /// Hydration RPC ws URL + #[clap(long = "hydration-rpc-ws-url", env("MPC_HYDRATION_RPC_WS_URL"))] + pub rpc_ws_url: Option, + /// Hydration signer URI + #[clap(long = "hydration-signer-uri", env("MPC_HYDRATION_SIGNER_URI"))] + pub signer_uri: Option, + #[clap( + long = "hydration-total-timeout", + env("MPC_HYDRATION_TOTAL_TIMEOUT"), + default_value = "200" + )] + pub total_timeout: Option, +} + +impl HydrationArgs { + pub fn into_str_args(self) -> Vec { + let mut args = Vec::with_capacity(2); + if let Some(rpc_ws_url) = self.rpc_ws_url { + args.extend(["--hydration-rpc-ws-url".to_string(), rpc_ws_url]); + } + if let Some(signer_uri) = self.signer_uri { + args.extend(["--hydration-signer-uri".to_string(), signer_uri]); + } + if let Some(total_timeout) = self.total_timeout { + args.extend([ + "--hydration-total-timeout".to_string(), + total_timeout.to_string(), + ]); + } + args + } + + pub fn into_config(self) -> Option { + Some(HydrationConfig { + rpc_ws_url: self.rpc_ws_url?, + signer_uri: self.signer_uri?, + total_timeout: self.total_timeout?, + }) + } + + pub fn from_config(config: Option) -> Self { + match config { + Some(config) => HydrationArgs { + rpc_ws_url: Some(config.rpc_ws_url), + signer_uri: Some(config.signer_uri), + total_timeout: Some(config.total_timeout), + }, + None => HydrationArgs { + rpc_ws_url: None, + signer_uri: None, + total_timeout: None, + }, + } + } +} + +#[derive(Clone)] +pub struct HydrationConfig { + /// Hydration RPC ws URL + pub rpc_ws_url: String, + /// Hydration signer URI + pub signer_uri: String, + /// total timeout for a sign request starting from indexed time in seconds + pub total_timeout: u64, +} + +impl fmt::Debug for HydrationConfig { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("HydrationConfig") + .field("rpc_ws_url", &self.rpc_ws_url) + .field("signer_uri", &"") + .field("total_timeout", &self.total_timeout) + .finish() + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct HydrationSignatureRequestedEvent { + pub sender: [u8; 32], + pub payload: [u8; 32], + pub path: String, + pub key_version: u32, + pub deposit: u64, + pub chain_id: String, + pub algo: String, + pub dest: String, + pub params: String, +} + +impl HydrationSignatureRequestedEvent { + fn from(event: hydration::signet::events::SignatureRequested) -> anyhow::Result { + let mut sender = [0u8; 32]; + let sender_array: &[u8; 32] = + >::as_ref(&event.sender); + sender.copy_from_slice(sender_array); + Ok(Self { + sender, + payload: event.payload, + path: String::from_utf8(event.path)?, + key_version: event.key_version, + deposit: event.deposit.try_into()?, + chain_id: String::from_utf8(event.chain_id)?, + algo: String::from_utf8(event.algo)?, + dest: String::from_utf8(event.dest)?, + params: String::from_utf8(event.params)?, + }) + } +} + +impl SignatureEvent for HydrationSignatureRequestedEvent { + fn generate_request_id(&self) -> [u8; 32] { + // Encode the event data in ABI format + let encoded = encode(&[ + Token::String(self.sender_string()), + Token::Bytes(self.payload.to_vec()), + Token::String(self.path.clone()), + Token::Uint(self.key_version.into()), + Token::String(self.chain_id.clone()), + Token::String(self.algo.clone()), + Token::String(self.dest.clone()), + Token::String(self.params.clone()), + ]); + // Calculate keccak256 hash + let mut hasher = Keccak256::new(); + hasher.update(&encoded); + hasher.finalize().into() + } + + fn generate_sign_request( + &self, + entropy: [u8; 32], + total_timeout: Duration, + ) -> anyhow::Result { + tracing::info!("found hydration event: {:?}", self); + if self.deposit == 0 { + tracing::warn!("deposit is 0, skipping sign request"); + anyhow::bail!("deposit is 0"); + } + + if self.key_version > LATEST_MPC_KEY_VERSION { + tracing::warn!("unsupported key version: {}", self.key_version); + anyhow::bail!("unsupported key version"); + } + + let Some(payload) = Scalar::from_bytes(self.payload) else { + tracing::warn!( + "hydration `sign` did not produce payload hash correctly: {:?}", + self.payload, + ); + anyhow::bail!("failed to convert event payload hash to scalar"); + }; + + if payload > *MAX_SECP256K1_SCALAR { + tracing::warn!("payload exceeds secp256k1 curve order: {payload:?}"); + anyhow::bail!("payload exceeds secp256k1 curve order"); + } + + let epsilon = mpc_crypto::kdf::derive_epsilon_hydration( + self.key_version, + &self.sender_string(), + &self.path, + ); + + let sign_id = SignId::new(self.generate_request_id()); + tracing::info!(?sign_id, "hydration signature requested"); + + Ok(IndexedSignRequest { + id: sign_id, + args: SignArgs { + entropy, + epsilon, + payload, + path: self.path.clone(), + key_version: self.key_version, + }, + chain: Chain::Hydration, + timestamp_sign_queue: Instant::now(), + unix_timestamp_indexed: crate::util::current_unix_timestamp(), + total_timeout, + sign_request_type: SignRequestType::Sign, + }) + } + + fn source_chain(&self) -> Chain { + Chain::Hydration + } + + fn sender_string(&self) -> String { + ss58_address_from_account32(self.sender) + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Hash)] +pub struct HydrationSignBidirectionalRequestedEvent { + pub sender: [u8; 32], + pub serialized_transaction: Vec, + pub caip2_id: String, + pub key_version: u32, + pub deposit: u64, + pub path: String, + pub algo: String, + pub dest: String, + pub params: String, + pub program_id: [u8; 32], + pub output_deserialization_schema: Vec, + pub respond_serialization_schema: Vec, +} + +impl HydrationSignBidirectionalRequestedEvent { + fn from(event: hydration::signet::events::SignBidirectionalRequested) -> anyhow::Result { + let mut sender = [0u8; 32]; + let sender_array: &[u8; 32] = + >::as_ref(&event.sender); + sender.copy_from_slice(sender_array); + let mut program_id = [0u8; 32]; + let program_id_array: &[u8; 32] = + >::as_ref(&event.program_id); + program_id.copy_from_slice(program_id_array); + Ok(Self { + sender, + serialized_transaction: event.serialized_transaction, + caip2_id: String::from_utf8(event.caip2_id)?, + path: String::from_utf8(event.path)?, + key_version: event.key_version, + deposit: event.deposit.try_into()?, + algo: String::from_utf8(event.algo)?, + dest: String::from_utf8(event.dest)?, + params: String::from_utf8(event.params)?, + program_id, + output_deserialization_schema: event.output_deserialization_schema, + respond_serialization_schema: event.respond_serialization_schema, + }) + } +} + +impl SignatureEvent for HydrationSignBidirectionalRequestedEvent { + fn generate_request_id(&self) -> [u8; 32] { + // Match TypeScript implementation using ABI encoding + let encoded = ( + self.sender_string(), + self.serialized_transaction.clone(), + self.caip2_id.clone(), + self.key_version, + self.path.clone(), + self.algo.clone(), + self.dest.clone(), + self.params.clone(), + ) + .abi_encode_packed(); + + alloy::primitives::keccak256(encoded).into() + } + + fn generate_sign_request( + &self, + entropy: [u8; 32], + total_timeout: Duration, + ) -> anyhow::Result { + tracing::info!("found hydration event: {:?}", self); + if self.deposit == 0 { + tracing::warn!("deposit is 0, skipping sign request"); + anyhow::bail!("deposit is 0"); + } + + if self.key_version > LATEST_MPC_KEY_VERSION { + tracing::warn!("unsupported key version: {}", self.key_version); + anyhow::bail!("unsupported key version"); + } + + let request_id = self.generate_request_id(); + let rlp_encoded_tx = self.serialized_transaction.clone(); + + // Call the existing derive_epsilon_sol function with the correct parameters + // to match the TypeScript implementation + let epsilon = mpc_crypto::kdf::derive_epsilon_hydration( + self.key_version, + &self.sender_string(), + &self.path, + ); + + let sign_id = SignId::new(request_id); + tracing::info!(?sign_id, "hydration signature requested"); + let unsigned_tx_hash = hash_rlp_data(rlp_encoded_tx); + let Some(payload) = Scalar::from_bytes(unsigned_tx_hash) else { + anyhow::bail!("Failed to convert unsigned_tx_hash to scalar: {unsigned_tx_hash:?}"); + }; + + if payload > *MAX_SECP256K1_SCALAR { + tracing::warn!("payload exceeds secp256k1 curve order: {payload:?}"); + anyhow::bail!("payload exceeds secp256k1 curve order"); + } + + Ok(IndexedSignRequest { + id: sign_id, + args: SignArgs { + entropy, + epsilon, + payload, + path: self.path.clone(), + key_version: self.key_version, + }, + chain: Chain::Hydration, + timestamp_sign_queue: Instant::now(), + unix_timestamp_indexed: crate::util::current_unix_timestamp(), + total_timeout, + sign_request_type: SignRequestType::SignBidirectional( + crate::indexer_common::SignBidirectionalEvent::Hydration(self.clone()), + ), + }) + } + + fn source_chain(&self) -> Chain { + Chain::Hydration + } + + fn sender_string(&self) -> String { + ss58_address_from_account32(self.sender) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct HydrationRespondBidirectionalEvent { + pub request_id: [u8; 32], + pub responder: [u8; 32], + pub serialized_output: Vec, + pub signature: Signature, +} + +impl HydrationRespondBidirectionalEvent { + fn from(event: hydration::signet::events::RespondBidirectionalEvent) -> anyhow::Result { + let signature = to_mpc_signature(event.signature)?; + let responder = account32_to_bytes(&event.responder); + Ok(Self { + request_id: event.request_id, + responder, + serialized_output: event.serialized_output, + signature, + }) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct HydrationSignatureRespondedEvent { + pub request_id: [u8; 32], + pub responder: [u8; 32], + pub signature: Signature, +} + +impl HydrationSignatureRespondedEvent { + fn from(event: hydration::signet::events::SignatureResponded) -> anyhow::Result { + let signature = to_mpc_signature(event.signature)?; + let responder = account32_to_bytes(&event.responder); + Ok(Self { + request_id: event.request_id, + responder, + signature, + }) + } +} + +fn to_mpc_signature(sig: HydrationSignature) -> anyhow::Result { + let x_bytes: FieldBytes = sig.big_r.x.into(); + let y_bytes: FieldBytes = sig.big_r.y.into(); + let enc = EncodedPoint::from_affine_coordinates(&x_bytes, &y_bytes, false); + + let big_r = AffinePoint::from_encoded_point(&enc) + .into_option() + .ok_or_else(|| anyhow::anyhow!("invalid affine point in HydrationSignature"))?; + + let s = Scalar::from_bytes(sig.s) + .ok_or_else(|| anyhow::anyhow!("invalid scalar in HydrationSignature"))?; + + Ok(Signature::new(big_r, s, sig.recovery_id)) +} + +fn account32_to_bytes(account: &subxt::utils::AccountId32) -> [u8; 32] { + let mut result = [0u8; 32]; + let account_array: &[u8; 32] = >::as_ref(account); + result.copy_from_slice(account_array); + result +} + +#[subxt::subxt(runtime_metadata_path = "src/indexer_hydration/artifacts/hydration_metadata.scale")] +pub mod hydration {} + +/// Storage key for `frame_system::Events`. +fn system_events_key() -> Vec { + let mut key = Vec::with_capacity(32); + key.extend_from_slice(&twox_128(b"System")); + key.extend_from_slice(&twox_128(b"Events")); + key +} + +/// Fetch and *verify* the SCALE‑encoded `System::Events` bytes at a given block. +/// +/// - Uses `state_get_read_proof` via `LegacyRpcMethods`. +/// - Verifies the proof against `state_root` using `read_proof_check`. +/// - Returns the proven SCALE bytes for `System::Events`. +async fn fetch_proven_system_events_bytes( + legacy_rpc: &LegacyRpcMethods, + state_root: H256, + block_hash: HashFor, +) -> Result> { + let events_key = system_events_key(); + + // 1. Get storage proof for System::Events at this block. + let read_proof = legacy_rpc + .state_get_read_proof([events_key.as_slice()], Some(block_hash)) + .await + .map_err(|e| anyhow!("state_get_read_proof failed: {e}"))?; + + // read_proof.proof is Vec; Bytes wraps Vec. + let sp_proof = StorageProof::new(read_proof.proof.into_iter().map(|bytes| bytes.0)); + + // 2. Verify the proof against the block's state_root using Blake2 trie layout. + let values_by_key = + read_proof_check::(state_root, sp_proof, vec![events_key.clone()]) + .map_err(|e| anyhow!("read_proof_check failed: {e}"))?; + + // 3. Extract the SCALE‑encoded System::Events bytes. + let events_bytes = values_by_key + .get(&events_key) + .and_then(|opt| opt.as_ref()) + .ok_or_else(|| anyhow!("System::Events missing from verified proof"))? + .to_vec(); + + Ok(events_bytes) +} + +pub(crate) fn ss58_address_from_account32(sender: [u8; 32]) -> String { + let acc = SpAccountId32::from(sender); + acc.to_ss58check_with_version(Ss58AddressFormatRegistry::PolkadotAccount.into()) +} + +pub async fn run( + hydration: Option, + sign_tx: mpsc::Sender, + node_near_account_id: AccountId, + backlog: Backlog, + mut contract_watcher: ContractStateWatcher, + mut mesh_state: watch::Receiver, + node_client: NodeClient, +) { + let Some(hydration) = hydration else { + tracing::warn!("hydration indexer is disabled"); + return; + }; + let total_timeout = Duration::from_secs(hydration.total_timeout); + + let ws_url: &str = hydration.rpc_ws_url.as_str(); + + tracing::info!("connecting to hydration rpc at {}", ws_url); + + // High‑level Subxt client for blocks + events. + let hydration_api = OnlineClient::::from_url(ws_url).await; + let hydration_api = match hydration_api { + Ok(api) => api, + Err(e) => { + tracing::error!("failed to connect to hydration rpc: {e}"); + return; + } + }; + // Low‑level RPC client for legacy methods like state_get_read_proof. + let rpc_client = RpcClient::from_url(ws_url).await; + let rpc_client = match rpc_client { + Ok(client) => client, + Err(e) => { + tracing::error!("failed to connect to hydration rpc: {e}"); + return; + } + }; + let legacy_rpc = LegacyRpcMethods::::new(rpc_client); + + // Wait for threshold to be available + crate::indexer_common::recover_backlog( + &backlog, + &mut contract_watcher, + &mut mesh_state, + &node_client, + Chain::Hydration, + ) + .await; + + // Subscribe to finalized Hydration blocks. + let mut blocks = match hydration_api.blocks().subscribe_finalized().await { + Ok(blocks) => blocks, + Err(e) => { + tracing::error!("failed to subscribe to finalized blocks: {e}"); + return; + } + }; + + while let Some(block_res) = blocks.next().await { + let block = match block_res { + Ok(block) => block, + Err(e) => { + tracing::error!("failed to get block: {e}"); + continue; + } + }; + let number = block.number(); + let hash = block.hash(); + let header = block.header().clone(); + tracing::info!("received block from hydration rpc: block number {number}, hash {hash:?}"); + + // Subxt's Substrate header uses H256 as state root (BlakeTwo256 hash). + let state_root: H256 = header.state_root; + + // Events as decoded by Subxt (unproven bytes). + let events = match block.events().await { + Ok(events) => events, + Err(e) => { + tracing::error!("failed to get events: {e}"); + continue; + } + }; + // Raw SCALE bytes for `System::Events` that Subxt decoded. + let events_bytes_unproven = events.bytes().to_vec(); + + // Events bytes proven via storage proof under state_root. + let events_bytes_proven = + match fetch_proven_system_events_bytes(&legacy_rpc, state_root, hash).await { + Ok(events_bytes_proven) => events_bytes_proven, + Err(e) => { + tracing::error!("failed to fetch proven system events bytes: {e}"); + continue; + } + }; + + // Sanity check: bytes that Subxt decoded must match the Merkle‑proven bytes. + if events_bytes_unproven != events_bytes_proven { + tracing::error!( + "Mismatch between RPC events and Merkle‑proven System::Events \ + in block #{number} ({hash:?})" + ); + continue; + } + + // At this point: + // - Block is finalized (subscribe_finalized) + // - System::Events is Merkle‑proven under state_root + // - The bytes Subxt decoded match the proven bytes + // + // → Safe to trust individual decoded events. + + let sign_tx = sign_tx.clone(); + let node_near_account_id = node_near_account_id.clone(); + let backlog = backlog.clone(); + + for ev in events.iter() { + let ev = match ev { + Ok(ev) => ev, + Err(e) => { + tracing::error!("failed to get event: {e}"); + continue; + } + }; + + // SignatureRequested + if let Ok(Some(req)) = ev.as_event::() { + let event = match HydrationSignatureRequestedEvent::from(req) { + Ok(event) => event, + Err(e) => { + tracing::error!( + "failed to convert event to HydrationSignatureRequestedEvent: {e}" + ); + continue; + } + }; + tracing::info!( + "Hydration::Signet::SignatureRequested in block #{number} ({hash:?}): {:?}", + event + ); + + let entropy = match entropy_from_event(&ev) { + Ok(entropy) => entropy, + Err(e) => { + tracing::error!("failed to extract entropy from event: {e}"); + continue; + } + }; + + if let Err(e) = crate::indexer_common::process_sign_event( + Box::new(event), + entropy, + sign_tx.clone(), + node_near_account_id.clone(), + total_timeout, + backlog.clone(), + ) + .await + { + tracing::error!("failed to process sign event: {e}"); + } + } + + // SignatureResponded + if let Ok(Some(resp)) = ev.as_event::() { + let event = match HydrationSignatureRespondedEvent::from(resp) { + Ok(event) => event, + Err(e) => { + tracing::error!( + "failed to convert event to HydrationSignatureRespondedEvent: {e}" + ); + continue; + } + }; + tracing::info!( + "Hydration::Signet::SignatureResponded in block #{number} ({hash:?}): {:?}", + event + ); + if let Err(e) = crate::indexer_common::process_respond_event( + crate::indexer_common::SignatureRespondedEvent::Hydration(event), + sign_tx.clone(), + &mut contract_watcher, + &backlog, + ) + .await + { + tracing::error!("failed to process respond event: {e}"); + } + } + + // Bidirectional request + if let Ok(Some(req_bi)) = + ev.as_event::() + { + let event = match HydrationSignBidirectionalRequestedEvent::from(req_bi) { + Ok(event) => event, + Err(e) => { + tracing::error!("failed to convert event to HydrationSignBidirectionalRequestedEvent: {e}"); + continue; + } + }; + tracing::info!( + "Hydration::Signet::SignBidirectionalRequested in block #{number} ({hash:?}): {:?}", + event + ); + + let entropy = match entropy_from_event(&ev) { + Ok(entropy) => entropy, + Err(e) => { + tracing::error!("failed to extract entropy from event: {e}"); + continue; + } + }; + + if let Err(e) = crate::indexer_common::process_sign_event( + Box::new(event), + entropy, + sign_tx.clone(), + node_near_account_id.clone(), + total_timeout, + backlog.clone(), + ) + .await + { + tracing::error!("failed to process sign event: {e}"); + } + } + + // Bidirectional response + if let Ok(Some(resp_bi)) = + ev.as_event::() + { + let event = match HydrationRespondBidirectionalEvent::from(resp_bi) { + Ok(event) => event, + Err(e) => { + tracing::error!( + "failed to convert event to HydrationRespondBidirectionalEvent: {e}" + ); + continue; + } + }; + tracing::info!( + "Hydration::Signet::RespondBidirectionalEvent in block #{number} ({hash:?}): {:?}", + event + ); + if let Err(e) = crate::indexer_common::process_respond_bidirectional_event( + crate::indexer_common::RespondBidirectionalEvent::Hydration(event), + sign_tx.clone(), + &backlog, + ) + .await + { + tracing::error!("failed to process respond bidirectional event: {e}"); + } + } + } + } +} + +fn entropy_from_event( + ev: &subxt::events::EventDetails, +) -> anyhow::Result<[u8; 32]> { + ev.bytes().to_vec()[..32] + .try_into() + .map_err(|_| anyhow::anyhow!("failed to convert event bytes to [u8; 32]")) +} diff --git a/chain-signatures/node/src/indexer_sol.rs b/chain-signatures/node/src/indexer_sol.rs index 0a578ae01..cf84a83ce 100644 --- a/chain-signatures/node/src/indexer_sol.rs +++ b/chain-signatures/node/src/indexer_sol.rs @@ -1,12 +1,11 @@ -use crate::backlog::{Backlog, BacklogTransaction, SignTx}; -use crate::mesh::{wait_threshold_active, MeshState}; +use crate::backlog::Backlog; +use crate::mesh::MeshState; use crate::node_client::NodeClient; use crate::protocol::{Chain, IndexedSignRequest, Sign, SignRequestType}; use crate::rpc::ContractStateWatcher; -use crate::sign_bidirectional::{ - hash_rlp_data, BidirectionalTx, BidirectionalTxId, PendingRequestStatus, -}; +use crate::sign_bidirectional::hash_rlp_data; +use crate::indexer_common::{SignatureEvent, SignatureEventBox}; use alloy_sol_types::SolValue; use anchor_client::anchor_lang::AnchorDeserialize; use anchor_client::{Client, Cluster, Program}; @@ -164,22 +163,7 @@ pub struct SolSignRequest { pub key_version: u32, } -trait SignatureEventTrait { - fn generate_request_id(&self) -> [u8; 32]; - fn generate_sign_request( - &self, - tx_sig: Vec, - total_timeout: Duration, - ) -> anyhow::Result; -} - -trait SignatureEvent: SignatureEventTrait + std::fmt::Debug {} - -type SignatureEventBox = Box; - -impl SignatureEvent for SignatureRequestedEvent {} - -impl SignatureEventTrait for SignatureRequestedEvent { +impl SignatureEvent for SignatureRequestedEvent { fn generate_request_id(&self) -> [u8; 32] { // Encode the event data in ABI format let encoded = encode(&[ @@ -200,7 +184,7 @@ impl SignatureEventTrait for SignatureRequestedEvent { fn generate_sign_request( &self, - tx_sig: Vec, + entropy: [u8; 32], total_timeout: Duration, ) -> anyhow::Result { tracing::info!("found solana event: {:?}", self); @@ -229,11 +213,7 @@ impl SignatureEventTrait for SignatureRequestedEvent { // Call the existing derive_epsilon_sol function with the correct parameters // to match the TypeScript implementation - let epsilon = derive_epsilon_sol(self.key_version, &self.sender.to_string(), &self.path); - - // Use transaction signature as entropy - let mut entropy = [0u8; 32]; - entropy.copy_from_slice(&tx_sig[..32]); + let epsilon = derive_epsilon_sol(self.key_version, &self.sender_string(), &self.path); let sign_id = SignId::new(self.generate_request_id()); tracing::info!(?sign_id, "solana signature requested"); @@ -254,11 +234,17 @@ impl SignatureEventTrait for SignatureRequestedEvent { sign_request_type: SignRequestType::Sign, }) } -} -impl SignatureEvent for SignBidirectionalEvent {} + fn source_chain(&self) -> Chain { + Chain::Solana + } -impl SignatureEventTrait for SignBidirectionalEvent { + fn sender_string(&self) -> String { + self.sender.to_string() + } +} + +impl SignatureEvent for SignBidirectionalEvent { fn generate_request_id(&self) -> [u8; 32] { // Match TypeScript implementation using ABI encoding let encoded = ( @@ -278,7 +264,7 @@ impl SignatureEventTrait for SignBidirectionalEvent { fn generate_sign_request( &self, - tx_sig: Vec, + entropy: [u8; 32], total_timeout: Duration, ) -> anyhow::Result { tracing::info!("found solana event: {:?}", self); @@ -297,11 +283,7 @@ impl SignatureEventTrait for SignBidirectionalEvent { // Call the existing derive_epsilon_sol function with the correct parameters // to match the TypeScript implementation - let epsilon = derive_epsilon_sol(self.key_version, &self.sender.to_string(), &self.path); - - // Use transaction signature as entropy - let mut entropy = [0u8; 32]; - entropy.copy_from_slice(&tx_sig[..32]); + let epsilon = derive_epsilon_sol(self.key_version, &self.sender_string(), &self.path); let sign_id = SignId::new(request_id); tracing::info!(?sign_id, "solana signature requested"); @@ -328,9 +310,19 @@ impl SignatureEventTrait for SignBidirectionalEvent { timestamp_sign_queue: Instant::now(), unix_timestamp_indexed: crate::util::current_unix_timestamp(), total_timeout, - sign_request_type: SignRequestType::SignBidirectional(self.clone()), + sign_request_type: SignRequestType::SignBidirectional( + crate::indexer_common::SignBidirectionalEvent::Solana(self.clone()), + ), }) } + + fn source_chain(&self) -> Chain { + Chain::Solana + } + + fn sender_string(&self) -> String { + self.sender.to_string() + } } type Result = anyhow::Result; @@ -356,14 +348,15 @@ pub async fn run( }; // Wait for threshold to be available - let threshold = contract_watcher.wait_threshold().await; - if threshold > 0 { - wait_threshold_active(&mut mesh_state, threshold).await; - let mesh_state = mesh_state.borrow().clone(); - backlog - .recover(&mesh_state, &node_client, threshold, &[Chain::Solana]) - .await; - } + crate::indexer_common::recover_backlog( + &backlog, + &mut contract_watcher, + &mut mesh_state, + &node_client, + Chain::Solana, + ) + .await; + let keypair = Keypair::from_base58_string(&sol.account_sk); let cluster = Cluster::Custom(sol.rpc_http_url.clone(), sol.rpc_ws_url.clone()); let client = @@ -484,47 +477,17 @@ async fn process_anchor_sign_event( total_timeout: Duration, backlog: Backlog, ) -> anyhow::Result<()> { - let sign_request = sign_event.generate_sign_request(tx_sig, total_timeout)?; - - // Insert the transaction into the backlog when we first see the sign request - let sign_id = sign_request.id; - let sign_request_type = sign_request.sign_request_type.clone(); - - // Create the appropriate BacklogTransaction based on the sign request type - let backlog_tx = match &sign_request_type { - SignRequestType::Sign => BacklogTransaction::Sign(SignTx { - request_id: sign_id.request_id, - source_chain: Chain::Solana, - key_version: sign_request.args.key_version, - status: PendingRequestStatus::AwaitingResponse, - }), - SignRequestType::SignBidirectional(_event) => { - // For bidirectional requests, start with a Sign transaction - // The protocol will advance it to Bidirectional after generating the signature - BacklogTransaction::Sign(SignTx { - request_id: sign_id.request_id, - source_chain: Chain::Solana, - key_version: sign_request.args.key_version, - status: PendingRequestStatus::AwaitingResponse, - }) - } - _ => anyhow::bail!("Unexpected sign request type"), - }; - - backlog - .insert(Chain::Solana, sign_id, backlog_tx, sign_request_type) - .await; - - if let Err(err) = sign_tx.send(Sign::Request(sign_request)).await { - // TODO: handle error to ensure 100% success rate - tracing::error!(?err, "Failed to send Solana sign request into queue"); - } else { - crate::metrics::requests::NUM_SIGN_REQUESTS - .with_label_values(&[Chain::Solana.as_str(), node_near_account_id.as_str()]) - .inc(); - } - - Ok(()) + let mut entropy = [0u8; 32]; + entropy.copy_from_slice(&tx_sig[..32]); + crate::indexer_common::process_sign_event( + sign_event, + entropy, + sign_tx, + node_near_account_id, + total_timeout, + backlog, + ) + .await } // Reference: https://github.com/solana-foundation/anchor/blob/a5df519319ac39cff21191f2b09d54eda42c5716/client/src/lib.rs#L31 @@ -931,167 +894,56 @@ async fn subscribe_to_program_respond_events( continue; }; for ev in respond_bidirectional_events { - let sign_id = SignId::new(ev.request_id); - tracing::info!(?sign_id, "processing RespondBidirectionalEvent"); - if backlog.remove(Chain::Solana, &sign_id).await.is_some() { - tracing::info!(?sign_id, "bidirectional tx completed"); - } else { - tracing::warn!(?sign_id, "bidirectional tx not found on completion"); - } - - if let Err(err) = sign_tx.send(Sign::Completion(sign_id)).await { - tracing::error!( - ?sign_id, - ?err, - "failed to send completion for respond bidirectional" - ); + if let Err(err) = crate::indexer_common::process_respond_bidirectional_event( + crate::indexer_common::RespondBidirectionalEvent::Solana(ev), + sign_tx.clone(), + &backlog, + ) + .await + { + tracing::error!(?err, "failed to process respond bidirectional event"); } } for ev in respond_events { - let sign_id = SignId::new(ev.request_id); - - let Some(sign_type) = backlog.sign_type(Chain::Solana, &sign_id).await else { - tracing::warn!( - ?sign_id, - "sign type not found for respond event (may have already been processed)" - ); - continue; - }; - let event = match sign_type { - SignRequestType::SignBidirectional(event) => event, - SignRequestType::Sign => { - tracing::info!(?sign_id, "sign request completed successfully"); - backlog.remove(Chain::Solana, &sign_id).await; - if let Err(err) = sign_tx.send(Sign::Completion(sign_id)).await { - tracing::error!( - ?sign_id, - ?err, - "failed to send completion for respond event" - ); - } - continue; - } - SignRequestType::RespondBidirectional(_) => { - tracing::warn!(?sign_id, "RespondBidirectional received respond event?"); - continue; - } - }; - - tracing::info!(?sign_id, "bidirectional processing initial respond event"); - let Ok(target_chain) = Chain::from_str(&event.dest).inspect_err(|err| { - tracing::warn!(?sign_id, %err, "unable to parse target chain from dest"); - }) else { - continue; - }; - - let Some(BacklogTransaction::Sign(_)) = backlog.get(Chain::Solana, &sign_id).await - else { - tracing::warn!(?sign_id, "bidirectional tx not found for advancement"); - continue; - }; - - // Create a 65-byte uncompressed point representation (0x04 || x || y) - let mut big_r = [0u8; 65]; - big_r[0] = 0x04; - big_r[1..33].copy_from_slice(&ev.signature.big_r.x); - big_r[33..65].copy_from_slice(&ev.signature.big_r.y); - - let Ok(big_r) = k256::EncodedPoint::from_bytes(big_r).inspect_err(|err| { - tracing::warn!(?sign_id, %err, "unable to parse big_r for encoded point"); - }) else { - continue; - }; - let big_r_ct_opt = AffinePoint::from_encoded_point(&big_r); - let big_r = if bool::from(big_r_ct_opt.is_some()) { - big_r_ct_opt.unwrap() - } else { - tracing::warn!(?sign_id, "failed to create AffinePoint from encoded point"); - continue; - }; - - let Some(s) = Scalar::from_bytes(ev.signature.s) else { - tracing::warn!(?sign_id, "failed to create Scalar from s bytes"); - continue; - }; - - let mpc_sig = mpc_primitives::Signature { - big_r, - s, - recovery_id: ev.signature.recovery_id, - }; - - // Sign and hash the transaction to get the correct tx_id and nonce - let (signed_tx_hash, nonce) = crate::sign_bidirectional::sign_and_hash_transaction( - &event.serialized_transaction, - mpc_sig, - )?; - - let tx_id = BidirectionalTxId(signed_tx_hash.into()); - - // Get the MPC public key and derive the from_address - let root_public_key = contract_watcher.wait_public_key().await; - let epsilon = mpc_crypto::kdf::derive_epsilon_sol( - event.key_version, - &event.sender.to_string(), - &event.path, - ); - let from_address = - crate::sign_bidirectional::derive_user_address(root_public_key, epsilon); - - let bidirectional_tx = BidirectionalTx { - id: tx_id, - sender: event.sender, - serialized_transaction: event.serialized_transaction, - source_chain: Chain::Solana, - target_chain, - caip2_id: event.caip2_id, - key_version: event.key_version, - deposit: event.deposit, - path: event.path.clone(), - algo: event.algo.clone(), - dest: event.dest.clone(), - params: event.params.clone(), - output_deserialization_schema: event.output_deserialization_schema.clone(), - respond_serialization_schema: event.respond_serialization_schema.clone(), - request_id: ev.request_id, - from_address, - nonce, - status: PendingRequestStatus::AwaitingResponse, - }; - - tracing::info!( - ?sign_id, - ?tx_id, - nonce = ?bidirectional_tx.nonce, - from_address = ?bidirectional_tx.from_address, - "bidirectional tx details before advancement", - ); - - match backlog - .advance(Chain::Solana, sign_id, bidirectional_tx) - .await + if let Err(err) = crate::indexer_common::process_respond_event( + crate::indexer_common::SignatureRespondedEvent::Solana(ev), + sign_tx.clone(), + &mut contract_watcher, + &backlog, + ) + .await { - Ok(_) => { - tracing::info!( - ?sign_id, - ?tx_id, - ?target_chain, - "advance bidirectional tx to execution successful" - ); - } - Err(err) => { - tracing::error!( - ?sign_id, - ?tx_id, - ?target_chain, - ?err, - "advance bidirectional tx to execution failed" - ); - } + tracing::error!(?err, "failed to process respond event"); } } } Ok(()) } + +pub fn to_mpc_signature( + sig: signet_program::Signature, +) -> anyhow::Result { + // Create a 65-byte uncompressed point representation (0x04 || x || y) + let mut big_r = [0u8; 65]; + big_r[0] = 0x04; + big_r[1..33].copy_from_slice(&sig.big_r.x); + big_r[33..65].copy_from_slice(&sig.big_r.y); + + let big_r = k256::EncodedPoint::from_bytes(big_r) + .map_err(|err| anyhow::anyhow!("unable to parse big_r for encoded point: {err}"))?; + let big_r_ct_opt = AffinePoint::from_encoded_point(&big_r); + let big_r = big_r_ct_opt + .into_option() + .ok_or_else(|| anyhow::anyhow!("failed to create AffinePoint from encoded point"))?; + + let s = Scalar::from_bytes(sig.s) + .ok_or_else(|| anyhow::anyhow!("failed to create Scalar from s bytes"))?; + + Ok(mpc_primitives::Signature { + big_r, + s, + recovery_id: sig.recovery_id, + }) +} diff --git a/chain-signatures/node/src/lib.rs b/chain-signatures/node/src/lib.rs index 69131d95a..163630c6e 100644 --- a/chain-signatures/node/src/lib.rs +++ b/chain-signatures/node/src/lib.rs @@ -5,7 +5,9 @@ pub mod cli; pub mod config; pub mod gcp; pub mod indexer; +pub mod indexer_common; pub mod indexer_eth; +pub mod indexer_hydration; pub mod indexer_sol; pub mod kdf; pub mod logs; diff --git a/chain-signatures/node/src/protocol/mod.rs b/chain-signatures/node/src/protocol/mod.rs index 372dce3bf..58d6b361c 100644 --- a/chain-signatures/node/src/protocol/mod.rs +++ b/chain-signatures/node/src/protocol/mod.rs @@ -19,7 +19,6 @@ pub use cryptography::CryptographicError; pub use message::{Message, MessageChannel}; pub use mpc_primitives::Chain; pub use signature::{IndexedSignRequest, Sign}; -use signet_program::SignBidirectionalEvent; pub use state::{Node, NodeState}; use crate::backlog::Backlog; @@ -238,7 +237,7 @@ pub async fn spawn_system_metrics(node_account_id: &str) -> tokio::task::JoinHan #[allow(clippy::large_enum_variant)] pub enum SignRequestType { Sign, - SignBidirectional(SignBidirectionalEvent), + SignBidirectional(crate::indexer_common::SignBidirectionalEvent), RespondBidirectional(RespondBidirectionalTx), } diff --git a/chain-signatures/node/src/protocol/signature.rs b/chain-signatures/node/src/protocol/signature.rs index d08bebae9..e199b789a 100644 --- a/chain-signatures/node/src/protocol/signature.rs +++ b/chain-signatures/node/src/protocol/signature.rs @@ -930,7 +930,7 @@ impl SignGenerator { tracing::info!( ?sign_id, source_chain = ?self.indexed.chain, - target_chain = ?event.dest, + target_chain = ?event.dest(), "generated signature for bidirectional request, awaiting indexer to process" ); } diff --git a/chain-signatures/node/src/respond_bidirectional.rs b/chain-signatures/node/src/respond_bidirectional.rs index d9f1b97ce..a44433ae5 100644 --- a/chain-signatures/node/src/respond_bidirectional.rs +++ b/chain-signatures/node/src/respond_bidirectional.rs @@ -13,6 +13,7 @@ use tokio::time::Duration; const MAGIC_ERROR_PREFIX: [u8; 4] = [0xde, 0xad, 0xbe, 0xef]; const SOLANA_RESPOND_BIDIRECTIONAL_PATH: &str = "solana response key"; +const HYDRATION_RESPOND_BIDIRECTIONAL_PATH: &str = "hydration response key"; // Use Borsh as this is what we are using for solana pub(crate) const RESPOND_SERIALIZATION_FORMAT: SerDeserFormat = SerDeserFormat::Borsh; // Use Abi as this is what we are using for ethereum @@ -117,16 +118,12 @@ impl CompletedTx { let Some(payload) = Scalar::from_bytes(message) else { anyhow::bail!("Failed to convert respond bidirectional message to scalar: {message:?}"); }; - let path = SOLANA_RESPOND_BIDIRECTIONAL_PATH.to_string(); - tracing::info!( - "requester to derive epsilon: {:?}", - self.tx.sender.to_string() - ); - let epsilon = mpc_crypto::kdf::derive_epsilon_sol( - self.tx.key_version, - &self.tx.sender.to_string(), - &path, - ); + let path = match chain { + Chain::Solana => SOLANA_RESPOND_BIDIRECTIONAL_PATH.to_string(), + Chain::Hydration => HYDRATION_RESPOND_BIDIRECTIONAL_PATH.to_string(), + _ => anyhow::bail!("Unsupported chain: {}", chain), + }; + let epsilon = self.tx.epsilon(&path)?; let entropy = self.tx.id.0; Ok(IndexedSignRequest { id: SignId::new(request_id_bytes), diff --git a/chain-signatures/node/src/rpc.rs b/chain-signatures/node/src/rpc.rs index d5ba4acf9..1a1a66aba 100644 --- a/chain-signatures/node/src/rpc.rs +++ b/chain-signatures/node/src/rpc.rs @@ -41,6 +41,18 @@ use std::time::{Duration, Instant}; use tokio::sync::{mpsc, watch}; use url::Url; +use crate::indexer_hydration::HydrationConfig; +use hydration::runtime_types::bounded_collections::bounded_vec::BoundedVec as HydrationBoundedVec; +use hydration::runtime_types::pallet_signet::pallet::{ + AffinePoint as HydrationAffinePoint, Signature as HydrationSignature, +}; +use subxt::config::substrate::{ + BlakeTwo256, SubstrateConfig, SubstrateExtrinsicParams, SubstrateHeader, +}; +use subxt::Config as SubxtConfig; +use subxt::OnlineClient; +use subxt_signer::{sr25519, SecretUri}; + /// The maximum amount of times to retry publishing a signature. const MAX_PUBLISH_RETRY: usize = 6; /// The maximum number of concurrent RPC requests the system can make @@ -319,19 +331,31 @@ pub struct RpcExecutor { near: NearClient, eth: Option, solana: Option, + hydration: Option, action_rx: mpsc::Receiver, backlog: Backlog, } impl RpcExecutor { - pub fn new( + pub async fn new( near: &NearClient, eth: &Option, solana: &Option, + hydration: &Option, backlog: Backlog, ) -> (RpcChannel, Self) { let eth = eth.as_ref().map(EthClient::new); let solana = solana.as_ref().map(SolanaClient::new); + let hydration = match hydration { + Some(h) => match HydrationClient::new(h).await { + Ok(client) => Some(client), + Err(e) => { + tracing::error!(%e, "failed to create hydration client"); + None + } + }, + None => None, + }; let (tx, rx) = mpsc::channel(MAX_CONCURRENT_RPC_REQUESTS); ( RpcChannel { tx }, @@ -339,6 +363,7 @@ impl RpcExecutor { near: near.clone(), eth, solana, + hydration, action_rx: rx, backlog, }, @@ -390,7 +415,7 @@ impl RpcExecutor { tokio::spawn(async move { match chain { - Chain::NEAR | Chain::Solana => { + Chain::NEAR | Chain::Solana | Chain::Hydration => { execute_publish(client, action, near_account_id, backlog).await; } Chain::Ethereum => { @@ -421,6 +446,13 @@ impl RpcExecutor { ChainClient::Err("no solana client available for node") } } + Chain::Hydration => { + if let Some(hydration) = &self.hydration { + ChainClient::Hydration(hydration.clone()) + } else { + ChainClient::Err("no hydration client available for node") + } + } } } } @@ -642,6 +674,115 @@ impl SolanaClient { } } +pub enum HydradxConfig {} + +impl SubxtConfig for HydradxConfig { + type AccountId = ::AccountId; + type Address = ::AccountId; + type Signature = ::Signature; + type Hasher = BlakeTwo256; + type Header = SubstrateHeader; + type ExtrinsicParams = SubstrateExtrinsicParams; + type AssetId = ::AssetId; +} + +#[subxt::subxt(runtime_metadata_path = "src/indexer_hydration/artifacts/hydration_metadata.scale")] +pub mod hydration {} +#[derive(Clone)] +pub struct HydrationClient { + api: OnlineClient, + signer: sr25519::Keypair, +} +type TxHash = subxt::config::HashFor; + +impl HydrationClient { + /// Create a new Hydration client. + /// + /// `rpc_url`: e.g. "ws://127.0.0.1:9944" or "wss://rpc.hydration.cloud" + /// `signer_uri`: sr25519 secret URI, e.g. "//Alice" or a mnemonic. + pub async fn new(config: &HydrationConfig) -> anyhow::Result { + let api = OnlineClient::::from_url(&config.rpc_ws_url).await?; + + let uri = SecretUri::from_str(&config.signer_uri)?; + let signer = sr25519::Keypair::from_uri(&uri)?; + + Ok(Self { api, signer }) + } + + /// Helper to convert your MPC signature type into the pallet_signet Signature. + fn to_hydration_signature(sig: &Signature) -> HydrationSignature { + let enc = sig.big_r.to_encoded_point(false); + + let x: [u8; 32] = enc + .x() + .map(|x| x.as_slice()) + .map(|x| x.try_into().expect("x must be 32 bytes")) + .expect("missing x"); + let y: [u8; 32] = enc + .y() + .map(|y| y.as_slice()) + .map(|y| y.try_into().expect("y must be 32 bytes")) + .expect("missing y"); + + let s_bytes: [u8; 32] = sig.s.to_bytes().into(); + + HydrationSignature { + big_r: HydrationAffinePoint { x, y }, + s: s_bytes, + recovery_id: sig.recovery_id, + } + } + + /// Call the Signet pallet's `respond()` extrinsic for a *single* request. + pub async fn call_respond(&self, id: &SignId, response: &Signature) -> anyhow::Result<()> { + let request_ids = HydrationBoundedVec(vec![id.request_id]); + + let signatures = HydrationBoundedVec(vec![Self::to_hydration_signature(response)]); + + // Build the call: signet::respond(request_ids, signatures) + let tx = hydration::tx().signet().respond(request_ids, signatures); + + // Sign, submit, and wait for finalized success. + let progress = self + .api + .tx() + .sign_and_submit_then_watch_default(&tx, &self.signer) + .await?; + + let _events = progress.wait_for_finalized_success().await?; + + Ok(()) + } + + pub async fn call_respond_bidirectional( + &self, + id: &SignId, + serialized_output: Vec, + response: &Signature, + ) -> anyhow::Result { + let request_id: [u8; 32] = id.request_id; + let hyd_sig = Self::to_hydration_signature(response); + + let tx = hydration::tx().signet().respond_bidirectional( + request_id, + HydrationBoundedVec(serialized_output), + hyd_sig, + ); + + let progress = self + .api + .tx() + .sign_and_submit_then_watch_default(&tx, &self.signer) + .await?; + + let events = progress.wait_for_finalized_success().await?; + + let tx_hash = events.extrinsic_hash(); + + Ok(tx_hash) + } +} + /// Client related to a specific chain #[allow(clippy::large_enum_variant)] pub enum ChainClient { @@ -649,6 +790,7 @@ pub enum ChainClient { Near(NearClient), Ethereum(EthClient), Solana(SolanaClient), + Hydration(HydrationClient), } async fn update_contract(near: NearClient, contract: watch::Sender>) { @@ -737,6 +879,15 @@ async fn execute_publish( ) .await .map_err(|_| ()), + ChainClient::Hydration(hyd) => try_publish_hydration( + hyd, + &action, + &action.timestamp, + &signature, + &near_account_id, + ) + .await + .map_err(|_| ()), ChainClient::Err(msg) => { tracing::warn!(msg, "no client for chain"); Ok(()) @@ -1254,6 +1405,10 @@ async fn execute_batch_publish( ChainClient::Ethereum(eth) => { try_batch_publish_eth(eth, actions, &signatures, near_account_id, start).await } + ChainClient::Hydration(_) => { + tracing::error!("Hydration has no batch publish"); + Ok(()) + } ChainClient::Err(msg) => { tracing::warn!(msg, "no client for chain"); Ok(()) @@ -1400,3 +1555,80 @@ async fn try_publish_sol( .observe(timestamp.elapsed().as_secs_f64()); Ok(()) } + +async fn try_publish_hydration( + hyd: &HydrationClient, + action: &PublishAction, + timestamp: &Instant, + signature: &Signature, + near_account_id: &AccountId, +) -> Result<(), ()> { + let chain = action.indexed.chain; + let sign_id = action.indexed.id; + let request_ids = [action.indexed.id.request_id]; + + tracing::info!( + ?sign_id, + ?chain, + elapsed = ?timestamp.elapsed(), + request_id = ?request_ids[0], + "Hydration: publishing signature" + ); + + match &action.indexed.sign_request_type { + SignRequestType::Sign | SignRequestType::SignBidirectional(_) => { + hyd.call_respond(&action.indexed.id, signature) + .await + .map_err(|e| { + tracing::error!(?sign_id, ?e, "Hydration: failed to publish signature"); + })?; + tracing::info!( + ?sign_id, + elapsed = ?timestamp.elapsed(), + "published hydration signature successfully" + ); + } + SignRequestType::RespondBidirectional(respond_bidirectional_tx) => { + let serialized_output = respond_bidirectional_tx.output.clone(); + tracing::debug!( + ?sign_id, + request_id = ?request_ids[0], + serialized_output_len = serialized_output.len(), + "try_publish_hydration: entering RespondBidirectional arm" + ); + let tx_hash = hyd + .call_respond_bidirectional(&action.indexed.id, serialized_output, signature) + .await + .map_err(|e| { + tracing::error!( + ?sign_id, + ?e, + "Hydration: failed to publish respond bidirectional signature" + ); + })?; + tracing::info!( + ?sign_id, + tx_hash = ?tx_hash, + elapsed = ?timestamp.elapsed(), + "published respond bidirectional hydration signature successfully" + ); + } + } + + crate::metrics::requests::NUM_SIGN_SUCCESS + .with_label_values(&[chain.as_str(), near_account_id.as_str()]) + .inc(); + let sign_latency_in_secs = crate::util::duration_between_unix( + action.indexed.unix_timestamp_indexed, + crate::util::current_unix_timestamp(), + ) + .as_secs(); + crate::metrics::requests::SIGN_TOTAL_LATENCY + .with_label_values(&[chain.as_str(), near_account_id.as_str()]) + .observe(sign_latency_in_secs as f64); + crate::metrics::requests::SIGN_RESPOND_LATENCY + .with_label_values(&[chain.as_str(), near_account_id.as_str()]) + .observe(timestamp.elapsed().as_secs_f64()); + + Ok(()) +} diff --git a/chain-signatures/node/src/sign_bidirectional.rs b/chain-signatures/node/src/sign_bidirectional.rs index 72243286b..c79b16b6c 100644 --- a/chain-signatures/node/src/sign_bidirectional.rs +++ b/chain-signatures/node/src/sign_bidirectional.rs @@ -1,8 +1,7 @@ -use crate::protocol::{Chain, IndexedSignRequest, SignRequestType}; +use crate::protocol::{Chain, IndexedSignRequest}; use crate::respond_bidirectional::SerDeserFormat; use alloy::primitives::{keccak256, Address, Bytes, B256, I256, U256}; use alloy_dyn_abi::{DynSolType, DynSolValue}; -use anchor_lang::prelude::Pubkey; use borsh::BorshSerialize; use k256::elliptic_curve::point::AffineCoordinates; use k256::{AffinePoint, Scalar}; @@ -13,7 +12,6 @@ use serde_json::Value; use sha3::{Digest, Keccak256}; use std::collections::HashMap; use std::io::Write; -use std::str::FromStr; #[derive(Debug, Clone, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize, Copy)] pub struct BidirectionalTxId(pub B256); @@ -48,7 +46,7 @@ pub enum PendingRequestStatus { #[derive(Debug, Clone, Hash, serde::Serialize, serde::Deserialize)] pub struct BidirectionalTx { pub id: BidirectionalTxId, - pub sender: Pubkey, + pub sender: [u8; 32], pub serialized_transaction: Vec, pub source_chain: Chain, pub target_chain: Chain, @@ -68,51 +66,24 @@ pub struct BidirectionalTx { } impl BidirectionalTx { - pub fn new(signature: SignBidirectionalSignature) -> anyhow::Result { - let SignRequestType::SignBidirectional(event) = signature.indexed.sign_request_type.clone() - else { - anyhow::bail!("sign request is not a sign bidirectional"); - }; + pub(crate) fn sender_string(&self) -> anyhow::Result { + crate::indexer_common::sender_string(self.sender, self.source_chain) + } - let unsigned_rlp_data = &event.serialized_transaction; - let target_chain = Chain::from_str(&event.dest).map_err(|err| { - anyhow::anyhow!( - "invalid target chain '{}' for bidirectional transaction: {err}", - event.dest - ) - })?; - let source_chain = signature.indexed.chain; - - let (signed_transaction_hash, nonce) = - sign_and_hash_transaction(unsigned_rlp_data, signature.signature)?; - - tracing::info!(signed_transaction_hash = ?signed_transaction_hash, "signed_transaction_hash"); - - let from_address = - derive_user_address(signature.public_key, signature.indexed.args.epsilon); - - tracing::info!(from_address = ?from_address, "from_address"); - - Ok(Self { - id: BidirectionalTxId(signed_transaction_hash.into()), - sender: event.sender, - serialized_transaction: event.serialized_transaction, - source_chain, - target_chain, - caip2_id: event.caip2_id, - key_version: event.key_version, - deposit: event.deposit, - path: event.path, - algo: event.algo, - dest: event.dest, - params: event.params, - output_deserialization_schema: event.output_deserialization_schema, - respond_serialization_schema: event.respond_serialization_schema, - request_id: signature.indexed.id.request_id, - from_address, - nonce, - status: PendingRequestStatus::AwaitingResponse, - }) + pub(crate) fn epsilon(&self, path: &str) -> anyhow::Result { + match self.source_chain { + Chain::Solana => Ok(mpc_crypto::kdf::derive_epsilon_sol( + self.key_version, + &self.sender_string()?, + path, + )), + Chain::Hydration => Ok(mpc_crypto::kdf::derive_epsilon_hydration( + self.key_version, + &self.sender_string()?, + path, + )), + _ => anyhow::bail!("Unsupported chain: {}", self.source_chain), + } } } diff --git a/chain-signatures/primitives/src/lib.rs b/chain-signatures/primitives/src/lib.rs index 60b84f549..051dc7f7a 100644 --- a/chain-signatures/primitives/src/lib.rs +++ b/chain-signatures/primitives/src/lib.rs @@ -125,6 +125,7 @@ pub enum Chain { NEAR, Ethereum, Solana, + Hydration, } impl Chain { @@ -133,11 +134,17 @@ impl Chain { Chain::NEAR => "NEAR", Chain::Ethereum => "Ethereum", Chain::Solana => "Solana", + Chain::Hydration => "Hydration", } } - pub const fn iter() -> [Chain; 3] { - [Chain::NEAR, Chain::Ethereum, Chain::Solana] + pub const fn iter() -> [Chain; 4] { + [ + Chain::NEAR, + Chain::Ethereum, + Chain::Solana, + Chain::Hydration, + ] } pub fn checkpoint_interval(&self) -> Option { @@ -145,6 +152,7 @@ impl Chain { Chain::NEAR => return None, Chain::Ethereum => ("CHECKPOINT_INTERVAL_ETHEREUM", 20), Chain::Solana => ("CHECKPOINT_INTERVAL_SOLANA", 120), + Chain::Hydration => ("CHECKPOINT_INTERVAL_HYDRATION", 240), }; let interval = std::env::var(key) @@ -158,6 +166,7 @@ impl Chain { vec![ ("CHECKPOINT_INTERVAL_ETHEREUM", "2"), ("CHECKPOINT_INTERVAL_SOLANA", "5"), + ("CHECKPOINT_INTERVAL_HYDRATION", "5"), ] } } @@ -176,6 +185,7 @@ impl FromStr for Chain { "near" => Ok(Chain::NEAR), "ethereum" | "eth" => Ok(Chain::Ethereum), "solana" | "sol" => Ok(Chain::Solana), + "hydration" | "hyd" => Ok(Chain::Hydration), other => Err(format!("unknown or unsupported chain {other}")), } } diff --git a/infra/scripts/generate_keys/Cargo.lock b/infra/scripts/generate_keys/Cargo.lock index 804bb754d..347ddcc06 100644 --- a/infra/scripts/generate_keys/Cargo.lock +++ b/infra/scripts/generate_keys/Cargo.lock @@ -62,6 +62,18 @@ dependencies = [ "subtle", ] +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -71,12 +83,329 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "anyhow" version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bls12-381" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df4dcc01ff89867cd86b0da835f23c3f02738353aaee7dde7495af71363b8d5" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff 0.4.2", + "ark-poly 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", + "itertools 0.13.0", + "num-bigint", + "num-integer", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1786b2e3832f6f0f7c8d62d5d5a282f6952a1ab99981c54cd52b6ac1d8f02df5" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-std 0.5.0", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "educe", + "itertools 0.13.0", + "num-bigint", + "num-traits", + "paste", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" +dependencies = [ + "quote", + "syn 2.0.98", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "educe", + "fnv", + "hashbrown 0.15.5", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive 0.4.2", + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", + "arrayvec", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "ark-transcript" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c1c928edb9d8ff24cb5dcb7651d3a98494fff3099eee95c2404cd813a9139f" +dependencies = [ + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_core", + "sha3", +] + +[[package]] +name = "ark-vrf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d63e9780640021b74d02b32895d8cec1b4abe8e5547b560a6bda6b14b78c6da" +dependencies = [ + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "digest 0.10.7", + "rand_chacha", + "sha2 0.10.8", + "w3f-ring-proof", + "zeroize", +] + +[[package]] +name = "array-bytes" +version = "6.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + [[package]] name = "arrayvec" version = "0.7.6" @@ -164,6 +493,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -191,6 +526,22 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -221,7 +572,27 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest", + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06e903a20b159e944f91ec8499fe1e55651480c541ea0a584f5d967c49ad9d99" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq 0.3.1", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", ] [[package]] @@ -256,6 +627,19 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "bounded-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee8eddd066a8825ec5570528e6880471210fd5d88cb6abbe1cfdd51ca249c33" +dependencies = [ + "jam-codec", + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "bs58" version = "0.4.0" @@ -268,7 +652,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2", + "sha2 0.10.8", "tinyvec", ] @@ -280,9 +664,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "byteorder" @@ -349,7 +733,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 1.0.61", + "thiserror 1.0.69", ] [[package]] @@ -427,12 +811,12 @@ checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" dependencies = [ "bs58 0.5.1", "coins-core", - "digest", + "digest 0.10.7", "hmac", "k256", "serde", - "sha2", - "thiserror 1.0.61", + "sha2 0.10.8", + "thiserror 1.0.69", ] [[package]] @@ -447,8 +831,8 @@ dependencies = [ "once_cell", "pbkdf2 0.12.2", "rand", - "sha2", - "thiserror 1.0.61", + "sha2 0.10.8", + "thiserror 1.0.69", ] [[package]] @@ -460,15 +844,15 @@ dependencies = [ "base64 0.21.7", "bech32", "bs58 0.5.1", - "digest", + "digest 0.10.7", "generic-array", "hex", "ripemd", "serde", "serde_derive", - "sha2", + "sha2 0.10.8", "sha3", - "thiserror 1.0.61", + "thiserror 1.0.69", ] [[package]] @@ -490,12 +874,38 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + [[package]] name = "convert_case" version = "0.4.0" @@ -608,7 +1018,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest", + "digest 0.10.7", "fiat-crypto", "rustc_version", "subtle", @@ -639,6 +1049,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -651,6 +1062,17 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -684,13 +1106,22 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + [[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", "const-oid", "crypto-common", "subtle", @@ -755,6 +1186,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "ecdsa" version = "0.16.9" @@ -762,9 +1199,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -775,6 +1213,7 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ + "pkcs8", "signature", ] @@ -787,10 +1226,38 @@ dependencies = [ "curve25519-dalek", "ed25519", "rand_core", - "sha2", + "sha2 0.10.8", "subtle", ] +[[package]] +name = "ed25519-zebra" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0017d969298eec91e3db7a2985a8cab4df6341d86e6f3a6f5878b13fb7846bc9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.15.5", + "pkcs8", + "rand_core", + "sha2 0.10.8", + "subtle", + "zeroize", +] + +[[package]] +name = "educe" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7bc049e1bd8cdeb31b68bbd586a9464ecf9f3944af3958a7a9d0f8b9799417" +dependencies = [ + "enum-ordinalize", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "either" version = "1.13.0" @@ -805,7 +1272,7 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array", "group", @@ -813,6 +1280,7 @@ dependencies = [ "pkcs8", "rand_core", "sec1", + "serdect", "subtle", "zeroize", ] @@ -853,6 +1321,32 @@ dependencies = [ "zeroize", ] +[[package]] +name = "enum-ordinalize" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a1091a7bb1f8f2c4b28f1fe2cef4980ca2d410a3d727d67ecc3178c9b0800f0" +dependencies = [ + "enum-ordinalize-derive", +] + +[[package]] +name = "enum-ordinalize-derive" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca9601fb2d62598ee17836250842873a413586e5d7ed88b356e38ddbb0ec631" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + [[package]] name = "equivalent" version = "1.0.1" @@ -877,7 +1371,7 @@ checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes", "ctr", - "digest", + "digest 0.10.7", "hex", "hmac", "pbkdf2 0.11.0", @@ -885,9 +1379,9 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2", + "sha2 0.10.8", "sha3", - "thiserror 1.0.61", + "thiserror 1.0.69", "uuid", ] @@ -904,8 +1398,8 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror 1.0.61", - "uint", + "thiserror 1.0.69", + "uint 0.9.5", ] [[package]] @@ -916,9 +1410,9 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "scale-info", "tiny-keccak", ] @@ -931,12 +1425,12 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom", "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", "primitive-types 0.12.2", "scale-info", - "uint", + "uint 0.9.5", ] [[package]] @@ -983,7 +1477,7 @@ dependencies = [ "pin-project", "serde", "serde_json", - "thiserror 1.0.61", + "thiserror 1.0.69", ] [[package]] @@ -1051,7 +1545,7 @@ dependencies = [ "strum", "syn 2.0.98", "tempfile", - "thiserror 1.0.61", + "thiserror 1.0.69", "tiny-keccak", "unicode-xid", ] @@ -1068,7 +1562,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 1.0.61", + "thiserror 1.0.69", "tracing", ] @@ -1092,7 +1586,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 1.0.61", + "thiserror 1.0.69", "tokio", "tracing", "tracing-futures", @@ -1124,7 +1618,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "thiserror 1.0.61", + "thiserror 1.0.69", "tokio", "tokio-tungstenite", "tracing", @@ -1150,8 +1644,8 @@ dependencies = [ "eth-keystore", "ethers-core", "rand", - "sha2", - "thiserror 1.0.61", + "sha2 0.10.8", + "thiserror 1.0.69", "tracing", ] @@ -1179,7 +1673,7 @@ dependencies = [ "serde_json", "solang-parser", "svm-rs", - "thiserror 1.0.61", + "thiserror 1.0.69", "tiny-keccak", "tokio", "tracing", @@ -1262,6 +1756,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1327,6 +1827,7 @@ dependencies = [ "futures-core", "futures-task", "futures-util", + "num_cpus", ] [[package]] @@ -1414,6 +1915,7 @@ dependencies = [ "mpc-keys", "near-crypto", "rand", + "sp-core", ] [[package]] @@ -1451,6 +1953,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand", + "rand_core", +] + [[package]] name = "ghash" version = "0.5.1" @@ -1515,11 +2027,46 @@ dependencies = [ "tracing", ] +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "hashers" @@ -1551,6 +2098,12 @@ dependencies = [ "serde", ] +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hkdf" version = "0.12.4" @@ -1566,7 +2119,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -1588,14 +2141,14 @@ dependencies = [ "aes-gcm", "byteorder", "chacha20poly1305", - "digest", + "digest 0.10.7", "generic-array", "hkdf", "hmac", "p256", "rand_core", "serde", - "sha2", + "sha2 0.10.8", "subtle", "x25519-dalek", "zeroize", @@ -1821,6 +2374,26 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d15461ab0dcc56706adf266158acbc44ccf719bf7d0af30705f58b90a4b8c" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint 0.10.0", +] + [[package]] name = "impl-rlp" version = "0.3.0" @@ -1839,15 +2412,24 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a143eada6a1ec4aefa5049037a26a6d597bfd64f8c026d07b77133e02b7dd0b" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -1858,12 +2440,12 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.16.1", ] [[package]] @@ -1884,12 +2466,30 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + [[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.11.0" @@ -1899,12 +2499,49 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jam-codec" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb948eace373d99de60501a02fb17125d30ac632570de20dccc74370cdd611b9" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "jam-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "jam-codec-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319af585c4c8a6b5552a52b7787a1ab3e4d59df7614190b1f85b9b842488789d" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "jobserver" version = "0.1.32" @@ -1954,7 +2591,8 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2", + "serdect", + "sha2 0.10.8", "signature", ] @@ -1976,7 +2614,7 @@ dependencies = [ "ascii-canvas", "bit-set", "ena", - "itertools", + "itertools 0.11.0", "lalrpop-util", "petgraph", "regex", @@ -2019,6 +2657,52 @@ dependencies = [ "libc", ] +[[package]] +name = "libsecp256k1" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" +dependencies = [ + "arrayref", + "base64 0.22.1", + "digest 0.9.0", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand", + "serde", + "sha2 0.9.9", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -2054,7 +2738,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ "cfg-if", - "digest", + "digest 0.10.7", ] [[package]] @@ -2063,6 +2747,18 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core", + "zeroize", +] + [[package]] name = "mime" version = "0.3.17" @@ -2118,7 +2814,7 @@ checksum = "4e7b41110a20f1d82bb06f06e4800068c5ade6d8ff844787f8753bc2ce7b16f7" dependencies = [ "anyhow", "json_comments", - "thiserror 1.0.61", + "thiserror 1.0.69", "tracing", ] @@ -2141,11 +2837,11 @@ dependencies = [ "near-stdx", "primitive-types 0.10.1", "rand", - "secp256k1", + "secp256k1 0.27.0", "serde", "serde_json", "subtle", - "thiserror 1.0.61", + "thiserror 1.0.69", ] [[package]] @@ -2198,6 +2894,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-format" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a652d9771a63711fd3c3deb670acfbe5c30a4072e664d7a3bf5a9e1056ac72c3" +dependencies = [ + "arrayvec", + "itoa", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -2309,30 +3015,45 @@ dependencies = [ "primeorder", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.98", ] [[package]] @@ -2360,15 +3081,32 @@ dependencies = [ [[package]] name = "password-hash" -version = "0.4.2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "password-hash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", "rand_core", "subtle", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "path-slash" version = "0.2.1" @@ -2381,10 +3119,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest", + "digest 0.10.7", "hmac", - "password-hash", - "sha2", + "password-hash 0.4.2", + "sha2 0.10.8", ] [[package]] @@ -2393,8 +3131,9 @@ version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "digest", + "digest 0.10.7", "hmac", + "password-hash 0.5.0", ] [[package]] @@ -2406,6 +3145,15 @@ dependencies = [ "base64 0.13.1", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -2589,7 +3337,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" dependencies = [ "fixed-hash 0.7.0", - "uint", + "uint 0.9.5", ] [[package]] @@ -2599,27 +3347,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash 0.8.0", - "impl-codec", + "impl-codec 0.6.0", "impl-rlp", - "impl-serde", + "impl-serde 0.4.0", + "scale-info", + "uint 0.9.5", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec 0.7.1", + "impl-num-traits", + "impl-serde 0.5.0", "scale-info", - "uint", + "uint 0.10.0", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.23.9", ] [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" dependencies = [ "unicode-ident", ] @@ -2642,9 +3404,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" dependencies = [ "proc-macro2", ] @@ -2731,7 +3493,27 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.12", "libredox", - "thiserror 1.0.61", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -2850,7 +3632,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] @@ -2976,10 +3758,12 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" dependencies = [ + "bitvec", "cfg-if", "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", + "serde", ] [[package]] @@ -2994,6 +3778,25 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "schnorrkel" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e9fcb6c2e176e86ec703e22560d99d65a5ee9056ae45a08e13e84ebf796296f" +dependencies = [ + "aead", + "arrayref", + "arrayvec", + "curve25519-dalek", + "getrandom_or_panic", + "merlin", + "rand_core", + "serde_bytes", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -3009,7 +3812,7 @@ dependencies = [ "hmac", "pbkdf2 0.11.0", "salsa20", - "sha2", + "sha2 0.10.8", ] [[package]] @@ -3032,6 +3835,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3043,7 +3847,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "rand", - "secp256k1-sys", + "secp256k1-sys 0.8.1", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "secp256k1-sys 0.9.2", ] [[package]] @@ -3055,6 +3868,24 @@ dependencies = [ "cc", ] +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + [[package]] name = "semver" version = "1.0.22" @@ -3078,18 +3909,38 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + +[[package]] +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -3129,6 +3980,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3137,7 +3998,20 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", ] [[package]] @@ -3148,7 +4022,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -3157,7 +4031,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] @@ -3173,7 +4047,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core", ] @@ -3226,14 +4100,117 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" dependencies = [ - "itertools", + "itertools 0.11.0", "lalrpop", "lalrpop-util", "phf", - "thiserror 1.0.61", + "thiserror 1.0.69", "unicode-xid", ] +[[package]] +name = "sp-core" +version = "38.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707602208776d0e19d4269bb3f68c5306cacbdfabbb2e4d8d499af7b907bb0a3" +dependencies = [ + "ark-vrf", + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58 0.5.1", + "dyn-clone", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde 0.5.0", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types 0.13.1", + "rand", + "scale-info", + "schnorrkel", + "secp256k1 0.28.2", + "secrecy", + "serde", + "sha2 0.10.8", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities", + "sp-std", + "sp-storage", + "ss58-registry", + "substrate-bip39", + "thiserror 1.0.69", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "twox-hash", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + +[[package]] +name = "sp-externalities" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cbf059dce180a8bf8b6c8b08b6290fa3d1c7f069a60f1df038ab5dd5fc0ba6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage", +] + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" + +[[package]] +name = "sp-storage" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee3b70ca340e41cde9d2e069d354508a6e37a6573d66f7cc38f11549002f64ec" +dependencies = [ + "impl-serde 0.5.0", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + [[package]] name = "spin" version = "0.5.2" @@ -3256,6 +4233,21 @@ dependencies = [ "der", ] +[[package]] +name = "ss58-registry" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19409f13998e55816d1c728395af0b52ec066206341d939e22e7766df9b494b8" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -3302,11 +4294,24 @@ dependencies = [ "syn 2.0.98", ] +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "svm-rs" @@ -3322,8 +4327,8 @@ dependencies = [ "semver", "serde", "serde_json", - "sha2", - "thiserror 1.0.61", + "sha2 0.10.8", + "thiserror 1.0.69", "url", "zip", ] @@ -3421,11 +4426,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.61", + "thiserror-impl 1.0.69", ] [[package]] @@ -3439,9 +4444,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -3585,7 +4590,7 @@ checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", - "toml_datetime", + "toml_datetime 0.6.6", "toml_edit 0.22.16", ] @@ -3599,14 +4604,12 @@ dependencies = [ ] [[package]] -name = "toml_edit" -version = "0.21.1" +name = "toml_datetime" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", + "serde_core", ] [[package]] @@ -3618,10 +4621,31 @@ dependencies = [ "indexmap", "serde", "serde_spanned", - "toml_datetime", + "toml_datetime 0.6.6", "winnow 0.6.26", ] +[[package]] +name = "toml_edit" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d7cbc3b4b49633d57a0509303158ca50de80ae32c265093b24c414705807832" +dependencies = [ + "indexmap", + "toml_datetime 0.7.3", + "toml_parser", + "winnow 0.7.14", +] + +[[package]] +name = "toml_parser" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +dependencies = [ + "winnow 0.7.14", +] + [[package]] name = "tower-service" version = "0.3.3" @@ -3690,11 +4714,23 @@ dependencies = [ "rand", "rustls", "sha1", - "thiserror 1.0.61", + "thiserror 1.0.69", "url", "utf-8", ] +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.7", + "rand", + "static_assertions", +] + [[package]] name = "typenum" version = "1.17.0" @@ -3713,6 +4749,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unarray" version = "0.1.4" @@ -3725,6 +4773,15 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-xid" version = "0.2.6" @@ -3798,6 +4855,74 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "w3f-bls" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6bfb937b3d12077654a9e43e32a4e9c20177dd9fea0f3aba673e7840bb54f32" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381 0.4.0", + "ark-ec 0.4.2", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-serialize-derive 0.4.2", + "arrayref", + "digest 0.10.7", + "rand", + "rand_chacha", + "rand_core", + "sha2 0.10.8", + "sha3", + "zeroize", +] + +[[package]] +name = "w3f-pcs" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbe7a8d5c914b69392ab3b267f679a2e546fe29afaddce47981772ac71bd02e1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "merlin", +] + +[[package]] +name = "w3f-plonk-common" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aca389e494fe08c5c108b512e2328309036ee1c0bc7bdfdb743fef54d448c8c" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "getrandom_or_panic", + "rand_core", + "w3f-pcs", +] + +[[package]] +name = "w3f-ring-proof" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a639379402ad51504575dbd258740383291ac8147d3b15859bdf1ea48c677de" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "ark-transcript", + "w3f-pcs", + "w3f-plonk-common", +] + [[package]] name = "walkdir" version = "2.5.0" @@ -4100,18 +5225,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" dependencies = [ "memchr", ] [[package]] name = "winnow" -version = "0.6.26" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -4160,7 +5285,7 @@ dependencies = [ "pharos", "rustc_version", "send_wrapper 0.6.0", - "thiserror 1.0.61", + "thiserror 1.0.69", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4215,6 +5340,26 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zerocopy" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd74ec98b9250adb3ca554bdde269adf631549f51d8a8f8f0a10b50f1cb298c3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a8d209fdf45cf5138cbb5a506f6b52522a25afccc534d1475dad8e31105c6a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.98", +] + [[package]] name = "zerofrom" version = "0.1.5" @@ -4238,9 +5383,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" dependencies = [ "zeroize_derive", ] @@ -4287,7 +5432,7 @@ dependencies = [ "aes", "byteorder", "bzip2", - "constant_time_eq", + "constant_time_eq 0.1.5", "crc32fast", "crossbeam-utils", "flate2", diff --git a/infra/scripts/generate_keys/Cargo.toml b/infra/scripts/generate_keys/Cargo.toml index ebfc95a09..dde70d1d6 100644 --- a/infra/scripts/generate_keys/Cargo.toml +++ b/infra/scripts/generate_keys/Cargo.toml @@ -10,4 +10,5 @@ ethers = "2.0" hex = "0.4.3" near-crypto = "0.27" mpc-keys = { path = "../../../chain-signatures/keys" } -rand = "0.8" \ No newline at end of file +rand = "0.8" +sp-core = { version = "38.1", default-features = false, features = ["std"] } \ No newline at end of file diff --git a/infra/scripts/generate_keys/src/main.rs b/infra/scripts/generate_keys/src/main.rs index f3e8176a5..e0c67a66d 100644 --- a/infra/scripts/generate_keys/src/main.rs +++ b/infra/scripts/generate_keys/src/main.rs @@ -1,11 +1,22 @@ use ethers::signers::LocalWallet; use ethers::signers::Signer; use mpc_keys::hpke; +use sp_core::crypto::{Ss58AddressFormatRegistry, Ss58Codec}; +use sp_core::{sr25519, Pair}; use std::env; fn main() { let args: Vec = env::args().collect(); + let (hydration_pair, hydration_phrase, _seed) = sr25519::Pair::generate_with_phrase(None); + + let hydration_account_id = hydration_pair + .public() + .to_ss58check_with_version(Ss58AddressFormatRegistry::PolkadotAccount.into()); + + println!("Hydrationsigner_uri (secret phrase): {hydration_phrase}"); + println!("Hydration ss58 address: {hydration_account_id}"); + let solana_sk = near_crypto::SecretKey::from_random(near_crypto::KeyType::ED25519); let solana_pk = solana_sk.public_key(); println!( diff --git a/integration-tests/src/containers.rs b/integration-tests/src/containers.rs index 9566e6306..30e57f9ce 100644 --- a/integration-tests/src/containers.rs +++ b/integration-tests/src/containers.rs @@ -114,6 +114,8 @@ impl Node { }; let eth_args = EthArgs::from_config(config.cfg.eth.clone()); let sol_args = mpc_node::indexer_sol::SolArgs::from_config(config.cfg.sol.clone()); + let hydration_args = + mpc_node::indexer_hydration::HydrationArgs::from_config(config.cfg.hydration.clone()); let args = mpc_node::cli::Cli::Start { near_rpc: config.near_rpc.clone(), mpc_contract_id: ctx.mpc_contract.id().clone(), @@ -124,6 +126,7 @@ impl Node { indexer_options: indexer_options.clone(), eth: eth_args, sol: sol_args, + hydration: hydration_args, my_address: None, storage_options: ctx.storage_options.clone(), log_options: ctx.log_options.clone(), diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 13f71aad7..d0fbe1bcc 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -22,6 +22,7 @@ use mpc_contract::config::{PresignatureConfig, ProtocolConfig, TripleConfig}; use mpc_contract::primitives::CandidateInfo; use mpc_node::gcp::GcpService; use mpc_node::indexer_eth::EthConfig; +use mpc_node::indexer_hydration::HydrationConfig; use mpc_node::indexer_sol::SolConfig; use mpc_node::storage::triple_storage::{TriplePair, TripleStorage}; use mpc_node::{logs, mesh, node_client, storage}; @@ -61,6 +62,7 @@ pub struct NodeConfig { pub protocol: ProtocolConfig, pub eth: Option, pub sol: Option, + pub hydration: Option, } impl Default for NodeConfig { @@ -85,6 +87,7 @@ impl Default for NodeConfig { }, eth: None, sol: None, + hydration: None, } } } diff --git a/integration-tests/src/local.rs b/integration-tests/src/local.rs index 6a8e5d78d..b486cad24 100644 --- a/integration-tests/src/local.rs +++ b/integration-tests/src/local.rs @@ -69,6 +69,8 @@ impl Node { }; let eth = mpc_node::indexer_eth::EthArgs::from_config(cfg.eth.clone()); let sol = mpc_node::indexer_sol::SolArgs::from_config(cfg.sol.clone()); + let hydration = + mpc_node::indexer_hydration::HydrationArgs::from_config(cfg.hydration.clone()); let near_rpc = ctx.worker.rpc_addr(); let mpc_contract_id = ctx.mpc_contract.id().clone(); let cli = mpc_node::cli::Cli::Start { @@ -81,6 +83,7 @@ impl Node { sign_sk: Some(sign_sk.clone()), eth, sol, + hydration, indexer_options, my_address: None, storage_options: ctx.storage_options.clone(), @@ -167,6 +170,8 @@ impl Node { let eth = EthArgs::from_config(config.cfg.eth.clone()); let sol = mpc_node::indexer_sol::SolArgs::from_config(config.cfg.sol.clone()); + let hydration = + mpc_node::indexer_hydration::HydrationArgs::from_config(config.cfg.hydration.clone()); let cli = mpc_node::cli::Cli::Start { near_rpc: config.near_rpc.clone(), mpc_contract_id: ctx.mpc_contract.id().clone(), @@ -177,6 +182,7 @@ impl Node { sign_sk: Some(config.sign_sk.clone()), eth, sol, + hydration, indexer_options, my_address: None, storage_options: ctx.storage_options.clone(),