From 33e6d27d44629ba8c91f56a43ad0e86ee28918b2 Mon Sep 17 00:00:00 2001 From: Donovan Tjemmes <37707055+Tjemmmic@users.noreply.github.com> Date: Thu, 24 Oct 2024 21:56:53 -0500 Subject: [PATCH] feat(cargo-tangle): key generation (#385) * fix(cli): key generation in cli * fix(cli): key generation and tests wip * feat(cli): command-line key generation and tests --- Cargo.lock | 568 +++++++++--------- .../incredible-squaring-eigenlayer/src/lib.rs | 2 - .../src/tests.rs | 301 ---------- cli/Cargo.toml | 7 +- cli/README.md | 18 + cli/src/keys.rs | 146 +++++ cli/src/lib.rs | 3 + cli/src/main.rs | 36 +- cli/src/signer.rs | 71 +-- cli/src/tests.rs | 181 ++++++ sdk/src/keystore/mod.rs | 16 + 11 files changed, 681 insertions(+), 668 deletions(-) delete mode 100644 blueprints/incredible-squaring-eigenlayer/src/tests.rs create mode 100644 cli/src/keys.rs create mode 100644 cli/src/tests.rs diff --git a/Cargo.lock b/Cargo.lock index bf01cdc98..cafec442b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,10 +128,11 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "alloy-chains" -version = "0.1.36" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c225801d42099570d0674701dddd4142f0ef715282aeb5985042e2ec962df7" +checksum = "d4932d790c723181807738cf1ac68198ab581cd699545b155601332541ee47bd" dependencies = [ + "alloy-primitives 0.8.9", "num_enum", "strum", ] @@ -183,7 +184,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -393,9 +394,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" dependencies = [ "alloy-rlp-derive", "arrayvec 0.7.6", @@ -404,13 +405,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -569,7 +570,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -583,7 +584,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -600,7 +601,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity 0.7.7", "tiny-keccak", ] @@ -618,7 +619,7 @@ dependencies = [ "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity 0.8.9", "tiny-keccak", ] @@ -636,7 +637,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity 0.7.7", ] @@ -651,7 +652,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity 0.8.9", ] @@ -662,7 +663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -736,7 +737,7 @@ dependencies = [ "alloy-json-rpc 0.1.4", "alloy-transport 0.1.4", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "reqwest 0.12.8", "serde_json", @@ -770,7 +771,7 @@ dependencies = [ "alloy-transport 0.1.4", "futures", "http 1.1.0", - "rustls 0.23.14", + "rustls 0.23.15", "serde_json", "tokio", "tokio-tungstenite 0.23.1", @@ -853,9 +854,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "anymap2" @@ -1132,7 +1133,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "synstructure 0.13.1", ] @@ -1144,7 +1145,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1292,7 +1293,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1309,7 +1310,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1408,7 +1409,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1478,14 +1479,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] name = "aws-sdk-kms" -version = "1.46.0" +version = "1.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33590e8d45206fdc4273ded8a1f292bcceaadd513037aa790fc67b237bc30ee" +checksum = "564a597a3c71a957d60a2e4c62c93d78ee5a0d636531e15b760acad983a5c18e" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1568,9 +1569,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "be28bd063fa91fd871d131fc8b68d7cd4c5fa0869bea68daca50dcb1cbd76be2" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -1583,7 +1584,7 @@ dependencies = [ "http-body 0.4.6", "http-body 1.0.1", "httparse", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", @@ -1612,9 +1613,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.7" +version = "1.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +checksum = "07c9cdc179e6afbf5d391ab08c85eac817b51c87e1892a5edb5f7bbdc64314b4" dependencies = [ "base64-simd", "bytes", @@ -1783,7 +1784,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.79", + "syn 2.0.85", "which", ] @@ -2005,7 +2006,7 @@ dependencies = [ "tokio-util 0.7.12", "tracing", "url", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] @@ -2023,7 +2024,7 @@ dependencies = [ "home", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-named-pipe", "hyper-rustls 0.26.0", "hyper-util", @@ -2111,9 +2112,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -2242,12 +2243,15 @@ dependencies = [ "escargot", "gadget-blueprint-proc-macro-core", "gadget-sdk", + "hex", "k256", "serde_json", "subxt", "tangle-subxt", + "tempfile", "tokio", "tracing-subscriber 0.3.18", + "w3f-bls", ] [[package]] @@ -2275,9 +2279,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -2455,7 +2459,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2816,7 +2820,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2875,7 +2879,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2932,7 +2936,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2954,7 +2958,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3050,7 +3054,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3061,7 +3065,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3074,7 +3078,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3094,7 +3098,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "unicode-xid", ] @@ -3182,7 +3186,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3212,7 +3216,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.79", + "syn 2.0.85", "termcolor", "toml", "walkdir", @@ -3470,7 +3474,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "thiserror", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] @@ -3761,9 +3765,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] @@ -3801,7 +3805,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3814,7 +3818,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4021,7 +4025,7 @@ dependencies = [ "reqwest 0.11.27", "serde", "serde_json", - "syn 2.0.79", + "syn 2.0.85", "toml", "walkdir", ] @@ -4039,7 +4043,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4065,7 +4069,7 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 2.0.79", + "syn 2.0.85", "tempfile", "thiserror", "tiny-keccak", @@ -4252,7 +4256,7 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4382,9 +4386,9 @@ dependencies = [ [[package]] name = "flume" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" dependencies = [ "futures-core", "futures-sink", @@ -4596,7 +4600,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4606,7 +4610,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", ] @@ -4688,7 +4692,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.85", "tracing", "trybuild", ] @@ -4726,7 +4730,7 @@ dependencies = [ "gadget-sdk", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "trybuild", ] @@ -4790,7 +4794,7 @@ dependencies = [ "getrandom", "hex", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "k256", "libp2p", @@ -4821,7 +4825,7 @@ dependencies = [ "tracing", "tracing-subscriber 0.3.18", "url", - "uuid 1.10.0", + "uuid 1.11.0", "w3f-bls", ] @@ -4912,7 +4916,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -4933,14 +4937,14 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow 0.6.20", + "winnow", ] [[package]] name = "gix-config-value" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" +checksum = "f3de3fdca9c75fa4b83a76583d265fa49b1de6b088ebcd210749c24ceeb74660" dependencies = [ "bitflags 2.6.0", "bstr", @@ -5036,14 +5040,14 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow 0.6.20", + "winnow", ] [[package]] name = "gix-path" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" +checksum = "c04e5a94fdb56b1e91eb7df2658ad16832428b8eeda24ff1a0f0288de2bce554" dependencies = [ "bstr", "gix-trace", @@ -5071,14 +5075,14 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow 0.6.20", + "winnow", ] [[package]] name = "gix-sec" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" +checksum = "a2007538eda296445c07949cf04f4a767307d887184d6b3e83e2d636533ddc6e" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -5101,15 +5105,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" +checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-utils" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" dependencies = [ "fastrand", "unicode-normalization", @@ -5591,9 +5595,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -5615,9 +5619,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -5641,7 +5645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" dependencies = [ "hex", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -5657,7 +5661,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -5673,7 +5677,7 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", "rustls 0.22.4", @@ -5692,10 +5696,10 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -5711,7 +5715,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.30", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -5725,7 +5729,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -5744,7 +5748,7 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -5760,7 +5764,7 @@ checksum = "acf569d43fa9848e510358c07b80f4adf34084ddc28c6a4a651ee8474c070dcc" dependencies = [ "hex", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -5856,7 +5860,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rand", "tokio", @@ -5964,7 +5968,7 @@ dependencies = [ "tokio", "tokio-util 0.7.12", "tracing", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] @@ -6040,7 +6044,7 @@ dependencies = [ "tokio", "tokio-util 0.7.12", "tracing", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] @@ -6228,9 +6232,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -6257,7 +6261,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ "futures", - "hyper 0.14.30", + "hyper 0.14.31", "jsonrpc-core", "jsonrpc-server-utils", "log", @@ -6344,7 +6348,7 @@ dependencies = [ "http 1.1.0", "jsonrpsee-core 0.23.2", "pin-project", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "rustls-platform-verifier", "soketto 0.8.0", @@ -6367,7 +6371,7 @@ dependencies = [ "beef", "futures-timer", "futures-util", - "hyper 0.14.30", + "hyper 0.14.31", "jsonrpsee-types 0.22.5", "pin-project", "rustc-hash 1.1.0", @@ -6410,7 +6414,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ccf93fc4a0bfe05d851d37d7c32b7f370fe94336b52a2f0efc5f1981895c2e5" dependencies = [ "async-trait", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "jsonrpsee-core 0.22.5", "jsonrpsee-types 0.22.5", @@ -6592,9 +6596,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libgit2-sys" @@ -6986,7 +6990,7 @@ dependencies = [ "quinn", "rand", "ring 0.17.8", - "rustls 0.23.14", + "rustls 0.23.15", "socket2", "thiserror", "tokio", @@ -7073,7 +7077,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7105,7 +7109,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.17.8", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-webpki 0.101.7", "thiserror", "x509-parser", @@ -7295,7 +7299,7 @@ checksum = "3b51f1d220e3fa869e24cfd75915efe3164bd09bb11b3165db3f37f57bf673e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7462,7 +7466,7 @@ checksum = "b4f0c8427b39666bf970460908b213ec09b3b350f20c0c2eabcbba51704a08e6" dependencies = [ "base64 0.22.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-util", "indexmap 2.6.0", @@ -7574,13 +7578,13 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" dependencies = [ "core2", "serde", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] @@ -7804,9 +7808,9 @@ dependencies = [ [[package]] name = "ntex" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93daf570cdedb9a01a3020ccd367b2ff37402b30c979aff2da23e3e84d2b6cfc" +checksum = "223834e688405dcc46b5c28bc9225648c603e64d7b61e8903da33064b6f1464e" dependencies = [ "base64 0.22.1", "bitflags 2.6.0", @@ -7863,9 +7867,9 @@ dependencies = [ [[package]] name = "ntex-h2" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98763f0ee78f247c02fe1bcdf6380f306a08d95169f9c2d83619d5e1cb26c738" +checksum = "8e01b86bf30768ed7dca26bf279d0e0798ba5acf0baef4b0ea8e17a91ba71ad4" dependencies = [ "bitflags 2.6.0", "fxhash", @@ -7898,14 +7902,15 @@ dependencies = [ [[package]] name = "ntex-io" -version = "2.6.1" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8e90ceb0a9a1bcb57459b8e14c6257519afc8dc3460d68b507fb12e909d02c" +checksum = "80c49628e35ff52f36137a8e732261f392de621406a163571888f6163e3f6b10" dependencies = [ "bitflags 2.6.0", "log", "ntex-bytes", "ntex-codec", + "ntex-rt", "ntex-service", "ntex-util", "pin-project-lite", @@ -7954,9 +7959,9 @@ dependencies = [ [[package]] name = "ntex-rt" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d24cfad65aab77e56ee1f1a218ca248c141a22f6f65aba8ed56037ec3c6f3a4" +checksum = "76f86c83f89053c29dcf5f1e9663c53726eea337a3221fa243e61e0410a40ad7" dependencies = [ "async-channel", "futures-core", @@ -7988,9 +7993,9 @@ dependencies = [ [[package]] name = "ntex-service" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab2cc8f131d5fed702d758485fdc45a41dfab69d8ed71b84e2b910b4ea39f795" +checksum = "02daa9c4fc8b5382b24dd69d504599a72774d6828e4fc21e9013cb62096db7aa" dependencies = [ "slab", ] @@ -8171,10 +8176,10 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8267,9 +8272,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if 1.0.0", @@ -8288,7 +8293,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8299,18 +8304,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.0+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -8327,9 +8332,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d501f1a72f71d3c063a6bbc8f7271fa73aa09fe5d6283b6571e2ed176a2537" +checksum = "83e7ccb95e240b7c9506a3d544f10d935e142cc90b0a1d56954fb44d89ad6b97" dependencies = [ "num-traits", ] @@ -8386,7 +8391,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -8468,7 +8473,7 @@ dependencies = [ "regex", "regex-syntax 0.8.5", "structmeta", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8616,9 +8621,9 @@ dependencies = [ [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -8627,9 +8632,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -8637,22 +8642,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -8718,7 +8723,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8741,29 +8746,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -8848,7 +8853,7 @@ dependencies = [ "polkavm-common 0.8.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8860,7 +8865,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8870,7 +8875,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl 0.8.0", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8880,7 +8885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8950,12 +8955,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "prettyplease" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -8972,23 +8977,13 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -9034,14 +9029,14 @@ dependencies = [ "proc-macro-error-attr2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -9086,7 +9081,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -9173,7 +9168,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.15", "socket2", "thiserror", "tokio", @@ -9190,7 +9185,7 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.15", "slab", "thiserror", "tinyvec", @@ -9385,7 +9380,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -9466,7 +9461,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -9512,7 +9507,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", @@ -9525,7 +9520,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -9591,7 +9586,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -9888,9 +9883,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "aws-lc-rs", "log", @@ -9960,9 +9955,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-platform-verifier" @@ -9975,7 +9970,7 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", @@ -10015,9 +10010,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rusty-fork" @@ -10143,9 +10138,9 @@ dependencies = [ [[package]] name = "scale-encode" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba0b9c48dc0eb20c60b083c29447c0c4617cb7c4a4c9fef72aa5c5bc539e15e" +checksum = "528464e6ae6c8f98e2b79633bf79ef939552e795e316579dab09c61670d56602" dependencies = [ "derive_more 0.99.18", "parity-scale-codec", @@ -10158,26 +10153,26 @@ dependencies = [ [[package]] name = "scale-encode-derive" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ab7e60e2d9c8d47105f44527b26f04418e5e624ffc034f6b4a86c0ba19c5bf" +checksum = "bef2618f123c88da9cd8853b69d766068f1eddc7692146d7dfe9b89e25ce2efd" dependencies = [ - "darling 0.14.4", - "proc-macro-crate 1.3.1", + "darling 0.20.10", + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] name = "scale-info" -version = "2.11.3" +version = "2.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "1aa7ffc1c0ef49b0452c6e2986abf2b07743320641ffd5fc63d552458e3b779b" dependencies = [ "bitvec", "cfg-if 1.0.0", - "derive_more 0.99.18", + "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", "serde", @@ -10185,14 +10180,14 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.11.3" +version = "2.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "46385cc24172cf615450267463f937c10072516359b3ff1cb24228a4a08bf951" dependencies = [ - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.85", ] [[package]] @@ -10214,7 +10209,7 @@ dependencies = [ "proc-macro2", "quote", "scale-info", - "syn 2.0.79", + "syn 2.0.85", "thiserror", ] @@ -10425,9 +10420,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -10454,13 +10449,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -10471,14 +10466,14 @@ checksum = "e578a843d40b4189a4d66bba51d7684f57da5bd7c304c64e14bd63efbef49509" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -10494,7 +10489,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -10545,7 +10540,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11043,7 +11038,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11161,10 +11156,10 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.2.0", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11589,7 +11584,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11600,7 +11595,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11646,7 +11641,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11722,16 +11717,16 @@ dependencies = [ "scale-info", "scale-typegen", "subxt-metadata", - "syn 2.0.79", + "syn 2.0.85", "thiserror", "tokio", ] [[package]] name = "subxt-core" -version = "0.37.0" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f41eb2e2eea6ed45649508cc735f92c27f1fcfb15229e75f8270ea73177345" +checksum = "3af3b36405538a36b424d229dc908d1396ceb0994c90825ce928709eac1a159a" dependencies = [ "base58", "blake2", @@ -11795,7 +11790,7 @@ dependencies = [ "quote", "scale-typegen", "subxt-codegen", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11867,9 +11862,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -11885,7 +11880,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11897,7 +11892,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -11935,7 +11930,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12020,6 +12015,12 @@ version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" version = "3.10.1" @@ -12118,22 +12119,22 @@ checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12214,9 +12215,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", @@ -12238,7 +12239,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12289,7 +12290,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", ] @@ -12329,7 +12330,7 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -12375,7 +12376,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -12387,17 +12388,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.6.0", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -12408,7 +12398,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -12472,7 +12462,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12610,14 +12600,15 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" dependencies = [ "glob", "serde", "serde_derive", "serde_json", + "target-triple", "termcolor", "toml", ] @@ -12644,7 +12635,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12680,7 +12671,7 @@ dependencies = [ "httparse", "log", "rand", - "rustls 0.23.14", + "rustls 0.23.15", "rustls-pki-types", "sha1", "thiserror", @@ -12716,7 +12707,7 @@ checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -12888,9 +12879,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", ] @@ -12933,9 +12924,9 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "w3f-bls" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" +checksum = "6a48c48447120a85b0bdb897ba9426a7aa15b4229498a2e19103e8c9368dd4b2" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -12997,9 +12988,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -13008,24 +12999,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -13035,9 +13026,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -13045,22 +13036,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasmi" @@ -13246,9 +13237,9 @@ dependencies = [ [[package]] name = "wasmtimer" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f656cd8858a5164932d8a90f936700860976ec21eb00e0fe2aa8cab13f6b4cf" +checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" dependencies = [ "futures", "js-sys", @@ -13260,9 +13251,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -13410,7 +13401,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -13421,7 +13412,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -13677,15 +13668,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.20" @@ -13847,7 +13829,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -13867,7 +13849,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] diff --git a/blueprints/incredible-squaring-eigenlayer/src/lib.rs b/blueprints/incredible-squaring-eigenlayer/src/lib.rs index 9fa2b8b50..c7acb6849 100644 --- a/blueprints/incredible-squaring-eigenlayer/src/lib.rs +++ b/blueprints/incredible-squaring-eigenlayer/src/lib.rs @@ -27,8 +27,6 @@ use IncredibleSquaringTaskManager::TaskResponse; pub mod client; pub mod constants; pub mod runner; -#[cfg(test)] -mod tests; // Codegen from ABI file to interact with the contract. sol!( diff --git a/blueprints/incredible-squaring-eigenlayer/src/tests.rs b/blueprints/incredible-squaring-eigenlayer/src/tests.rs deleted file mode 100644 index c481b1f9d..000000000 --- a/blueprints/incredible-squaring-eigenlayer/src/tests.rs +++ /dev/null @@ -1,301 +0,0 @@ -use std::error::Error; -// #[cfg(test)] -// mod tests { -use super::*; -use crate::runner::EigenlayerGadgetRunner; -use alloy_primitives::address; -use alloy_provider::Provider; -use alloy_signer_local::PrivateKeySigner; -use blueprint_test_utils::test_ext::NAME_IDS; -use blueprint_test_utils::{anvil, get_receipt, inject_test_keys}; -use gadget_io::SupportedChains; -use gadget_sdk::config::{ContextConfig, GadgetCLICoreSettings, Protocol}; -use gadget_sdk::info; -use gadget_sdk::logging::setup_log; -use gadget_sdk::run::GadgetRunner; -use incredible_squaring_aggregator::aggregator::Aggregator; -use reqwest::Url; -use std::net::IpAddr; -use std::path::PathBuf; -use std::str::FromStr; -use std::time::Duration; -use uuid::Uuid; - -// alloy_sol_types::sol!( -// #[allow(missing_docs)] -// #[sol(rpc)] -// IncredibleSquaringTaskManager, -// "./contracts/out/IncredibleSquaringTaskManager.sol/IncredibleSquaringTaskManager.json" -// ); - -alloy_sol_types::sol!( - #[allow(missing_docs)] - #[sol(rpc)] - PauserRegistry, - "./contracts/out/IPauserRegistry.sol/IPauserRegistry.json" -); - -alloy_sol_types::sol!( - #[allow(missing_docs, clippy::too_many_arguments)] - #[sol(rpc)] - RegistryCoordinator, - "./contracts/out/RegistryCoordinator.sol/RegistryCoordinator.json" -); - -#[tokio::test(flavor = "multi_thread")] -#[allow(clippy::needless_return)] -async fn test_eigenlayer_incredible_squaring_blueprint() -> Result<(), Box> { - setup_log(); - let alice_keystore = setup_eigen_environment(0).await; // We use an ID of 0 for Alice - - let (_container, http_endpoint, ws_endpoint) = - anvil::start_anvil_container(&alice_keystore, true).await; - - std::env::set_var("EIGENLAYER_HTTP_ENDPOINT", http_endpoint.clone()); - std::env::set_var("EIGENLAYER_WS_ENDPOINT", ws_endpoint.clone()); - std::env::set_var("REGISTRATION_MODE_ON", "true"); // Set to run registration - std::env::set_var("RPC_URL", "http://127.0.0.1:8545"); - std::env::set_var("KEYSTORE_URI", alice_keystore.clone()); - std::env::set_var("DATA_DIR", alice_keystore.clone()); - std::env::set_var("OPERATOR_ECDSA_KEY_PASSWORD", "ECDSA_PASSWORD"); - std::env::set_var("OPERATOR_BLS_KEY_PASSWORD", "BLS_PASSWORD"); - - let url = Url::parse(&ws_endpoint.clone()).unwrap(); - let bind_port = url.port().unwrap(); - - // Sleep to give the testnet time to spin up - tokio::time::sleep(Duration::from_secs(1)).await; - - // Create a provider using the transport - let provider = alloy_provider::ProviderBuilder::new() - .with_recommended_fillers() - .on_http(http_endpoint.parse().unwrap()) - .root() - .clone() - .boxed(); - let accounts = provider.get_accounts().await.unwrap(); - - let registry_coordinator_addr = address!("c3e53f4d16ae77db1c982e75a937b9f60fe63690"); - let operator_state_retriever_addr = address!("1613beb3b2c4f22ee086b2b38c1476a3ce7f78e8"); - let erc20_mock_addr = address!("7969c5ed335650692bc04293b07f5bf2e7a673c0"); - - // Deploy the Pauser Registry to the running Testnet - let pauser_registry = PauserRegistry::deploy(provider.clone()).await.unwrap(); - let &pauser_registry_addr = pauser_registry.address(); - - // Create Quorum - let registry_coordinator = - RegistryCoordinator::new(registry_coordinator_addr, provider.clone()); - let operator_set_params = RegistryCoordinator::OperatorSetParam { - maxOperatorCount: 10, - kickBIPsOfOperatorStake: 100, - kickBIPsOfTotalStake: 1000, - }; - let strategy_params = RegistryCoordinator::StrategyParams { - strategy: erc20_mock_addr, - multiplier: 1, - }; - let _receipt = get_receipt(registry_coordinator.createQuorum( - operator_set_params, - 0, - vec![strategy_params], - )) - .await - .unwrap(); - - // Deploy the Incredible Squaring Task Manager to the running Testnet - let task_manager_addr = get_receipt(IncredibleSquaringTaskManager::deploy_builder( - provider.clone(), - registry_coordinator_addr, - 10u32, - )) - .await - .unwrap() - .contract_address - .unwrap(); - info!("Task Manager: {:?}", task_manager_addr); - std::env::set_var("TASK_MANAGER_ADDRESS", task_manager_addr.to_string()); - - // We create a Task Manager instance for the task spawner - let task_manager = IncredibleSquaringTaskManager::new(task_manager_addr, provider.clone()); - let task_generator_address = accounts[4]; - - // Initialize the Incredible Squaring Task Manager - let init_receipt = get_receipt(task_manager.initialize( - pauser_registry_addr, - accounts[1], - accounts[9], - task_generator_address, - )) - .await - .unwrap(); - assert!(init_receipt.status()); - - // Aggregator is set as the 10th Anvil Account - let signer: PrivateKeySigner = - "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6" - .parse() - .unwrap(); - let wallet = EthereumWallet::from(signer); - let (aggregator, _cancellation_token) = Aggregator::new( - task_manager_addr, - registry_coordinator_addr, - operator_state_retriever_addr, - http_endpoint.clone(), - ws_endpoint.clone(), - "127.0.0.1:8081".to_string(), - wallet, - ) - .await - .unwrap(); - - // Run the server in a separate thread - let (_aggregator_task, aggregator_shutdown) = aggregator.start(ws_endpoint.to_string()); - tokio::time::sleep(std::time::Duration::from_millis(3000)).await; - - // Create the Runner with the necessary configs - let config = ContextConfig { - gadget_core_settings: GadgetCLICoreSettings::Run { - bind_addr: IpAddr::from_str("127.0.0.1").unwrap(), - bind_port, - test_mode: false, - log_id: None, - url, - bootnodes: None, - keystore_uri: alice_keystore, - chain: SupportedChains::LocalTestnet, - verbose: 3, - pretty: true, - keystore_password: None, - blueprint_id: 0, - service_id: Some(0), - protocol: Protocol::Eigenlayer, - }, - }; - let env = gadget_sdk::config::load(config).expect("Failed to load environment"); - let mut runner = Box::new(EigenlayerGadgetRunner::new(env.clone()).await); - - info!("~~~ Executing the incredible squaring blueprint ~~~"); - - info!("Registering..."); - if env.should_run_registration() { - runner.register().await.unwrap(); - } - - // Deploy a new task - if get_receipt( - task_manager - .createNewTask(U256::from(2), 100u32, Bytes::from(vec![0])) - .from(task_generator_address), - ) - .await - .unwrap() - .status() - { - info!("Deployed a new task"); - } - - // Start the Chain Updater Spawner - let operators = vec![vec![accounts[0]]]; - let quorums = Bytes::from(vec![0]); - let chain_updater = async move { - loop { - tokio::time::sleep(std::time::Duration::from_millis(2000)).await; - - // Update the operators for quorum 0 to keep StakeRegistry updates within withdrawalDelayBlocks window - if get_receipt( - registry_coordinator.updateOperatorsForQuorum(operators.clone(), quorums.clone()), - ) - .await - .unwrap() - .status() - { - info!("Updated operators for quorum 0"); - } - - // Mine a block - mine_blocks(&http_endpoint, 1).await; - } - }; - let _chain_task = tokio::spawn(chain_updater); - - info!("Running..."); - let runner_task = async move { - runner.run().await.unwrap(); - }; - let _runner_task = tokio::spawn(runner_task); - - tokio::time::sleep(tokio::time::Duration::from_secs(12)).await; - - let latest_task_num = task_manager.latestTaskNum().call().await.unwrap()._0; - - let task_hash = task_manager - .allTaskHashes(latest_task_num - 1) - .call() - .await - .unwrap() - ._0; - assert_ne!(FixedBytes::<32>::default(), task_hash); - - let response_hash = task_manager - .allTaskResponses(latest_task_num - 1) - .call() - .await - .unwrap() - ._0; - assert_ne!(FixedBytes::<32>::default(), response_hash); - - info!("Shutting down aggregator..."); - aggregator_shutdown.send(()).await.unwrap(); - // chain_task.abort(); - // runner_task.abort(); - // aggregator_task.abort(); - // cancellation_token.cancel(); - - tokio::time::sleep(tokio::time::Duration::from_secs(5)).await; - - info!("Exiting Successfully..."); - return Ok(()); // TODO: Aggregator Server tends to hang and keeps test from completing -} - -async fn setup_eigen_environment(id: usize) -> String { - // Set up the Keys required for Tangle AVS - if id >= NAME_IDS.len() { - panic!("Invalid ID: {id}"); - } - let name = NAME_IDS[id]; - let tmp_store = Uuid::new_v4().to_string(); - let keystore_uri = PathBuf::from(format!( - "./target/keystores/{}/{tmp_store}/", - name.to_lowercase() - )); - assert!( - !keystore_uri.exists(), - "Keystore URI cannot exist: {}", - keystore_uri.display() - ); - let keystore_uri_normalized = - std::path::absolute(keystore_uri.clone()).expect("Failed to resolve keystore URI"); - let keystore_uri_str = format!("file:{}", keystore_uri_normalized.display()); - inject_test_keys(&keystore_uri, id) - .await - .expect("Failed to inject testing keys for Tangle AVS"); - keystore_uri_str -} - -async fn mine_blocks(endpoint: &str, blocks: u8) { - tokio::process::Command::new("sh") - .arg("-c") - .arg(format!( - "cast rpc anvil_mine {} --rpc-url {} > /dev/null", - blocks, endpoint - )) - .output() - .await - .unwrap(); - gadget_sdk::info!( - "Mined {} block{}", - blocks, - if blocks == 1 { "" } else { "s" } - ); -} diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b56cc6687..edcc51e8c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -20,7 +20,7 @@ tracing-subscriber = { workspace = true, features = ["env-filter", "fmt", "ansi" color-eyre = { workspace = true } tangle-subxt = { workspace = true, features = ["std"] } subxt = { workspace = true, features = ["substrate-compat"] } -gadget-sdk = { workspace = true, features = ["std"] } +gadget-sdk = { workspace = true, features = ["std", "getrandom"] } gadget-blueprint-proc-macro-core = { workspace = true, features = ["std"] } serde_json = { workspace = true } tokio = { workspace = true, features = ["full"] } @@ -29,3 +29,8 @@ alloy-provider = { workspace = true } alloy-network = { workspace = true } alloy-rpc-types = { workspace = true } alloy-signer-local = { workspace = true } +hex = { workspace = true } +w3f-bls = { workspace = true } + +[dev-dependencies] +tempfile = "3.10.1" diff --git a/cli/README.md b/cli/README.md index 98e4f8f91..8cb12803d 100644 --- a/cli/README.md +++ b/cli/README.md @@ -103,3 +103,21 @@ The following environment variables are required for deploying the blueprint: export SIGNER="//Alice" # Substrate Signer account export EVM_SIGNER="0xcb6df9de1efca7a3998a8ead4e02159d5fa99c3e0d4fd6432667390bb4726854" # EVM signer account ``` + +## Generating Keys from the Command Line + +The following command will generate a keypair for a given key type: + +```shell +cargo tangle blueprint generate-keys -k -p -s --show-secret +``` + +where it is optional to include the path, seed, or the show-secret flags. + + +### Flags + +- `-k` or `--key-type`: Required flag. The key type to generate (sr25519, ecdsa, bls_bn254, ed25519, bls381). +- `-p` or `--path`: The path to write the generated keypair to. If not provided, the keypair will be written solely to stdout. +- `-s` or `--seed`: The suri/seed to generate the keypair from. If not provided, a random keypair will be generated. +- `--show-secret`: Denotes that the Private Key should also be printed to stdout. If not provided, only the public key will be printed. diff --git a/cli/src/keys.rs b/cli/src/keys.rs new file mode 100644 index 000000000..a11dbf38e --- /dev/null +++ b/cli/src/keys.rs @@ -0,0 +1,146 @@ +use clap::builder::PossibleValue; +use clap::ValueEnum; +use color_eyre::eyre::eyre; +use gadget_sdk::keystore::backend::fs::FilesystemKeystore; +use gadget_sdk::keystore::backend::mem::InMemoryKeystore; +use gadget_sdk::keystore::backend::GenericKeyStore; +use gadget_sdk::keystore::Backend; +use gadget_sdk::parking_lot::RawRwLock; +use std::path::PathBuf; +use std::str::FromStr; +use w3f_bls::serialize::SerializableToBytes; + +#[derive(Clone, Debug)] +pub enum KeyType { + Sr25519, + Ed25519, + Ecdsa, + Bls381, + BlsBn254, +} + +impl ValueEnum for KeyType { + fn value_variants<'a>() -> &'a [Self] { + &[ + Self::Sr25519, + Self::Ed25519, + Self::Ecdsa, + Self::Bls381, + Self::BlsBn254, + ] + } + + fn to_possible_value(&self) -> Option { + Some(match self { + Self::Sr25519 => PossibleValue::new("sr25519").help("Schnorrkel/Ristretto x25519"), + Self::Ed25519 => PossibleValue::new("ed25519").help("Edwards Curve 25519"), + Self::Ecdsa => { + PossibleValue::new("ecdsa").help("Elliptic Curve Digital Signature Algorithm") + } + Self::Bls381 => PossibleValue::new("bls381").help("Boneh-Lynn-Shacham on BLS12-381"), + Self::BlsBn254 => PossibleValue::new("blsbn254").help("Boneh-Lynn-Shacham on BN254"), + }) + } +} + +impl FromStr for KeyType { + type Err = String; + + fn from_str(s: &str) -> Result { + match s.to_lowercase().as_str() { + "sr25519" => Ok(Self::Sr25519), + "ed25519" => Ok(Self::Ed25519), + "ecdsa" => Ok(Self::Ecdsa), + "bls381" => Ok(Self::Bls381), + "blsbn254" => Ok(Self::BlsBn254), + _ => Err(format!("Unknown key type: {}", s)), + } + } +} + +pub fn generate_key( + key_type: KeyType, + output: Option, + seed: Option<&[u8]>, + show_secret: bool, +) -> color_eyre::Result<()> { + let keystore: GenericKeyStore = match output { + None => GenericKeyStore::Mem(InMemoryKeystore::new()), + Some(file_path) => { + // Filesystem Keystore + GenericKeyStore::Fs( + FilesystemKeystore::open(file_path).map_err(|e| eyre!(e.to_string()))?, + ) + } + }; + + let (public, secret) = match key_type { + KeyType::Sr25519 => { + let public_key = keystore + .sr25519_generate_new(seed) + .map_err(|e| eyre!(e.to_string()))?; + let secret = keystore + .expose_sr25519_secret(&public_key) + .map_err(|e| eyre!(e.to_string()))? + .ok_or(eyre!("Failed to expose secret"))?; + ( + hex::encode(public_key.to_bytes()), + hex::encode(secret.to_bytes()), + ) + } + KeyType::Ed25519 => { + let public_key = keystore + .ed25519_generate_new(seed) + .map_err(|e| eyre!(e.to_string()))?; + let secret = keystore + .expose_ed25519_secret(&public_key) + .map_err(|e| eyre!(e.to_string()))? + .ok_or(eyre!("Failed to expose secret"))?; + (hex::encode(public_key), hex::encode(secret)) + } + KeyType::Ecdsa => { + let public_key = keystore + .ecdsa_generate_new(seed) + .map_err(|e| eyre!(e.to_string()))?; + let secret = keystore + .expose_ecdsa_secret(&public_key) + .map_err(|e| eyre!(e.to_string()))? + .ok_or(eyre!("Failed to expose secret"))?; + ( + hex::encode(public_key.to_sec1_bytes()), + hex::encode(secret.to_bytes()), + ) + } + KeyType::Bls381 => { + let public_key = keystore + .bls381_generate_new(seed) + .map_err(|e| eyre!(e.to_string()))?; + let secret = keystore + .expose_bls381_secret(&public_key) + .map_err(|e| eyre!(e.to_string()))? + .ok_or(eyre!("Failed to expose secret"))?; + ( + hex::encode(public_key.0.to_string()), + hex::encode(secret.to_bytes()), + ) + } + KeyType::BlsBn254 => { + let public_key = keystore + .bls_bn254_generate_new(seed) + .map_err(|e| eyre!(e.to_string()))?; + let secret = keystore + .expose_bls_bn254_secret(&public_key) + .map_err(|e| eyre!(e.to_string()))? + .ok_or(eyre!("Failed to expose secret"))?; + (public_key.g1().to_string(), secret.0.to_string()) + } + }; + + println!("Generated {:?} key:", key_type); + println!("Public key: {}", public); + if show_secret { + println!("Private key: {}", secret); + } + + Ok(()) +} diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 185b3fe9f..d1456baf7 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,4 +1,7 @@ pub mod create; pub mod deploy; pub mod foundry; +pub mod keys; pub mod signer; +#[cfg(test)] +mod tests; diff --git a/cli/src/main.rs b/cli/src/main.rs index eaa2f4912..9b3561aed 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -1,7 +1,8 @@ use std::path::PathBuf; -use cargo_tangle::{create, deploy}; +use cargo_tangle::{create, deploy, keys}; use clap::{Parser, Subcommand}; +use keys::KeyType; /// Tangle CLI tool #[derive(Parser, Debug)] @@ -31,7 +32,7 @@ enum Commands { } #[derive(Subcommand, Debug)] -enum GadgetCommands { +pub enum GadgetCommands { /// Create a new blueprint #[command(visible_alias = "c")] Create { @@ -53,6 +54,24 @@ enum GadgetCommands { #[arg(short, long, value_name = "PACKAGE")] package: Option, }, + /// Generate a key + Keygen { + /// The type of key to generate + #[arg(short, long, value_enum)] + key_type: KeyType, + + /// The path to save the key (optional) + #[arg(short, long)] + path: Option, + + /// The SURI or seed to use for the generation of the key (optional) + #[arg(short, long)] + seed: Option, + + /// If true, the secret key will be printed along with the public key + #[arg(long)] + show_secret: bool, + }, } #[tokio::main] @@ -94,6 +113,19 @@ async fn main() -> color_eyre::Result<()> { }) .await?; } + GadgetCommands::Keygen { + key_type, + path, + seed, + show_secret, + } => { + keys::generate_key( + key_type, + path, + seed.as_deref().map(str::as_bytes), + show_secret, + )?; + } }, } Ok(()) diff --git a/cli/src/signer.rs b/cli/src/signer.rs index 03a4cdf39..1f2d030a2 100644 --- a/cli/src/signer.rs +++ b/cli/src/signer.rs @@ -9,8 +9,8 @@ use tangle_subxt::subxt_signer::bip39; use tangle_subxt::subxt_signer::ExposeSecret; use tangle_subxt::subxt_signer::SecretUri; -const SIGNER_ENV: &str = "SIGNER"; -const EVM_SIGNER_ENV: &str = "EVM_SIGNER"; +pub(crate) const SIGNER_ENV: &str = "SIGNER"; +pub(crate) const EVM_SIGNER_ENV: &str = "EVM_SIGNER"; const SURI_HELP_MSG: &str = r#" The `SURI` can be parsed from a string. The string takes this form: @@ -80,70 +80,3 @@ pub fn load_evm_signer_from_env() -> Result { Ok(key) } - -#[cfg(test)] -mod tests { - use super::*; - use std::env; - - #[test] - fn test_load_signer_from_env() -> color_eyre::Result<()> { - color_eyre::install().unwrap_or(()); - let s = [1u8; 32]; - let secret = bip39::Mnemonic::from_entropy(&s[..])?.to_string(); - // Test with a valid mnemonic phrase - env::set_var(SIGNER_ENV, secret); - load_signer_from_env()?; - - // Test with a valid hex string - env::set_var( - SIGNER_ENV, - "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", - ); - load_signer_from_env()?; - - // Test with an invalid mnemonic phrase - env::set_var(SIGNER_ENV, "invalid mnemonic phrase"); - assert!(load_signer_from_env().is_err()); - - // Test with an invalid hex string - env::set_var(SIGNER_ENV, "0xinvalidhexstring"); - assert!(load_signer_from_env().is_err()); - - // Test when the SIGNER environment variable is not set - env::remove_var(SIGNER_ENV); - assert!(load_signer_from_env().is_err()); - Ok(()) - } - - #[test] - fn test_load_evm_signer_from_env() -> color_eyre::Result<()> { - color_eyre::install().unwrap_or(()); - let s = [1u8; 32]; - let secret = bip39::Mnemonic::from_entropy(&s[..])?.to_string(); - // Test with a valid mnemonic phrase - env::set_var(EVM_SIGNER_ENV, secret); - load_evm_signer_from_env()?; - - // Test with a valid hex string - env::set_var( - EVM_SIGNER_ENV, - "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", - ); - load_evm_signer_from_env()?; - - // Test with an invalid mnemonic phrase - env::set_var(EVM_SIGNER_ENV, "invalid mnemonic phrase"); - assert!(load_evm_signer_from_env().is_err()); - - // Test with an invalid hex string - env::set_var(EVM_SIGNER_ENV, "0xinvalidhexstring"); - assert!(load_evm_signer_from_env().is_err()); - - // Test when the EVM_SIGNER environment variable is not set - env::remove_var(EVM_SIGNER_ENV); - assert!(load_evm_signer_from_env().is_err()); - - Ok(()) - } -} diff --git a/cli/src/tests.rs b/cli/src/tests.rs new file mode 100644 index 000000000..1f66d9890 --- /dev/null +++ b/cli/src/tests.rs @@ -0,0 +1,181 @@ +use crate::keys::KeyType; +use crate::signer::{load_evm_signer_from_env, load_signer_from_env, EVM_SIGNER_ENV, SIGNER_ENV}; +use color_eyre::eyre::Result; +use gadget_sdk::ext::sp_core::Pair; +use gadget_sdk::keystore::{BackendExt, KeystoreUriSanitizer}; +use std::env; +use std::process::Command; +use tangle_subxt::subxt_signer::bip39; +use tempfile::tempdir; +use w3f_bls::SerializableToBytes; + +#[test] +fn test_cli_fs_key_generation() -> Result<()> { + let temp_dir = tempdir()?; + let output_path = temp_dir.path().sanitize_file_path(); + let keystore = + gadget_sdk::keystore::backend::fs::FilesystemKeystore::open(output_path.clone())?; + + for key_type in [ + KeyType::Sr25519, + KeyType::Ed25519, + KeyType::Ecdsa, + KeyType::Bls381, + KeyType::BlsBn254, + ] + .iter() + { + println!("Testing key generation for: {:?}", key_type); + let mut cmd = Command::new("./../target/release/cargo-tangle"); + let key_str = format!("{:?}", key_type).to_lowercase(); + + let output = cmd + .arg("blueprint") + .arg("keygen") + .arg("-k") + .arg(key_str) + .arg("-p") + .arg(output_path.clone()) + .arg("--show-secret") + .output()?; + + assert!(&output.stderr.is_empty()); + + let stdout_str = String::from_utf8_lossy(&output.stdout); + assert!( + stdout_str.contains("Public key:"), + "Public key not found in output for {:?}", + key_type + ); + assert!( + stdout_str.contains("Private key:"), + "Secret key not found in output for {:?}", + key_type + ); + + match key_type { + KeyType::Sr25519 => { + let pair = keystore.sr25519_key()?; + assert!(!pair.public().is_empty()); + } + KeyType::Ed25519 => { + let pair = keystore.ed25519_key()?; + assert!(!pair.public().is_empty()); + } + KeyType::Ecdsa => { + let pair = keystore.ecdsa_key()?; + assert!(!pair.public().0.is_empty()); + } + KeyType::Bls381 => { + let pair = keystore.bls381_key()?; + assert!(!pair.public.to_bytes().is_empty()); + } + KeyType::BlsBn254 => { + let pair = keystore.bls_bn254_key()?; + assert!(!pair.public_key().g1().to_string().is_empty()); + } + } + } + Ok(()) +} + +#[test] +fn test_cli_mem_key_generation() -> Result<()> { + for key_type in [ + KeyType::Sr25519, + KeyType::Ed25519, + KeyType::Ecdsa, + KeyType::Bls381, + KeyType::BlsBn254, + ] + .iter() + { + println!("Testing key generation for: {:?}", key_type); + let mut cmd = Command::new("./../target/release/cargo-tangle"); + let key_str = format!("{:?}", key_type).to_lowercase(); + + let output = cmd + .arg("blueprint") + .arg("keygen") + .arg("-k") + .arg(key_str) + .arg("--show-secret") + .output()?; + + assert!(&output.stderr.is_empty()); + + let stdout_str = String::from_utf8_lossy(&output.stdout); + assert!( + stdout_str.contains("Public key:"), + "Public key not found in output for {:?}", + key_type + ); + assert!( + stdout_str.contains("Private key:"), + "Secret key not found in output for {:?}", + key_type + ); + } + Ok(()) +} + +#[test] +fn test_load_signer_from_env() -> color_eyre::Result<()> { + color_eyre::install().unwrap_or(()); + let s = [1u8; 32]; + let secret = bip39::Mnemonic::from_entropy(&s[..])?.to_string(); + // Test with a valid mnemonic phrase + env::set_var(SIGNER_ENV, secret); + load_signer_from_env()?; + + // Test with a valid hex string + env::set_var( + SIGNER_ENV, + "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + ); + load_signer_from_env()?; + + // Test with an invalid mnemonic phrase + env::set_var(SIGNER_ENV, "invalid mnemonic phrase"); + assert!(load_signer_from_env().is_err()); + + // Test with an invalid hex string + env::set_var(SIGNER_ENV, "0xinvalidhexstring"); + assert!(load_signer_from_env().is_err()); + + // Test when the SIGNER environment variable is not set + env::remove_var(SIGNER_ENV); + assert!(load_signer_from_env().is_err()); + Ok(()) +} + +#[test] +fn test_load_evm_signer_from_env() -> color_eyre::Result<()> { + color_eyre::install().unwrap_or(()); + let s = [1u8; 32]; + let secret = bip39::Mnemonic::from_entropy(&s[..])?.to_string(); + // Test with a valid mnemonic phrase + env::set_var(EVM_SIGNER_ENV, secret); + load_evm_signer_from_env()?; + + // Test with a valid hex string + env::set_var( + EVM_SIGNER_ENV, + "0x0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + ); + load_evm_signer_from_env()?; + + // Test with an invalid mnemonic phrase + env::set_var(EVM_SIGNER_ENV, "invalid mnemonic phrase"); + assert!(load_evm_signer_from_env().is_err()); + + // Test with an invalid hex string + env::set_var(EVM_SIGNER_ENV, "0xinvalidhexstring"); + assert!(load_evm_signer_from_env().is_err()); + + // Test when the EVM_SIGNER environment variable is not set + env::remove_var(EVM_SIGNER_ENV); + assert!(load_evm_signer_from_env().is_err()); + + Ok(()) +} diff --git a/sdk/src/keystore/mod.rs b/sdk/src/keystore/mod.rs index 84727e65a..f54333484 100644 --- a/sdk/src/keystore/mod.rs +++ b/sdk/src/keystore/mod.rs @@ -60,6 +60,7 @@ use subxt_core::tx::signer::{PairSigner, Signer}; use subxt_core::utils::{AccountId32, MultiAddress, MultiSignature}; #[cfg(any(feature = "std", feature = "wasm"))] use tangle_subxt::subxt; +use w3f_bls::{Keypair, TinyBLS381}; #[cfg(any(feature = "std", feature = "wasm"))] #[derive(Clone, Debug)] @@ -392,6 +393,21 @@ pub trait BackendExt: Backend { }) } + #[cfg(any(feature = "std", feature = "wasm"))] + fn bls381_key(&self) -> Result, Error> { + let first_key = self + .iter_bls381() + .next() + .ok_or_else(|| Error::Bls("No BLS 381 keys found".to_string()))?; + let bls_secret = self + .expose_bls381_secret(&first_key)? + .ok_or_else(|| Error::Bls("No BLS 381 secret found".to_string()))?; + Ok(w3f_bls::Keypair { + public: first_key, + secret: bls_secret, + }) + } + #[cfg(any(feature = "std", feature = "wasm"))] fn bls_bn254_key(&self) -> Result { let first_key = self