diff --git a/Cargo.lock b/Cargo.lock index 99791d30a..9f3515102 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "936697e9caf938eb2905036100edf8e1269da8291f8a02f5fe7b37073784eec0" dependencies = [ - "no-std-net", + "no-std-net 0.5.0", "psl", "psl-types", ] @@ -38,7 +38,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli 0.28.1", ] [[package]] @@ -47,25 +47,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", -] - [[package]] name = "aead" version = "0.5.2" @@ -76,29 +57,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - [[package]] name = "aes" version = "0.8.3" @@ -110,52 +68,18 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.8.0", - "ghash 0.4.4", - "subtle", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", + "aead", + "aes", "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", - "subtle", -] - -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", + "ctr", + "ghash", + "subtle 2.5.0", ] [[package]] @@ -164,19 +88,19 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "serde", "version_check", @@ -192,6 +116,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -224,9 +154,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -244,52 +174,51 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "ca87830a3e3fb156dc96cfbd31cb620265dd053be734723f22b760d6cc3c3051" [[package]] name = "api" version = "0.7.5" dependencies = [ + "anyhow", "assert_fs", "async-graphql", "async-graphql-poem", - "async-stl-client", "async-stream", "async-trait", "base64 0.21.5", "cached", "cfg-if", - "chronicle-protocol", "chronicle-signing", "chronicle-telemetry", "chrono", @@ -297,6 +226,7 @@ dependencies = [ "custom_error", "derivative", "diesel", + "diesel-async", "diesel_migrations", "futures", "glob", @@ -309,19 +239,19 @@ dependencies = [ "metrics", "metrics-exporter-prometheus", "opa", - "opa-tp-protocol", "opentelemetry 0.19.0", "parking_lot 0.12.1", "poem", "portpicker", "prost 0.10.4", "protobuf", + "protocol-substrate-chronicle", + "protocol-substrate-opa", "r2d2", "rand 0.8.5", "rand_core 0.6.4", "reqwest", - "sawtooth-sdk", - "sawtooth_tp", + "rust-embed", "serde", "serde_derive", "serde_json", @@ -333,7 +263,7 @@ dependencies = [ "tracing", "url", "user-error", - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] @@ -347,9 +277,9 @@ dependencies = [ [[package]] name = "aquamarine" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df752953c49ce90719c7bf1fc587bc8227aed04732ea0c0f85e5397d7fdbd1a1" +checksum = "d1da02abba9f9063d786eab1509833ebb2fac0f966862ca59439c76b9c566760" dependencies = [ "include_dir", "itertools 0.10.5", @@ -366,16 +296,145 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] -name = "arc-swap" -version = "1.6.0" +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "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-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-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "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-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "array-bytes" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.1.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" +checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" [[package]] name = "arrayref" @@ -383,6 +442,15 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +[[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.5.2" @@ -401,29 +469,13 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -433,18 +485,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -480,9 +520,9 @@ dependencies = [ [[package]] name = "assert_fs" -version = "1.0.13" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f070617a68e5c2ed5d06ee8dd620ee18fb72b99f6c094bed34cf8ab07c875b48" +checksum = "adc5d78e9048d836d12a0c0040ca5f45b18a94d204b4ba4f677a8a7de162426b" dependencies = [ "anstyle", "doc-comment", @@ -500,8 +540,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.1", + "event-listener-strategy", "futures-core", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "async-executor" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +dependencies = [ + "async-lock 3.2.0", + "async-task", + "concurrent-queue", + "fastrand 2.0.1", + "futures-lite 2.1.0", + "slab", +] + +[[package]] +name = "async-fs" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" +dependencies = [ + "async-lock 2.8.0", + "autocfg", + "blocking", + "futures-lite 1.13.0", ] [[package]] @@ -538,7 +617,7 @@ dependencies = [ "static_assertions", "tempfile", "thiserror", - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] @@ -550,7 +629,7 @@ dependencies = [ "Inflector", "async-graphql-parser", "darling 0.14.4", - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -600,70 +679,103 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", + "polling 2.8.0", "rustix 0.37.27", "slab", "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" +dependencies = [ + "async-lock 3.2.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.1.0", + "parking", + "polling 3.3.1", + "rustix 0.38.28", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", ] [[package]] -name = "async-recursion" -version = "1.0.5" +name = "async-lock" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.38", + "event-listener 4.0.1", + "event-listener-strategy", + "pin-project-lite 0.2.13", ] [[package]] -name = "async-stl-client" -version = "0.7.5" -source = "git+https://github.com/btpworks/async-stl-sdk#52c6766757f14e7a3dc4ccdb760d09f7c72875e6" +name = "async-net" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434b1ed18ce1cf5769b8ac540e33f01fa9471058b5e89da9e06f3c882a8c12f" dependencies = [ - "anyhow", - "async-trait", - "derivative", - "futures", - "glob", - "hex", - "k256 0.11.6", - "lazy_static", - "lru", - "pin-project-lite 0.2.13", - "pinvec", - "pow_of_2", - "prost 0.10.4", - "prost-build 0.10.4", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "serde_json", - "thiserror", - "tmq", - "tokio", - "tokio-stream", - "tracing", - "uuid 1.5.0", - "zmq", + "async-io 1.13.0", + "blocking", + "futures-lite 1.13.0", +] + +[[package]] +name = "async-process" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" +dependencies = [ + "async-io 1.13.0", + "async-lock 2.8.0", + "async-signal", + "blocking", + "cfg-if", + "event-listener 3.1.0", + "futures-lite 1.13.0", + "rustix 0.38.28", + "windows-sys 0.48.0", +] + +[[package]] +name = "async-signal" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +dependencies = [ + "async-io 2.2.2", + "async-lock 2.8.0", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix 0.38.28", + "signal-hook-registry", + "slab", + "windows-sys 0.48.0", ] [[package]] @@ -685,24 +797,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "async-task" -version = "4.5.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "531b97fb4cd3dfdce92c35dedbfdc1f0b9d8091c8ca943d6dae340ef5012d514" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -724,6 +836,12 @@ dependencies = [ "pin-project-lite 0.2.13", ] +[[package]] +name = "atomic" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" + [[package]] name = "atomic-waker" version = "1.1.2" @@ -803,7 +921,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object 0.32.2", "rustc-demangle", ] @@ -825,6 +943,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.13.1" @@ -879,7 +1003,16 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.38", + "syn 2.0.44", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", ] [[package]] @@ -897,6 +1030,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -921,6 +1060,18 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + [[package]] name = "blake2" version = "0.10.6" @@ -930,6 +1081,16 @@ 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.2" @@ -938,7 +1099,7 @@ checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -949,7 +1110,7 @@ checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -962,7 +1123,7 @@ dependencies = [ "arrayvec 0.7.4", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -971,7 +1132,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -995,16 +1156,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -1014,24 +1165,18 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.1", + "async-lock 3.2.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite", + "futures-lite 2.1.0", "piper", "tracing", ] @@ -1076,9 +1221,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "serde", @@ -1149,6 +1294,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher 0.2.5", + "ppv-lite86", +] + [[package]] name = "cached" version = "0.42.0" @@ -1204,9 +1359,9 @@ checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -1241,17 +1396,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -1282,27 +1426,36 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" +dependencies = [ + "byteorder", + "keystream", +] + [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", - "cipher 0.3.0", + "cipher 0.4.4", "cpufeatures", - "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", - "cipher 0.3.0", + "cipher 0.4.4", "poly1305", "zeroize", ] @@ -1315,9 +1468,7 @@ dependencies = [ "api", "assert_fs", "async-graphql", - "async-stl-client", "cfg-if", - "chronicle-protocol", "chronicle-signing", "chronicle-telemetry", "chrono", @@ -1328,6 +1479,7 @@ dependencies = [ "const_format", "diesel", "dotenvy", + "embedded-substrate", "futures", "genco", "hex", @@ -1336,13 +1488,13 @@ dependencies = [ "is-terminal", "jsonschema", "opa", - "opa-tp-protocol", "opentelemetry 0.19.0", "percent-encoding", + "protocol-substrate-chronicle", + "protocol-substrate-opa", "question", "rand 0.8.5", "rand_core 0.6.4", - "sawtooth-sdk", "serde", "serde_derive", "serde_json", @@ -1353,10 +1505,10 @@ dependencies = [ "tokio", "toml 0.7.8", "tracing", - "tracing-log", + "tracing-log 0.1.4", "url", "user-error", - "uuid 1.5.0", + "uuid 1.6.1", "valico", ] @@ -1380,55 +1532,18 @@ dependencies = [ name = "chronicle-example" version = "0.7.5" dependencies = [ - "async-stl-client", "chronicle", - "chronicle-protocol", "chronicle-signing", "chronicle-telemetry", "futures", "hex", "insta", - "opa-tp-protocol", - "tempfile", - "tracing", - "tracing-log", - "uuid 1.5.0", -] - -[[package]] -name = "chronicle-protocol" -version = "0.7.5" -dependencies = [ - "async-stl-client", - "async-trait", - "bytes", - "chronicle-signing", - "chrono", - "common", - "custom_error", - "derivative", - "futures", - "glob", - "hex", - "k256 0.11.6", - "lazy_static", - "opa-tp-protocol", - "openssl", - "prost 0.10.4", - "prost-build 0.10.4", - "prost-types 0.11.9", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "serde_derive", - "serde_json", + "protocol-substrate-chronicle", + "protocol-substrate-opa", "tempfile", - "thiserror", - "tokio", "tracing", - "url", - "uuid 1.5.0", - "zmq", + "tracing-log 0.1.4", + "uuid 1.6.1", ] [[package]] @@ -1473,8 +1588,8 @@ dependencies = [ "console-subscriber", "tracing", "tracing-elastic-apm", - "tracing-log", - "tracing-subscriber 0.3.17", + "tracing-log 0.1.4", + "tracing-subscriber 0.3.18", "url", ] @@ -1542,15 +1657,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1559,13 +1665,14 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1591,9 +1698,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive 4.4.7", @@ -1601,9 +1708,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -1642,7 +1749,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -1687,20 +1794,19 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.0.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" dependencies = [ - "is-terminal", "lazy_static", "windows-sys 0.48.0", ] [[package]] name = "colored_json" -version = "3.3.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4948aed0a773db233baf8997302da553ad285be28464c36584944a66ab107db2" +checksum = "74cb9ce6b86f6e54bfa9518df2eeeef65d424ec7244d083ed97229185e366a91" dependencies = [ "is-terminal", "serde", @@ -1748,18 +1854,20 @@ dependencies = [ "parity-scale-codec", "proptest", "rdf-types", + "scale-encode", "scale-info", "serde", "serde_derive", "serde_json", - "sp-std", + "sp-core 25.0.0", + "sp-std 11.0.0", "tempfile", "testcontainers", "thiserror", "thiserror-no-std", "tokio", "tracing", - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] @@ -1770,9 +1878,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -1823,14 +1931,14 @@ dependencies = [ "tonic", "tracing", "tracing-core", - "tracing-subscriber 0.3.17", + "tracing-subscriber 0.3.18", ] [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" @@ -1847,7 +1955,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", "once_cell", "tiny-keccak", ] @@ -1872,23 +1980,41 @@ dependencies = [ "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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" + [[package]] name = "contextual" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05ca71f324d19e85a2e976be04b5ecbb193253794a75adfe2e5044c8bef03f6a" +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1896,9 +2022,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -2133,21 +2259,6 @@ dependencies = [ "wasmtime-types 10.0.2", ] -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" version = "1.3.2" @@ -2166,7 +2277,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.7", + "clap 4.4.12", "criterion-plot", "futures", "is-terminal", @@ -2197,9 +2308,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -2207,9 +2318,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -2218,22 +2329,30 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" +dependencies = [ + "cfg-if", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -2252,19 +2371,19 @@ checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", "zeroize", ] [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -2281,31 +2400,32 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" dependencies = [ - "generic-array 0.14.7", - "subtle", + "generic-array 0.12.4", + "subtle 1.0.0", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] -name = "ctr" -version = "0.8.0" +name = "crypto-mac" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ - "cipher 0.3.0", + "generic-array 0.14.7", + "subtle 2.5.0", ] [[package]] @@ -2317,16 +2437,6 @@ dependencies = [ "cipher 0.4.4", ] -[[package]] -name = "ctrlc" -version = "3.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" -dependencies = [ - "nix 0.27.1", - "windows-sys 0.48.0", -] - [[package]] name = "curve25519-dalek" version = "2.1.3" @@ -2336,7 +2446,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -2349,7 +2459,7 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -2366,7 +2476,7 @@ dependencies = [ "fiat-crypto", "platforms", "rustc_version", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -2378,7 +2488,20 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.6.4", + "subtle-ng", + "zeroize", ] [[package]] @@ -2389,9 +2512,9 @@ checksum = "4f8a51dd197fa6ba5b4dc98a990a43cc13693c23eb0089ebb0fcc1f04152bca6" [[package]] name = "cxx" -version = "1.0.110" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8" +checksum = "58ab30434ea0ff6aa640a08dda5284026a366d47565496fd40b6cbfbdd7e31a2" dependencies = [ "cc", "cxxbridge-flags", @@ -2401,9 +2524,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.110" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a24f3f5f8eed71936f21e570436f024f5c2e25628f7496aa7ccd03b90109d5" +checksum = "b649d7dfae8268450d53d109388b337b9352c7cba1fc10db4a1bc23c3dc189fb" dependencies = [ "cc", "codespan-reporting", @@ -2411,24 +2534,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "cxxbridge-flags" -version = "1.0.110" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44" +checksum = "42281b20eba5218c539295c667c18e2f50211bb11902419194c6ed1ae808e547" [[package]] name = "cxxbridge-macro" -version = "1.0.110" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" +checksum = "b45506e3c66512b0a65d291a6b452128b7b1dd9841e20d1e151addbd2c00ea50" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -2451,6 +2574,16 @@ dependencies = [ "darling_macro 0.14.4", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + [[package]] name = "darling_core" version = "0.13.4" @@ -2479,6 +2612,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.44", +] + [[package]] name = "darling_macro" version = "0.13.4" @@ -2502,16 +2649,27 @@ dependencies = [ ] [[package]] -name = "data-encoding" -version = "2.4.0" +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.44", +] + +[[package]] +name = "data-encoding" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "data-encoding-macro" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" +checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -2519,9 +2677,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" +checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" dependencies = [ "data-encoding", "syn 1.0.109", @@ -2533,7 +2691,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] @@ -2563,27 +2721,13 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-parser" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" -dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "der-parser" version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -2593,9 +2737,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -2622,34 +2766,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro 0.11.2", -] - [[package]] name = "derive_builder" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ - "derive_builder_macro 0.12.0", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", + "derive_builder_macro", ] [[package]] @@ -2664,23 +2787,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core 0.11.2", - "syn 1.0.109", -] - [[package]] name = "derive_builder_macro" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core 0.12.0", + "derive_builder_core", "syn 1.0.109", ] @@ -2690,16 +2803,18 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ + "convert_case", "proc-macro2", "quote", + "rustc_version", "syn 1.0.109", ] [[package]] name = "diesel" -version = "2.1.3" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2268a214a6f118fce1838edba3d1561cf0e78d8de785475957a580a7f8c69d33" +checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" dependencies = [ "bitflags 2.4.1", "byteorder", @@ -2708,7 +2823,19 @@ dependencies = [ "itoa", "pq-sys", "r2d2", - "uuid 1.5.0", + "uuid 1.6.1", +] + +[[package]] +name = "diesel-async" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acada1517534c92d3f382217b485db8a8638f111b0e3f2a2a8e26165050f77be" +dependencies = [ + "async-trait", + "diesel", + "futures-util", + "scoped-futures", ] [[package]] @@ -2720,7 +2847,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -2740,7 +2867,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -2776,7 +2903,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -2838,7 +2965,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -2849,18 +2976,18 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "docify" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4235e9b248e2ba4b92007fe9c646f3adf0ffde16dc74713eacc92b8bc58d8d2f" +checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" dependencies = [ "docify_macros", ] [[package]] name = "docify_macros" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47020e12d7c7505670d1363dd53d6c23724f71a90a3ae32ff8eba40de8404626" +checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" dependencies = [ "common-path", "derive-syn-parse", @@ -2868,9 +2995,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.44", "termcolor", - "toml 0.7.8", + "toml 0.8.2", "walkdir", ] @@ -2886,6 +3013,12 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + [[package]] name = "dtoa" version = "1.0.9" @@ -2915,9 +3048,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d2f3407d9a573d666de4b5bdf10569d73ca9478087346697dcbae6244bfbcd" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -2934,16 +3067,25 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der 0.7.8", "digest 0.10.7", - "elliptic-curve 0.13.6", + "elliptic-curve 0.13.8", "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", + "signature 2.2.0", + "spki 0.7.3", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", ] [[package]] @@ -2953,20 +3095,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8 0.10.2", - "signature 2.1.0", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ "curve25519-dalek 4.1.1", - "ed25519", + "ed25519 2.2.3", "rand_core 0.6.4", "serde", "sha2 0.10.8", + "subtle 2.5.0", "zeroize", ] @@ -3003,24 +3158,23 @@ dependencies = [ "ff 0.12.1", "generic-array 0.14.7", "group 0.12.1", - "hkdf", "pem-rfc7468", "pkcs8 0.9.0", "rand_core 0.6.4", "sec1 0.3.0", "serdect", - "subtle", + "subtle 2.5.0", "zeroize", ] [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "crypto-bigint 0.5.5", "digest 0.10.7", "ff 0.13.0", "generic-array 0.14.7", @@ -3028,10 +3182,23 @@ dependencies = [ "pkcs8 0.10.2", "rand_core 0.6.4", "sec1 0.7.3", - "subtle", + "subtle 2.5.0", "zeroize", ] +[[package]] +name = "embedded-substrate" +version = "0.1.0" +dependencies = [ + "node-chronicle", + "sc-cli", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "subxt", + "tempfile", + "tokio", +] + [[package]] name = "encode_unicode" version = "0.3.6" @@ -3061,9 +3228,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -3086,12 +3253,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3106,6 +3273,38 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "event-listener" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.1", + "pin-project-lite 0.2.13", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -3121,11 +3320,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" dependencies = [ - "blake2", + "blake2 0.10.6", "fs-err", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -3190,7 +3389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -3200,14 +3399,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] name = "fiat-crypto" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a481586acf778f1b1455424c343f71124b048ffa5f4fc3f8f6ae9dc432dcb3c7" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "file-per-thread-logger" @@ -3221,14 +3420,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -3308,18 +3507,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6d54d3a638f0279210c924f4a44e6548bf6345670f5af059a874a5006af4eca" +checksum = "1c2d0a4310dcf0e5cce78e35e60dc2fda80ef61c8f8fc382e685dfc24fcf5db9" dependencies = [ "parity-scale-codec", ] [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -3342,9 +3541,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01af5751a0e4492dc979c57586976403e7ab63641add1a9fd804cad4169f4f6" +checksum = "3dd4946d63eab00d899f08a7e74e965cc6785c2298efaea6a2752905f4810407" dependencies = [ "frame-support", "frame-support-procedural", @@ -3356,26 +3555,26 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-application-crypto 27.0.0", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-runtime-interface 21.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4493341076535acb0bdb591e0e97b32cfacb8515dd74e66156f199d187cec004" +checksum = "67e51c371bff90ba44767a79e72a036d7d648cee621cd2fe9f693e8c1d62941e" dependencies = [ "Inflector", - "array-bytes", + "array-bytes 6.2.2", "chrono", - "clap 4.4.7", + "clap 4.4.12", "comfy-table", "frame-benchmarking", "frame-support", @@ -3400,26 +3599,26 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core", + "sp-core 25.0.0", "sp-database", - "sp-externalities", + "sp-externalities 0.23.0", "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-state-machine", - "sp-storage", - "sp-trie", - "sp-wasm-interface", + "sp-io 27.0.0", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", + "sp-storage 17.0.0", + "sp-trie 26.0.0", + "sp-wasm-interface 18.0.0", "thiserror", "thousands", ] [[package]] name = "frame-executive" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da12a8c223d6991bd7f9aae542d3d7c9fadde3a81b6f16c2550b808f3b21ecd5" +checksum = "2dda2c20ea3267ee20c9a5482f320236510c4ade6aec1dd930cb57dc5651c64f" dependencies = [ "frame-support", "frame-system", @@ -3427,11 +3626,22 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "sp-tracing", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", + "sp-tracing 14.0.0", +] + +[[package]] +name = "frame-metadata" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", ] [[package]] @@ -3448,21 +3658,20 @@ dependencies = [ [[package]] name = "frame-remote-externalities" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8b26379217d223364e6715ed12cdfdc9f368c6afcb15fd8771e387ab7b0265f" +checksum = "a30013df51f4d4e58472c4fecdbfeb141234ece5f6355e5b3a3e51d3f87d452d" dependencies = [ - "async-recursion", "futures", "indicatif", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-state-machine", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "spinners", "substrate-rpc-client", "tokio", @@ -3471,18 +3680,18 @@ dependencies = [ [[package]] name = "frame-support" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0dc5640279221fbd316a3a652963c1cb9d51630ea3f62a08a5ad7fa402f23a4" +checksum = "023504bbdd0e8d1ebe3d9d289b009337cdb9a24c5e74615ffd7b188aa1664c2d" dependencies = [ "aquamarine", "bitflags 1.3.2", "docify", "environmental", - "frame-metadata", + "frame-metadata 16.0.0", "frame-support-procedural", "impl-trait-for-tuples", - "k256 0.13.1", + "k256 0.13.2", "log", "macro_magic", "parity-scale-codec", @@ -3492,29 +3701,29 @@ dependencies = [ "serde_json", "smallvec", "sp-api", - "sp-arithmetic", - "sp-core", + "sp-arithmetic 20.0.0", + "sp-core 25.0.0", "sp-core-hashing-proc-macro", - "sp-debug-derive", + "sp-debug-derive 12.0.0", "sp-genesis-builder", "sp-inherents", - "sp-io", + "sp-io 27.0.0", "sp-metadata-ir", - "sp-runtime", + "sp-runtime 28.0.0", "sp-staking", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-weights", + "sp-state-machine 0.32.0", + "sp-std 12.0.0", + "sp-tracing 14.0.0", + "sp-weights 24.0.0", "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22719c65353a0010a084cb2040e2e6569aff34562e59119cb66ddd7ecfa588c" +checksum = "1d6bc383298353ff2790ac1a301262c21ac196dbc26ef67a2213c46524a06dd1" dependencies = [ "Inflector", "cfg-expr", @@ -3526,38 +3735,39 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.38", + "sp-core-hashing 13.0.0", + "syn 2.0.44", ] [[package]] name = "frame-support-procedural-tools" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e046ecdc04dd66f17d760525631f553ddcbea6f09423f78fcf52b47c97656cd0" +checksum = "b3ac1266522a8c9a2d2d26d205ec3028b88582d5f3cd5cbc75d0ec8271d197b7" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4034ebf9ca7497fa3893191fe3e81adcd3d7cd1c232e60ef41ef58ea0c445ae9" +checksum = "d9c078db2242ea7265faa486004e7fd8daaf1a577cfcac0070ce55d926922883" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "frame-system" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc19d4d4037b695805385d56983da173bbb969f68e0e4e6a1240bb30118e87d7" +checksum = "57e316407c45a5093c833966a906301aa0dcbd05048061cd9cde2548d017bfd9" dependencies = [ "cfg-if", "frame-support", @@ -3565,35 +3775,35 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "sp-version", - "sp-weights", + "sp-weights 24.0.0", ] [[package]] name = "frame-system-benchmarking" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb79e630dc8fbed5601e58c1b8d84ec3900a511f105140b5bbb6c18c476488d2" +checksum = "b5b1388055d29a7a1c4d41b1623d3fcbc9d7f31d17abe04500b270b26901d926" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 25.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13ed2be7e4ad2cf140d16b94194595d3b2fea0b60a46832945c497924c2d0d0" +checksum = "17572a34fd866ad6cab6977a2c30b38645e0a499b3486de00ae9103f7002d6d3" dependencies = [ "parity-scale-codec", "sp-api", @@ -3601,22 +3811,25 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9eceb53c4efa82dd7dd08f0770abfaa9587c592a015b21dc29ce4c24422de13" +checksum = "f082e770275f9b46ddf46b09bc7a993f84db691c39d9e4d038ac07443cb17a18" dependencies = [ "frame-support", "parity-scale-codec", "sp-api", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fs2" @@ -3636,9 +3849,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -3651,9 +3864,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -3661,15 +3874,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -3679,9 +3892,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -3698,15 +3911,28 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite 0.2.13", +] + [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -3717,20 +3943,20 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.9", - "webpki 0.22.4", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -3740,9 +3966,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -3849,9 +4075,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -3860,16 +4086,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.5.3", -] - [[package]] name = "ghash" version = "0.5.0" @@ -3877,7 +4093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ "opaque-debug 0.3.0", - "polyval 0.6.1", + "polyval", ] [[package]] @@ -3893,9 +4109,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -3905,15 +4121,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -3947,7 +4163,7 @@ checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -3958,14 +4174,14 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff 0.13.0", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -3973,7 +4189,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -3988,9 +4204,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.4.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -4030,22 +4246,36 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", ] [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.7", + "allocator-api2", + "serde", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.3", +] [[package]] name = "hdrhistogram" -version = "7.5.2" +version = "7.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +checksum = "765c9198f173dd59ce26ff9f95ef0aafd0a0fe01fb9d72841bc5066a4c06511d" dependencies = [ - "base64 0.13.1", + "base64 0.21.5", "byteorder", "flate2", "nom", @@ -4105,9 +4335,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -4128,7 +4358,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -4154,11 +4384,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4174,9 +4404,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -4185,9 +4415,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -4220,9 +4450,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -4235,7 +4465,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.13", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -4252,11 +4482,11 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.8", + "rustls 0.21.10", "rustls-native-certs", "tokio", "tokio-rustls", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", ] [[package]] @@ -4286,16 +4516,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -4326,9 +4556,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4336,21 +4566,21 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.7.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] name = "if-watch" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb892e5777fe09e16f3d44de7802f4daa7267ecbe8c466f19d94e25bb0c303e" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io", + "async-io 2.2.2", "core-foundation", "fnv", "futures", @@ -4365,17 +4595,16 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.3", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -4441,14 +4670,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + [[package]] name = "indicatif" version = "0.17.7" @@ -4507,23 +4742,10 @@ dependencies = [ ] [[package]] -name = "interceptor" -version = "0.8.2" +name = "intx" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", -] +checksum = "f6f38a50a899dc47a6d0ed5508e7f601a2e34c3a85303514b5d137f3c10a0c75" [[package]] name = "io-lifetimes" @@ -4582,13 +4804,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi 0.3.3", - "rustix 0.38.21", - "windows-sys 0.48.0", + "rustix 0.38.28", + "windows-sys 0.52.0", ] [[package]] @@ -4620,9 +4842,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -4635,9 +4857,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -4819,15 +5041,27 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" dependencies = [ - "jsonrpsee-core", - "jsonrpsee-http-client", + "jsonrpsee-core 0.16.3", + "jsonrpsee-http-client 0.16.3", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types", + "jsonrpsee-types 0.16.3", "jsonrpsee-ws-client", "tracing", ] +[[package]] +name = "jsonrpsee" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +dependencies = [ + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-http-client 0.20.3", + "jsonrpsee-types 0.20.3", +] + [[package]] name = "jsonrpsee-client-transport" version = "0.16.3" @@ -4836,8 +5070,28 @@ checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" dependencies = [ "futures-util", "http", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots 0.25.3", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core 0.20.3", "pin-project", "rustls-native-certs", "soketto", @@ -4846,7 +5100,7 @@ dependencies = [ "tokio-rustls", "tokio-util", "tracing", - "webpki-roots 0.25.2", + "url", ] [[package]] @@ -4857,7 +5111,7 @@ checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", - "async-lock", + "async-lock 2.8.0", "async-trait", "beef", "futures-channel", @@ -4865,7 +5119,7 @@ dependencies = [ "futures-util", "globset", "hyper", - "jsonrpsee-types", + "jsonrpsee-types 0.16.3", "parking_lot 0.12.1", "rand 0.8.5", "rustc-hash", @@ -4877,6 +5131,28 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +dependencies = [ + "anyhow", + "async-lock 2.8.0", + "async-trait", + "beef", + "futures-timer", + "futures-util", + "hyper", + "jsonrpsee-types 0.20.3", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "jsonrpsee-http-client" version = "0.16.3" @@ -4886,8 +5162,8 @@ dependencies = [ "async-trait", "hyper", "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", "rustc-hash", "serde", "serde_json", @@ -4896,6 +5172,26 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-http-client" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +dependencies = [ + "async-trait", + "hyper", + "hyper-rustls", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "serde", + "serde_json", + "thiserror", + "tokio", + "tower", + "tracing", + "url", +] + [[package]] name = "jsonrpsee-proc-macros" version = "0.16.3" @@ -4903,7 +5199,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" dependencies = [ "heck", - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -4919,8 +5215,8 @@ dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", "serde", "serde_json", "soketto", @@ -4945,6 +5241,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee-types" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "jsonrpsee-ws-client" version = "0.16.3" @@ -4952,9 +5262,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" dependencies = [ "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-client-transport 0.16.3", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", ] [[package]] @@ -4963,14 +5273,14 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a071f4f7efc9a9118dfb627a0a94ef247986e1ab8606a4c806ae2b3aa3b6978" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "anyhow", "base64 0.21.5", "bytecount", - "clap 4.4.7", + "clap 4.4.12", "fancy-regex", "fraction", - "getrandom 0.2.10", + "getrandom 0.2.11", "iso8601", "itoa", "memchr", @@ -4984,7 +5294,7 @@ dependencies = [ "serde_json", "time", "url", - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] @@ -5025,17 +5335,18 @@ dependencies = [ "elliptic-curve 0.12.3", "serdect", "sha2 0.10.8", + "sha3", ] [[package]] name = "k256" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" dependencies = [ "cfg-if", - "ecdsa 0.16.8", - "elliptic-curve 0.13.6", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", "sha2 0.10.8", ] @@ -5049,6 +5360,12 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keystream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" + [[package]] name = "kvdb" version = "0.13.0" @@ -5178,18 +5495,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.149" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -5200,14 +5517,14 @@ checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes", "futures", "futures-timer", - "getrandom 0.2.10", + "getrandom 0.2.11", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -5225,7 +5542,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -5327,7 +5643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ "bs58 0.4.0", - "ed25519-dalek", + "ed25519-dalek 2.1.0", "log", "multiaddr", "multihash", @@ -5537,12 +5853,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", + "rcgen", "ring 0.16.20", "rustls 0.20.9", "thiserror", - "webpki 0.22.4", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -5560,37 +5876,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -5623,6 +5908,17 @@ dependencies = [ "yamux", ] +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -5665,7 +5961,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -5744,9 +6040,21 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + +[[package]] +name = "lioness" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" +dependencies = [ + "arrayref", + "blake2 0.8.1", + "chacha", + "keystream", +] [[package]] name = "lock_api" @@ -5835,9 +6143,9 @@ dependencies = [ [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -5850,50 +6158,50 @@ checksum = "f21755d53936fc1663b414dba30636788f2183d3e782bdee4b1e7236637974e7" [[package]] name = "macro_magic" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "macro_magic_core" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "macro_magic_core_macros" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "macro_magic_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -5948,21 +6256,11 @@ dependencies = [ "rawpointer", ] -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memfd" @@ -5970,7 +6268,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.28", ] [[package]] @@ -5982,15 +6280,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -6000,15 +6289,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -6030,6 +6310,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "metadeps" version = "1.1.2" @@ -6047,16 +6339,16 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fde3af1a009ed76a778cb84fdef9e7dbbdf5775ae3e4cc1f434a6a307f6f76c5" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "metrics-macros", "portable-atomic", ] [[package]] name = "metrics-exporter-prometheus" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4964177ddfdab1e3a2b37aec7cf320e14169abb0ed73999f558136409178d5" +checksum = "1d4fa7ce7c4862db464a37b0b31d89bca874562f034bd7993895572783d02950" dependencies = [ "base64 0.21.5", "hyper", @@ -6072,13 +6364,13 @@ dependencies = [ [[package]] name = "metrics-macros" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddece26afd34c31585c74a4db0630c376df271c285d682d1e55012197830b6df" +checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -6140,15 +6432,40 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] +[[package]] +name = "mixnet" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "bitflags 1.3.2", + "blake2 0.10.6", + "c2-chacha", + "curve25519-dalek 4.1.1", + "either", + "hashlink", + "lioness", + "log", + "parking_lot 0.12.1", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_distr", + "subtle 2.5.0", + "thiserror", + "zeroize", +] + [[package]] name = "mockall" version = "0.11.4" @@ -6272,7 +6589,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", @@ -6438,7 +6755,6 @@ dependencies = [ "bitflags 1.3.2", "cfg-if", "libc", - "memoffset 0.6.5", ] [[package]] @@ -6461,18 +6777,22 @@ dependencies = [ "serde", ] +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + [[package]] name = "node-chronicle" version = "4.0.0-dev" dependencies = [ - "clap 4.4.7", + "clap 4.4.12", "frame-benchmarking", "frame-benchmarking-cli", "frame-system", "futures", - "jsonrpsee", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc", + "jsonrpsee 0.16.3", "runtime-chronicle", "sc-basic-authorship", "sc-cli", @@ -6494,17 +6814,24 @@ dependencies = [ "sp-blockchain", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-io", + "sp-io 27.0.0", "sp-keyring", - "sp-runtime", + "sp-runtime 28.0.0", "sp-timestamp", "substrate-build-script-utils", "substrate-frame-rpc-system", + "tracing", "try-runtime-cli", ] +[[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" @@ -6663,7 +6990,7 @@ checksum = "c38841cdd844847e3e7c8d29cef9dcfed8877f8f56f9071f77843ecf3baf937f" dependencies = [ "base64 0.13.1", "chrono", - "getrandom 0.2.10", + "getrandom 0.2.11", "http", "rand 0.8.5", "reqwest", @@ -6689,36 +7016,27 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -6745,115 +7063,22 @@ dependencies = [ ] [[package]] -name = "opa-tp" -version = "0.7.5" -dependencies = [ - "async-stl-client", - "async-trait", - "bytes", - "chronicle-signing", - "chronicle-telemetry", - "clap 3.2.25", - "const_format", - "hex", - "insta", - "k256 0.11.6", - "opa-tp-protocol", - "prost 0.10.4", - "protobuf", - "rand 0.8.5", - "rand_core 0.6.4", - "sawtooth-sdk", - "serde_json", - "thiserror", - "tokio", - "tracing", - "url", -] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] -name = "opa-tp-protocol" -version = "0.7.5" -dependencies = [ - "async-stl-client", - "async-trait", - "chronicle-signing", - "derivative", - "futures", - "glob", - "hex", - "k256 0.11.6", - "lazy_static", - "openssl", - "prost 0.10.4", - "prost-build 0.10.4", - "prost-types 0.11.9", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "uuid 1.5.0", - "zmq", -] - -[[package]] -name = "opactl" -version = "0.7.5" -dependencies = [ - "async-stl-client", - "async-trait", - "chronicle-signing", - "chronicle-telemetry", - "clap 4.4.7", - "common", - "const_format", - "futures", - "hex", - "insta", - "k256 0.11.6", - "lazy_static", - "opa-tp", - "opa-tp-protocol", - "portpicker", - "prost 0.10.4", - "protobuf", - "rand 0.8.5", - "rand_core 0.6.4", - "sawtooth-sdk", - "serde", - "serde_derive", - "serde_json", - "tempfile", - "thiserror", - "tmq", - "tokio", - "tokio-stream", - "tracing", - "url", - "user-error", - "uuid 1.5.0", -] - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.62" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -6872,7 +7097,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -6883,9 +7108,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -6899,39 +7124,45 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" dependencies = [ - "opentelemetry_api 0.19.0", - "opentelemetry_sdk 0.19.0", + "opentelemetry_api", + "opentelemetry_sdk", ] [[package]] name = "opentelemetry" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9591d937bc0e6d2feb6f71a559540ab300ea49955229c347a517a28d27784c54" +checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ - "opentelemetry_api 0.20.0", - "opentelemetry_sdk 0.20.0", + "futures-core", + "futures-sink", + "indexmap 2.1.0", + "js-sys", + "once_cell", + "pin-project-lite 0.2.13", + "thiserror", + "urlencoding", ] [[package]] name = "opentelemetry-http" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7594ec0e11d8e33faf03530a4c49af7064ebba81c1480e01be67d90b356508b" +checksum = "7f51189ce8be654f9b5f7e70e49967ed894e84a06fc35c6c042e64ac1fc5399e" dependencies = [ "async-trait", "bytes", "http", - "opentelemetry_api 0.20.0", + "opentelemetry 0.21.0", ] [[package]] name = "opentelemetry-semantic-conventions" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9f9340ad135068800e7f1b24e9e09ed9e7143f5bf8518ded3d3ec69789269" +checksum = "f5774f1ef1f982ef2a447f6ee04ec383981a3ab99c8e77a1a7b30182e65bbc84" dependencies = [ - "opentelemetry 0.20.0", + "opentelemetry 0.21.0", ] [[package]] @@ -6949,22 +7180,6 @@ dependencies = [ "urlencoding", ] -[[package]] -name = "opentelemetry_api" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a81f725323db1b1206ca3da8bb19874bbd3f57c3bcd59471bfb04525b265b9b" -dependencies = [ - "futures-channel", - "futures-util", - "indexmap 1.9.3", - "js-sys", - "once_cell", - "pin-project-lite 0.2.13", - "thiserror", - "urlencoding", -] - [[package]] name = "opentelemetry_sdk" version = "0.19.0" @@ -6977,7 +7192,7 @@ dependencies = [ "futures-executor", "futures-util", "once_cell", - "opentelemetry_api 0.19.0", + "opentelemetry_api", "percent-encoding", "rand 0.8.5", "thiserror", @@ -6985,41 +7200,12 @@ dependencies = [ "tokio-stream", ] -[[package]] -name = "opentelemetry_sdk" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8e705a0612d48139799fcbaba0d4a90f06277153e43dd2bdc16c6f0edd8026" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "once_cell", - "opentelemetry_api 0.20.0", - "ordered-float", - "percent-encoding", - "rand 0.8.5", - "regex", - "thiserror", -] - [[package]] name = "option-ext" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "ordered-float" -version = "3.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc" -dependencies = [ - "num-traits", -] - [[package]] name = "os_str_bytes" version = "6.6.1" @@ -7038,33 +7224,11 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - -[[package]] -name = "p384" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.8", -] - [[package]] name = "pallet-aura" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e2b1cf20dbd9fe630c69b4b0d3bb0d5fa1223ee728b0fc0064ef65698918c2" +checksum = "04fbef67cf62445b7fd8e68241e6b71d9fb8c77abb3d52259eebf525a4cd5586" dependencies = [ "frame-support", "frame-system", @@ -7072,41 +7236,25 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 27.0.0", "sp-consensus-aura", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "pallet-authorship" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae682e78744224150298730dfa1e2c39220e600dce17e42d2c77e49af3d9c59f" +checksum = "2d38eab59f7d15fe43c81fc3cd92f4c1f895ca6d0efb74fc2a6d6d7d3d34d413" dependencies = [ "frame-support", "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-balances" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c17ec19ad23b26866ad7d60cdf8b613f653db7f44232aa25009811441908e2b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] @@ -7122,19 +7270,19 @@ dependencies = [ "newtype-derive-2018", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "tracing", - "uuid 1.5.0", + "uuid 1.6.1", ] [[package]] name = "pallet-grandpa" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "977d01d5ce3f06fa17adf2ffa55ebaea765efa23bc11a242773a28955ee1d02b" +checksum = "b87c7f4cd94a526054dfebf7a84fbcaf6385033defa246ad83e321e71f8c5a92" dependencies = [ "frame-benchmarking", "frame-support", @@ -7144,21 +7292,45 @@ dependencies = [ "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 27.0.0", "sp-consensus-grandpa", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", "sp-session", "sp-staking", - "sp-std", + "sp-std 12.0.0", +] + +[[package]] +name = "pallet-opa" +version = "0.7.5" +dependencies = [ + "chronicle-telemetry", + "common", + "frame-benchmarking", + "frame-support", + "frame-system", + "k256 0.11.6", + "macro-attr-2018", + "newtype-derive-2018", + "parity-scale-codec", + "scale-info", + "serde", + "serde_json", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", + "tracing", + "uuid 1.6.1", ] [[package]] name = "pallet-session" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8482f465a73688a7d58e20dea4b10c9a0425995975b2a43d9ce4fe9a21a491" +checksum = "768a6fb5333efc2bd2a3538c1d6ffa4178398660d4e3be89f2eb82d4e9088ae6" dependencies = [ "frame-support", "frame-system", @@ -7167,21 +7339,21 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-runtime 28.0.0", "sp-session", "sp-staking", - "sp-state-machine", - "sp-std", - "sp-trie", + "sp-state-machine 0.32.0", + "sp-std 12.0.0", + "sp-trie 26.0.0", ] [[package]] name = "pallet-sudo" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "679c265de3a128714d43a7e2edf5ea29f2a39df65e4c44e216c04d6bb5dd5be7" +checksum = "fcec9f73ecb8d0439a13043a253a9fd90aa6bf5aece6470194bbfc7f79256d88" dependencies = [ "docify", "frame-benchmarking", @@ -7189,16 +7361,16 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-std", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "pallet-timestamp" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac4e66316d53673471420fb887b6a74e2507df169ced62584507ff0fb065c6b" +checksum = "b25ec8749cf3f481b5e5199be701bac0dea835851b83fc7c455192762711858d" dependencies = [ "docify", "frame-benchmarking", @@ -7208,67 +7380,20 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", - "sp-runtime", - "sp-std", - "sp-storage", + "sp-io 27.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", "sp-timestamp", ] -[[package]] -name = "pallet-transaction-payment" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4cbb78b8499af1d338072950e4aef6acf3cc630afdb8e19b00306e5252d0386" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-transaction-payment-rpc" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7857973b918e71367acb7c284c829612aa9c91a6ba1fb2985d56fbe224545" -dependencies = [ - "jsonrpsee", - "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", - "sp-api", - "sp-blockchain", - "sp-core", - "sp-rpc", - "sp-runtime", - "sp-weights", -] - -[[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402155004abb33b7f2eedfa60ba77fb6f898e62db979a796e013714d18a1c9c2" -dependencies = [ - "pallet-transaction-payment", - "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-weights", -] - [[package]] name = "parity-db" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ - "blake2", + "blake2 0.10.6", "crc32fast", "fs2", "hex", @@ -7284,9 +7409,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -7299,11 +7424,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.1", "proc-macro2", "quote", "syn 1.0.109", @@ -7393,7 +7518,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", ] [[package]] @@ -7405,6 +7530,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "pct-str" version = "1.2.0" @@ -7440,9 +7574,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "permutohedron" @@ -7481,7 +7615,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -7502,7 +7636,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.2", + "indexmap 2.1.0", ] [[package]] @@ -7560,7 +7694,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -7581,15 +7715,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pinvec" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "840ab949b9845c83495aba5cdfb23ab17aaa67b99ac36b17211bd02a5f9e6b36" -dependencies = [ - "pow_of_2", -] - [[package]] name = "piper" version = "0.2.1" @@ -7618,20 +7743,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der 0.7.8", - "spki 0.7.2", + "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "platforms" -version = "3.1.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "plotters" @@ -7663,9 +7788,9 @@ dependencies = [ [[package]] name = "poem" -version = "1.3.58" +version = "1.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc7ae19f3e791ae8108b08801abb3708d64d3a16490c720e0b81040cae87b5d" +checksum = "504774c97b0744c1ee108a37e5a65a9745a4725c4c06277521dabc28eb53a904" dependencies = [ "async-trait", "base64 0.21.5", @@ -7675,7 +7800,8 @@ dependencies = [ "http", "hyper", "mime", - "opentelemetry 0.20.0", + "nix 0.27.1", + "opentelemetry 0.21.0", "opentelemetry-http", "opentelemetry-semantic-conventions", "parking_lot 0.12.1", @@ -7693,18 +7819,19 @@ dependencies = [ "tokio-tungstenite", "tokio-util", "tracing", + "wildmatch", ] [[package]] name = "poem-derive" -version = "1.3.58" +version = "1.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2550a0bce7273b278894ef3ccc5a6869e7031b6870042f3cc6826ed9faa980a6" +checksum = "42ddcf4680d8d867e1e375116203846acb088483fa2070244f90589f458bbb31" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.1", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -7724,26 +7851,28 @@ dependencies = [ ] [[package]] -name = "poly1305" -version = "0.7.2" +name = "polling" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" dependencies = [ - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "cfg-if", + "concurrent-queue", + "pin-project-lite 0.2.13", + "rustix 0.38.28", + "tracing", + "windows-sys 0.52.0", ] [[package]] -name = "polyval" -version = "0.5.3" +name = "poly1305" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash", ] [[package]] @@ -7755,14 +7884,14 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.5.1", + "universal-hash", ] [[package]] name = "portable-atomic" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "portpicker" @@ -7773,12 +7902,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "pow_of_2" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4240ec1e46f35cb33cba66075d04778f53a5eba59ba4aecf2b1f8f6c4204d383" - [[package]] name = "powerfmt" version = "0.2.0" @@ -7868,7 +7991,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -7894,6 +8017,16 @@ dependencies = [ "toml 0.5.11", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -7920,20 +8053,20 @@ dependencies = [ [[package]] name = "proc-macro-warning" -version = "0.4.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "2dd5e8a1f1029c43224ad5898e50140c2aebb1705f19e67c918ebf5b9e797fe1" dependencies = [ "unicode-ident", ] @@ -7972,14 +8105,14 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "proptest" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c003ac8c77cb07bb74f5f198bce836a689bcd5a42574612bf14d17bfd08c20e" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ "bit-set", "bit-vec", @@ -7989,7 +8122,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", "rusty-fork", "tempfile", "unarray", @@ -8111,41 +8244,75 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] -name = "protobuf-codegen" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" +name = "protocol-abstract" +version = "0.1.0" dependencies = [ - "protobuf", + "anyhow", + "async-trait", + "futures", + "k256 0.11.6", + "pallet-chronicle", + "serde", + "subxt", + "thiserror", + "tokio", + "tracing", ] [[package]] -name = "protoc" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" +name = "protocol-substrate-chronicle" +version = "0.1.0" dependencies = [ - "log", - "which", + "async-trait", + "chronicle-signing", + "chronicle-telemetry", + "clap_builder", + "common", + "embedded-substrate", + "futures", + "k256 0.11.6", + "pallet-chronicle", + "protocol-abstract", + "serde", + "subxt", + "thiserror", + "tracing", + "uuid 1.6.1", ] [[package]] -name = "protoc-rust" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838" +name = "protocol-substrate-opa" +version = "0.7.5" dependencies = [ - "protobuf", - "protobuf-codegen", - "protoc", - "tempfile", + "async-trait", + "chronicle-signing", + "common", + "derivative", + "futures", + "glob", + "hex", + "k256 0.11.6", + "lazy_static", + "openssl", + "pallet-opa", + "prost-build 0.10.4", + "protocol-abstract", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "uuid 1.6.1", + "zmq", ] [[package]] name = "psl" -version = "2.1.4" +version = "2.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a1be0afcd844b15cfce18bf8cccf2dfa887a00a6454a9ea135f122b948cee91" +checksum = "fe5b9b0f029db58ebf478fa2a45a8c6f2772c979d878c2c495e2eb2f217f41bc" dependencies = [ "psl-types", ] @@ -8241,14 +8408,14 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "22a37c9326af5ed140c86a46655b5278de879853be5573c01df185b6f49a580a" dependencies = [ "proc-macro2", ] @@ -8330,7 +8497,17 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", +] + +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", ] [[package]] @@ -8404,19 +8581,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring 0.16.20", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -8452,15 +8616,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -8472,33 +8627,33 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.11", + "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "53313ec9f12686aeeffb43462c3ac77aa25f590a5f630eb2cde0de59417b29c7" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "2566c4bf6845f2c2e83b27043c3f5dfcd5ba8f2937d6c00dc009bfb51a079dc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -8564,12 +8719,6 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -8578,15 +8727,15 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64 0.21.5", "bytes", @@ -8607,7 +8756,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite 0.2.13", - "rustls 0.21.8", + "rustls 0.21.10", "rustls-pemfile", "serde", "serde_json", @@ -8621,7 +8770,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", "winreg", ] @@ -8653,7 +8802,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -8682,12 +8831,12 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "getrandom 0.2.10", + "getrandom 0.2.11", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -8706,13 +8855,13 @@ dependencies = [ [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -8726,17 +8875,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -8754,26 +8892,21 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi", + "windows-sys 0.48.0", ] [[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" +name = "runtime-api-chronicle" +version = "1.0.0" dependencies = [ - "async-trait", - "bytes", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", + "common", + "sp-api", + "sp-core 25.0.0", ] [[package]] @@ -8788,30 +8921,63 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "pallet-aura", - "pallet-balances", "pallet-chronicle", "pallet-grandpa", "pallet-sudo", "pallet-timestamp", - "pallet-transaction-payment", - "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", + "runtime-api-chronicle", "scale-info", "sp-api", "sp-block-builder", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core", + "sp-core 25.0.0", "sp-inherents", "sp-offchain", - "sp-runtime", + "sp-runtime 28.0.0", "sp-session", - "sp-std", + "sp-std 12.0.0", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", ] +[[package]] +name = "rust-embed" +version = "6.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a36224c3276f8c4ebc8c20f158eca7ca4359c8db89991c4925132aaaf6702661" +dependencies = [ + "rust-embed-impl", + "rust-embed-utils", + "walkdir", +] + +[[package]] +name = "rust-embed-impl" +version = "6.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49b94b81e5b2c284684141a2fb9e2a31be90638caf040bf9afbc5a0416afe1ac" +dependencies = [ + "proc-macro2", + "quote", + "rust-embed-utils", + "syn 2.0.44", + "walkdir", +] + +[[package]] +name = "rust-embed-utils" +version = "7.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d38ff6bf570dc3bb7100fce9f7b60c33fa71d80e88da3f2580df4ff2bdded74" +dependencies = [ + "globset", + "sha2 0.10.8", + "walkdir", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -8912,28 +9078,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", - "linux-raw-sys 0.4.10", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", + "linux-raw-sys 0.4.12", + "windows-sys 0.52.0", ] [[package]] @@ -8944,20 +9097,20 @@ checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", - "sct 0.7.1", - "webpki 0.22.4", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.7", "rustls-webpki", - "sct 0.7.1", + "sct", ] [[package]] @@ -8974,9 +9127,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64 0.21.5", ] @@ -8987,7 +9140,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -9009,6 +9162,17 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ruzstd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3ffab8f9715a0d455df4bbb9d21e91135aab3cd3ca187af0cd0c3c3f868fdc" +dependencies = [ + "byteorder", + "thiserror-core", + "twox-hash", +] + [[package]] name = "rvs_derive" version = "0.3.2" @@ -9042,9 +9206,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "ryu-js" @@ -9076,83 +9240,23 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "sawtooth-sdk" -version = "0.5.3" -source = "git+https://github.com/hyperledger/sawtooth-sdk-rust?rev=5a300de#5a300de293666aa056a2970a39651d4dd5098885" -dependencies = [ - "ctrlc", - "glob", - "hex", - "libc", - "log", - "openssl", - "protobuf", - "protoc-rust", - "rand 0.8.5", - "secp256k1 0.27.0", - "sha2 0.10.8", - "uuid 0.8.2", - "zmq", -] - -[[package]] -name = "sawtooth_tp" -version = "0.7.5" -dependencies = [ - "async-stl-client", - "async-trait", - "bytes", - "chronicle-protocol", - "chronicle-signing", - "chronicle-telemetry", - "chrono", - "clap 3.2.25", - "common", - "const_format", - "custom_error", - "derivative", - "futures", - "glob", - "hex", - "insta", - "lazy_static", - "opa-tp-protocol", - "openssl", - "opentelemetry 0.19.0", - "prost 0.10.4", - "protobuf", - "rand 0.8.5", - "rand_core 0.6.4", - "sawtooth-sdk", - "serde", - "serde_derive", - "serde_json", - "tempfile", - "tokio", - "tracing", - "url", - "uuid 1.5.0", - "zmq", -] - [[package]] name = "sc-allocator" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd6e58990dcb1eae76db49c456ded9a7906ee194857cf1dfb00da8bbc8cf73d" +checksum = "66b4c5976a9cff7fcf24c946276a62ea7837862b6f3bf9f8011f08faf4f08474" dependencies = [ "log", - "sp-core", - "sp-wasm-interface", + "sp-core 25.0.0", + "sp-wasm-interface 18.0.0", "thiserror", ] [[package]] name = "sc-basic-authorship" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f802a95cece137daa3a0980f41a8e9265aa65d1b078f8d771f7d2f41e04266" +checksum = "b0aa6c85e3e0b5af9cab7078166d8c4575b7b9edac0ade6be1aadee828420104" dependencies = [ "futures", "futures-timer", @@ -9166,33 +9270,33 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-runtime", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-block-builder" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4653cc3665319f76451f651bc5e3eb84965802293daeaf2def5bfe9c1310171b" +checksum = "9d3999b9b758c09a6c1155e481b683ee87712f071cc5a0679f9ee4906a14a404" dependencies = [ "parity-scale-codec", "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-runtime", + "sp-runtime 28.0.0", ] [[package]] name = "sc-chain-spec" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5fae1616d342e570fb4770c9f1a73ab8e1aecb9c5b71020404f8e45db458260" +checksum = "ec7e711ea9870d3fb8e2a3ea5b601a9e20c63d0d2f457f40146407721e246a77" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -9203,32 +9307,32 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 25.0.0", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", ] [[package]] name = "sc-chain-spec-derive" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a074891d17c03c58b1314c9add361a5a7fb28d4d3addd7a32dca8b119bd877" +checksum = "1f25158f791eb48715da9322375598b541cadd1f193674e8a4d77c79ffa3d95d" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "sc-cli" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc423e21a22adc4f6056ccb5e19fca9ddc6cce1a49cd9aa44c53d6b2338fbeb3" +checksum = "22c61058223f80c1f961b03f7737529609a3283eef91129e971a1966101c18ea" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "chrono", - "clap 4.4.7", + "clap 4.4.12", "fdlimit", "futures", "libp2p-identity", @@ -9241,6 +9345,7 @@ dependencies = [ "sc-client-api", "sc-client-db", "sc-keystore", + "sc-mixnet", "sc-network", "sc-service", "sc-telemetry", @@ -9249,11 +9354,11 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core", + "sp-core 25.0.0", "sp-keyring", - "sp-keystore", - "sp-panic-handler", - "sp-runtime", + "sp-keystore 0.31.0", + "sp-panic-handler 12.0.0", + "sp-runtime 28.0.0", "sp-version", "thiserror", "tiny-bip39", @@ -9262,9 +9367,9 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49efb455b1b276557ba3cac01c2e42811148cc73149858296e4ae96707dc70e" +checksum = "c7d32101f415f4d7ddbe8b5de1c1387a78d6dce070e26407ec605fe9f3fc9e23" dependencies = [ "fnv", "futures", @@ -9277,22 +9382,22 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", + "sp-core 25.0.0", "sp-database", - "sp-externalities", - "sp-runtime", - "sp-state-machine", + "sp-externalities 0.23.0", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "sp-statement-store", - "sp-storage", - "sp-trie", + "sp-storage 17.0.0", + "sp-trie 26.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1062af3e43f09e0080714382ee3e7dd850037908938323eefdcd4f4b61bdd6b" +checksum = "d4ced79f609a44782874d856cf39d256838957195ef34f4fb8ced90bf4b725d0" dependencies = [ "hash-db", "kvdb", @@ -9306,20 +9411,20 @@ dependencies = [ "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic", + "sp-arithmetic 20.0.0", "sp-blockchain", - "sp-core", + "sp-core 25.0.0", "sp-database", - "sp-runtime", - "sp-state-machine", - "sp-trie", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", + "sp-trie 26.0.0", ] [[package]] name = "sc-consensus" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f8da1ef0f036209b80d8bde5c8990ea1a86241532d84b5fd15f5e721da849c" +checksum = "86e4100cc8fb3876708e1ec5a7c63af3baa75febd5051beb9ddd1e4835fdfc27" dependencies = [ "async-trait", "futures", @@ -9334,18 +9439,18 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-runtime", - "sp-state-machine", + "sp-core 25.0.0", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-aura" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbb98be43737b79517f2de34b5185a58238dc8f69e84ddf7e4730bc0e2e2e65" +checksum = "5e3e282836a7deeeb71d965a0942828f81ae2b03fd67515b733d5f33dd5da855" dependencies = [ "async-trait", "futures", @@ -9357,28 +9462,28 @@ dependencies = [ "sc-consensus-slots", "sc-telemetry", "sp-api", - "sp-application-crypto", + "sp-application-crypto 27.0.0", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-keystore", - "sp-runtime", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-grandpa" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98285bbed76ba058f3c9f4111471208cd4c246d2ca7b52b7fbea15afdbb40ca5" +checksum = "30cbc5db21ea2c4ba65b23315e73e69e8155630fb47c84b93d40b0e759c9d86d" dependencies = [ - "ahash 0.8.6", - "array-bytes", + "ahash 0.8.7", + "array-bytes 6.2.2", "async-trait", "dyn-clone", "finality-grandpa", @@ -9401,23 +9506,23 @@ dependencies = [ "sc-utils", "serde_json", "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-application-crypto 27.0.0", + "sp-arithmetic 20.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 25.0.0", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", "thiserror", ] [[package]] name = "sc-consensus-slots" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a232d18eb53288775eaeb782cad70ca75815cd10e6212352e6e53cc3961931" +checksum = "2059681962e33394682627e7bd7245b5094236594f5c97c4c96988d901bda534" dependencies = [ "async-trait", "futures", @@ -9427,21 +9532,21 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic", + "sp-arithmetic 20.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", ] [[package]] name = "sc-executor" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfeaa8dc2a70ed5820667d3251266ed156f38d8062c2f976aa7c618411f1776" +checksum = "225f2ad733bc7234a6638d5203624194824b2f78ab631bc911223f536a66b9c8" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -9449,53 +9554,54 @@ dependencies = [ "sc-executor-wasmtime", "schnellru", "sp-api", - "sp-core", - "sp-externalities", - "sp-io", - "sp-panic-handler", - "sp-runtime-interface", - "sp-trie", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-io 27.0.0", + "sp-panic-handler 12.0.0", + "sp-runtime-interface 21.0.0", + "sp-trie 26.0.0", "sp-version", - "sp-wasm-interface", + "sp-wasm-interface 18.0.0", "tracing", ] [[package]] name = "sc-executor-common" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d404519f2a636d5977b1ac16c90aeb4129fe4609a5b284960a2dcb005c08da6" +checksum = "169c1cfe81ba0e0d44ab4ada1600e30b6a9de588c792db73e32a854a6e3e1a87" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface", + "sp-wasm-interface 18.0.0", "thiserror", "wasm-instrument", ] [[package]] name = "sc-executor-wasmtime" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82515a0cb74a2acb58f6ced20fae56eeb87ba4d813e60e46cf190a53d44c931" +checksum = "f9167d733e928c528273be63b905ec750cfda85d740453071463da69f7d633bc" dependencies = [ "anyhow", "cfg-if", "libc", "log", + "parking_lot 0.12.1", "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-runtime-interface 21.0.0", + "sp-wasm-interface 18.0.0", "wasmtime 8.0.1", ] [[package]] name = "sc-informant" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233ece6736217208ffac94f84de2d15465f80f676f881dacd0a9b3411b476951" +checksum = "7189a0b95fe5d79895a107c6c057bc9351cd9c867552200815199cde25bcdb9d" dependencies = [ "ansi_term", "futures", @@ -9505,48 +9611,77 @@ dependencies = [ "sc-network", "sc-network-common", "sp-blockchain", - "sp-runtime", + "sp-runtime 28.0.0", ] [[package]] name = "sc-keystore" -version = "21.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c15cc8b79eb0832cac48fde41e9ecd011df5d57dad7608f2b89fe721e97012c" +checksum = "abecdf9778fccc254c0b5e227ea8b90fd59247044a30ad293a068b180427d244" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "parking_lot 0.12.1", "serde_json", - "sp-application-crypto", - "sp-core", - "sp-keystore", + "sp-application-crypto 27.0.0", + "sp-core 25.0.0", + "sp-keystore 0.31.0", "thiserror", ] [[package]] -name = "sc-network" -version = "0.30.0" +name = "sc-mixnet" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edad0e7930c2572d6920dc257bc03af6f40ba272bc45602edd0a045d94e5e59" +checksum = "d53ea71ec60601c18d6adcaf7a62698fc2e886c16dc8fdf8d61b3b76244dea38" dependencies = [ - "array-bytes", - "async-channel", - "async-trait", - "asynchronous-codec", - "bytes", - "either", - "fnv", + "array-bytes 4.2.0", + "arrayvec 0.7.4", + "blake2 0.10.6", "futures", "futures-timer", - "ip_network", - "libp2p", - "linked_hash_set", + "libp2p-identity", "log", - "mockall", + "mixnet", + "multiaddr", "parity-scale-codec", "parking_lot 0.12.1", - "partial_sort", - "pin-project", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "sp-api", + "sp-consensus", + "sp-core 25.0.0", + "sp-keystore 0.31.0", + "sp-mixnet", + "sp-runtime 28.0.0", + "thiserror", +] + +[[package]] +name = "sc-network" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01f519592a971199c486d412dbf38ba54096857080bf4b9d29c9ffabcfee3745" +dependencies = [ + "array-bytes 6.2.2", + "async-channel 1.9.0", + "async-trait", + "asynchronous-codec", + "bytes", + "either", + "fnv", + "futures", + "futures-timer", + "ip_network", + "libp2p", + "linked_hash_set", + "log", + "mockall", + "parity-scale-codec", + "parking_lot 0.12.1", + "partial_sort", + "pin-project", "rand 0.8.5", "sc-client-api", "sc-network-common", @@ -9554,10 +9689,10 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic", + "sp-arithmetic 20.0.0", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", "thiserror", "unsigned-varint", @@ -9567,11 +9702,11 @@ dependencies = [ [[package]] name = "sc-network-bitswap" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a0d247f576989cb2fe49df0511cbbd826f1e47b444848971e2bddec8f18a65" +checksum = "8fe63a55e03d8bc796ff1e94e7fb62a62acfd7a80a47865a97b55c13371c3e05" dependencies = [ - "async-channel", + "async-channel 1.9.0", "cid", "futures", "libp2p-identity", @@ -9581,16 +9716,16 @@ dependencies = [ "sc-client-api", "sc-network", "sp-blockchain", - "sp-runtime", + "sp-runtime 28.0.0", "thiserror", "unsigned-varint", ] [[package]] name = "sc-network-common" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418c79cea8ab5b43f5bbe7ee95da7d6490bdfedbe92a9b07a714ca4f09a2426" +checksum = "8d236686d15275e4aa49ca929a06fb6fac28aa70e35ee185b981036c149f9e9d" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -9601,16 +9736,16 @@ dependencies = [ "sc-consensus", "sp-consensus", "sp-consensus-grandpa", - "sp-runtime", + "sp-runtime 28.0.0", ] [[package]] name = "sc-network-gossip" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27a9e8b4e16ab5b67b1fe389349855a2946d3c9168df54afcafec5dd67cae4cd" +checksum = "b884a9f7cd348c4c1899c0bbf95237e39dffba4baec48d4b98c1046f6bb04fa5" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "futures", "futures-timer", "libp2p", @@ -9618,19 +9753,19 @@ dependencies = [ "sc-network", "sc-network-common", "schnellru", - "sp-runtime", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", "tracing", ] [[package]] name = "sc-network-light" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36fc98d43aa75eb0d0690af6a8c6a929318f6cb4bf1fc039410ece56c8bb5a9" +checksum = "aac888fd720ef8bb2ff7d2b7f7b2e54d17bb85a417cf1e1b6f0f64f7e644936d" dependencies = [ - "array-bytes", - "async-channel", + "array-bytes 6.2.2", + "async-channel 1.9.0", "futures", "libp2p-identity", "log", @@ -9640,19 +9775,19 @@ dependencies = [ "sc-client-api", "sc-network", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "thiserror", ] [[package]] name = "sc-network-sync" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d049b008a7353fc46cb45a1f6f68e5e5128442b6726cfd82da09cb676443e73" +checksum = "10c697aa8f52cf194b9f00113a7d0d3ce5d1456bedd6169a9caae10737f02907" dependencies = [ - "array-bytes", - "async-channel", + "array-bytes 6.2.2", + "async-channel 1.9.0", "async-trait", "fork-tree", "futures", @@ -9670,23 +9805,24 @@ dependencies = [ "sc-utils", "schnellru", "smallvec", - "sp-arithmetic", + "sp-arithmetic 20.0.0", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", "thiserror", + "tokio-stream", ] [[package]] name = "sc-network-transactions" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef6606f7705bc9c038c9e11715b7ddbdb2a5b43c12d8e3cc346e0b9927218e4" +checksum = "bb7c9bfc7b58ce229d1512158b8f13dc849ec24857d1c29a41a867fb8afb5c09" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "futures", "libp2p", "log", @@ -9695,17 +9831,17 @@ dependencies = [ "sc-network-common", "sc-utils", "sp-consensus", - "sp-runtime", + "sp-runtime 28.0.0", "substrate-prometheus-endpoint", ] [[package]] name = "sc-offchain" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9d2458e033256bca62b01e89369bb9a7d74a460b74a5e3786afc5db3f55b1c" +checksum = "47950facab8dedf71c39667ccce8834252944e8f091f3a3bcdfc0b4503573da4" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "bytes", "fnv", "futures", @@ -9725,20 +9861,20 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "sp-api", - "sp-core", - "sp-externalities", - "sp-keystore", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-keystore 0.31.0", "sp-offchain", - "sp-runtime", + "sp-runtime 28.0.0", "threadpool", "tracing", ] [[package]] name = "sc-proposer-metrics" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6fc35c74a42a49d4ea4df44f78ebbd5a744f9bdca3f4ea1d3d9e5e02b0e6ee7" +checksum = "221845dce4e7adb57eca5f73318699b377cff29aef92a586e71aa5cef62f879b" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9746,18 +9882,19 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede50e654b3e0c076bb9beb041612af80f07dfb883cc05d8aaae1c7a1bb72761" +checksum = "eb277280b6b3519e4a2e693b75d4ca516ebb4a928162e6a1791b217b2be60c9f" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.1", "sc-block-builder", "sc-chain-spec", "sc-client-api", + "sc-mixnet", "sc-rpc-api", "sc-tracing", "sc-transaction-pool-api", @@ -9765,11 +9902,11 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core", - "sp-keystore", + "sp-core 25.0.0", + "sp-keystore 0.31.0", "sp-offchain", "sp-rpc", - "sp-runtime", + "sp-runtime 28.0.0", "sp-session", "sp-statement-store", "sp-version", @@ -9778,32 +9915,33 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac4149b7427beed423006c78e0b75c0193ac01d6e66ff0dd8a1909747cf593" +checksum = "def499ac717db8442fe18543e52330d5f105027b666df73c0b38e81e9105078b" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.16.3", "parity-scale-codec", "sc-chain-spec", + "sc-mixnet", "sc-transaction-pool-api", "scale-info", "serde", "serde_json", - "sp-core", + "sp-core 25.0.0", "sp-rpc", - "sp-runtime", + "sp-runtime 28.0.0", "sp-version", "thiserror", ] [[package]] name = "sc-rpc-server" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a62b9c5bf359cd4923ce10d294532936aa68d0cd59e890a0414f6434397180b" +checksum = "9e8083e1b026dcf397f8c1122b3fba6cc744c6962996df6a30e0fb75223f7637" dependencies = [ "http", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "serde_json", "substrate-prometheus-endpoint", @@ -9814,15 +9952,15 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e770646ab839fb33dfeb7cbde94d98cdaf78526c70b10aa59ec5810953ff2a5" +checksum = "198ea9287111b4060ce1d70dce99804b99d1a92b5fb23a79d94bf0cb460ca3ce" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "futures", "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9833,8 +9971,8 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "sp-version", "thiserror", "tokio", @@ -9843,16 +9981,16 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c7fa14eaf48c44edff226ce9b18dc984c122e9deebbf825a8945be7c046ade" +checksum = "3623ae5bd7b089da9796a3f1edd974c94f34dd4b4b527146662ef409ae9cd38c" dependencies = [ "async-trait", "directories", "exit-future", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9886,16 +10024,16 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", "sp-session", - "sp-state-machine", - "sp-storage", + "sp-state-machine 0.32.0", + "sp-storage 17.0.0", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie", + "sp-trie 26.0.0", "sp-version", "static_init", "substrate-prometheus-endpoint", @@ -9908,21 +10046,21 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bc9266fdec30b59857e794fc329aa600aaa6ed46799f9df859a7e30c0ec34b" +checksum = "3635fe572adfe796886e18910c8b94f7ce67f9ae3e2c161176e122ddf0baa7e4" dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "sp-core", + "sp-core 25.0.0", ] [[package]] name = "sc-statement-store" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d73800507e32d92f804acfa379dc6b6e91e0a2a25ce853b3848eb8aea019ea98" +checksum = "58635973b3a8ca0a40c885b6bc1a61365e5424bf4312ef86963c799f50cfa15b" dependencies = [ "log", "parity-db", @@ -9931,8 +10069,8 @@ dependencies = [ "sc-keystore", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "sp-statement-store", "substrate-prometheus-endpoint", "tokio", @@ -9940,9 +10078,9 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff97437e564c0e7483d7e32384e3f6571f656728ea03a6e1b07a6325e064a76" +checksum = "60967710b85e650652832df73915b64c315f7b437e53c4635bd26106d6d05c21" dependencies = [ "futures", "libc", @@ -9953,16 +10091,16 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core", - "sp-io", - "sp-std", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-std 12.0.0", ] [[package]] name = "sc-telemetry" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46193a2979c86da75fc43276d222359757ea257b512fe6e4128e7a50b0bb22" +checksum = "28e214e4d46cac02321bc3dc6fd72f019ac10819d1ac8f24f6935a4ae74ef273" dependencies = [ "chrono", "futures", @@ -9980,9 +10118,9 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fcb4398268e83957ebbc84e6290307198e817caa47386135d3de6ba3316203a" +checksum = "83bcd745ea216ba0c0a344cff2c41b12e27846d5fca4b28f56ff77e1d3ff3634" dependencies = [ "ansi_term", "atty", @@ -9998,33 +10136,33 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core", + "sp-core 25.0.0", "sp-rpc", - "sp-runtime", - "sp-tracing", + "sp-runtime 28.0.0", + "sp-tracing 14.0.0", "thiserror", "tracing", - "tracing-log", + "tracing-log 0.1.4", "tracing-subscriber 0.2.25", ] [[package]] name = "sc-tracing-proc-macro" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71bd05d3f24c0c2489c57b90a76db883c23c25577718ca05c9b0181fd427f501" +checksum = "9c4ae9e4f957d7274ac6b59d667b66262caf6482dbb1b63f1c370528626b1272" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "sc-transaction-pool" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6af477c0e8a2698aabf442a3918313e8f096eb6695ceaaa7e12679c496d2826" +checksum = "6f6db45a057a619670e07deefb4e69aab83386f076363db424907da2b2e82590" dependencies = [ "async-trait", "futures", @@ -10039,9 +10177,9 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core", - "sp-runtime", - "sp-tracing", + "sp-core 25.0.0", + "sp-runtime 28.0.0", + "sp-tracing 14.0.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -10049,9 +10187,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f1b864d0ae8f1891eb310672c12fc160d24e37ef297d5ef0db257558fe13b1" +checksum = "1491607f296bb8cce09a5eb3a03320c60ad52bb8120127b26f69c32bcaccd8f2" dependencies = [ "async-trait", "futures", @@ -10059,25 +10197,92 @@ dependencies = [ "parity-scale-codec", "serde", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "thiserror", ] [[package]] name = "sc-utils" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8b01c8eed623f999d402e44679d42ad42586afd4638aaed38708a307b59f4d7" +checksum = "81a4769c82dde62b9243dcc166be52e0c5d2d61cf2599923271118d9c8b997b1" dependencies = [ - "async-channel", + "async-channel 1.9.0", "futures", "futures-timer", "lazy_static", "log", "parking_lot 0.12.1", "prometheus", - "sp-arithmetic", + "sp-arithmetic 20.0.0", +] + +[[package]] +name = "scale-bits" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7789f5728e4e954aaa20cadcc370b99096fb8645fca3c9333ace44bb18f30095" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-decode-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27873eb6005868f8cc72dcfe109fae664cf51223d35387bc2f28be4c28d94c47" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-encode" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-encode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-encode-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -10100,19 +10305,39 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "scale-value" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6538d1cc1af9c0baf401c57da8a6d4730ef582db0d330d2efa56ec946b5b0283" +dependencies = [ + "base58", + "blake2 0.10.6", + "derive_more", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "serde", + "yap", +] + [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -10130,7 +10355,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "cfg-if", "hashbrown 0.13.2", ] @@ -10145,14 +10370,40 @@ dependencies = [ "arrayvec 0.5.2", "curve25519-dalek 2.1.3", "getrandom 0.1.16", - "merlin", + "merlin 2.0.1", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle", + "subtle 2.5.0", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "844b7645371e6ecdf61ff246ba1958c29e802881a749ae3fb1993675d210d28d" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek-ng", + "merlin 3.0.0", + "rand_core 0.6.4", + "sha2 0.9.9", + "subtle-ng", "zeroize", ] +[[package]] +name = "scoped-futures" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1473e24c637950c9bd38763220bea91ec3e095a89f672bbd7a10d03e77ba467" +dependencies = [ + "cfg-if", + "pin-utils", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -10165,38 +10416,16 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - [[package]] name = "sec1" version = "0.3.0" @@ -10208,7 +10437,7 @@ dependencies = [ "generic-array 0.14.7", "pkcs8 0.9.0", "serdect", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -10222,7 +10451,7 @@ dependencies = [ "der 0.7.8", "generic-array 0.14.7", "pkcs8 0.10.2", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -10232,16 +10461,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" dependencies = [ - "secp256k1-sys 0.6.1", -] - -[[package]] -name = "secp256k1" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" -dependencies = [ - "secp256k1-sys 0.8.1", + "secp256k1-sys", ] [[package]] @@ -10253,15 +10473,6 @@ dependencies = [ "cc", ] -[[package]] -name = "secp256k1-sys" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" -dependencies = [ - "cc", -] - [[package]] name = "secrecy" version = "0.8.0" @@ -10348,29 +10559,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.190" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "cb0652c533506ad7a2e353cce269330d6afd8bdfb6d75e0ace5b35aacbd7b9e9" dependencies = [ "itoa", "ryu", @@ -10389,9 +10600,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -10432,11 +10643,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.27" +version = "0.9.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" +checksum = "a15e0ef66bf939a7c890a0bf6d5a733c70202225f9888a89ed5c62298b019129" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "itoa", "ryu", "serde", @@ -10568,9 +10779,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -10591,9 +10802,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" [[package]] name = "siphasher" @@ -10633,52 +10844,150 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" - -[[package]] -name = "snap" -version = "1.1.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] -name = "snow" -version = "0.9.3" +name = "smol" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +checksum = "13f2b548cd8447f8de0fdf1c592929f70f4fc7039a05e47404b0d096ec6987a1" dependencies = [ - "aes-gcm 0.9.4", - "blake2", - "chacha20poly1305", - "curve25519-dalek 4.1.1", - "rand_core 0.6.4", - "ring 0.16.20", - "rustc_version", - "sha2 0.10.8", - "subtle", + "async-channel 1.9.0", + "async-executor", + "async-fs", + "async-io 1.13.0", + "async-lock 2.8.0", + "async-net", + "async-process", + "blocking", + "futures-lite 1.13.0", ] [[package]] -name = "socket2" -version = "0.4.10" +name = "smoldot" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "1cce5e2881b30bad7ef89f383a816ad0b22c45915911f28499026de4a76d20ee" dependencies = [ - "libc", - "winapi", + "arrayvec 0.7.4", + "async-lock 2.8.0", + "atomic", + "base64 0.21.5", + "bip39", + "blake2-rfc", + "bs58 0.5.0", + "crossbeam-queue", + "derive_more", + "ed25519-zebra", + "either", + "event-listener 2.5.3", + "fnv", + "futures-channel", + "futures-util", + "hashbrown 0.14.3", + "hex", + "hmac 0.12.1", + "itertools 0.10.5", + "libsecp256k1", + "merlin 3.0.0", + "no-std-net 0.6.0", + "nom", + "num-bigint", + "num-rational", + "num-traits", + "pbkdf2 0.12.2", + "pin-project", + "rand 0.8.5", + "rand_chacha 0.3.1", + "ruzstd", + "schnorrkel 0.10.2", + "serde", + "serde_json", + "sha2 0.10.8", + "siphasher", + "slab", + "smallvec", + "smol", + "snow", + "soketto", + "tiny-keccak", + "twox-hash", + "wasmi", ] [[package]] -name = "socket2" -version = "0.5.5" +name = "smoldot-light" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "4b2f7b4687b83ff244ef6137735ed5716ad37dcdf3ee16c4eb1a32fb9808fa47" dependencies = [ - "libc", - "windows-sys 0.48.0", -] + "async-lock 2.8.0", + "blake2-rfc", + "derive_more", + "either", + "event-listener 2.5.3", + "fnv", + "futures-channel", + "futures-util", + "hashbrown 0.14.3", + "hex", + "itertools 0.10.5", + "log", + "lru", + "parking_lot 0.12.1", + "rand 0.8.5", + "serde", + "serde_json", + "siphasher", + "slab", + "smol", + "smoldot", +] + +[[package]] +name = "snap" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" + +[[package]] +name = "snow" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58021967fd0a5eeeb23b08df6cc244a4d4a5b4aec1d27c9e02fad1a58b4cd74e" +dependencies = [ + "aes-gcm", + "blake2 0.10.6", + "chacha20poly1305", + "curve25519-dalek 4.1.1", + "rand_core 0.6.4", + "ring 0.17.7", + "rustc_version", + "sha2 0.10.8", + "subtle 2.5.0", +] + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] [[package]] name = "soketto" @@ -10699,87 +11008,116 @@ dependencies = [ [[package]] name = "sp-api" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc5213210472ba2becdc094fbb9d30c4455753b1a608962797e1e971c3e5ec4" +checksum = "f582f92ce47c86e4ffffe81fdd5120fea7c850dc0800653a7fa203bcc1532335" dependencies = [ "hash-db", "log", "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core", - "sp-externalities", + "sp-core 25.0.0", + "sp-externalities 0.23.0", "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", - "sp-std", - "sp-trie", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", + "sp-std 12.0.0", + "sp-trie 26.0.0", "sp-version", "thiserror", ] [[package]] name = "sp-api-proc-macro" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e7f093302d30b9d35436db024376459bdc9da7530abcacf5d87c32a67d94fd" +checksum = "a896941b2d27365a6f937ebce11e36d55132dc32104f6a48b4cd765b55efd252" dependencies = [ "Inflector", - "blake2", + "blake2 0.10.6", "expander", - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "sp-application-crypto" -version = "26.0.0" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899492ea547816d5dfe9a5a2ecc32f65a7110805af6da3380aa4902371b31dc2" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-std 8.0.0", +] + +[[package]] +name = "sp-application-crypto" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93da025616ab59639f8e378df579c5aaa2c8b9999f328a0239156a57c991b53" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-std 12.0.0", +] + +[[package]] +name = "sp-arithmetic" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74454c936a45ac55c8de95b9fd8b5e38f8b43d97df8f4274dd6777b20d95569" +checksum = "bb6020576e544c6824a51d651bc8df8e6ab67cd59f1c9ac09868bb81a5199ded" dependencies = [ + "integer-sqrt", + "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-std", + "sp-std 8.0.0", + "static_assertions", ] [[package]] name = "sp-arithmetic" -version = "19.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e41f710a77e9debd1c9b80f862709dce648e50f0904cde4117488e7d11d4796d" +checksum = "f80b5c16afb61dde1037a469d570adcc686440036429e50abe2301ba9d61aad5" dependencies = [ "integer-sqrt", "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 12.0.0", "static_assertions", ] [[package]] name = "sp-block-builder" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6a066e310d4c0c240829d7bb5d6bd01dde55d03e15b665f0372b40952f37e6" +checksum = "6cd16df3d1cdad862d3e764f10f7675876b011e032907423fdfa377ae2ec8575" dependencies = [ "sp-api", "sp-inherents", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-blockchain" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f506119858f25a73ed9d61a2ead0d5b97b5141055b3b4a12b9b82e530b06c673" +checksum = "4932b97cde61874f395bab9b02443e3bd2046943abb280b63f83da9d0b623ea7" dependencies = [ "futures", "log", @@ -10789,70 +11127,70 @@ dependencies = [ "sp-api", "sp-consensus", "sp-database", - "sp-runtime", - "sp-state-machine", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "thiserror", ] [[package]] name = "sp-consensus" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e142e27f140d50701e613d925f61482fafccb7d90933ee30d7bae54d293ea3" +checksum = "2c5d7170fb7cfb18024ef7eeb40d272d22b9c3587d85cde2d091e8463b397f06" dependencies = [ "async-trait", "futures", "log", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "thiserror", ] [[package]] name = "sp-consensus-aura" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dcc6df7a006a55651d0e7bdf2d8d4583d5b917cb4b7b6a1331398e96307a883" +checksum = "643a7c486a645f398d219d1fbcc8a416cad5018164a212fefde5c2ef00a182e4" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "sp-api", - "sp-application-crypto", + "sp-application-crypto 27.0.0", "sp-consensus-slots", "sp-inherents", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-babe" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572374a1260687fa18481ccac58c4a64611df379fb1aa65389ce96c6661b3b05" +checksum = "268f9b2e36d4e136c09ad87876cdcfd7ff734cb5917f333fefebff248f95a24f" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "serde", "sp-api", - "sp-application-crypto", + "sp-application-crypto 27.0.0", "sp-consensus-slots", - "sp-core", + "sp-core 25.0.0", "sp-inherents", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "sp-timestamp", ] [[package]] name = "sp-consensus-grandpa" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d20516ed05a6a17f712050d6be385ca53c16b2d49938a29ca05e07f7aa5118" +checksum = "28bbee685900110419913f281ce0f29457fbc17418f00d15f0212c8043aba167" dependencies = [ "finality-grandpa", "log", @@ -10860,35 +11198,80 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", + "sp-application-crypto 27.0.0", + "sp-core 25.0.0", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-consensus-slots" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ebe1c46246a76af1105639c7434c1383d376fd45a8548fc18ed66dbf86f803c" +checksum = "895b0c176d4eead833ddee5251d3cccbaeb0191ca3f33f84b11d347bebc6e21f" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 12.0.0", "sp-timestamp", ] [[package]] name = "sp-core" -version = "24.0.0" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f18d9e2f67d8661f9729f35347069ac29d92758b59135176799db966947a7336" +dependencies = [ + "array-bytes 4.2.0", + "bitflags 1.3.2", + "blake2 0.10.6", + "bounded-collections", + "bs58 0.4.0", + "dyn-clonable", + "ed25519-zebra", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin 2.0.1", + "parity-scale-codec", + "parking_lot 0.12.1", + "paste", + "primitive-types", + "rand 0.8.5", + "regex", + "scale-info", + "schnorrkel 0.9.1", + "secp256k1", + "secrecy", + "serde", + "sp-core-hashing 9.0.0", + "sp-debug-derive 8.0.0", + "sp-externalities 0.19.0", + "sp-runtime-interface 17.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7921d278ed2aebbb21a644c96e09663dc49a6139d1e2e063c059dc9f866e149b" +checksum = "f9ebb090ead698a6df04347c86a31ba91a387edb8a58534ec70c4f977d1e1e87" dependencies = [ - "array-bytes", + "array-bytes 6.2.2", "bitflags 1.3.2", - "blake2", + "blake2 0.10.6", "bounded-collections", "bs58 0.5.0", "dyn-clonable", @@ -10900,7 +11283,7 @@ dependencies = [ "lazy_static", "libsecp256k1", "log", - "merlin", + "merlin 2.0.1", "parity-scale-codec", "parking_lot 0.12.1", "paste", @@ -10908,29 +11291,45 @@ dependencies = [ "rand 0.8.5", "regex", "scale-info", - "schnorrkel", - "secp256k1 0.24.3", + "schnorrkel 0.9.1", + "secp256k1", "secrecy", "serde", - "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-core-hashing 13.0.0", + "sp-debug-derive 12.0.0", + "sp-externalities 0.23.0", + "sp-runtime-interface 21.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", "ss58-registry", "substrate-bip39", "thiserror", "tiny-bip39", "tracing", + "w3f-bls", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "12.0.0" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee599a8399448e65197f9a6cee338ad192e9023e35e31f22382964c3c174c68" +dependencies = [ + "blake2b_simd", + "byteorder", + "digest 0.10.7", + "sha2 0.10.8", + "sha3", + "sp-std 8.0.0", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cb5c31aa385d6997a5b73fdc9837c1c0145559205198555c3000739a474767" +checksum = "cb8524f01591ee58b46cd83c9dbc0fcffd2fd730dabec4f59326cd58a00f17e2" dependencies = [ "blake2b_simd", "byteorder", @@ -10942,20 +11341,20 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4327a220777a8d492ed3d0bcd4c769cbb030301e7d4a2d9e09513d690c313b" +checksum = "42ce3e6931303769197da81facefa86159fa1085dcd96ecb7e7407b5b93582a0" dependencies = [ "quote", - "sp-core-hashing", - "syn 2.0.38", + "sp-core-hashing 13.0.0", + "syn 2.0.44", ] [[package]] name = "sp-database" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab25f79468af89010a8eb84e6bf56068b59929a55291c03519f47208360f3ebe" +checksum = "9c6e8c710d6a71512af6f42d9dba9c3d1f6ad793846480babf459bbde3d60a94" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10963,109 +11362,173 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "11.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f7d375610590566e11882bf5b5a4b8d0666a96ba86808b2650bbbd9be50bf8" +checksum = "c7f531814d2f16995144c74428830ccf7d94ff4a7749632b83ad8199b181140c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", +] + +[[package]] +name = "sp-debug-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50535e1a5708d3ba5c1195b59ebefac61cc8679c2c24716b87a86e8b7ed2e4a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.44", ] [[package]] name = "sp-externalities" -version = "0.22.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede074871514ca7c5d2eca9563515d858c6220b47ae815714ed4393a4e99db4a" +checksum = "a0f71c671e01a8ca60da925d43a1b351b69626e268b8837f8371e320cf1dd100" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884d05160bc89d0943d1c9fb8006c3d44b80f37f8af607aeff8d4d9cc82e279a" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 12.0.0", + "sp-storage 17.0.0", ] [[package]] name = "sp-genesis-builder" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b9f0251a09b578393f3297abe54a29abdb7e93c17e89a88dc1cabb8e2d5a2d" +checksum = "a0cb71d40ad47e40bdcce5ae5531c7d7ba579cd495a0e0413642fb063fa66f84" dependencies = [ "serde_json", "sp-api", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-inherents" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439882da80e9bcfd1ba53df7ec5070d4d7f2a9a93f988aa3598f99ee5bfc76eb" +checksum = "604229aa145be0cff853b47ffed8bc2c62eb08ec6974d6307b9a559c378e6dc5" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "thiserror", ] [[package]] name = "sp-io" -version = "26.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88fb6e281de5054565f07a9f79504d21133e115db549993c99f1b21236c677a5" +checksum = "9d597e35a9628fe7454b08965b2442e3ec0f264b0a90d41328e87422cec02e99" dependencies = [ "bytes", - "ed25519-dalek", + "ed25519 1.5.3", + "ed25519-dalek 1.0.1", + "futures", "libsecp256k1", "log", "parity-scale-codec", "rustversion", - "secp256k1 0.24.3", - "sp-core", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-tracing", - "sp-trie", + "secp256k1", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "sp-keystore 0.27.0", + "sp-runtime-interface 17.0.0", + "sp-state-machine 0.28.0", + "sp-std 8.0.0", + "sp-tracing 10.0.0", + "sp-trie 22.0.0", "tracing", "tracing-core", ] [[package]] -name = "sp-keyring" +name = "sp-io" version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f09927534d2233e135e4b4a0c758554d0ff66178f6e9cfba2e151dfeac97b3" +checksum = "0ced350da15e8ba3a106206840acc42a6d3eb0d7e8bf7aa43ab00eac0bdf956f" +dependencies = [ + "bytes", + "ed25519-dalek 2.1.0", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-keystore 0.31.0", + "sp-runtime-interface 21.0.0", + "sp-state-machine 0.32.0", + "sp-std 12.0.0", + "sp-tracing 14.0.0", + "sp-trie 26.0.0", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "655ec0b35cb9cb9029fb323aa676b07d58deb872cecc7566e50278409a00ee95" dependencies = [ "lazy_static", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.30.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9f19e773319d96223ce8dba960267e6cb977907537a8f738746ceb86592413" +checksum = "9be3cdd67cc1d9c1db17c5cbc4ec4924054a8437009d167f21f6590797e4aa45" +dependencies = [ + "futures", + "parity-scale-codec", + "parking_lot 0.12.1", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "thiserror", +] + +[[package]] +name = "sp-keystore" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8ec5ebbba70bee83d79c3fe5e49f12df0a4bb6029858ddf9a15eea7539a592" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", - "sp-core", - "sp-externalities", + "sp-core 25.0.0", + "sp-externalities 0.23.0", "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377a0e22a104a1a83804562fba6702537af6a36df9ee2049c89c3be9148b42b1" +checksum = "8846768f036429227e49f6ab523fbee4bc6edfee278a361bf27999590fe020d4" dependencies = [ "thiserror", "zstd 0.12.4", @@ -11073,32 +11536,56 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0dec8af38c68358600da59cf14424e1230fe9ae1d4b4f64a098288145c0775" +checksum = "7ca9ff0e522a74725ac92f009d38deeb12e880f5296afbd78a6c6b970b773278" dependencies = [ - "frame-metadata", + "frame-metadata 16.0.0", "parity-scale-codec", "scale-info", - "sp-std", + "sp-std 12.0.0", +] + +[[package]] +name = "sp-mixnet" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf61f28ca97aab6c21a3c6e0ed496e60d505e5de1f43fd4ba748c9afaa4fc85" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto 27.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-offchain" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b1501eb4ede6471162ff48c85ccabb21434b698c8b61e2651f85c00bc1656f" +checksum = "9310227f043ed99877b0449a683025a7461431a00995dcd6ef423a273d0fd85d" dependencies = [ "sp-api", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", ] [[package]] name = "sp-panic-handler" -version = "11.0.0" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd2de46003fa8212426838ca71cd42ee36a26480ba9ffea983506ce03131033" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-panic-handler" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd099ba2d6c1bfe5d0c79aa56e440fa3c9257eadfc0c782c09cdc2122b1e60ed" +checksum = "b00e40857ed3e0187f145b037c733545c5633859f1bd1d1b09deb52805fa696a" dependencies = [ "backtrace", "lazy_static", @@ -11107,20 +11594,20 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8534ae0a6043f70a93054bf0d3da27436637a8134ed44667c360e7a955cb3d" +checksum = "51867fea921f54bbaa2bf505f373559b5f3b80e8d7f38ecb9677f0d3795a3e6a" dependencies = [ "rustc-hash", "serde", - "sp-core", + "sp-core 25.0.0", ] [[package]] name = "sp-runtime" -version = "27.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c0641e1a9d340960b562bcceea1457680fd0e109fc1040f8f5364fd7bc2506" +checksum = "21c5bfc764a1a8259d7e8f7cfd22c84006275a512c958d3ff966c92151e134d5" dependencies = [ "either", "hash256-std-hasher", @@ -11131,82 +11618,158 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-std", - "sp-weights", + "sp-application-crypto 23.0.0", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", + "sp-io 23.0.0", + "sp-std 8.0.0", + "sp-weights 20.0.0", +] + +[[package]] +name = "sp-runtime" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9c40ff7303e62219b55635e5245d963358cb77d6916250991ebcb82c0be2c6" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "scale-info", + "serde", + "sp-application-crypto 27.0.0", + "sp-arithmetic 20.0.0", + "sp-core 25.0.0", + "sp-io 27.0.0", + "sp-std 12.0.0", + "sp-weights 24.0.0", ] [[package]] name = "sp-runtime-interface" -version = "20.0.0" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e676128182f90015e916f806cba635c8141e341e7abbc45d25525472e1bbce8" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.19.0", + "sp-runtime-interface-proc-macro 11.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", + "sp-tracing 10.0.0", + "sp-wasm-interface 14.0.0", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17a4030ad93f05c93f2cc294c74bc5fea227f90fb3d1426d4a6f165e017fb7ea" +checksum = "4f365332922a8cfa98ab00c6d08b1b0f24e159e730dd554e720d950ff3371b1f" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.23.0", + "sp-runtime-interface-proc-macro 15.0.0", + "sp-std 12.0.0", + "sp-storage 17.0.0", + "sp-tracing 14.0.0", + "sp-wasm-interface 18.0.0", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "14.0.0" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d5bd5566fe5633ec48dfa35ab152fd29f8a577c21971e1c6db9f28afb9bbb9" +dependencies = [ + "Inflector", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 2.0.44", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b232943ee7ca83a6d56face33b8af12e9fb470a15a53835f4e12a6e452a41c1c" +checksum = "9b2afcbd1bd18d323371111b66b7ac2870bdc1c86c3d7b0dae67b112ca52b4d8" dependencies = [ "Inflector", - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "sp-session" -version = "23.0.0" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd062688577cc54493ba6f58383bfed89c66d5ef7b7c3747293b0da06c7f795" +checksum = "248dd8f49aa96b56bf0a7d513691ddb4194f9359fdb93e94397eabdef1036085" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core", - "sp-keystore", - "sp-runtime", + "sp-core 25.0.0", + "sp-keystore 0.31.0", + "sp-runtime 28.0.0", "sp-staking", - "sp-std", + "sp-std 12.0.0", ] [[package]] name = "sp-staking" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3b2a4a7aa67a9adb2a8f49ed516f6694b5fa70792ab9b0125934b1c8cdc2e3" +checksum = "ee0feed0137234598bd1f76d0b468c585ea16619ea9ed1acbba82dd24ac79788" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", - "sp-std", + "sp-core 25.0.0", + "sp-runtime 28.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-state-machine" -version = "0.31.0" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef45d31f9e7ac648f8899a0cd038a3608f8499028bff55b6c799702592325b6" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "smallvec", + "sp-core 21.0.0", + "sp-externalities 0.19.0", + "sp-panic-handler 8.0.0", + "sp-std 8.0.0", + "sp-trie 22.0.0", + "thiserror", + "tracing", +] + +[[package]] +name = "sp-state-machine" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf4c76bea1a9e4a2e79afe70f42f1d368a8a45308e58f19bfd755c5ddb2b4a3" +checksum = "96e087fa4430befd2047b61d912c9d6fa4eaed408c4b58b46c6e9acd7965f2d3" dependencies = [ "hash-db", "log", @@ -11214,83 +11777,122 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "smallvec", - "sp-core", - "sp-externalities", - "sp-panic-handler", - "sp-std", - "sp-trie", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-panic-handler 12.0.0", + "sp-std 12.0.0", + "sp-trie 26.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", ] [[package]] name = "sp-statement-store" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a11bbdc403457dd7a850078936aa7cc753c617b7bbeba5f5766ce5a55b2bf124" +checksum = "4b8654bcd37602b1811414050d34d14f543873bd4e64e50d210a0116b660c600" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "curve25519-dalek 4.1.1", - "ed25519-dalek", + "ed25519-dalek 2.1.0", "hkdf", "parity-scale-codec", "rand 0.8.5", "scale-info", "sha2 0.10.8", "sp-api", - "sp-application-crypto", - "sp-core", - "sp-externalities", - "sp-runtime", - "sp-runtime-interface", - "sp-std", + "sp-application-crypto 27.0.0", + "sp-core 25.0.0", + "sp-externalities 0.23.0", + "sp-runtime 28.0.0", + "sp-runtime-interface 21.0.0", + "sp-std 12.0.0", "thiserror", "x25519-dalek 2.0.0", ] +[[package]] +name = "sp-std" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53458e3c57df53698b3401ec0934bea8e8cfce034816873c0b0abbd83d7bac0d" + [[package]] name = "sp-std" version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c91d32e165d08a14098ce5ec923eaec59d1d0583758a18a770beec1b780b0d0" +[[package]] +name = "sp-std" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54c78c5a66682568cc7b153603c5d01a2cc8f5c221c7b1e921517a0eef18ae05" + [[package]] name = "sp-storage" -version = "16.0.0" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94294be83f11d4958cfea89ed5798f0b6605f5defc3a996948848458abbcc18e" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] + +[[package]] +name = "sp-storage" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9660ecd48314443e73ad0f44d58b76426666a1343d72f6f65664e174da9244" +checksum = "016f20812cc51bd479cc88d048c35d44cd3adde4accdb159d49d6050f2953595" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 12.0.0", + "sp-std 12.0.0", ] [[package]] name = "sp-timestamp" -version = "22.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0ab4b6b2d31db93e7da68894ccb7c5a305524cea051109820b958361d162be" +checksum = "004a7f453240db80b2967c0e1c6411836efc7daa7afae98fd16202caa51460e0" dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "thiserror", ] [[package]] name = "sp-tracing" -version = "13.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69a61948986d2a9f8d67d60884ff0277d910df09ebe08d0e1f309da777516453" +checksum = "357f7591980dd58305956d32f8f6646d0a8ea9ea0e7e868e46f53b68ddf00cec" dependencies = [ "parity-scale-codec", - "sp-std", + "sp-std 8.0.0", + "tracing", + "tracing-core", + "tracing-subscriber 0.2.25", +] + +[[package]] +name = "sp-tracing" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d727cb5265641ffbb7d4e42c18b63e29f6cfdbd240aae3bcf093c3d6eb29a19" +dependencies = [ + "parity-scale-codec", + "sp-std 12.0.0", "tracing", "tracing-core", "tracing-subscriber 0.2.25", @@ -11298,37 +11900,61 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "22.0.0" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7cd2afe89c474339d15d06e73639171ebe4d280be6904d9349072103da21427" +dependencies = [ + "sp-api", + "sp-runtime 28.0.0", +] + +[[package]] +name = "sp-transaction-storage-proof" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ea9c85f85f52e0a49c3f2ec6cff952fdc3ffe8392bebe21ed30eddd8d059c5" +checksum = "39ae7c4954431b8479f7b2b6b82f0551cc360a1ee59b6a5276eef86a1099eaed" dependencies = [ - "sp-api", - "sp-runtime", + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-core 25.0.0", + "sp-inherents", + "sp-runtime 28.0.0", + "sp-std 12.0.0", + "sp-trie 26.0.0", ] [[package]] -name = "sp-transaction-storage-proof" +name = "sp-trie" version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a2d2d676a4c8e9ff18cb43782ed557d00de28ee9fb090842a8510e4a7ce0a7" +checksum = "48e4eeb7ef23f79eba8609db79ef9cef242f994f1f87a3c0387b4b5f177fda74" dependencies = [ - "async-trait", + "ahash 0.8.7", + "hash-db", + "hashbrown 0.13.2", + "lazy_static", + "memory-db", + "nohash-hasher", "parity-scale-codec", + "parking_lot 0.12.1", "scale-info", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-trie", + "schnellru", + "sp-core 21.0.0", + "sp-std 8.0.0", + "thiserror", + "tracing", + "trie-db 0.27.1", + "trie-root", ] [[package]] name = "sp-trie" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb2d292eb90452dcb0909fb44e74bf04395e3ffa37a66c0f1635a00600382a4" +checksum = "1e359b358263cc322c3f678c272a3a519621d9853dcfa1374dfcbdb5f54c6f85" dependencies = [ - "ahash 0.8.6", + "ahash 0.8.7", "hash-db", "hashbrown 0.13.2", "lazy_static", @@ -11336,21 +11962,22 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", + "rand 0.8.5", "scale-info", "schnellru", - "sp-core", - "sp-std", + "sp-core 25.0.0", + "sp-std 12.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", "trie-root", ] [[package]] name = "sp-version" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125da59ea46ecb23860e7d895f6f2882f596b71ffca0ae4887558aac541f4342" +checksum = "3e93da332eba3cb59a65f128da5edd5c70e1475692b45470104e7465b1278471" dependencies = [ "impl-serde", "parity-scale-codec", @@ -11358,52 +11985,82 @@ dependencies = [ "scale-info", "serde", "sp-core-hashing-proc-macro", - "sp-runtime", - "sp-std", + "sp-runtime 28.0.0", + "sp-std 12.0.0", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92897ffa04436cbd100c49ea1f8b637cb68e2a9fe144115f4b545b5ace2f47e2" +checksum = "49535d8c7184dab46d15639c68374a30cbb1534e392fa09a1ebb059a993ad436" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "sp-wasm-interface" -version = "17.0.0" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19c122609ca5d8246be6386888596320d03c7bc880959eaa2c36bcd5acd6846" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 8.0.0", + "wasmtime 8.0.1", +] + +[[package]] +name = "sp-wasm-interface" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43bb0c8eb76dc41057ce0fb6b744b94c9aec28b31dff53a1efc4f04ef25384" +checksum = "d5d85813d46a22484cdf5e5afddbbe85442dd1b4d84d67a8c7792f92f9f93607" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", + "sp-std 12.0.0", "wasmtime 8.0.1", ] [[package]] name = "sp-weights" -version = "23.0.0" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45d084c735544f70625b821c3acdbc7a2fc1893ca98b85f1942631284692c75b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 16.0.0", + "sp-core 21.0.0", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] + +[[package]] +name = "sp-weights" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1cef0aad13ed8a8522a6e86ace16fb97ab220c16d2357e628352b528582693" +checksum = "751676c1263e7f3600af16bad26a7978a816bc532676fe05eafa23b862c05b9e" dependencies = [ "parity-scale-codec", "scale-info", "serde", "smallvec", - "sp-arithmetic", - "sp-core", - "sp-debug-derive", - "sp-std", + "sp-arithmetic 20.0.0", + "sp-core 25.0.0", + "sp-debug-derive 12.0.0", + "sp-std 12.0.0", ] [[package]] @@ -11420,9 +12077,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spinners" -version = "4.1.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" +checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" dependencies = [ "lazy_static", "maplit", @@ -11441,9 +12098,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der 0.7.8", @@ -11457,9 +12114,9 @@ checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" [[package]] name = "ss58-registry" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" +checksum = "35935738370302d5e33963665b77541e4b990a3e919ec904c837a56cfc891de1" dependencies = [ "Inflector", "num-format", @@ -11563,26 +12220,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.38", -] - -[[package]] -name = "stun" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" -dependencies = [ - "base64 0.13.1", - "crc", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util", + "syn 2.0.44", ] [[package]] @@ -11593,26 +12231,26 @@ checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" dependencies = [ "hmac 0.11.0", "pbkdf2 0.8.0", - "schnorrkel", + "schnorrkel 0.9.1", "sha2 0.9.9", "zeroize", ] [[package]] name = "substrate-build-script-utils" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78127cdb5849eed7399ff9c730faea57c2a4e148e3b46e565abe98248432feb9" +checksum = "8a3b7556a62d77b7b8abc34e425817f6f563c2f2aa7142f1c4e93e6422156cc1" [[package]] name = "substrate-frame-rpc-system" -version = "24.0.0" +version = "25.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5978d5bc95506e7770fe7de97610db13ee72dd1e242894d4843587dc5954102" +checksum = "4c241af714c378075b1185e574202cbb9105e849b8c9ea44ef87880bdb3e9a75" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "parity-scale-codec", "sc-rpc-api", @@ -11620,15 +12258,15 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core", - "sp-runtime", + "sp-core 25.0.0", + "sp-runtime 28.0.0", ] [[package]] name = "substrate-prometheus-endpoint" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e99fe4e955b8d7c25bd3a88a6907933867d11ef6194ef935e865a9e87c320ff" +checksum = "ededbe617291db8a47d6e5155486ff1e5425f0bbf5dcb7f752730466a62bd293" dependencies = [ "hyper", "log", @@ -11639,23 +12277,23 @@ dependencies = [ [[package]] name = "substrate-rpc-client" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624257055386482adba21684a4af2cebdbaf0a8dd0e1b7cd9eec05b564afa5db" +checksum = "5575c2bef89385e5406565b8fe5620856d414e3846c60927a78f0788cb288c8c" dependencies = [ "async-trait", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "sc-rpc-api", "serde", - "sp-runtime", + "sp-runtime 28.0.0", ] [[package]] name = "substrate-wasm-builder" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a23975404eca6d81818f3f3d4ecde9635dae3e616f366dbc1a0d510c86f02a2" +checksum = "12ab1707dbbd129622b771a9b80b25f0ebf1c04854b907bc44b51ec96fb4005b" dependencies = [ "ansi_term", "build-helper", @@ -11671,19 +12309,119 @@ dependencies = [ ] [[package]] -name = "substring" -version = "1.4.5" +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + +[[package]] +name = "subxt" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" +checksum = "588b8ce92699eeb06290f4fb02dad4f7e426c4e6db4d53889c6bcbc808cf24ac" dependencies = [ - "autocfg", + "async-trait", + "base58", + "blake2 0.10.6", + "derivative", + "either", + "frame-metadata 16.0.0", + "futures", + "hex", + "impl-serde", + "jsonrpsee 0.20.3", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 21.0.0", + "sp-core-hashing 9.0.0", + "sp-runtime 24.0.0", + "subxt-lightclient", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", ] [[package]] -name = "subtle" -version = "2.4.1" +name = "subxt-codegen" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98f5a534c8d475919e9c845d51fc2316da4fcadd04fe17552d932d2106de930e" +dependencies = [ + "frame-metadata 16.0.0", + "heck", + "hex", + "jsonrpsee 0.20.3", + "parity-scale-codec", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn 2.0.44", + "thiserror", + "tokio", +] + +[[package]] +name = "subxt-lightclient" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10fd0ac9b091211f962b6ae19e26cd08e0b86efa064dfb7fac69c8f79f122329" +dependencies = [ + "futures", + "futures-util", + "serde", + "serde_json", + "smoldot-light", + "thiserror", + "tokio", + "tokio-stream", + "tracing", +] + +[[package]] +name = "subxt-macro" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12e8be9ab6fe88b8c13edbe15911e148482cfb905a8b8d5b8d766a64c54be0bd" +dependencies = [ + "darling 0.20.3", + "proc-macro-error", + "subxt-codegen", + "syn 2.0.44", +] + +[[package]] +name = "subxt-metadata" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "b6898275765d36a37e5ef564358e0341cf41b5f3a91683d7d8b859381b65ac8a" +dependencies = [ + "frame-metadata 16.0.0", + "parity-scale-codec", + "scale-info", + "sp-core-hashing 9.0.0", + "thiserror", +] [[package]] name = "syn" @@ -11698,9 +12436,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "92d27c2c202598d05175a6dd3af46824b7f747f8d8e9b14c623f19fa5069735d" dependencies = [ "proc-macro2", "quote", @@ -11771,22 +12509,22 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.21", - "windows-sys 0.48.0", + "rustix 0.38.28", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] @@ -11822,22 +12560,42 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "b2cd5904763bad08ad5513ddbb12cf2ae273ca53fa9f68e843e236ec6dfccc09" dependencies = [ "thiserror-impl", ] [[package]] -name = "thiserror-impl" +name = "thiserror-core" +version = "1.0.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c001ee18b7e5e3f62cbf58c7fe220119e68d902bb7443179c0c8aef30090e999" +dependencies = [ + "thiserror-core-impl", +] + +[[package]] +name = "thiserror-core-impl" version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.44", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcf4a824cce0aeacd6f38ae6f24234c8e80d68632338ebaa1443b5df9e29e19" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -11897,9 +12655,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -11917,9 +12675,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -11992,9 +12750,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.33.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -12022,13 +12780,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -12058,7 +12816,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.8", + "rustls 0.21.10", "tokio", ] @@ -12125,14 +12883,26 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -12143,7 +12913,20 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -12248,7 +13031,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] @@ -12276,7 +13059,7 @@ dependencies = [ "serde_json", "tokio", "tracing", - "tracing-subscriber 0.3.17", + "tracing-subscriber 0.3.18", "version", ] @@ -12301,6 +13084,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -12330,15 +13124,15 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.4", "tracing-serde", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers 0.1.0", "nu-ansi-term", @@ -12351,10 +13145,23 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-serde", ] +[[package]] +name = "trie-db" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +dependencies = [ + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-db" version = "0.28.0" @@ -12425,18 +13232,18 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "try-runtime-cli" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30562bc5a4beccd52cc4091607830fa0b77c1ce09d55b47f232c8b3d03e23fa" +checksum = "845090aa8572116b06813914fc1d09448fe895d82982b63d58de4f91b4eb79b6" dependencies = [ "async-trait", - "clap 4.4.7", + "clap 4.4.12", "frame-remote-externalities", "frame-try-runtime", "hex", @@ -12449,19 +13256,19 @@ dependencies = [ "sp-api", "sp-consensus-aura", "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", + "sp-core 25.0.0", + "sp-debug-derive 12.0.0", + "sp-externalities 0.23.0", "sp-inherents", - "sp-io", - "sp-keystore", + "sp-io 27.0.0", + "sp-keystore 0.31.0", "sp-rpc", - "sp-runtime", - "sp-state-machine", + "sp-runtime 28.0.0", + "sp-state-machine 0.32.0", "sp-timestamp", "sp-transaction-storage-proof", "sp-version", - "sp-weights", + "sp-weights 24.0.0", "substrate-rpc-client", "zstd 0.12.4", ] @@ -12491,25 +13298,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring 0.16.20", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" @@ -12563,9 +13351,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -12594,16 +13382,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" -dependencies = [ - "generic-array 0.14.7", - "subtle", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -12611,14 +13389,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "unsigned-varint" @@ -12655,12 +13433,12 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -12701,16 +13479,16 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", ] [[package]] name = "uuid" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.11", "serde", ] @@ -12750,7 +13528,7 @@ checksum = "28084ac780b443e7f3514df984a2933bd3ab39e71914d951cdf8e4d298a7c9bc" dependencies = [ "async-trait", "bytes", - "derive_builder 0.12.0", + "derive_builder", "http", "reqwest", "rustify", @@ -12786,6 +13564,30 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "w3f-bls" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +dependencies = [ + "ark-bls12-377", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-serialize-derive", + "arrayref", + "constcat", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.8", + "sha3", + "thiserror", + "zeroize", +] + [[package]] name = "wait-timeout" version = "0.2.0" @@ -12795,15 +13597,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waitgroup" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" -dependencies = [ - "atomic-waker", -] - [[package]] name = "waker-fn" version = "1.1.1" @@ -12843,9 +13636,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -12853,24 +13646,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -12880,9 +13673,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -12890,22 +13683,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-instrument" @@ -12918,9 +13711,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.114.2" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effbef3bd1dde18acb401f73e740a6f3d4a1bc651e9773bddc512fe4d8d68f67" +checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", @@ -12934,9 +13727,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.114.2" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09e24eb283919ace2ed5733bda4842a59ce4c8de110ef5c6d98859513d17047" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" dependencies = [ "anyhow", "cxx", @@ -12946,9 +13739,9 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.114.2" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f2f817bed2e8d65eb779fa37317e74de15585751f903c9118342d1970703a4" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" dependencies = [ "anyhow", "cc", @@ -12971,6 +13764,38 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmi" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51fb5c61993e71158abf5bb863df2674ca3ec39ed6471c64f07aeaf751d67b4" +dependencies = [ + "intx", + "smallvec", + "spin 0.9.8", + "wasmi_arena", + "wasmi_core", + "wasmparser-nostd", +] + +[[package]] +name = "wasmi_arena" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "401c1f35e413fac1846d4843745589d9ec678977ab35a384db8ae7830525d468" + +[[package]] +name = "wasmi_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624e6333e861ef49095d2d678b76ebf30b06bf37effca845be7e5b87c90071b7" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + [[package]] name = "wasmparser" version = "0.102.0" @@ -12991,6 +13816,15 @@ dependencies = [ "semver 1.0.20", ] +[[package]] +name = "wasmparser-nostd" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +dependencies = [ + "indexmap-nostd", +] + [[package]] name = "wasmtime" version = "8.0.1" @@ -13304,7 +14138,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", "rustix 0.36.17", @@ -13328,7 +14162,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", "rustix 0.37.27", @@ -13365,31 +14199,21 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "webpki" version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -13399,222 +14223,14 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.4", + "webpki", ] [[package]] name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring 0.16.20", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.8", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes", - "derive_builder 0.11.2", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.3", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring 0.16.20", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.8", - "signature 1.6.4", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid 1.5.0", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.10", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes", - "crc", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1", - "subtle", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix 0.24.3", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi", -] +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -13625,7 +14241,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.21", + "rustix 0.38.28", ] [[package]] @@ -13644,6 +14260,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +[[package]] +name = "wildmatch" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495ec47bf3c1345005f40724f0269362c8556cbc43aed0526ed44cae1d35fceb" + [[package]] name = "winapi" version = "0.3.9" @@ -13681,7 +14303,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", + "windows-core 0.51.1", "windows-targets 0.48.5", ] @@ -13694,6 +14316,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -13712,6 +14343,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -13742,6 +14382,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -13754,6 +14409,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -13766,6 +14427,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -13778,6 +14445,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -13790,6 +14463,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -13802,6 +14481,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -13814,6 +14499,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -13826,11 +14517,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] @@ -13877,38 +14574,19 @@ dependencies = [ "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring 0.16.20", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", @@ -13916,11 +14594,13 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" dependencies = [ "libc", + "linux-raw-sys 0.4.12", + "rustix 0.38.28", ] [[package]] @@ -13952,6 +14632,12 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4524214bc4629eba08d78ceb1d6507070cc0bcbbed23af74e19e6e924a24cf" + [[package]] name = "yasna" version = "0.5.2" @@ -13963,29 +14649,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.20" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd66a62464e3ffd4e37bd09950c2b9dd6c4f8767380fabba0d523f9a775bc85a" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.20" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255c4596d41e6916ced49cfafea18727b24d67878fa180ddfd69b9df34fd1726" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -13998,7 +14684,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.44", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3339dacdf..c219bd027 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,19 +8,19 @@ members = [ "crates/chronicle-domain", "crates/chronicle-domain-lint", "crates/chronicle-domain-test", - "crates/chronicle-protocol", "crates/chronicle-synth", "crates/chronicle-signing", "crates/chronicle-telemetry", "crates/gq-subscribe", "crates/id-provider", - "crates/opa-tp", - "crates/opa-tp-protocol", - "crates/opactl", - "crates/sawtooth-tp", "crates/pallet-chronicle", + "crates/pallet-opa", "node/runtime-chronicle", "node/node-chronicle", + "crates/embedded-substrate", + "crates/runtime-api-chronicle", + "crates/protocol-substrate-chronicle", + "crates/protocol-substrate-opa", ] [workspace.dependencies] @@ -29,16 +29,12 @@ anyhow = "1.0.6" assert_fs = "1.0" async-graphql = "5.0.9" async-graphql-poem = "5.0.9" -async-stl-client = { git = "https://github.com/btpworks/async-stl-sdk" } async-stream = "0.3.3" async-trait = "0.1.61" backoff = { version = "0.4.0", features = ["futures", "tokio"] } base64 = "0.21" bytes = "1.3.0" cached = "0.42" -frame-support = "24.0.0" -frame-system = "24.0.0" -frame-benchmarking = "24.0.0" cfg-if = "1.0.0" chronicle-signing = { path = "crates/chronicle-signing" } chrono = "0.4.26" @@ -53,14 +49,13 @@ criterion = { version = "0.5.1", features = ["async_futures", "async_tokio"] } crossbeam = "0.8.1" custom_error = "1.9.2" derivative = "2.2.0" -diesel = { version = "2.0.0-rc.0", features = [ - "postgres", - "uuid", - "chrono", - "r2d2", -] } -diesel_migrations = { version = "2.0.0-rc.0", features = ["postgres"] } +diesel = { version = "2.1", features = ["postgres", "uuid", "chrono", "r2d2"] } +diesel-async = { version = "0.4" } +diesel_migrations = { version = "2.1", features = ["postgres"] } dotenvy = "0.15" +frame-benchmarking = "24.0.0" +frame-support = "24.0.0" +frame-system = "24.0.0" futures = "0.3.21" genco = "0.16.1" glob = "0.3.0" @@ -80,6 +75,7 @@ k256 = { version = "0.11.3", features = [ "ecdsa", "pkcs8", "sha256", + "keccak256", "std", "pem", "serde", @@ -87,11 +83,14 @@ k256 = { version = "0.11.3", features = [ lazy_static = "1.4.0" locspan = "0.7" lru = "0.11" +macro-attr-2018 = "3.0.0" maplit = "1.0.2" metrics = "0.21.0" metrics-exporter-prometheus = "0.12.1" mime = "0.3" +mobc = "0.8" mockito = "1.1" +newtype-derive-2018 = "0.2.1" oauth2 = "4.4" opa = { git = "https://github.com/tamasfe/opa-rs", rev = "3cf7fea" } openssl = { version = "0.10" } @@ -127,7 +126,6 @@ rust-embed = { version = "6.6.0", features = [ "debug-embed", "include-exclude", ] } -sawtooth-sdk = { git = "https://github.com/hyperledger/sawtooth-sdk-rust", rev = "5a300de" } secret-vault = { version = "1.8", features = [] } secret-vault-value = "0.3" serde = "1.0.152" @@ -135,10 +133,9 @@ serde_derive = "1.0.152" serde_json = "1.0.93" serde_yaml = "0.9.14" shellexpand = "3.0.0" -macro-attr-2018 = "3.0.0" -newtype-derive-2018 = "0.2.1" temp-dir = "0.1.11" tempfile = "3.4.0" +testcontainers = "0.14" thiserror = "1.0" tmq = "0.3" tokio = { version = "1.27", features = [ @@ -166,4 +163,3 @@ uuid = "1.2.2" valico = "3.6.0" vaultrs = "*" zmq = { version = "0.9", features = ["vendored"] } -testcontainers = "0.14" diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml index c0295433b..d745c9966 100644 --- a/crates/api/Cargo.toml +++ b/crates/api/Cargo.toml @@ -6,6 +6,7 @@ version = "0.7.5" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = { workspace = true } async-graphql = { workspace = true, features = [ "opentelemetry", "chrono", @@ -14,20 +15,24 @@ async-graphql = { workspace = true, features = [ "uuid", ] } async-graphql-poem = { workspace = true } -async-stl-client = { workspace = true } async-stream = { workspace = true } async-trait = { workspace = true } base64 = { workspace = true } cached = { workspace = true } cfg-if = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } chronicle-signing = { workspace = true } chronicle-telemetry = { path = "../chronicle-telemetry" } chrono = { workspace = true } -common = { path = "../common" } +common = { path = "../common", features = [ + "json-ld", + "diesel-bindings", + "graphql-bindings", + "std", +] } custom_error = { workspace = true } derivative = { workspace = true } diesel = { workspace = true } +diesel-async = { workspace = true } diesel_migrations = { workspace = true } futures = { workspace = true } glob = { workspace = true } @@ -45,12 +50,13 @@ poem = { workspace = true } portpicker = { workspace = true } prost = { workspace = true } protobuf = { workspace = true } +protocol-substrate-chronicle = { path = "../protocol-substrate-chronicle" } +protocol-substrate-opa = { path = "../protocol-substrate-opa" } r2d2 = { workspace = true } rand = { workspace = true } rand_core = { workspace = true } reqwest = { workspace = true } -sawtooth-sdk = { workspace = true } -sawtooth_tp = { path = "../sawtooth-tp" } +rust-embed = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true } @@ -64,11 +70,9 @@ user-error = { workspace = true } uuid = { workspace = true } [dev-dependencies] -assert_fs = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } -insta = { workspace = true, features = ["json", "yaml"] } -opa-tp-protocol = { path = "../opa-tp-protocol" } -tempfile = { workspace = true } +assert_fs = { workspace = true } +insta = { workspace = true, features = ["json", "yaml"] } +tempfile = { workspace = true } [build-dependencies] diff --git a/crates/api/src/chronicle_graphql/mod.rs b/crates/api/src/chronicle_graphql/mod.rs index e2b80a510..0aba39f7b 100644 --- a/crates/api/src/chronicle_graphql/mod.rs +++ b/crates/api/src/chronicle_graphql/mod.rs @@ -1,3 +1,4 @@ +use crate::opa::{ExecutorContext, OpaExecutorError}; use async_graphql::{ extensions::OpenTelemetry, http::{playground_source, GraphQLPlaygroundConfig, ALL_WEBSOCKET_PROTOCOLS}, @@ -12,9 +13,8 @@ use chrono::NaiveDateTime; use common::{ identity::{AuthId, IdentityError, JwtClaims, OpaData, SignedIdentity}, ledger::{SubmissionError, SubmissionStage}, - opa::{ExecutorContext, OpaExecutorError}, prov::{ - to_json_ld::ToJson, ChronicleIri, ChronicleTransactionId, ExternalId, ExternalIdPart, + json_ld::ToJson, ChronicleIri, ChronicleTransactionId, ExternalId, ExternalIdPart, ProvModel, }, }; @@ -292,10 +292,7 @@ impl From for CommitIdentity { CommitIdentity { identity: identity.identity, signature: identity.signature.map(|x| hex::encode(&*x)).unwrap_or_default(), - verifying_key: identity - .verifying_key - .map(|x| hex::encode(x.to_bytes())) - .unwrap_or_default(), + verifying_key: identity.verifying_key.map(|x| hex::encode(x)).unwrap_or_default(), } } } @@ -810,8 +807,8 @@ impl IriEndpoint { .body("failed to compact JSON response")) }, }, - Err(StoreError::Db(diesel::result::Error::NotFound)) - | Err(StoreError::RecordNotFound) => { + Err(StoreError::Db(diesel::result::Error::NotFound)) | + Err(StoreError::RecordNotFound) => { tracing::debug!("not found: {prov_type} {} in {ns}", id.external_id_part()); Ok(poem::Response::builder() .status(StatusCode::NOT_FOUND) @@ -875,9 +872,8 @@ impl IriEndpoint { match ChronicleIri::from_str(&ns_iri.iri) { Ok(iri) => Ok(Ok((ns_iri.ns.into(), iri))), - Err(error) => { - Ok(Err(Response::builder().status(StatusCode::NOT_FOUND).body(error.to_string()))) - }, + Err(error) => + Ok(Err(Response::builder().status(StatusCode::NOT_FOUND).body(error.to_string()))), } } @@ -888,24 +884,21 @@ impl IriEndpoint { claims: Option<&JwtClaims>, ) -> poem::Result { match self.parse_ns_iri_from_uri_path(req).await? { - Ok((ns, ChronicleIri::Activity(id))) => { + Ok((ns, ChronicleIri::Activity(id))) => self.response_for_query(claims, "activity", &id, &ns, |mut conn, id, ns| { self.store.prov_model_for_activity_id(&mut conn, id, ns) }) - .await - }, - Ok((ns, ChronicleIri::Agent(id))) => { + .await, + Ok((ns, ChronicleIri::Agent(id))) => self.response_for_query(claims, "agent", &id, &ns, |mut conn, id, ns| { self.store.prov_model_for_agent_id(&mut conn, id, ns) }) - .await - }, - Ok((ns, ChronicleIri::Entity(id))) => { + .await, + Ok((ns, ChronicleIri::Entity(id))) => self.response_for_query(claims, "entity", &id, &ns, |mut conn, id, ns| { self.store.prov_model_for_entity_id(&mut conn, id, ns) }) - .await - }, + .await, Ok(_) => Ok(poem::Response::builder() .status(StatusCode::NOT_FOUND) .body("may query only: activity, agent, entity")), diff --git a/crates/api/src/chronicle_graphql/mutation.rs b/crates/api/src/chronicle_graphql/mutation.rs index 43c806858..e96255ff9 100644 --- a/crates/api/src/chronicle_graphql/mutation.rs +++ b/crates/api/src/chronicle_graphql/mutation.rs @@ -1,10 +1,9 @@ //! Primitive mutation operations that are not in terms of particular domain types - +use crate::commands::{ActivityCommand, AgentCommand, ApiCommand, ApiResponse, EntityCommand}; use async_graphql::Context; use chrono::{DateTime, Utc}; use common::{ attributes::Attributes, - commands::{ActivityCommand, AgentCommand, ApiCommand, ApiResponse, EntityCommand}, identity::AuthId, prov::{operations::DerivationType, ActivityId, AgentId, EntityId, Role}, }; diff --git a/crates/api/src/commands.rs b/crates/api/src/commands.rs index 3719d38fc..baf77e4f6 100644 --- a/crates/api/src/commands.rs +++ b/crates/api/src/commands.rs @@ -1,4 +1,5 @@ use core::pin::Pin; +use std::{path::PathBuf, sync::Arc}; #[cfg(feature = "std")] use std::{path::PathBuf, sync::Arc}; @@ -7,7 +8,7 @@ use futures::AsyncRead; use serde::{Deserialize, Serialize}; -use crate::{ +use common::{ attributes::Attributes, prov::{ operations::{ChronicleOperation, DerivationType}, @@ -16,13 +17,6 @@ use crate::{ }, }; -#[cfg(not(feature = "std"))] -use parity_scale_codec::{ - alloc::boxed::Box, alloc::string::String, alloc::sync::Arc, alloc::vec::Vec, -}; -#[cfg(not(feature = "std"))] -use scale_info::prelude::*; - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum NamespaceCommand { Create { external_id: ExternalId }, @@ -47,7 +41,6 @@ pub enum AgentCommand { role: Option, }, } - #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ActivityCommand { Create { @@ -156,8 +149,7 @@ impl ActivityCommand { #[derive(Clone)] pub enum PathOrFile { Path(PathBuf), - File(Arc>>), /* Non serialisable variant, used in - * process */ + File(Arc>>), } impl core::fmt::Debug for PathOrFile { diff --git a/crates/api/src/inmem.rs b/crates/api/src/inmem.rs deleted file mode 100644 index 73d0b8aa4..000000000 --- a/crates/api/src/inmem.rs +++ /dev/null @@ -1,405 +0,0 @@ -use async_stl_client::{ - error::SawtoothCommunicationError, - ledger::SawtoothLedger, - zmq_client::{HighestBlockValidatorSelector, ZmqRequestResponseSawtoothChannel}, -}; -use chronicle_protocol::address::{FAMILY, VERSION}; -use protobuf::{self, Message, ProtobufEnum}; - -use chronicle_protocol::{messages::ChronicleSubmitTransaction, protocol::ChronicleOperationEvent}; -use chronicle_sawtooth_tp::tp::ChronicleTransactionHandler; -use futures::{select, FutureExt, SinkExt, StreamExt}; -use sawtooth_sdk::{ - messages::{ - block::{Block, BlockHeader}, - client_batch_submit::{ - ClientBatchSubmitRequest, ClientBatchSubmitResponse, ClientBatchSubmitResponse_Status, - }, - client_block::{ - ClientBlockGetByNumRequest, ClientBlockGetResponse, ClientBlockGetResponse_Status, - ClientBlockListResponse, ClientBlockListResponse_Status, - }, - client_event::{ClientEventsSubscribeResponse, ClientEventsSubscribeResponse_Status}, - client_state::{ - ClientStateGetRequest, ClientStateGetResponse, ClientStateGetResponse_Status, - }, - processor::TpProcessRequest, - transaction::TransactionHeader, - validator::Message_MessageType, - }, - processor::handler::{ContextError, TransactionContext, TransactionHandler}, -}; -use serde_json::Value; -use std::{ - cell::RefCell, - collections::BTreeMap, - net::{Ipv4Addr, SocketAddr}, - sync::{Arc, Mutex}, - thread::{self}, -}; -use tmq::{router, Context, Multipart}; -use tokio::runtime; -use tokio_stream::wrappers::UnboundedReceiverStream; -use tracing::{debug, error, info, instrument}; -use uuid::Uuid; - -type TestTxEvents = Vec<(String, Vec<(String, String)>, Vec)>; - -pub trait SimulatedSawtoothBehavior { - fn handle_request( - &self, - message_type: Message_MessageType, - request: Vec, - ) -> Result<(Message_MessageType, Vec), SawtoothCommunicationError>; -} - -pub type InMemLedger = SawtoothLedger< - ZmqRequestResponseSawtoothChannel, - ChronicleOperationEvent, - ChronicleSubmitTransaction, ->; - -pub struct SimulatedTransactionContext { - pub state: RefCell>>, - pub events: RefCell, - tx: tokio::sync::mpsc::UnboundedSender)>>, -} - -impl SimulatedTransactionContext { - pub fn new( - tx: tokio::sync::mpsc::UnboundedSender)>>, - ) -> Self { - Self { state: RefCell::new(BTreeMap::new()), events: RefCell::new(vec![]), tx } - } - - pub fn new_with_state( - tx: tokio::sync::mpsc::UnboundedSender)>>, - state: BTreeMap>, - ) -> Self { - Self { state: state.into(), events: RefCell::new(vec![]), tx } - } - - pub fn readable_state(&self) -> Vec<(String, Value)> { - // Deal with the fact that policies are raw bytes, but meta data and - // keys are json - - self.state - .borrow() - .iter() - .map(|(k, v)| { - let as_string = String::from_utf8(v.clone()).unwrap(); - if serde_json::from_str::(&as_string).is_ok() { - (k.clone(), serde_json::from_str(&as_string).unwrap()) - } else { - (k.clone(), serde_json::to_value(v.clone()).unwrap()) - } - }) - .collect() - } -} - -impl TransactionContext for SimulatedTransactionContext { - fn add_receipt_data( - self: &SimulatedTransactionContext, - _data: &[u8], - ) -> Result<(), ContextError> { - unimplemented!() - } - - #[instrument(skip(self))] - fn add_event( - self: &SimulatedTransactionContext, - event_type: String, - attributes: Vec<(String, String)>, - data: &[u8], - ) -> Result<(), ContextError> { - let stl_event = sawtooth_sdk::messages::events::Event { - event_type: event_type.clone(), - attributes: attributes - .iter() - .map(|(k, v)| sawtooth_sdk::messages::events::Event_Attribute { - key: k.clone(), - value: v.clone(), - ..Default::default() - }) - .collect(), - data: data.to_vec(), - ..Default::default() - }; - let list = sawtooth_sdk::messages::events::EventList { - events: vec![stl_event].into(), - ..Default::default() - }; - let stl_event = list.write_to_bytes().unwrap(); - - self.tx.send(Some((Message_MessageType::CLIENT_EVENTS, stl_event))).unwrap(); - - self.events.borrow_mut().push((event_type, attributes, data.to_vec())); - - Ok(()) - } - - fn delete_state_entries( - self: &SimulatedTransactionContext, - _addresses: &[std::string::String], - ) -> Result, ContextError> { - unimplemented!() - } - - fn get_state_entries( - &self, - addresses: &[String], - ) -> Result)>, ContextError> { - Ok(self - .state - .borrow() - .iter() - .filter(|(k, _)| addresses.contains(k)) - .map(|(k, v)| (k.clone(), v.clone())) - .collect()) - } - - fn set_state_entries( - self: &SimulatedTransactionContext, - entries: Vec<(String, Vec)>, - ) -> std::result::Result<(), sawtooth_sdk::processor::handler::ContextError> { - for entry in entries { - self.state.borrow_mut().insert(entry.0, entry.1); - } - - Ok(()) - } -} - -#[derive(Clone)] -pub struct WellBehavedBehavior { - handler: Arc, - context: Arc>, -} - -impl SimulatedSawtoothBehavior for WellBehavedBehavior { - #[instrument(skip(self, request))] - fn handle_request( - &self, - message_type: Message_MessageType, - request: Vec, - ) -> Result<(Message_MessageType, Vec), SawtoothCommunicationError> { - match message_type { - // Batch submit request, decode and apply the transactions - // in the batch - Message_MessageType::CLIENT_BATCH_SUBMIT_REQUEST => { - let mut req = ClientBatchSubmitRequest::parse_from_bytes(&request).unwrap(); - let batch = req.take_batches().into_iter().next().unwrap(); - - debug!(received_batch = ?batch, transactions = ?batch.transactions); - - // Convert transaction into TpProcessRequest - for tx in batch.transactions { - let req = TpProcessRequest { - payload: tx.get_payload().to_vec(), - header: Some(TransactionHeader::parse_from_bytes(tx.get_header()).unwrap()) - .into(), - signature: tx.get_header_signature().to_string(), - ..Default::default() - }; - - self.handler.as_ref().apply(&req, &mut *self.context.lock().unwrap()).unwrap(); - } - let mut response = ClientBatchSubmitResponse::new(); - response.set_status(ClientBatchSubmitResponse_Status::OK); - let mut buf = vec![]; - response.write_to_vec(&mut buf).unwrap(); - Ok((Message_MessageType::CLIENT_BATCH_SUBMIT_RESPONSE, buf)) - }, - Message_MessageType::CLIENT_BLOCK_GET_BY_NUM_REQUEST => { - let req = ClientBlockGetByNumRequest::parse_from_bytes(&request).unwrap(); - debug!(get_block=?req); - let mut response = ClientBlockGetResponse::new(); - let block_header = BlockHeader { - block_num: req.get_block_num(), - previous_block_id: hex::encode([0; 32]), - ..Default::default() - }; - let block_header_bytes = block_header.write_to_bytes().unwrap(); - response.set_block(Block { header: block_header_bytes, ..Default::default() }); - response.set_status(ClientBlockGetResponse_Status::OK); - let mut buf = vec![]; - response.write_to_vec(&mut buf).unwrap(); - Ok((Message_MessageType::CLIENT_BLOCK_GET_RESPONSE, buf)) - }, - // Always respond with a block height of one - Message_MessageType::CLIENT_BLOCK_LIST_REQUEST => { - let mut response = ClientBlockListResponse::new(); - let block_header = BlockHeader { block_num: 1, ..Default::default() }; - let block_header_bytes = block_header.write_to_bytes().unwrap(); - response.set_blocks( - vec![Block { header: block_header_bytes, ..Default::default() }].into(), - ); - response.set_status(ClientBlockListResponse_Status::OK); - let mut buf = vec![]; - response.write_to_vec(&mut buf).unwrap(); - Ok((Message_MessageType::CLIENT_BLOCK_LIST_RESPONSE, buf)) - }, - // We can just return Ok here, no need to fake routing - Message_MessageType::CLIENT_EVENTS_SUBSCRIBE_REQUEST => { - let mut response = ClientEventsSubscribeResponse::new(); - response.set_status(ClientEventsSubscribeResponse_Status::OK); - let mut buf = vec![]; - response.write_to_vec(&mut buf).unwrap(); - Ok((Message_MessageType::CLIENT_EVENTS_SUBSCRIBE_RESPONSE, buf)) - }, - Message_MessageType::CLIENT_STATE_GET_REQUEST => { - let mut request = ClientStateGetRequest::parse_from_bytes(&request).unwrap(); - let address = request.take_address(); - - let state = self.context.lock().unwrap().get_state_entries(&[address]).unwrap(); - - let mut response = ClientStateGetResponse { - status: ClientStateGetResponse_Status::OK, - ..Default::default() - }; - - if state.is_empty() { - response.set_status(ClientStateGetResponse_Status::NO_RESOURCE); - } else { - response.set_value(state[0].1.clone()); - } - - let mut buf = vec![]; - response.write_to_vec(&mut buf).unwrap(); - Ok((Message_MessageType::CLIENT_STATE_GET_RESPONSE, buf)) - }, - _ => panic!("Unexpected message type {} received", message_type as i32), - } - } -} - -pub struct EmbeddedChronicleTp { - pub ledger: InMemLedger, - context: Arc>, -} - -impl EmbeddedChronicleTp { - pub fn new_with_state( - state: BTreeMap>, - ) -> Result { - let (tx, rx) = tokio::sync::mpsc::unbounded_channel(); - - let context = Arc::new(Mutex::new(SimulatedTransactionContext::new_with_state(tx, state))); - - let (policy, entrypoint) = ("allow_transactions", "allow_transactions.allowed_users"); - - let handler = Arc::new(ChronicleTransactionHandler::new(policy, entrypoint).unwrap()); - - let behavior = WellBehavedBehavior { handler, context: context.clone() }; - - let listen_port = portpicker::pick_unused_port().expect("No ports free"); - let listen_addr = SocketAddr::new(Ipv4Addr::new(127, 0, 0, 1).into(), listen_port); - let connect_addr = SocketAddr::new(Ipv4Addr::new(127, 0, 0, 1).into(), listen_port); - - let behavior_clone = behavior; - thread::spawn(move || { - let rt = runtime::Builder::new_current_thread() - .enable_io() - .enable_time() - .build() - .unwrap(); - let mut rx = UnboundedReceiverStream::new(rx); - let local = tokio::task::LocalSet::new(); - - let task = local.run_until(async move { - tokio::task::spawn_local(async move { - let (mut router_tx, mut router_rx) = router(&Context::new()) - .bind(&format!("tcp://{}", listen_addr)) - .unwrap() - .split(); - - debug!(listen_addr = ?listen_addr, "Embedded TP listening"); - let mut last_address = vec![]; - loop { - select! { - message = router_rx.next().fuse() => { - if message.is_none() { - break; - } - - let multipart = message.unwrap().unwrap(); - - last_address = multipart[0].to_vec(); - let request: async_stl_client::messages::Message = - async_stl_client::prost::Message::decode(&*multipart[1].to_vec()).map_err(|e| error!(%e)).unwrap(); - - debug!(request = ?request); - - let response = behavior_clone - .handle_request( - Message_MessageType::from_i32(request.message_type).unwrap(), - request.content, - ) - .unwrap(); - - let message_wrapper = async_stl_client::messages::Message { - message_type: response.0 as i32, - tx_id: request.tx_id, - content: response.1 - }; - - let mut multipart = Multipart::default(); - multipart.push_back(last_address.clone().into()); - multipart.push_back(tmq::Message::from(prost::Message::encode_to_vec(&message_wrapper))); - - debug!(response = ?multipart); - router_tx.send(multipart).await.ok(); - }, - unsolicited_message = rx.next().fuse() => { - if unsolicited_message.is_none() { - break; - } - tracing::trace!(unsolicited_message=?unsolicited_message); - - let unsolicited_message = unsolicited_message.unwrap().unwrap(); - debug!(unsolicited_message = ?unsolicited_message); - let message_wrapper = async_stl_client::messages::Message { - message_type: unsolicited_message.0 as i32, - tx_id: "".to_string(), - content: unsolicited_message.1 - }; - let mut multipart = Multipart::default(); - multipart.push_back(last_address.clone().into()); - - multipart.push_back(tmq::Message::from(prost::Message::encode_to_vec(&message_wrapper))); - router_tx.send(multipart).await.ok(); - }, - complete => { - info!("close embedded router"); - } - } - } - }) - .await - }); - rt.block_on(task).ok(); - }); - - Ok(Self { - ledger: InMemLedger::new( - ZmqRequestResponseSawtoothChannel::new( - &format!("test_{}", Uuid::new_v4()), - &[connect_addr], - HighestBlockValidatorSelector, - )?, - FAMILY, - VERSION, - ), - context, - }) - } - - pub fn new() -> Result { - Self::new_with_state(BTreeMap::new()) - } - - pub fn readable_state(&self) -> Vec<(String, Value)> { - self.context.lock().unwrap().readable_state() - } -} diff --git a/crates/api/src/lib.rs b/crates/api/src/lib.rs index c835fa9d6..cfbf2b661 100644 --- a/crates/api/src/lib.rs +++ b/crates/api/src/lib.rs @@ -1,18 +1,10 @@ #![cfg_attr(feature = "strict", deny(warnings))] pub mod chronicle_graphql; -pub mod inmem; +mod commands; +mod opa; mod persistence; -use async_stl_client::{ - error::SawtoothCommunicationError, - ledger::{BlockId, BlockingLedgerWriter, FromBlock}, -}; -use chronicle_protocol::{ - async_stl_client::ledger::{LedgerReader, LedgerWriter}, - messages::ChronicleSubmitTransaction, - protocol::ChronicleOperationEvent, -}; -use chronicle_signing::{ChronicleSigning, SecretError}; +use chronicle_signing::{ChronicleKnownKeyNamesSigner, ChronicleSigning, SecretError}; use chrono::{DateTime, Utc}; use diesel::{r2d2::ConnectionManager, PgConnection}; @@ -21,20 +13,19 @@ use futures::{select, FutureExt, StreamExt}; use common::{ attributes::Attributes, - commands::*, - identity::{AuthId, IdentityError}, - ledger::{Commit, SubmissionError, SubmissionStage, SubscriptionError}, + identity::{AuthId, IdentityError, SignedIdentity}, + ledger::{Commit, SubmissionError, SubmissionStage}, prov::{ + json_ld::ToJson, operations::{ ActivityExists, ActivityUses, ActsOnBehalfOf, AgentExists, ChronicleOperation, CreateNamespace, DerivationType, EndActivity, EntityDerive, EntityExists, SetAttributes, StartActivity, WasAssociatedWith, WasAttributedTo, WasGeneratedBy, WasInformedBy, }, - to_json_ld::ToJson, - ActivityId, AgentId, ChronicleIri, ChronicleTransaction, ChronicleTransactionId, - Contradiction, EntityId, ExternalId, ExternalIdPart, NamespaceId, ProcessorError, - ProvModel, Role, UuidPart, SYSTEM_ID, SYSTEM_UUID, + ActivityId, AgentId, ChronicleIri, ChronicleTransactionId, Contradiction, EntityId, + ExternalId, ExternalIdPart, NamespaceId, ProcessorError, ProvModel, Role, UuidPart, + SYSTEM_ID, SYSTEM_UUID, }, }; @@ -42,12 +33,15 @@ use metrics::histogram; use metrics_exporter_prometheus::PrometheusBuilder; pub use persistence::StoreError; use persistence::{Store, MIGRATIONS}; +use protocol_substrate_chronicle::{ + protocol::{BlockId, FromBlock, LedgerReader, LedgerWriter}, + SubstrateEvent, SubstrateTransaction, SubxtClientError, +}; use r2d2::Pool; use std::{ convert::Infallible, marker::PhantomData, net::AddrParseError, - sync::Arc, time::{Duration, Instant}, }; use thiserror::Error; @@ -58,10 +52,10 @@ use tokio::{ use tracing::{debug, error, info, info_span, instrument, trace, warn, Instrument}; +use commands::*; pub use persistence::ConnectionOptions; use user_error::UFE; use uuid::Uuid; - #[derive(Error, Debug)] pub enum ApiError { #[error("Storage: {0:?}")] @@ -76,9 +70,6 @@ pub enum ApiError { #[error("JSON-LD processing: {0}")] JsonLD(String), - #[error("Ledger error: {0}")] - Ledger(#[from] SubmissionError), - #[error("Signing: {0}")] Signing(#[from] SecretError), @@ -106,26 +97,26 @@ pub enum ApiError { #[error("Blocking thread pool: {0}")] Join(#[from] JoinError), - #[error("State update subscription: {0}")] - Subscription(#[from] SubscriptionError), - #[error("No appropriate activity to end")] NotCurrentActivity, - #[error("Contradiction: {0}")] - Contradiction(#[from] Contradiction), - #[error("Processor: {0}")] ProcessorError(#[from] ProcessorError), #[error("Identity: {0}")] IdentityError(#[from] IdentityError), - #[error("Sawtooth communication error: {0}")] - SawtoothCommunicationError(#[from] SawtoothCommunicationError), - #[error("Authentication endpoint error: {0}")] AuthenticationEndpoint(#[from] chronicle_graphql::AuthorizationError), + + #[error("Substrate : {0}")] + ClientError(#[from] SubxtClientError), + + #[error("Submission : {0}")] + Submission(#[from] SubmissionError), + + #[error("Contradiction: {0}")] + Contradiction(Contradiction), } /// Ugly but we need this until ! is stable, see @@ -135,10 +126,16 @@ impl From for ApiError { } } +impl From for ApiError { + fn from(x: Contradiction) -> Self { + Self::Contradiction(x) + } +} + impl UFE for ApiError {} type LedgerSendWithReply = - (ChronicleSubmitTransaction, Sender>); + (SubstrateTransaction, Sender>); type ApiSendWithReply = ((ApiCommand, AuthId), Sender>); @@ -150,25 +147,27 @@ pub trait UuidGen { pub trait ChronicleSigned { /// Get the user identity's [`SignedIdentity`] - pub fn signed_identity( + fn signed_identity( &self, store: &S, ) -> Result; } -impl ChronicleSigned for Identity { - pub fn signed_identity( +impl ChronicleSigned for AuthId { + fn signed_identity( &self, store: &S, ) -> Result { - let buf = serde_json::to_string(self)?.as_bytes().to_vec(); - - futures::executor::block_on(async move { - SignedIdentity::new( - self, - store.chronicle_sign(&buf).await?, - store.chronicle_verifying().await?, - ) + let signable = self.to_string(); + let signature = futures::executor::block_on(store.chronicle_sign(signable.as_bytes())) + .map_err(|e| IdentityError::Signing(e.into()))?; + let public_key = futures::executor::block_on(store.chronicle_verifying()) + .map_err(|e| IdentityError::Signing(e.into()))?; + + Ok(SignedIdentity { + identity: signable, + signature: signature.into(), + verifying_key: Some(public_key.to_bytes().to_vec()), }) } } @@ -176,7 +175,7 @@ impl ChronicleSigned for Identity { #[derive(Clone)] pub struct Api< U: UuidGen + Send + Sync + Clone, - W: LedgerWriter + W: LedgerWriter + Clone + Send + Sync @@ -185,7 +184,7 @@ pub struct Api< _reply_tx: Sender, submit_tx: tokio::sync::broadcast::Sender, signing: ChronicleSigning, - ledger_writer: Arc>, + ledger_writer: W, store: persistence::Store, uuid_source: PhantomData, policy_name: Option, @@ -283,12 +282,12 @@ fn install_prometheus_metrics_exporter() { impl Api where U: UuidGen + Send + Sync + Clone + core::fmt::Debug + 'static, - LEDGER: LedgerWriter + LEDGER: LedgerWriter + Clone + Send + Sync + 'static - + LedgerReader, + + LedgerReader, { #[instrument(skip(ledger))] pub async fn new( @@ -338,7 +337,7 @@ where _reply_tx: commit_tx.clone(), submit_tx: commit_notify_tx.clone(), signing, - ledger_writer: Arc::new(BlockingLedgerWriter::new(ledger)), + ledger_writer: ledger, store: store.clone(), uuid_source: PhantomData, policy_name, @@ -347,9 +346,7 @@ where loop { let state_updates = reuse_reader.clone(); - let state_updates = state_updates - .state_updates("chronicle/prov-update", start_from_block, None) - .await; + let state_updates = state_updates.state_updates(start_from_block, None).await; if let Err(e) = state_updates { error!(subscribe_to_events = ?e); @@ -370,27 +367,27 @@ where } // Ledger contradicted or error, so nothing to // apply, but forward notification - Some((ChronicleOperationEvent(Err(e), id),tx,_block_id,_position, _span)) => { + Some((SubstrateEvent::Contradicted{contradiction,identity,..},tx,_block_id,_position, _span)) => { commit_notify_tx.send(SubmissionStage::not_committed( - ChronicleTransactionId::from(tx.as_str()),e.clone(), id + tx,contradiction, identity )).ok(); }, // Successfully committed to ledger, so apply // to db and broadcast notification to // subscription subscribers - Some((ChronicleOperationEvent(Ok(ref commit), id,),tx,block_id,_position,_span )) => { + Some((SubstrateEvent::Committed{ref diff, ref identity, ..},tx,block_id,_position,_span )) => { debug!(committed = ?tx); - debug!(delta = %serde_json::to_string_pretty(&commit.to_json().compact().await.unwrap()).unwrap()); + debug!(delta = %serde_json::to_string_pretty(&diff.to_json().compact().await.unwrap()).unwrap()); - api.sync( commit.clone().into(), &block_id,ChronicleTransactionId::from(tx.as_str())) - .instrument(info_span!("Incoming confirmation", offset = ?block_id, tx_id = %tx)) + api.sync( diff.clone().into(), &block_id,tx ) + .instrument(info_span!("Incoming confirmation", offset = ?block_id, tx = %tx)) .await .map_err(|e| { error!(?e, "Api sync to confirmed commit"); }).map(|_| commit_notify_tx.send(SubmissionStage::committed(Commit::new( - ChronicleTransactionId::from(tx.as_str()),block_id, Box::new(commit.clone()) - ), id )).ok()) + tx,block_id.to_string(), Box::new(diff.clone()) + ), identity.clone() )).ok()) .ok(); }, } @@ -450,12 +447,11 @@ where }; match stage { - SubmissionStage::Submitted(Ok(id)) => { + SubmissionStage::Submitted(Ok(id)) => if id == tx_id { debug!("Depth charge operation submitted: {id}"); continue; - } - }, + }, SubmissionStage::Submitted(Err(err)) => { if err.tx_id() == &tx_id { error!("Depth charge transaction rejected by Chronicle: {} {}", @@ -510,30 +506,22 @@ where /// This is a measure to keep the api interface stable once this is introduced fn submit_blocking( &mut self, - tx: &ChronicleTransaction, + tx: SubstrateTransaction, ) -> Result { - let res = self.ledger_writer.submit(&ChronicleSubmitTransaction { - tx: tx.clone(), - signer: self.signing.clone(), - policy_name: self.policy_name.clone(), - }); + let (submission, id) = futures::executor::block_on(self.ledger_writer.pre_submit(tx))?; + let res = futures::executor::block_on(self.ledger_writer.do_submit(submission)); match res { Ok(tx_id) => { - let tx_id = ChronicleTransactionId::from(tx_id.as_str()); self.submit_tx.send(SubmissionStage::submitted(&tx_id)).ok(); Ok(tx_id) }, - Err((Some(tx_id), e)) => { + Err((e, id)) => { // We need the cloneable SubmissionError wrapper here - let submission_error = SubmissionError::communication( - &ChronicleTransactionId::from(tx_id.as_str()), - e, - ); + let submission_error = SubmissionError::communication(&id, e.into()); self.submit_tx.send(SubmissionStage::submitted_error(&submission_error)).ok(); Err(submission_error.into()) }, - Err((None, e)) => Err(e.into()), } } @@ -546,8 +534,10 @@ where to_apply: Vec, ) -> Result { let identity = identity.signed_identity(&self.signing)?; - let model = ProvModel::from_tx(&to_apply)?; - let tx_id = self.submit_blocking(&ChronicleTransaction::new(to_apply, identity))?; + let model = ProvModel::from_tx(&to_apply).map_err(ApiError::Contradiction)?; + let tx_id = self.submit_blocking(futures::executor::block_on( + SubstrateTransaction::new(&self.signing, identity, to_apply), + )?)?; Ok(ApiResponse::submission(id, model, tx_id)) } @@ -568,8 +558,9 @@ where let mut transactions = Vec::::with_capacity(to_apply.len()); for op in to_apply { let mut applied_model = match op { - ChronicleOperation::CreateNamespace(CreateNamespace { external_id, .. }) => { - let (namespace, _) = self.ensure_namespace(connection, external_id)?; + ChronicleOperation::CreateNamespace(CreateNamespace { id, .. }) => { + let (namespace, _) = + self.ensure_namespace(connection, id.external_id_part())?; model.namespace_context(&namespace); model }, @@ -866,14 +857,7 @@ where let uuid = U::uuid(); let id: NamespaceId = NamespaceId::from_external_id(external_id, uuid); - Ok(( - id.clone(), - vec![ChronicleOperation::CreateNamespace(CreateNamespace::new( - id, - external_id, - uuid, - ))], - )) + Ok((id.clone(), vec![ChronicleOperation::CreateNamespace(CreateNamespace::new(id))])) } else { Ok((ns?.0, vec![])) } @@ -1188,9 +1172,13 @@ where ChronicleOperation::StartActivity(StartActivity { namespace: namespace.clone(), id: id.clone(), - time: Utc::now(), + time: Utc::now().into(), + }), + ChronicleOperation::EndActivity(EndActivity { + namespace, + id, + time: Utc::now().into(), }), - ChronicleOperation::EndActivity(EndActivity { namespace, id, time: Utc::now() }), ]; api.submit_depth_charge(identity, to_apply) }) @@ -1203,29 +1191,27 @@ where to_apply: Vec, ) -> Result { let identity = identity.signed_identity(&self.signing)?; - let tx_id = self.submit_blocking(&ChronicleTransaction::new(to_apply, identity))?; + let tx_id = self.submit_blocking(futures::executor::block_on( + SubstrateTransaction::new(&self.signing, identity, to_apply), + )?)?; Ok(ApiResponse::depth_charge_submission(tx_id)) } #[instrument(skip(self))] async fn dispatch(&mut self, command: (ApiCommand, AuthId)) -> Result { match command { - (ApiCommand::DepthCharge(DepthChargeCommand { namespace }), identity) => { - self.depth_charge(namespace, identity).await - }, - (ApiCommand::Import(ImportCommand { namespace, operations }), identity) => { - self.submit_import_operations(identity, namespace, operations).await - }, - (ApiCommand::NameSpace(NamespaceCommand::Create { external_id }), identity) => { - self.create_namespace(&external_id, identity).await - }, + (ApiCommand::DepthCharge(DepthChargeCommand { namespace }), identity) => + self.depth_charge(namespace, identity).await, + (ApiCommand::Import(ImportCommand { namespace, operations }), identity) => + self.submit_import_operations(identity, namespace, operations).await, + (ApiCommand::NameSpace(NamespaceCommand::Create { external_id }), identity) => + self.create_namespace(&external_id, identity).await, ( ApiCommand::Agent(AgentCommand::Create { external_id, namespace, attributes }), identity, ) => self.create_agent(external_id, namespace, attributes, identity).await, - (ApiCommand::Agent(AgentCommand::UseInContext { id, namespace }), _identity) => { - self.use_agent_in_cli_context(id, namespace).await - }, + (ApiCommand::Agent(AgentCommand::UseInContext { id, namespace }), _identity) => + self.use_agent_in_cli_context(id, namespace).await, ( ApiCommand::Agent(AgentCommand::Delegate { id, @@ -1256,9 +1242,8 @@ where ApiCommand::Activity(ActivityCommand::End { id, namespace, time, agent }), identity, ) => self.end_activity(id, namespace, time, agent, identity).await, - (ApiCommand::Activity(ActivityCommand::Use { id, namespace, activity }), identity) => { - self.activity_use(id, namespace, activity, identity).await - }, + (ApiCommand::Activity(ActivityCommand::Use { id, namespace, activity }), identity) => + self.activity_use(id, namespace, activity, identity).await, ( ApiCommand::Activity(ActivityCommand::WasInformedBy { id, @@ -1297,10 +1282,9 @@ where derivation, }), identity, - ) => { + ) => self.entity_derive(id, namespace, activity, used_entity, derivation, identity) - .await - }, + .await, (ApiCommand::Query(query), _identity) => self.query(query).await, } } @@ -1491,16 +1475,16 @@ where let mut api = self.clone(); let identity = identity.signed_identity(&self.signing)?; let model = ProvModel::from_tx(&operations)?; + let signer = self.signing.clone(); tokio::task::spawn_blocking(move || { // Check here to ensure that import operations result in data changes let mut connection = api.store.connection()?; connection.build_transaction().run(|connection| { if let Some(operations_to_apply) = api.check_for_effects(connection, &operations)? { info!("Submitting import operations to ledger"); - let tx_id = api.submit_blocking(&ChronicleTransaction::new( - operations_to_apply, - identity, - ))?; + let tx_id = api.submit_blocking(futures::executor::block_on( + SubstrateTransaction::new(&signer, identity, operations_to_apply), + )?)?; Ok(ApiResponse::import_submitted(model, tx_id)) } else { info!("Import will not result in any data changes"); @@ -1563,13 +1547,13 @@ where to_apply.push(ChronicleOperation::StartActivity(StartActivity { namespace: namespace.clone(), id: id.clone(), - time: time.unwrap_or_else(Utc::now), + time: time.unwrap_or_else(Utc::now).into(), })); to_apply.push(ChronicleOperation::EndActivity(EndActivity { namespace: namespace.clone(), id: id.clone(), - time: time.unwrap_or_else(Utc::now), + time: time.unwrap_or_else(Utc::now).into(), })); if let Some(agent_id) = agent_id { @@ -1623,7 +1607,7 @@ where to_apply.push(ChronicleOperation::StartActivity(StartActivity { namespace: namespace.clone(), id: id.clone(), - time: time.unwrap_or_else(Utc::now), + time: time.unwrap_or_else(Utc::now).into(), })); if let Some(agent_id) = agent_id { @@ -1677,7 +1661,7 @@ where to_apply.push(ChronicleOperation::EndActivity(EndActivity { namespace: namespace.clone(), id: id.clone(), - time: time.unwrap_or_else(Utc::now), + time: time.unwrap_or_else(Utc::now).into(), })); if let Some(agent_id) = agent_id { @@ -1770,9 +1754,8 @@ mod test { let commit = self.api.notify_commit.subscribe().recv().await.unwrap(); match commit { common::ledger::SubmissionStage::Submitted(Ok(_)) => continue, - common::ledger::SubmissionStage::Committed(commit, _id) => { - return Ok(Some((commit.delta, commit.tx_id))) - }, + common::ledger::SubmissionStage::Committed(commit, _id) => + return Ok(Some((commit.delta, commit.tx_id))), common::ledger::SubmissionStage::Submitted(Err(e)) => panic!("{e:?}"), common::ledger::SubmissionStage::NotCommitted((_, tx, _id)) => { panic!("{tx:?}") @@ -1780,9 +1763,8 @@ mod test { } } }, - ApiResponse::AlreadyRecorded { subject: _, prov } => { - Ok(Some((prov, ChronicleTransactionId::from("null")))) - }, + ApiResponse::AlreadyRecorded { subject: _, prov } => + Ok(Some((prov, ChronicleTransactionId::from("null")))), _ => Ok(None), } } diff --git a/crates/api/src/opa.rs b/crates/api/src/opa.rs index 39ef0ad8f..ccd885c9d 100644 --- a/crates/api/src/opa.rs +++ b/crates/api/src/opa.rs @@ -1,13 +1,7 @@ -use crate::{ - identity::{AuthId, IdentityError, OpaData}, - import::FromUrlError, -}; +use common::identity::{AuthId, IdentityError, OpaData}; use futures::lock::Mutex; use opa::{bundle::Bundle, wasm::Opa}; -#[cfg(not(feature = "std"))] -use parity_scale_codec::alloc::sync::Arc; -#[cfg(feature = "std")] use std::sync::Arc; use rust_embed::RustEmbed; @@ -27,9 +21,6 @@ pub enum PolicyLoaderError { #[error("Error loading OPA policy: {0}")] SawtoothCommunicationError(#[from] anyhow::Error), - - #[error("Error loading policy bundle from URL: {0}")] - UrlError(#[from] FromUrlError), } #[async_trait::async_trait] diff --git a/crates/api/src/persistence/mod.rs b/crates/api/src/persistence/mod.rs index 0e363446d..65ba90c24 100644 --- a/crates/api/src/persistence/mod.rs +++ b/crates/api/src/persistence/mod.rs @@ -1,6 +1,4 @@ -use std::{collections::BTreeMap, str::FromStr, time::Duration}; - -use async_stl_client::ledger::{BlockId, BlockIdError}; +use std::{collections::BTreeMap, str::FromStr, sync::Arc, time::Duration}; use chrono::{TimeZone, Utc}; use common::{ @@ -8,8 +6,8 @@ use common::{ prov::{ operations::DerivationType, Activity, ActivityId, Agent, AgentId, Association, Attribution, ChronicleTransactionId, ChronicleTransactionIdError, Delegation, Derivation, DomaintypeId, - Entity, EntityId, ExternalId, ExternalIdPart, Generation, Identity, IdentityId, Namespace, - NamespaceId, ProvModel, PublicKeyPart, Role, Usage, + Entity, EntityId, ExternalId, ExternalIdPart, Generation, Namespace, NamespaceId, + ProvModel, Role, Usage, }, }; use derivative::*; @@ -20,6 +18,7 @@ use diesel::{ PgConnection, }; use diesel_migrations::{embed_migrations, EmbeddedMigrations}; +use protocol_substrate_chronicle::protocol::{BlockId, BlockIdError}; use thiserror::Error; use tracing::{debug, instrument, warn}; use uuid::Uuid; @@ -117,10 +116,10 @@ impl Store { &self, connection: &mut PgConnection, external_id: &ExternalId, - namespaceid: &NamespaceId, + namespace_id: &NamespaceId, ) -> Result { let (_namespaceid, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; + self.namespace_by_external_id(connection, namespace_id.external_id_part())?; use schema::activity::dsl; Ok(schema::activity::table @@ -149,10 +148,10 @@ impl Store { &self, connection: &mut PgConnection, external_id: &ExternalId, - namespaceid: &NamespaceId, + namespace_id: &NamespaceId, ) -> Result { let (_namespaceid, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; + self.namespace_by_external_id(connection, namespace_id.external_id_part())?; use schema::agent::dsl; Ok(schema::agent::table @@ -167,27 +166,21 @@ impl Store { &self, connection: &mut PgConnection, Activity { - ref external_id, - namespaceid, - started, - ended, - domaintypeid, - attributes, - .. - }: &Activity, - ns: &BTreeMap, + ref external_id, namespace_id, started, ended, domaintype_id, attributes, .. + }: &Activity, + ns: &BTreeMap>, ) -> Result<(), StoreError> { use schema::activity as dsl; - let _namespace = ns.get(namespaceid).ok_or(StoreError::InvalidNamespace {})?; + let _namespace = ns.get(namespace_id).ok_or(StoreError::InvalidNamespace {})?; let (_, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; + self.namespace_by_external_id(connection, namespace_id.external_id_part())?; let existing = self - .activity_by_activity_external_id_and_namespace(connection, external_id, namespaceid) + .activity_by_activity_external_id_and_namespace(connection, external_id, namespace_id) .ok(); let resolved_domain_type = - domaintypeid.as_ref().map(|x| x.external_id_part().clone()).or_else(|| { + domaintype_id.as_ref().map(|x| x.external_id_part().clone()).or_else(|| { existing.as_ref().and_then(|x| x.domaintype.as_ref().map(ExternalId::from)) }); @@ -204,7 +197,7 @@ impl Store { dsl::namespace_id.eq(nsid), dsl::started.eq(started.map(|t| t.naive_utc())), dsl::ended.eq(ended.map(|t| t.naive_utc())), - dsl::domaintype.eq(domaintypeid.as_ref().map(|x| x.external_id_part())), + dsl::domaintype.eq(domaintype_id.as_ref().map(|x| x.external_id_part())), )) .on_conflict((dsl::external_id, dsl::namespace_id)) .do_update() @@ -218,7 +211,7 @@ impl Store { let query::Activity { id, .. } = self.activity_by_activity_external_id_and_namespace( connection, external_id, - namespaceid, + namespace_id, )?; diesel::insert_into(schema::activity_attribute::table) @@ -246,7 +239,7 @@ impl Store { &self, connection: &mut PgConnection, Agent { ref external_id, namespaceid, domaintypeid, attributes, .. }: &Agent, - ns: &BTreeMap, + ns: &BTreeMap>, ) -> Result<(), StoreError> { use schema::agent::dsl; let _namespace = ns.get(namespaceid).ok_or(StoreError::InvalidNamespace {})?; @@ -298,16 +291,16 @@ impl Store { fn apply_entity( &self, connection: &mut PgConnection, - Entity { namespaceid, id, external_id, domaintypeid, attributes }: &Entity, - ns: &BTreeMap, + Entity { namespace_id, id, external_id, domaintypeid, attributes }: &Entity, + ns: &BTreeMap>, ) -> Result<(), StoreError> { use schema::entity::dsl; - let _namespace = ns.get(namespaceid).ok_or(StoreError::InvalidNamespace {})?; + let _namespace = ns.get(namespace_id).ok_or(StoreError::InvalidNamespace {})?; let (_, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; + self.namespace_by_external_id(connection, namespace_id.external_id_part())?; let existing = self - .entity_by_entity_external_id_and_namespace(connection, external_id, namespaceid) + .entity_by_entity_external_id_and_namespace(connection, external_id, namespace_id) .ok(); let resolved_domain_type = @@ -327,7 +320,7 @@ impl Store { .execute(connection)?; let query::Entity { id, .. } = - self.entity_by_entity_external_id_and_namespace(connection, external_id, namespaceid)?; + self.entity_by_entity_external_id_and_namespace(connection, external_id, namespace_id)?; diesel::insert_into(schema::entity_attribute::table) .values( @@ -346,73 +339,6 @@ impl Store { Ok(()) } - #[instrument(level = "trace", skip(self, connection), ret(Debug))] - fn apply_has_identity( - &self, - connection: &mut PgConnection, - model: &ProvModel, - namespaceid: &NamespaceId, - agent: &AgentId, - identity: &IdentityId, - ) -> Result<(), StoreError> { - let (_, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; - let identity = self.identity_by(connection, namespaceid, identity)?; - use schema::agent::dsl; - - diesel::update(schema::agent::table) - .filter(dsl::external_id.eq(agent.external_id_part()).and(dsl::namespace_id.eq(nsid))) - .set(dsl::identity_id.eq(identity.id)) - .execute(connection)?; - - Ok(()) - } - - #[instrument(level = "trace", skip(self, connection), ret(Debug))] - fn apply_had_identity( - &self, - connection: &mut PgConnection, - model: &ProvModel, - namespaceid: &NamespaceId, - agent: &AgentId, - identity: &IdentityId, - ) -> Result<(), StoreError> { - let identity = self.identity_by(connection, namespaceid, identity)?; - let agent = self.agent_by_agent_external_id_and_namespace( - connection, - agent.external_id_part(), - namespaceid, - )?; - use schema::hadidentity::dsl; - - diesel::insert_into(schema::hadidentity::table) - .values((dsl::agent_id.eq(agent.id), dsl::identity_id.eq(identity.id))) - .on_conflict_do_nothing() - .execute(connection)?; - - Ok(()) - } - - #[instrument(level = "trace", skip(self, connection), ret(Debug))] - fn apply_identity( - &self, - connection: &mut PgConnection, - Identity { id, namespaceid, public_key, .. }: &Identity, - ns: &BTreeMap, - ) -> Result<(), StoreError> { - use schema::identity::dsl; - let _namespace = ns.get(namespaceid).ok_or(StoreError::InvalidNamespace {})?; - let (_, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; - - diesel::insert_into(schema::identity::table) - .values((dsl::namespace_id.eq(nsid), dsl::public_key.eq(public_key))) - .on_conflict_do_nothing() - .execute(connection)?; - - Ok(()) - } - fn apply_model( &self, connection: &mut PgConnection, @@ -430,19 +356,6 @@ impl Store { for (_, entity) in model.entities.iter() { self.apply_entity(connection, entity, &model.namespaces)? } - for (_, identity) in model.identities.iter() { - self.apply_identity(connection, identity, &model.namespaces)? - } - - for ((namespaceid, agent_id), (_, identity_id)) in model.has_identity.iter() { - self.apply_has_identity(connection, model, namespaceid, agent_id, identity_id)?; - } - - for ((namespaceid, agent_id), identity_id) in model.had_identity.iter() { - for (_, identity_id) in identity_id { - self.apply_had_identity(connection, model, namespaceid, agent_id, identity_id)?; - } - } for ((namespaceid, _), association) in model.association.iter() { for association in association.iter() { @@ -502,7 +415,7 @@ impl Store { ) -> Result<(), StoreError> { use schema::namespace::dsl; diesel::insert_into(schema::namespace::table) - .values((dsl::external_id.eq(external_id), dsl::uuid.eq(uuid.to_string()))) + .values((dsl::external_id.eq(external_id), dsl::uuid.eq(hex::encode(uuid)))) .on_conflict_do_nothing() .execute(connection)?; @@ -800,7 +713,7 @@ impl Store { .map_err(StoreError::from)?; if let Some(block_id) = block_id_and_tx.0 { - Ok(Some(BlockId::try_from(block_id)?)) + Ok(Some(BlockId::try_from(&*block_id)?)) } else { Ok(None) } @@ -825,23 +738,6 @@ impl Store { Ok((NamespaceId::from_external_id(ns.1, Uuid::from_str(&ns.2)?), ns.0)) } - #[instrument(skip(connection))] - pub(crate) fn identity_by( - &self, - connection: &mut PgConnection, - namespaceid: &NamespaceId, - identity: &IdentityId, - ) -> Result { - use self::schema::identity::dsl; - let (_, nsid) = - self.namespace_by_external_id(connection, namespaceid.external_id_part())?; - let public_key = identity.public_key_part(); - - Ok(dsl::identity - .filter(dsl::public_key.eq(public_key).and(dsl::namespace_id.eq(nsid))) - .first::(connection)?) - } - #[instrument] pub(crate) fn new(pool: Pool>) -> Result { Ok(Store { pool }) @@ -876,7 +772,8 @@ impl Store { }) }) .collect::, _>>()?, - }, + } + .into(), ); for (responsible, activity, role) in schema::delegation::table @@ -938,11 +835,11 @@ impl Store { (namespaceid.clone(), id.clone()), Activity { id: id.clone(), - namespaceid: namespaceid.clone(), + namespace_id: namespaceid.clone(), external_id: activity.external_id.into(), - started: activity.started.map(|x| Utc.from_utc_datetime(&x)), - ended: activity.ended.map(|x| Utc.from_utc_datetime(&x)), - domaintypeid: activity.domaintype.map(DomaintypeId::from_external_id), + started: activity.started.map(|x| Utc.from_utc_datetime(&x).into()), + ended: activity.ended.map(|x| Utc.from_utc_datetime(&x).into()), + domaintype_id: activity.domaintype.map(DomaintypeId::from_external_id), attributes: attributes .into_iter() .map(|attr| { @@ -951,7 +848,8 @@ impl Store { }) }) .collect::, _>>()?, - }, + } + .into(), ); for generation in schema::generation::table @@ -1022,7 +920,7 @@ impl Store { ) -> Result<(), StoreError> { debug!(?entity, "Map entity to prov"); - let query::Entity { id, namespace_id: _, domaintype, external_id } = entity; + let query::Entity { id, namespace_id: _, domaintype: domaintype, external_id } = entity; let entity_id = EntityId::from_external_id(&external_id); @@ -1055,7 +953,7 @@ impl Store { (namespace_id.clone(), entity_id.clone()), Entity { id: entity_id.clone(), - namespaceid: namespace_id.clone(), + namespace_id: namespace_id.clone(), external_id: external_id.into(), domaintypeid: domaintype.map(DomaintypeId::from_external_id), attributes: attributes @@ -1066,7 +964,8 @@ impl Store { }) }) .collect::, _>>()?, - }, + } + .into(), ); for (activity_id, activity_external_id, used_entity_id, typ) in schema::derivation::table diff --git a/crates/chronicle-domain-test/Cargo.toml b/crates/chronicle-domain-test/Cargo.toml index 4500bf4b4..e1a79d244 100644 --- a/crates/chronicle-domain-test/Cargo.toml +++ b/crates/chronicle-domain-test/Cargo.toml @@ -28,10 +28,9 @@ strict = [] inmem = ["chronicle/inmem"] [dev-dependencies] -async-stl-client = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } -futures = { workspace = true } -hex = { workspace = true } -insta = { workspace = true, features = ["json"] } -opa-tp-protocol = { path = "../opa-tp-protocol" } -tempfile = { workspace = true } +futures = { workspace = true } +hex = { workspace = true } +insta = { workspace = true, features = ["json"] } +protocol-substrate-chronicle = { path = "../protocol-substrate-chronicle" } +protocol-substrate-opa = { path = "../protocol-substrate-opa" } +tempfile = { workspace = true } diff --git a/crates/chronicle-protocol/Cargo.toml b/crates/chronicle-protocol/Cargo.toml deleted file mode 100644 index 332b23fc5..000000000 --- a/crates/chronicle-protocol/Cargo.toml +++ /dev/null @@ -1,57 +0,0 @@ -[package] -build = "build.rs" -edition = "2021" -name = "chronicle-protocol" -version = "0.7.5" - -[lib] -name = "chronicle_protocol" -path = "src/lib.rs" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -async-stl-client = { workspace = true } -async-trait = { workspace = true } -bytes = { workspace = true } -chronicle-signing = { path = "../chronicle-signing" } -common = { path = "../common" } -custom_error = { workspace = true } -derivative = { workspace = true } -futures = { workspace = true } -glob = { workspace = true } -hex = { workspace = true } -k256 = { workspace = true, features = [ - "default", - "arithmetic", - "ecdsa", - "pkcs8", - "sha256", - "std", - "pem", -] } -lazy_static = { workspace = true } -opa-tp-protocol = { path = "../opa-tp-protocol" } -openssl = { workspace = true } -prost = { workspace = true } -prost-types = { workspace = true } -rand = { workspace = true, features = ["getrandom"] } -rand_core = { workspace = true } -serde = { workspace = true } -serde_derive = { workspace = true } -serde_json = { workspace = true } -tempfile = { workspace = true } -thiserror = { workspace = true } -tokio = { workspace = true, features = ["time", "macros", "rt-multi-thread"] } -tracing = { workspace = true } -url = { workspace = true } -uuid = { workspace = true, features = ["serde", "v4"] } -zmq = { workspace = true } - -[build-dependencies] -glob = { workspace = true } -prost-build = { workspace = true } - -[dev-dependencies] -chrono = { workspace = true } -tempfile = { workspace = true } diff --git a/crates/chronicle-protocol/build.rs b/crates/chronicle-protocol/build.rs deleted file mode 100644 index 109764ea7..000000000 --- a/crates/chronicle-protocol/build.rs +++ /dev/null @@ -1,10 +0,0 @@ -use std::io::Result; - -fn main() -> Result<()> { - let protos = glob::glob("./src/protos/*.proto") - .unwrap() - .map(|x| x.unwrap()) - .collect::>(); - prost_build::compile_protos(&protos, &["./src/protos"])?; - Ok(()) -} diff --git a/crates/chronicle-protocol/src/address.rs b/crates/chronicle-protocol/src/address.rs deleted file mode 100644 index 59e43701a..000000000 --- a/crates/chronicle-protocol/src/address.rs +++ /dev/null @@ -1,47 +0,0 @@ -use core::fmt::Display; - -use common::{ - ledger::{LedgerAddress, NameSpacePart, ResourcePart}, - prov::AsCompact, -}; -use lazy_static::lazy_static; -use openssl::sha::Sha256; - -lazy_static! { - pub static ref PREFIX: String = { - let mut sha = Sha256::new(); - sha.update("chronicle".as_bytes()); - hex::encode(sha.finish())[..6].to_string() - }; -} - -pub static VERSION: &str = "1.0"; -pub static FAMILY: &str = "chronicle"; - -#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd)] -pub struct SawtoothAddress(String); - -impl SawtoothAddress { - pub fn new(address: String) -> Self { - SawtoothAddress(address) - } -} - -/// Our sawtooth addresses use hash(chronicle)[..6] as the prefix, -/// followed by a 256 bit hash of the resource Iri and namespace Iri. -impl From<&LedgerAddress> for SawtoothAddress { - fn from(addr: &LedgerAddress) -> Self { - let mut sha = Sha256::new(); - if let Some(ns) = addr.namespace_part().as_ref() { - sha.update(ns.compact().as_bytes()) - } - sha.update(addr.resource_part().compact().as_bytes()); - SawtoothAddress(format!("{}{}", &*PREFIX, hex::encode(sha.finish()))) - } -} - -impl Display for SawtoothAddress { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - f.write_str(&self.0) - } -} diff --git a/crates/chronicle-protocol/src/lib.rs b/crates/chronicle-protocol/src/lib.rs deleted file mode 100644 index d3a550778..000000000 --- a/crates/chronicle-protocol/src/lib.rs +++ /dev/null @@ -1,28 +0,0 @@ -use async_stl_client::{ - ledger::SawtoothLedger, - zmq_client::{RetryingRequestResponseChannel, ZmqRequestResponseSawtoothChannel}, -}; -use messages::ChronicleSubmitTransaction; - -pub mod address; -pub mod messages; -pub mod protocol; -pub mod settings; - -pub use async_stl_client; -use protocol::ChronicleOperationEvent; - -static PROTOCOL_VERSION: &str = "2"; -const SUBMISSION_BODY_VERSION: u16 = 1; - -pub type ChronicleLedger = SawtoothLedger< - RetryingRequestResponseChannel, - ChronicleOperationEvent, - ChronicleSubmitTransaction, ->; - -pub mod sawtooth { - #![allow(clippy::derive_partial_eq_without_eq)] - - include!(concat!(env!("OUT_DIR"), "/_.rs")); -} diff --git a/crates/chronicle-protocol/src/messages.rs b/crates/chronicle-protocol/src/messages.rs deleted file mode 100644 index e48ff1aed..000000000 --- a/crates/chronicle-protocol/src/messages.rs +++ /dev/null @@ -1,135 +0,0 @@ -use std::sync::Arc; - -use chronicle_signing::{BatcherKnownKeyNamesSigner, ChronicleSigning, SecretError}; -use common::prov::{to_json_ld::ToJson, ChronicleTransaction}; -use k256::ecdsa::VerifyingKey; -use opa_tp_protocol::state::{policy_address, policy_meta_address}; -use serde_json::json; - -use crate::{ - address::SawtoothAddress, - protocol::ProtocolError, - sawtooth::submission::{BodyVariant, IdentityVariant}, - settings::sawtooth_settings_address, - PROTOCOL_VERSION, SUBMISSION_BODY_VERSION, -}; - -use super::sawtooth::*; -use async_stl_client::{ - ledger::{LedgerTransaction, TransactionId}, - sawtooth::{MessageBuilder, TransactionPayload}, -}; -use prost::Message; - -#[derive(Debug, Clone)] -pub struct ChronicleSubmitTransaction { - pub tx: ChronicleTransaction, - pub signer: ChronicleSigning, - pub policy_name: Option, -} - -#[async_trait::async_trait] -impl TransactionPayload for ChronicleSubmitTransaction { - type Error = ProtocolError; - - /// Envelope a payload of `ChronicleOperations` and `SignedIdentity` in a `Submission` protocol - /// buffer, along with placeholders for protocol version info and a tracing span id. - async fn to_bytes(&self) -> Result, ProtocolError> { - let mut submission = Submission { - version: PROTOCOL_VERSION.to_string(), - span_id: 0u64, - ..Default::default() - }; - - let mut ops = Vec::with_capacity(self.tx.tx.len()); - for op in &self.tx.tx { - let op_json = op.to_json(); - let compact_json = op_json.compact_stable_order().await?; - ops.push(compact_json); - } - - let ops_json = - serde_json::to_string(&json!({"version": SUBMISSION_BODY_VERSION, "ops": ops}))?; - let identity_json = serde_json::to_string(&self.tx.identity)?; - tracing::debug!(ops_json = %ops_json, identity_json = %identity_json); - - submission.body_variant = Some(BodyVariant::Body(BodyMessageV1 { payload: ops_json })); - submission.identity_variant = - Some(IdentityVariant::Identity(IdentityMessageV1 { payload: identity_json })); - Ok(submission.encode_to_vec()) - } -} - -impl ChronicleSubmitTransaction { - pub fn new( - tx: ChronicleTransaction, - signer: ChronicleSigning, - policy_name: Option, - ) -> Self { - Self { tx, signer, policy_name } - } -} - -#[async_trait::async_trait] -impl LedgerTransaction for ChronicleSubmitTransaction { - type Error = SecretError; - - async fn sign(&self, bytes: Arc>) -> Result, SecretError> { - self.signer.batcher_sign(&bytes).await - } - - async fn verifying_key(&self) -> Result { - self.signer.batcher_verifying().await - } - - fn addresses(&self) -> Vec { - self.tx - .tx - .iter() - .flat_map(|op| op.dependencies()) - .map(|dep| SawtoothAddress::from(&dep).to_string()) - .collect::>() - .into_iter() - .collect() - } - - async fn as_sawtooth_tx( - &self, - message_builder: &MessageBuilder, - ) -> Result<(async_stl_client::messages::Transaction, TransactionId), Self::Error> { - //Ensure we append any opa policy binary address and meta address to the - //list of addresses, along with the settings address - let mut addresses: Vec<_> = self - .addresses() - .into_iter() - .chain(vec![ - sawtooth_settings_address("chronicle.opa.policy_name"), - sawtooth_settings_address("chronicle.opa.entrypoint"), - ]) - .collect(); - - if self.policy_name.is_some() { - addresses = addresses - .into_iter() - .chain(vec![ - policy_address(self.policy_name.as_ref().unwrap()), - policy_meta_address(self.policy_name.as_ref().unwrap()), - ]) - .collect(); - } - message_builder - .make_sawtooth_transaction( - addresses.clone(), - addresses, - vec![], - self, - self.signer.batcher_verifying().await?, - |bytes| { - let signer = self.signer.clone(); - let bytes = bytes.to_vec(); - async move { signer.batcher_sign(&bytes).await } - }, - ) - .await - } -} diff --git a/crates/chronicle-protocol/src/perf.md b/crates/chronicle-protocol/src/perf.md deleted file mode 100644 index 73e9f7af6..000000000 --- a/crates/chronicle-protocol/src/perf.md +++ /dev/null @@ -1,32 +0,0 @@ -# Chronicle on sawtooth performance - -## Environment - -4 node sawtooth cluster backed onto a 4x 4X Large AWS node Kubernetes cluster -using our default helm settings. This creates a 4 node sawtooth network with a -validator and transaction processor per AWS node, and a single chronicle service -using persistent Postgres. - -## Testing methodology - -Sequences of 10000 chronicle mutations (the creation of an activity and the -setting of multiple attributes) were sent from a task, through the Chronicle API -at increasing rates of transactions per-second to find the rate where system -performance begins to break down and discover failure modes. - -## Results - -The maximum throughput for the whole system is between 50-60 transactions per -second. This throughput is constrained by Sawtooth consensus, and there are ways -this could be significantly raised if Chronicle can increase batch sizes at high throughput -rates. Failure modes over the saturation points are resumable - Sawtooth will -eventually report its queue to be full to Chronicle, and Chronicle will send -errors to connected clients. - -No data will be lost due to errors running Chronicle beyond its saturation point - -## Future actions - -Chronicle 0.8 has some minor performance improvements that could be back ported -to .7. Batching of transactions at high throughput rates would significantly -improve the total throughput of the network - 2 orders of magnitude is possible. diff --git a/crates/chronicle-protocol/src/protocol.rs b/crates/chronicle-protocol/src/protocol.rs deleted file mode 100644 index 3384ba077..000000000 --- a/crates/chronicle-protocol/src/protocol.rs +++ /dev/null @@ -1,308 +0,0 @@ -use std::io::Cursor; - -use async_stl_client::{ - error::SawtoothCommunicationError, - ledger::{LedgerEvent, Span}, -}; -use common::{ - identity::SignedIdentity, - prov::{ - operations::ChronicleOperation, to_json_ld::ToJson, CompactionError, Contradiction, - PayloadError, ProcessorError, ProvModel, - }, -}; -use prost::Message; -use tracing::span; - -use thiserror::Error; - -use self::messages::event::OptionContradiction; - -#[derive(Debug)] -pub struct ChronicleOperationEvent(pub Result, pub SignedIdentity); - -impl From for Result { - fn from(val: ChronicleOperationEvent) -> Self { - val.0 - } -} - -#[async_trait::async_trait] -impl LedgerEvent for ChronicleOperationEvent { - async fn deserialize( - buf: &[u8], - ) -> Result<(Self, Span), async_stl_client::error::SawtoothCommunicationError> - where - Self: Sized, - { - let event = messages::Event::decode(buf) - .map_err(|e| SawtoothCommunicationError::LedgerEventParse { source: e.into() })?; - // Spans of zero panic, so assign a dummy value until we thread the span correctly - let span_id = { - if event.span_id == 0 { - span::Id::from_u64(0xffffffffffffffff) - } else { - span::Id::from_u64(event.span_id) - } - }; - let model = match (event.delta, event.option_contradiction) { - (_, Some(OptionContradiction::Contradiction(contradiction))) => - Err(serde_json::from_str::(&contradiction).map_err(|e| { - SawtoothCommunicationError::LedgerEventParse { source: e.into() } - })?), - (delta, None) => { - let mut model = ProvModel::default(); - model.apply_json_ld_str(&delta).await.map_err(|e| { - SawtoothCommunicationError::LedgerEventParse { source: e.into() } - })?; - - Ok(model) - }, - }; - - let identity = { - if event.identity.is_empty() { - SignedIdentity::new_no_identity() - } else { - serde_json::from_str(&event.identity).map_err(|e| { - SawtoothCommunicationError::LedgerEventParse { source: e.into() } - })? - } - }; - Ok((Self(model, identity), Span::Span(span_id.into_u64()))) - } -} - -#[derive(Error, Debug)] -pub enum ProtocolError { - #[error("Protobuf deserialization error {source}")] - ProtobufDeserialize { - #[from] - source: prost::DecodeError, - }, - #[error("Protobuf serialization error {source}")] - ProtobufSerialize { - #[from] - source: prost::EncodeError, - }, - #[error("Serde de/serialization error {source}")] - JsonSerialize { - #[from] - source: serde_json::Error, - }, - #[error("Problem applying delta {source}")] - ProcessorError { - #[from] - source: ProcessorError, - }, - #[error("Could not compact json {source}")] - Compaction { - #[from] - source: CompactionError, - }, -} - -static PROTOCOL_VERSION: &str = "2"; - -// Include the `submission` module, which is -// generated from ./protos/submission.proto. -pub mod messages { - #![allow(clippy::derive_partial_eq_without_eq)] - - include!(concat!(env!("OUT_DIR"), "/_.rs")); -} - -pub async fn chronicle_committed( - span: u64, - delta: ProvModel, - identity: &SignedIdentity, -) -> Result { - Ok(messages::Event { - version: PROTOCOL_VERSION.to_owned(), - delta: serde_json::to_string(&delta.to_json().compact_stable_order().await?)?, - span_id: span, - identity: serde_json::to_string(identity)?, - ..Default::default() - }) -} - -pub fn chronicle_contradicted( - span: u64, - contradiction: &Contradiction, - identity: &SignedIdentity, -) -> Result { - Ok(messages::Event { - version: PROTOCOL_VERSION.to_owned(), - span_id: span, - option_contradiction: Some(OptionContradiction::Contradiction(serde_json::to_string( - &contradiction, - )?)), - identity: serde_json::to_string(identity)?, - ..Default::default() - }) -} - -impl messages::Event { - pub async fn get_contradiction(&self) -> Result, ProtocolError> { - Ok(self - .option_contradiction - .as_ref() - .map(|OptionContradiction::Contradiction(s)| serde_json::from_str(s)) - .transpose()?) - } - - pub async fn get_delta(&self) -> Result { - let mut model = ProvModel::default(); - model.apply_json_ld_str(&self.delta).await?; - - Ok(model) - } -} - -pub fn serialize_submission(submission: &messages::Submission) -> Vec { - let mut buf = Vec::with_capacity(submission.encoded_len()); - submission.encode(&mut buf).unwrap(); - buf -} - -/// `Submission` protocol buffer deserializer -pub fn deserialize_submission(buf: &[u8]) -> Result { - messages::Submission::decode(&mut Cursor::new(buf)) -} - -/// Convert a `Submission` payload from a vector of -/// strings to a vector of `ChronicleOperation`s. -/// Operates for version 1 of the protocol. -pub async fn chronicle_operations_from_submission_v1( - submission_body: Vec, -) -> Result, ProcessorError> { - let mut ops = Vec::with_capacity(submission_body.len()); - for op in submission_body.iter() { - let json = serde_json::from_str(op)?; - // The inner json value should be in compacted form, - // wrapping in `ExpandedJson`, as required by `ChronicleOperation::from_json` - let op = ChronicleOperation::from_json(&json).await?; - ops.push(op); - } - Ok(ops) -} - -/// Convert a `Submission` payload from a vector of -/// strings to a vector of `ChronicleOperation`s. -/// Operates for version 2 of the protocol. -pub async fn chronicle_operations_from_submission_v2( - submission_body: String, -) -> Result, ProcessorError> { - use serde_json::{json, Value}; - let json = serde_json::from_str(&submission_body)?; - - if let Value::Object(map) = json { - if let Some(version) = map.get("version") { - if version == &json!(1) { - if let Some(ops_json) = map.get("ops").and_then(|x| x.as_array()) { - let mut ops = Vec::with_capacity(ops_json.len()); - for op in ops_json { - ops.push(ChronicleOperation::from_json(op).await?); - } - Ok(ops) - } else { - Err(PayloadError::OpsNotAList.into()) - } - } else { - Err(PayloadError::VersionUnknown.into()) - } - } else { - Err(PayloadError::VersionMissing.into()) - } - } else { - Err(PayloadError::NotAnObject.into()) - } -} - -/// Convert a `Submission` identity from a String -/// to a `SignedIdentity` -pub async fn chronicle_identity_from_submission( - submission_identity: String, -) -> Result { - Ok(serde_json::from_str(&submission_identity)?) -} - -#[cfg(test)] -mod test { - use crate::protocol::{ - chronicle_operations_from_submission_v1, chronicle_operations_from_submission_v2, - ChronicleOperation, - }; - use chrono::{NaiveDateTime, TimeZone, Utc}; - use common::prov::{ - operations::{EndActivity, StartActivity}, - to_json_ld::ToJson, - ActivityId, NamespaceId, - }; - use serde_json::{json, Value}; - use std::{ - collections::hash_map::DefaultHasher, - hash::{Hash, Hasher}, - }; - use uuid::Uuid; - - fn construct_operations() -> Vec { - let mut hasher = DefaultHasher::new(); - "foo".hash(&mut hasher); - let n1 = hasher.finish(); - "bar".hash(&mut hasher); - let n2 = hasher.finish(); - let uuid = Uuid::from_u64_pair(n1, n2); - - let base_ms = 1234567654321; - let activity_start = - Utc.from_utc_datetime(&NaiveDateTime::from_timestamp_millis(base_ms).unwrap()); - let activity_end = - Utc.from_utc_datetime(&NaiveDateTime::from_timestamp_millis(base_ms + 12345).unwrap()); - - let start = ChronicleOperation::StartActivity(StartActivity { - namespace: NamespaceId::from_external_id("test-namespace", uuid), - id: ActivityId::from_external_id("test-activity"), - time: activity_start, - }); - let end = ChronicleOperation::EndActivity(EndActivity { - namespace: NamespaceId::from_external_id("test-namespace", uuid), - id: ActivityId::from_external_id("test-activity"), - time: activity_end, - }); - - vec![start, end] - } - - #[tokio::test] - async fn deserialize_submission_v1() { - let operations_expected = construct_operations(); - - let submission_body = operations_expected - .iter() - .map(|operation| serde_json::to_string(&operation.to_json().0).unwrap()) - .collect(); - - let operations_actual = - chronicle_operations_from_submission_v1(submission_body).await.unwrap(); - - assert_eq!(operations_expected, operations_actual); - } - - #[tokio::test] - async fn deserialize_submission_v2() { - let operations_expected = construct_operations(); - - let submission_body = - serde_json::to_string(&json!({"version": 1, "ops": operations_expected - .iter() - .map(|operation| operation.to_json().0) - .collect::>()})) - .unwrap(); - - let operations_actual = - chronicle_operations_from_submission_v2(submission_body).await.unwrap(); - - assert_eq!(operations_expected, operations_actual); - } -} diff --git a/crates/chronicle-protocol/src/protos/event.proto b/crates/chronicle-protocol/src/protos/event.proto deleted file mode 100644 index 166bc0ac4..000000000 --- a/crates/chronicle-protocol/src/protos/event.proto +++ /dev/null @@ -1,14 +0,0 @@ - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "sawtooth.sdk.protobuf"; -option go_package = "batch_pb2"; - -message Event { - string version = 1; - uint64 span_id = 2; - oneof option_contradiction { string contradiction = 3; } - string delta = 4; - string identity = 5; -} diff --git a/crates/chronicle-protocol/src/protos/submission.proto b/crates/chronicle-protocol/src/protos/submission.proto deleted file mode 100644 index dc3ae4c82..000000000 --- a/crates/chronicle-protocol/src/protos/submission.proto +++ /dev/null @@ -1,37 +0,0 @@ -// a place to keep protocol version information (that’s not the address space) -// and send along an opentelemetry distributed span id -- a leverage point for -// future protocol versioning and a way of sneaking in a OTEL span id -// for distributed tracing as there’s no sawtooth native way of smuggling in -// metadata - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "sawtooth.sdk.protobuf"; -option go_package = "batch_pb2"; - -message OpaPolicy { - string id = 1; - string entrypoint = 2; -} - -message Submission { - string version = 1; - uint64 span_id = 2; - repeated string body_old = 3 [ deprecated = true ]; - oneof identity_variant { - string identity_old = 4 [ deprecated = true ]; - IdentityMessageV1 identity = 5; - } - oneof body_variant { - BodyMessageV1 body = 6; - } -} - -message BodyMessageV1 { - string payload = 1; -} - -message IdentityMessageV1 { - string payload = 1; -} diff --git a/crates/chronicle-protocol/src/settings.rs b/crates/chronicle-protocol/src/settings.rs deleted file mode 100644 index ad4071eef..000000000 --- a/crates/chronicle-protocol/src/settings.rs +++ /dev/null @@ -1,114 +0,0 @@ -use std::iter::repeat; - -use async_stl_client::{ - error::SawtoothCommunicationError, ledger::LedgerReader, messages::Setting, -}; -use k256::sha2::{Digest, Sha256}; -use prost::Message; -use tracing::error; - -use crate::ChronicleLedger; - -fn setting_key_to_address(key: &str) -> String { - let mut address = String::new(); - address.push_str("000000"); - address.push_str( - &key.splitn(4, '.') - .chain(repeat("")) - .map(short_hash) - .take(4) - .collect::>() - .join(""), - ); - - address -} - -fn short_hash(s: &str) -> String { - hex::encode(Sha256::digest(s.as_bytes()))[..16].to_string() -} - -/// Generates a Sawtooth address for a given setting key. -/// -/// The address is a hex string that is computed based on the input key, -/// according to the Sawtooth settings addressing algorithm. The key is -/// split into four parts based on the dots in the string. If there are -/// less than four parts, the remaining parts are filled with empty strings. -/// Each of these parts has a short hash computed (the first 16 characters -/// of its SHA256 hash in hex) and is joined into a single address, with the -/// settings namespace (`000000`) added at the beginning. -/// -/// Does not account for settings keys with more than 4 components -/// -/// # Arguments -/// -/// * `s` - A string representing the setting key to generate an address for. -/// -/// # Example -/// -/// ``` -/// use chronicle_protocol::settings::sawtooth_settings_address; -/// -/// let address = sawtooth_settings_address("sawtooth.config.vote.proposals"); -/// assert_eq!(address, "000000a87cb5eafdcca6a8b79606fb3afea5bdab274474a6aa82c1c0cbf0fbcaf64c0b"); -/// ``` -pub fn sawtooth_settings_address(s: &str) -> String { - setting_key_to_address(s) -} - -/// This `SettingsReader` struct is used for extracting particular configuration -/// settings from the Sawtooth settings TP given the key. -pub struct SettingsReader(ChronicleLedger); - -impl SettingsReader { - pub fn new(reader: ChronicleLedger) -> Self { - Self(reader) - } - - /// Async function that returns the value of a specific configuration setting, given its key. - /// - /// # Arguments - /// * `key` - a reference to a string that contains the key for the setting to retrieve. - /// - /// # Errors - /// If the value is not found, returns a `SawtoothCommunicationError`, which indicates that - /// there was an error in communicating with the Sawtooth network. - /// - /// Settings values are not uniform, so we return a `Vec` for further processing - pub async fn read_settings(&self, key: &str) -> Result { - let address = sawtooth_settings_address(key); - loop { - let res = self.0.get_state_entry(&address).await; - - if let Err(e) = res { - error!("Error reading settings: {}", e); - tokio::time::sleep(std::time::Duration::from_secs(2)).await; - continue - } - - return Ok(Setting::decode(&*res.unwrap())?) - } - } -} - -#[derive(Debug, Clone)] -pub struct OpaSettings { - pub policy_name: String, - pub entrypoint: String, -} - -pub async fn read_opa_settings( - settings: &SettingsReader, -) -> Result { - let policy_id = settings.read_settings("chronicle.opa.policy_name").await?; - let entrypoint = settings.read_settings("chronicle.opa.entrypoint").await?; - let policy_id = policy_id - .entries - .first() - .ok_or_else(|| SawtoothCommunicationError::MalformedMessage)?; - let entrypoint = entrypoint - .entries - .first() - .ok_or_else(|| SawtoothCommunicationError::MalformedMessage)?; - Ok(OpaSettings { policy_name: policy_id.value.clone(), entrypoint: entrypoint.value.clone() }) -} diff --git a/crates/chronicle-signing/src/embedded_secret_manager_source.rs b/crates/chronicle-signing/src/embedded_secret_manager_source.rs index 6d4d964ae..c8908ceb6 100644 --- a/crates/chronicle-signing/src/embedded_secret_manager_source.rs +++ b/crates/chronicle-signing/src/embedded_secret_manager_source.rs @@ -6,7 +6,10 @@ use k256::{ use rand::{rngs::StdRng, SeedableRng}; use secret_vault::{Secret, SecretMetadata, SecretVaultRef, SecretVaultResult, SecretsSource}; use secret_vault_value::SecretValue; -use std::{collections::HashMap, sync::Arc}; +use std::{ + collections::{BTreeMap, HashMap}, + sync::Arc, +}; use tokio::sync::Mutex; use tracing::debug; @@ -14,22 +17,22 @@ use crate::SecretError; pub struct EmbeddedSecretManagerSource { secrets: Arc>>>, - deterministic: bool, + seeds: BTreeMap, } impl EmbeddedSecretManagerSource { pub fn new() -> Self { - Self { secrets: Arc::new(Mutex::new(HashMap::new())), deterministic: false } + Self { secrets: Arc::new(Mutex::new(HashMap::new())), seeds: BTreeMap::default() } } - pub fn new_deterministic() -> Self { - Self { secrets: Arc::new(Mutex::new(HashMap::new())), deterministic: true } + pub fn new_seeded(seeds: BTreeMap) -> Self { + Self { secrets: Arc::new(Mutex::new(HashMap::new())), seeds } } } -fn new_signing_key(deterministic: bool, index: usize) -> Result, SecretError> { - let secret = if deterministic { - SecretKey::random(StdRng::seed_from_u64(index as _)) +fn new_signing_key(name: &str, seeds: &BTreeMap) -> Result, SecretError> { + let secret = if let Some(seed) = seeds.get(name) { + SecretKey::from_be_bytes(seed).map_err(|_| SecretError::BadSeed)? } else { SecretKey::random(StdRng::from_entropy()) }; @@ -55,9 +58,10 @@ impl SecretsSource for EmbeddedSecretManagerSource { let mut result_map: HashMap = HashMap::new(); let mut secrets = self.secrets.lock().await; - for (index, secret_ref) in references.iter().enumerate() { + for (_index, secret_ref) in references.iter().enumerate() { let secret = secrets.entry(secret_ref.clone()).or_insert_with(|| { - let secret = new_signing_key(self.deterministic, index).unwrap(); + let secret = + new_signing_key(secret_ref.key.secret_name.as_ref(), &self.seeds).unwrap(); secret.to_vec() }); diff --git a/crates/chronicle-signing/src/lib.rs b/crates/chronicle-signing/src/lib.rs index f19657a76..ca9c864dd 100644 --- a/crates/chronicle-signing/src/lib.rs +++ b/crates/chronicle-signing/src/lib.rs @@ -10,6 +10,7 @@ use secret_vault::{ SecretNamespace, SecretVaultBuilder, SecretVaultRef, SecretVaultView, }; use std::{ + collections::BTreeMap, path::{Path, PathBuf}, sync::Arc, }; @@ -42,15 +43,19 @@ pub enum SecretError { #[from] source: SecretVaultError, }, + + #[error("Bad BIP39 seed")] + BadSeed, } pub enum ChronicleSecretsOptions { // Connect to hashicorp vault for secrets Vault(vault_secret_manager_source::VaultSecretManagerSourceOptions), - // Generate secrets in memory on demand + // Generate secrets from entropy in memory on demand Embedded, - //Deterministically generate secrets for testing - Test, + + //Seed secrets with name using a map of secret name to BIP39 seed phrase + Seeded(BTreeMap), //Filesystem based keys Filesystem(PathBuf), } @@ -81,9 +86,9 @@ impl ChronicleSecretsOptions { ChronicleSecretsOptions::Embedded } - // Generate deterministic secrets in memory on demand - pub fn test_keys() -> ChronicleSecretsOptions { - ChronicleSecretsOptions::Test + // Use supplied seeds, or fall back to entropy + pub fn seeded(seeds: BTreeMap) -> ChronicleSecretsOptions { + ChronicleSecretsOptions::Seeded(seeds) } } @@ -121,8 +126,11 @@ impl ChronicleSigning { multi_source = multi_source.add_source(&SecretNamespace::new(namespace), source); }, - (namespace, ChronicleSecretsOptions::Test) => { - let source = embedded_secret_manager_source::EmbeddedSecretManagerSource::new_deterministic(); + (namespace, ChronicleSecretsOptions::Seeded(seeds)) => { + let source = + embedded_secret_manager_source::EmbeddedSecretManagerSource::new_seeded( + seeds, + ); multi_source = multi_source.add_source(&SecretNamespace::new(namespace), source); }, @@ -184,6 +192,30 @@ pub trait WithSecret { ) -> Result; } +#[async_trait::async_trait] +pub trait OwnedSecret { + async fn copy_signing_key( + &self, + secret_namespace: &str, + secret_name: &str, + ) -> Result; +} + +#[async_trait::async_trait] +impl OwnedSecret for T { + async fn copy_signing_key( + &self, + secret_namespace: &str, + secret_name: &str, + ) -> Result { + let secret = + WithSecret::with_signing_key(self, secret_namespace, secret_name, |secret| secret) + .await?; + + Ok(secret) + } +} + #[async_trait::async_trait] impl WithSecret for ChronicleSigning { async fn with_signing_key( diff --git a/crates/chronicle/Cargo.toml b/crates/chronicle/Cargo.toml index 53f5d52ed..1bc02bdd5 100644 --- a/crates/chronicle/Cargo.toml +++ b/crates/chronicle/Cargo.toml @@ -10,9 +10,7 @@ version = "0.7.5" Inflector = { workspace = true } api = { path = "../api" } async-graphql = { workspace = true } -async-stl-client = { workspace = true } cfg-if = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } chronicle-signing = { workspace = true } chronicle-telemetry = { path = "../chronicle-telemetry" } chrono = { workspace = true, features = ["serde"] } @@ -50,18 +48,19 @@ user-error = { workspace = true } uuid = { workspace = true } valico = { workspace = true } +embedded-substrate = { path = "../embedded-substrate", optional = true } + [features] devmode = ["inmem"] # Use an in-memory stub ledger -inmem = [] +inmem = ["dep:embedded-substrate"] strict = [] [build-dependencies] [dev-dependencies] -assert_fs = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } -insta = { workspace = true, features = ["yaml"] } -opa-tp-protocol = { path = "../opa-tp-protocol" } -sawtooth-sdk = { workspace = true } -tempfile = { workspace = true } +assert_fs = { workspace = true } +insta = { workspace = true, features = ["yaml"] } +protocol-substrate-chronicle = { path = "../protocol-substrate-chronicle" } +protocol-substrate-opa = { path = "../protocol-substrate-opa" } +tempfile = { workspace = true } diff --git a/crates/chronicle/src/bootstrap/cli.rs b/crates/chronicle/src/bootstrap/cli.rs index d7a934c78..c9b5848b4 100644 --- a/crates/chronicle/src/bootstrap/cli.rs +++ b/crates/chronicle/src/bootstrap/cli.rs @@ -1,7 +1,6 @@ use std::{collections::BTreeMap, convert::Infallible}; use api::ApiError; -use chronicle_protocol::async_stl_client::error::SawtoothCommunicationError; use chronicle_signing::SecretError; use clap::{ builder::{PossibleValuesParser, StringValueParser}, @@ -9,12 +8,9 @@ use clap::{ }; use common::{ attributes::{Attribute, Attributes}, - commands::{ActivityCommand, AgentCommand, ApiCommand, EntityCommand}, - import::FromUrlError, - opa::{OpaExecutorError, PolicyLoaderError}, prov::{ - operations::DerivationType, ActivityId, AgentId, CompactionError, DomaintypeId, EntityId, - ExternalId, ExternalIdPart, ParseIriError, + operations::DerivationType, ActivityId, AgentId, DomaintypeId, EntityId, ExternalId, + ExternalIdPart, ParseIriError, }, }; use iref::Iri; @@ -357,14 +353,14 @@ impl SubCommand for AgentCliModel { external_id: name_from::(matches, "external_id", "id")?, namespace: namespace_from(matches)?, attributes: attributes_from(matches, &self.agent.external_id, &self.attributes)?, - }))) + }))); } if let Some(matches) = matches.subcommand_matches("use") { return Ok(Some(ApiCommand::Agent(AgentCommand::UseInContext { id: id_from(matches, "id")?, namespace: namespace_from(matches)?, - }))) + }))); }; Ok(None) @@ -569,7 +565,7 @@ impl SubCommand for ActivityCliModel { external_id: name_from::(matches, "external_id", "id")?, namespace: namespace_from(matches)?, attributes: attributes_from(matches, &self.activity.external_id, &self.attributes)?, - }))) + }))); } if let Some(matches) = matches.subcommand_matches("start") { @@ -578,7 +574,7 @@ impl SubCommand for ActivityCliModel { namespace: namespace_from(matches)?, time: matches.get_one::("time").map(|t| t.parse()).transpose()?, agent: id_from_option(matches, "agent_id")?, - }))) + }))); }; if let Some(matches) = matches.subcommand_matches("end") { @@ -587,7 +583,7 @@ impl SubCommand for ActivityCliModel { namespace: namespace_from(matches)?, time: matches.get_one::("time").map(|t| t.parse()).transpose()?, agent: id_from_option(matches, "agent_id")?, - }))) + }))); }; if let Some(matches) = matches.subcommand_matches("instant") { @@ -596,7 +592,7 @@ impl SubCommand for ActivityCliModel { namespace: namespace_from(matches)?, time: matches.get_one::("time").map(|t| t.parse()).transpose()?, agent: id_from_option(matches, "agent_id")?, - }))) + }))); }; if let Some(matches) = matches.subcommand_matches("use") { @@ -604,7 +600,7 @@ impl SubCommand for ActivityCliModel { id: id_from(matches, "entity_id")?, namespace: namespace_from(matches)?, activity: id_from(matches, "activity_id")?, - }))) + }))); }; if let Some(matches) = matches.subcommand_matches("generate") { @@ -612,7 +608,7 @@ impl SubCommand for ActivityCliModel { id: id_from(matches, "entity_id")?, namespace: namespace_from(matches)?, activity: id_from(matches, "activity_id")?, - }))) + }))); }; Ok(None) @@ -725,7 +721,7 @@ impl SubCommand for EntityCliModel { external_id: name_from::(matches, "external_id", "id")?, namespace: namespace_from(matches)?, attributes: attributes_from(matches, &self.entity.external_id, &self.attributes)?, - }))) + }))); } if let Some(matches) = matches.subcommand_matches("derive") { @@ -743,7 +739,7 @@ impl SubCommand for EntityCliModel { .unwrap_or(DerivationType::None), activity: id_from_option(matches, "activity_id")?, used_entity: id_from(matches, "used_entity_id")?, - }))) + }))); } Ok(None) @@ -1096,14 +1092,14 @@ impl SubCommand for CliModel { matches.subcommand_matches(&agent.external_id).map(|matches| (agent, matches)) }) { if let Some(cmd) = agent.matches(matches)? { - return Ok(Some(cmd)) + return Ok(Some(cmd)); } } for (entity, matches) in self.entities.iter().filter_map(|entity| { matches.subcommand_matches(&entity.external_id).map(|matches| (entity, matches)) }) { if let Some(cmd) = entity.matches(matches)? { - return Ok(Some(cmd)) + return Ok(Some(cmd)); } } for (activity, matches) in self.activities.iter().filter_map(|activity| { @@ -1112,7 +1108,7 @@ impl SubCommand for CliModel { .map(|matches| (activity, matches)) }) { if let Some(cmd) = activity.matches(matches)? { - return Ok(Some(cmd)) + return Ok(Some(cmd)); } } Ok(None) diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml index 897936e57..61f9b4873 100644 --- a/crates/common/Cargo.toml +++ b/crates/common/Cargo.toml @@ -7,45 +7,66 @@ version = "0.7.5" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = { version="1", default-features=false} -async-graphql = { version="5.0.9", features = [ +anyhow = { version = "1", default-features = false } +async-graphql = { version = "5.0.9", features = [ "opentelemetry", "chrono", "unblock", "default", - "uuid"], optional=true } -sp-std= {version="11.0.0", optional=true} + "uuid", +], optional = true } async-trait = { workspace = true } -chrono = { version="0.4", default-features=false,features=["serde","alloc"] } -diesel = { version="2.0.0-rc.0",features = [ +chrono = { version = "0.4", default-features = false, features = [ + "serde", + "alloc", +] } +diesel = { version = "2.0.0-rc.0", features = [ "postgres", "uuid", "chrono", "r2d2", -], optional=true} -iref= {version="2.2", optional = true} -futures = { version="0.3", default-features=false} -hex = { version="0.4", default-features=false, features=["alloc"]} -rdf-types={ version="0.14", optional=true} -json-ld = { version="0.14", optional=true} -hashbrown = {version="0.13", optional=true} -json-syntax = { version="0.9", features=["serde","serde_json"], optional = true } -k256 = { version="0.11.3",default-features=false,features=["ecdsa","pkcs8"] } -lazy_static = { version="1.4" } -locspan = { version="0.7", optional=true} -mime = { version="0.3", optional=true } -scale-info = {version="2.10.0", default-features=false, features=["derive"]} -parity-scale-codec = {version = "3.6.5", default-features=false,features=["derive","max-encoded-len"]} -newtype-derive-2018 = {workspace=true} -macro-attr-2018 = {workspace=true} -serde = { version="1.0", default-features=false } -serde_derive = { version="1.0",default-features=false } -serde_json = { version="1.0", default-features=false } -iri-string = {version="0.7",default-features=false, features=["alloc"]} +], optional = true } +futures = { version = "0.3", default-features = false } +hashbrown = { version = "0.13", optional = true } +hex = { version = "0.4", default-features = false, features = ["alloc"] } +iref = { version = "2.2", optional = true } +iri-string = { version = "0.7", default-features = false, features = ["alloc"] } +json-ld = { version = "0.14", optional = true } +json-syntax = { version = "0.9", features = [ + "serde", + "serde_json", +], optional = true } +k256 = { version = "0.11.3", default-features = false, features = [ + "ecdsa", + "pkcs8", +] } +lazy_static = { version = "1.4" } +locspan = { version = "0.7", optional = true } +macro-attr-2018 = { workspace = true } +mime = { version = "0.3", optional = true } +newtype-derive-2018 = { workspace = true } +parity-scale-codec = { version = "3.6.5", default-features = false, features = [ + "derive", + "max-encoded-len", +], optional = true } +rdf-types = { version = "0.14", optional = true } +scale-encode = { version = "0.5", default-features = false, features = [ + "derive", +], optional = true } +scale-info = { version = "2.10.0", default-features = false, features = [ + "derive", +], optional = true } +serde = { version = "1.0", default-features = false, features = ["rc"] } +serde_derive = { version = "1.0", default-features = false } +serde_json = { version = "1.0", default-features = false } +sp-core = { version = "25.0.0", default-features = false } +sp-std = { version = "11.0.0", optional = true } thiserror = { workspace = true } -thiserror-no-std = {version="2.0.2" } -tracing = { version="0.1.40", default-features=false, features=["attributes"]} -uuid = {version="1.5.0", default-features=false, features=["serde"]} +thiserror-no-std = { version = "2.0.2" } +tracing = { version = "0.1.40", default-features = false, features = [ + "attributes", +] } +uuid = { version = "1.5.0", default-features = false, features = ["serde"] } [build-dependencies] glob = { workspace = true } @@ -53,20 +74,45 @@ lazy_static = { workspace = true } serde_json = { workspace = true } [dev-dependencies] -tokio={workspace=true} +criterion = { workspace = true } +insta = { workspace = true, features = ["json"] } +mockito = { workspace = true } +proptest = { workspace = true } +tempfile = { workspace = true } testcontainers = { workspace = true } -criterion = { workspace = true } -insta = { workspace = true, features = ["json"] } -mockito = { workspace = true } -proptest = { workspace = true } -tempfile = { workspace = true } +tokio = { workspace = true } [features] -std = ["k256/std","tracing/std","serde/std","serde_json/std","hex/std","futures/std","iri-string/std","chrono/std","anyhow/std"] -default = ["std","graphql-bindings","diesel-bindings","json-ld"] +default = [] +std = [ + "k256/std", + "sp-core/std", + "tracing/std", + "serde/std", + "serde_json/std", + "hex/std", + "scale-encode/std", + "futures/std", + "iri-string/std", + "chrono/std", + "anyhow/std", +] # Enable parity support, annoyingly lazy_static has a non standard way of enabling non_std -parity = ["lazy_static/spin_no_std"] +parity-encoding = [ + "lazy_static/spin_no_std", + "dep:parity-scale-codec", + "dep:scale-info", + "dep:scale-encode", +] # At this point, LD should be a seperate crate -json-ld = ["dep:json-ld","dep:json-syntax","dep:rdf-types","dep:hashbrown","dep:mime","dep:locspan","dep:iref"] +diesel-bindings = ["diesel"] graphql-bindings = ["async-graphql"] -diesel-bindings = ["diesel"] +json-ld = [ + "dep:json-ld", + "dep:json-syntax", + "dep:rdf-types", + "dep:hashbrown", + "dep:mime", + "dep:locspan", + "dep:iref", +] diff --git a/crates/common/src/attributes.rs b/crates/common/src/attributes.rs index b7e67c892..641573e31 100644 --- a/crates/common/src/attributes.rs +++ b/crates/common/src/attributes.rs @@ -1,13 +1,13 @@ #[cfg(feature = "std")] use std::collections::BTreeMap; +use parity_scale_codec::Encode; #[cfg(not(feature = "std"))] use parity_scale_codec::{alloc::collections::BTreeMap, alloc::string::String}; +use scale_encode::error::Kind; #[cfg(not(feature = "std"))] use scale_info::{prelude::borrow::ToOwned, prelude::string::ToString, prelude::*}; -use parity_scale_codec::{Decode, Encode}; -use scale_info::{build::Fields, Path, Type, TypeInfo}; use serde_json::Value; use crate::prov::DomaintypeId; @@ -27,7 +27,31 @@ impl core::fmt::Display for SerdeWrapper { } } -impl Encode for SerdeWrapper { +#[cfg(feature = "parity-encoding")] +impl scale_encode::EncodeAsType for SerdeWrapper { + fn encode_as_type_to( + &self, + type_id: u32, + _types: &scale_info::PortableRegistry, + out: &mut scale_encode::Vec, + ) -> Result<(), scale_encode::Error> { + let json_string = match serde_json::to_string(&self.0) { + Ok(json_string) => json_string, + Err(e) => { + tracing::error!("Failed to serialize Value to JSON string: {}", e); + return Err(scale_encode::Error::new(scale_encode::error::ErrorKind::WrongShape { + actual: Kind::Str, + expected: type_id, + })); + }, + }; + json_string.encode_to(out); + Ok(()) + } +} + +#[cfg(feature = "parity-encoding")] +impl parity_scale_codec::Encode for SerdeWrapper { fn encode_to(&self, dest: &mut T) { let json_string = serde_json::to_string(&self.0).expect("Failed to serialize Value to JSON string"); @@ -35,19 +59,8 @@ impl Encode for SerdeWrapper { } } -impl From for SerdeWrapper { - fn from(value: Value) -> Self { - SerdeWrapper(value) - } -} - -impl From for Value { - fn from(wrapper: SerdeWrapper) -> Self { - wrapper.0 - } -} - -impl Decode for SerdeWrapper { +#[cfg(feature = "parity-encoding")] +impl parity_scale_codec::Decode for SerdeWrapper { fn decode( input: &mut I, ) -> Result { @@ -59,16 +72,40 @@ impl Decode for SerdeWrapper { } } -impl TypeInfo for SerdeWrapper { +#[cfg(feature = "parity-encoding")] +impl scale_info::TypeInfo for SerdeWrapper { type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("SerdeWrapper", module_path!())) - .composite(Fields::unnamed().field(|f| f.ty::().type_name("Json"))) + fn type_info() -> scale_info::Type { + scale_info::Type::builder() + .path(scale_info::Path::new("SerdeWrapper", module_path!())) + .composite( + scale_info::build::Fields::unnamed().field(|f| f.ty::().type_name("Json")), + ) + } +} + +impl From for SerdeWrapper { + fn from(value: Value) -> Self { + SerdeWrapper(value) } } -#[derive(Debug, Clone, Encode, Decode, TypeInfo, Serialize, Deserialize, PartialEq, Eq)] +impl From for Value { + fn from(wrapper: SerdeWrapper) -> Self { + wrapper.0 + } +} + +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct Attribute { pub typ: String, pub value: SerdeWrapper, @@ -98,9 +135,16 @@ impl Attribute { } } -#[derive( - Debug, Clone, Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Default, +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)] pub struct Attributes { pub typ: Option, pub attributes: BTreeMap, diff --git a/crates/common/src/identity.rs b/crates/common/src/identity.rs index 9147603fd..0667a2bd9 100644 --- a/crates/common/src/identity.rs +++ b/crates/common/src/identity.rs @@ -1,19 +1,16 @@ use crate::prov::AgentId; -use k256::{ - ecdsa::VerifyingKey, - sha2::{Digest, Sha512}, -}; +use k256::sha2::{Digest, Sha512}; use serde_json::{Map, Value}; use tracing::warn; #[cfg(not(feature = "std"))] use parity_scale_codec::{ alloc::collections::BTreeMap, alloc::collections::BTreeSet, alloc::string::String, - alloc::vec::Vec, + alloc::vec::Vec, Decode, Encode, }; #[cfg(not(feature = "std"))] -use scale_info::{prelude::borrow::ToOwned, prelude::string::ToString, prelude::*}; +use scale_info::{prelude::borrow::ToOwned, prelude::string::ToString, prelude::*, TypeInfo}; #[cfg(feature = "std")] use std::collections::BTreeMap; @@ -31,16 +28,13 @@ pub enum IdentityError { JwtClaims, #[error("Signer : {0}")] - KeyStore(#[from] anyhow::Error), + Signing(#[from] anyhow::Error), #[error("Malformed JSON: {0}")] SerdeJson(#[from] serde_json::Error), #[error("Serialization error: {0}")] SerdeJsonSerialize(String), - - #[error("Signing error: {0}")] - Signing(#[from] k256::ecdsa::Error), } /// Contains the scalar ID and identity claims for a user established via JWT @@ -192,22 +186,26 @@ impl OpaData { )) } } - /// Signed user identity containing the serialized identity, signature, and /// verifying key. Implements `TryFrom` to deserialize to the user identity object +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] #[derive(Clone, Debug, Eq, PartialEq)] pub struct SignedIdentity { pub identity: String, pub signature: Option>, - pub verifying_key: Option, + pub verifying_key: Option>, } impl SignedIdentity { - fn new( - id: &AuthId, - signature: Vec, - verifying_key: VerifyingKey, - ) -> Result { + fn new(id: &AuthId, signature: Vec, verifying_key: Vec) -> Result { Ok(Self { identity: serde_json::to_string(&id)?, signature: Some(signature), diff --git a/crates/common/src/json_ld.rs b/crates/common/src/json_ld.rs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/crates/common/src/json_ld.rs @@ -0,0 +1 @@ + diff --git a/crates/common/src/ledger.rs b/crates/common/src/ledger.rs index f4edf1fb6..2e2fb3f46 100644 --- a/crates/common/src/ledger.rs +++ b/crates/common/src/ledger.rs @@ -1,4 +1,3 @@ -use scale_info::TypeInfo; use tracing::instrument; use crate::{ @@ -19,7 +18,8 @@ use core::str::FromStr; #[cfg(not(feature = "std"))] use parity_scale_codec::{ alloc::boxed::Box, alloc::collections::btree_map::Entry, alloc::collections::BTreeMap, - alloc::collections::BTreeSet, alloc::string::String, alloc::sync::Arc, alloc::vec::Vec, + alloc::collections::BTreeSet, alloc::string::String, alloc::sync::Arc, alloc::vec::Vec, Decode, + Encode, }; #[cfg(not(feature = "std"))] use scale_info::prelude::*; @@ -36,6 +36,9 @@ pub enum SubmissionError { Contradiction { source: Contradiction, tx_id: ChronicleTransactionId }, } +#[cfg(feature = "std")] +impl std::error::Error for SubmissionError {} + impl SubmissionError { pub fn tx_id(&self) -> &ChronicleTransactionId { match self { @@ -46,15 +49,15 @@ impl SubmissionError { } pub fn processor(tx_id: &ChronicleTransactionId, source: ProcessorError) -> SubmissionError { - SubmissionError::Processor { source: Arc::new(source), tx_id: tx_id.clone() } + SubmissionError::Processor { source: Arc::new(source), tx_id: *tx_id } } pub fn contradiction(tx_id: &ChronicleTransactionId, source: Contradiction) -> SubmissionError { - SubmissionError::Contradiction { source, tx_id: tx_id.clone() } + SubmissionError::Contradiction { source, tx_id: *tx_id } } pub fn communication(tx_id: &ChronicleTransactionId, source: anyhow::Error) -> SubmissionError { - SubmissionError::Communication { source: Arc::new(source), tx_id: tx_id.clone() } + SubmissionError::Communication { source: Arc::new(source), tx_id: *tx_id } } } @@ -81,6 +84,49 @@ impl core::fmt::Display for SubmissionError { } } +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + scale_encode::EncodeAsType, + parity_scale_codec::Encode, + parity_scale_codec::Decode + ) +)] +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct OperationSubmission { + pub correlation_id: [u8; 16], + pub operations: Arc>, + pub identity: Arc, +} + +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + scale_encode::EncodeAsType, + parity_scale_codec::Encode, + parity_scale_codec::Decode + ) +)] +pub struct ApplyArgs { + pub operations: OperationSubmission, +} + +impl OperationSubmission { + pub fn new(identity: SignedIdentity, operations: Vec) -> Self { + OperationSubmission { + correlation_id: uuid::Uuid::new_v4().into_bytes(), + identity: identity.into(), + operations: operations.into(), + } + } + + pub fn new_anonymous(operations: Vec) -> Self { + Self::new(SignedIdentity::new_no_identity(), operations) + } +} + pub type SubmitResult = Result; #[derive(Debug, Clone)] @@ -111,7 +157,7 @@ impl SubmissionStage { } pub fn submitted(r: &ChronicleTransactionId) -> Self { - SubmissionStage::Submitted(Ok(r.clone())) + SubmissionStage::Submitted(Ok(*r)) } pub fn committed(commit: Commit, identity: SignedIdentity) -> Self { @@ -138,16 +184,10 @@ impl SubmissionStage { } } -#[derive( - parity_scale_codec::Encode, - parity_scale_codec::Decode, - TypeInfo, - PartialEq, - Eq, - PartialOrd, - Ord, - Debug, - Clone, +#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct LedgerAddress { // Namespaces do not have a namespace @@ -155,6 +195,7 @@ pub struct LedgerAddress { resource: ChronicleIri, } +#[cfg(feature = "parity-encoding")] impl parity_scale_codec::MaxEncodedLen for LedgerAddress { fn max_encoded_len() -> usize { 2048usize diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs index 1065a21fe..8651e2898 100644 --- a/crates/common/src/lib.rs +++ b/crates/common/src/lib.rs @@ -7,6 +7,7 @@ pub mod attributes; pub mod context; pub mod identity; pub mod ledger; +pub mod opa; pub mod prov; pub use k256; diff --git a/crates/common/src/opa.rs b/crates/common/src/opa.rs new file mode 100644 index 000000000..123b91947 --- /dev/null +++ b/crates/common/src/opa.rs @@ -0,0 +1,466 @@ +#[cfg(not(feature = "std"))] +use parity_scale_codec::alloc::string::String; +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType, + parity_scale_codec::MaxEncodedLen + ) +)] +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct PolicyAddress(H128); + +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType, + parity_scale_codec::MaxEncodedLen + ) +)] +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct PolicyMetaAddress(H128); + +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType, + parity_scale_codec::MaxEncodedLen + ) +)] +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct KeyAddress(H128); + +use scale_encode::ext::primitive_types::H128; +#[cfg(not(feature = "std"))] +use scale_info::prelude::{string::String, vec::Vec}; +use sp_core::blake2_128; + +#[derive(Debug, Clone, Eq, PartialEq)] +// This message is used to bootstrap the root key for a newly created authz tp, +// it can only be executed once +pub struct BootstrapRoot { + pub public_key: PemEncoded, +} +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType, + ) +)] +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct PemEncoded(String); + +impl PemEncoded { + pub fn as_str(&self) -> &str { + &self.0 + } + + pub fn as_bytes(&self) -> &[u8] { + self.0.as_bytes() + } +} + +impl PemEncoded { + pub fn new(encoded: String) -> Self { + PemEncoded(encoded) + } +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct RegisterKey { + pub public_key: PemEncoded, + pub id: String, + pub overwrite_existing: bool, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct NewPublicKey { + pub public_key: PemEncoded, + pub id: String, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +// Rotate the key with name to the new public key, the SignedOperation for this +// message must be signed by the old key. The signature must be valid for +// the new one, to demonstrate ownership of both keys +pub struct RotateKey { + pub payload: NewPublicKey, + pub previous_signing_key: PemEncoded, + pub previous_signature: Vec, + pub new_signing_key: PemEncoded, + pub new_signature: Vec, +} +#[derive(Debug, Clone, Eq, PartialEq)] +// Set the policy with name to the new policy, the SignedOperation for this must +// be signed by the root key +pub struct SetPolicy { + pub id: String, + pub policy: Policy, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct SignedOperationPayload { + pub operation: Operation, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +// An OPA TP operation and its signature +pub struct SignedOperation { + pub payload: SignedOperationPayload, + pub verifying_key: PemEncoded, + pub signature: Vec, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub enum Operation { + RegisterKey(RegisterKey), + RotateKey(RotateKey), + SetPolicy(SetPolicy), +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct OpaSubmission { + pub version: String, + pub correlation_id: [u8; 16], + pub span_id: u64, + pub payload: Payload, +} + +#[derive(Debug, Clone, Eq, PartialEq)] +pub enum Payload { + BootstrapRoot(BootstrapRoot), + SignedOperation(SignedOperation), +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct KeyRegistration { + pub key: PemEncoded, + pub version: u64, +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Keys { + pub id: String, + pub current: KeyRegistration, + pub expired: Option, +} + +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType, + ) +)] +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Policy(Vec); + +impl Policy { + pub fn new(data: Vec) -> Self { + Policy(data) + } + + pub fn as_bytes(&self) -> &[u8] { + &self.0 + } +} + +pub fn policy_address(id: impl AsRef) -> PolicyAddress { + PolicyAddress(blake2_128(format!("opa:policy:binary:{}", id.as_ref()).as_bytes()).into()) +} + +pub fn policy_meta_address(id: impl AsRef) -> PolicyMetaAddress { + PolicyMetaAddress(blake2_128(format!("opa:policy:meta:{}", id.as_ref()).as_bytes()).into()) +} + +pub fn key_address(id: impl AsRef) -> KeyAddress { + KeyAddress(blake2_128(format!("opa:keys:{}", id.as_ref()).as_bytes()).into()) +} + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct PolicyMeta { + pub id: String, + pub hash: H128, + pub policy_address: PolicyAddress, +} + +pub mod codec { + use super::*; + use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; + use scale_info::TypeInfo; + + #[derive(Encode, Decode, Debug, Eq, PartialEq, TypeInfo, Clone)] + pub struct KeysV1 { + pub id: String, + pub current: KeyRegistrationV1, + pub expired: Option, + } + + impl MaxEncodedLen for KeysV1 { + fn max_encoded_len() -> usize { + 1024 + KeyRegistrationV1::max_encoded_len() + + Option::::max_encoded_len() + } + } + + #[derive(Encode, Decode, Debug, Eq, PartialEq, TypeInfo, Clone)] + pub struct KeyRegistrationV1 { + // Der encoded public key + pub key: PemEncoded, + pub version: u64, + } + + impl MaxEncodedLen for KeyRegistrationV1 { + fn max_encoded_len() -> usize { + 1024 + u64::max_encoded_len() + } + } + + impl From for KeysV1 { + fn from(keys: super::Keys) -> Self { + Self { + id: keys.id, + current: KeyRegistrationV1 { key: keys.current.key, version: keys.current.version }, + expired: keys.expired.map(|expired_key| KeyRegistrationV1 { + key: expired_key.key, + version: expired_key.version, + }), + } + } + } + + impl std::convert::TryFrom for super::Keys { + type Error = std::convert::Infallible; + + fn try_from(keys_v1: KeysV1) -> Result { + Ok(Self { + id: keys_v1.id, + current: super::KeyRegistration { + key: keys_v1.current.key, + version: keys_v1.current.version, + }, + expired: keys_v1.expired.map(|expired_key_v1| super::KeyRegistration { + key: expired_key_v1.key, + version: expired_key_v1.version, + }), + }) + } + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct BootstrapRootV1 { + pub public_key: PemEncoded, + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct RegisterKeyV1 { + pub public_key: PemEncoded, + pub id: String, + pub overwrite_existing: bool, + } + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct NewPublicKeyV1 { + pub public_key: PemEncoded, + pub id: String, + } + + impl From for NewPublicKeyV1 { + fn from(new_public_key: super::NewPublicKey) -> Self { + Self { public_key: new_public_key.public_key, id: new_public_key.id } + } + } + + impl std::convert::TryFrom for super::NewPublicKey { + type Error = std::convert::Infallible; + + fn try_from(new_public_key_v1: NewPublicKeyV1) -> Result { + Ok(Self { public_key: new_public_key_v1.public_key, id: new_public_key_v1.id }) + } + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct RotateKeyV1 { + pub payload: NewPublicKeyV1, + pub previous_signing_key: PemEncoded, + pub previous_signature: Vec, + pub new_signing_key: PemEncoded, + pub new_signature: Vec, + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct SetPolicyV1 { + pub id: String, + pub policy: Policy, + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct SignedOperationPayloadV1 { + pub operation: OperationV1, + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct SignedOperationV1 { + pub payload: SignedOperationPayloadV1, + pub verifying_key: PemEncoded, + pub signature: Vec, + } + + #[derive(Encode, Decode, Debug, Clone, TypeInfo, PartialEq, Eq)] + pub enum OperationV1 { + RegisterKey(RegisterKeyV1), + RotateKey(RotateKeyV1), + SetPolicy(SetPolicyV1), + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub struct OpaSubmissionV1 { + pub version: String, + pub correlation_id: [u8; 16], + pub span_id: u64, + pub payload: PayloadV1, + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq, Eq)] + pub enum PayloadV1 { + BootstrapRoot(BootstrapRootV1), + SignedOperation(SignedOperationV1), + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq)] + pub struct PolicyV1(Vec); + + impl MaxEncodedLen for PolicyV1 { + fn max_encoded_len() -> usize { + 1024 * 1024 * 10 + } + } + + impl From for codec::PolicyV1 { + fn from(item: Policy) -> Self { + Self(item.0) + } + } + + impl std::convert::TryFrom for Policy { + type Error = std::convert::Infallible; + + fn try_from(value: codec::PolicyV1) -> Result { + Ok(Self(value.0)) + } + } + + #[derive(Encode, Decode, Debug, TypeInfo, Clone, PartialEq)] + pub struct PolicyMetaV1 { + pub id: String, + pub hash: H128, + pub policy_address: PolicyAddress, + } + + impl MaxEncodedLen for PolicyMetaV1 { + fn max_encoded_len() -> usize { + 1024 + H128::max_encoded_len() + PolicyAddress::max_encoded_len() + } + } + + impl From for codec::PolicyMetaV1 { + fn from(item: super::PolicyMeta) -> Self { + Self { id: item.id, hash: item.hash, policy_address: item.policy_address } + } + } + + impl std::convert::TryFrom for super::PolicyMeta { + type Error = std::convert::Infallible; + + fn try_from(value: codec::PolicyMetaV1) -> Result { + Ok(Self { id: value.id, hash: value.hash, policy_address: value.policy_address }) + } + } + + impl From for BootstrapRoot { + fn from(item: codec::BootstrapRootV1) -> Self { + Self { public_key: item.public_key } + } + } + + impl From for Payload { + fn from(item: codec::PayloadV1) -> Self { + match item { + codec::PayloadV1::BootstrapRoot(v) => Self::BootstrapRoot(v.into()), + codec::PayloadV1::SignedOperation(v) => Self::SignedOperation(v.into()), + } + } + } + + impl From for OpaSubmission { + fn from(item: codec::OpaSubmissionV1) -> Self { + Self { + correlation_id: item.correlation_id, + version: item.version, + span_id: item.span_id, + payload: item.payload.into(), + } + } + } + + impl From for Operation { + fn from(item: codec::OperationV1) -> Self { + match item { + codec::OperationV1::RegisterKey(v) => Self::RegisterKey(v.into()), + codec::OperationV1::RotateKey(v) => Self::RotateKey(v.into()), + codec::OperationV1::SetPolicy(v) => Self::SetPolicy(v.into()), + } + } + } + + impl From for SignedOperation { + fn from(item: codec::SignedOperationV1) -> Self { + Self { + payload: SignedOperationPayload { operation: item.payload.operation.into() }, + verifying_key: item.verifying_key, + signature: item.signature, + } + } + } + + impl From for RotateKey { + fn from(item: codec::RotateKeyV1) -> Self { + Self { + payload: NewPublicKey { public_key: item.payload.public_key, id: item.payload.id }, + previous_signing_key: item.previous_signing_key, + previous_signature: item.previous_signature, + new_signing_key: item.new_signing_key, + new_signature: item.new_signature, + } + } + } + + impl From for RegisterKey { + fn from(item: codec::RegisterKeyV1) -> Self { + Self { + public_key: item.public_key, + id: item.id, + overwrite_existing: item.overwrite_existing, + } + } + } + + impl From for SetPolicy { + fn from(item: codec::SetPolicyV1) -> Self { + Self { id: item.id, policy: item.policy } + } + } +} diff --git a/crates/common/src/prov/id/graphlql_scalars.rs b/crates/common/src/prov/id/graphlql_scalars.rs index 47a78a6d9..d6d9b1706 100644 --- a/crates/common/src/prov/id/graphlql_scalars.rs +++ b/crates/common/src/prov/id/graphlql_scalars.rs @@ -1,5 +1,4 @@ use async_graphql::{InputValueError, InputValueResult, Scalar, ScalarType, Value}; -use iref::Iri; use super::{ActivityId, AgentId, ChronicleJSON, DomaintypeId, EntityId}; diff --git a/crates/common/src/prov/id/mod.rs b/crates/common/src/prov/id/mod.rs index 8e3492f5a..20f9fda63 100644 --- a/crates/common/src/prov/id/mod.rs +++ b/crates/common/src/prov/id/mod.rs @@ -2,12 +2,9 @@ mod graphlql_scalars; #[cfg(feature = "graphql-bindings")] use async_graphql::OneofObject; -#[cfg(feature = "graphql-bindings")] -pub use graphlql_scalars::*; -use iri_string::types::{IriAbsoluteString, UriAbsoluteString, UriRelativeStr}; -use parity_scale_codec::{Decode, Encode}; -use scale_info::{build::Fields, Path, Type, TypeInfo}; + +use iri_string::types::{IriAbsoluteString, UriAbsoluteString}; use tracing::trace; #[cfg(feature = "diesel-bindings")] @@ -59,8 +56,8 @@ impl ProbableChronicleIri { fn from_uri(uri: UriAbsoluteString) -> Result { let iri: IriAbsoluteString = uri.into(); - if iri.authority_str() != Some(Chronicle::PREFIX) - && iri.authority_str() != Some(Chronicle::LONG_PREFIX) + if iri.authority_str() != Some(Chronicle::PREFIX) && + iri.authority_str() != Some(Chronicle::LONG_PREFIX) { return Err(ParseIriError::IncorrectIriKind(iri.to_string())); } @@ -68,7 +65,7 @@ impl ProbableChronicleIri { Ok(Self(iri)) } - fn path_components<'a>(&'a self) -> impl Iterator { + fn path_components(&self) -> impl Iterator { self.0.path_str().split(':') } } @@ -79,19 +76,15 @@ impl core::fmt::Display for ProbableChronicleIri { } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] #[cfg_attr(feature = "diesel-bindings", derive(AsExpression, FromSqlRow))] #[cfg_attr(feature = "diesel-bindings", diesel(sql_type = diesel::sql_types::Text))] @@ -124,19 +117,15 @@ impl AsRef for &Role { } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - PartialOrd, - Ord, - Hash, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] #[cfg_attr(feature = "diesel-bindings", derive(AsExpression, FromSqlRow))] #[cfg_attr(feature = "diesel-bindings", diesel(sql_type = diesel::sql_types::Text))] @@ -174,7 +163,7 @@ pub trait ExternalIdPart { } pub trait UuidPart { - fn uuid_part(&self) -> &Uuid; + fn uuid_part(&self) -> Uuid; } /// Transform a chronicle IRI into its compact representation @@ -199,19 +188,15 @@ impl FromCompact for T { } } -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub enum ChronicleIri { Namespace(NamespaceId), @@ -224,6 +209,7 @@ pub enum ChronicleIri { Delegation(DelegationId), } +#[cfg(feature = "parity-encoding")] impl parity_scale_codec::MaxEncodedLen for ChronicleIri { fn max_encoded_len() -> usize { 2048usize @@ -343,19 +329,15 @@ fn optional_component(external_id: &str, component: &str) -> Result for UriAbsoluteString { &val.activity().map(|n| ActivityId::from_external_id(n.external_id_part())), &val.role, ) - .into() } } // A composite identifier of agent, activity and role -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct AssociationId { agent: ExternalId, @@ -535,24 +512,19 @@ impl From<&AssociationId> for UriAbsoluteString { &ActivityId::from_external_id(&val.activity), &val.role, ) - .into() } } // A composite identifier of agent, entity, and role -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct AttributionId { agent: ExternalId, @@ -627,23 +599,18 @@ impl From<&AttributionId> for UriAbsoluteString { &EntityId::from_external_id(&val.entity), &val.role, ) - .into() - } -} - -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, + } +} + +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct DomaintypeId(ExternalId); @@ -694,61 +661,23 @@ impl TryFrom for DomaintypeId { impl From<&DomaintypeId> for UriAbsoluteString { fn from(val: &DomaintypeId) -> Self { - Chronicle::domaintype(&val.0).into() + Chronicle::domaintype(&val.0) } } -#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug, Hash, PartialOrd, Ord)] -pub struct UuidWrapper(Uuid); - -impl From for UuidWrapper { - fn from(uuid: Uuid) -> Self { - Self(uuid) - } -} - -impl Encode for UuidWrapper { - fn encode_to(&self, dest: &mut T) { - self.0.as_bytes().encode_to(dest); - } -} - -impl Decode for UuidWrapper { - fn decode( - input: &mut I, - ) -> Result { - let uuid_bytes = <[u8; 16]>::decode(input)?; - let uuid = Uuid::from_slice(&uuid_bytes).map_err(|_| "Error decoding UUID")?; - Ok(Self(uuid)) - } -} - -impl TypeInfo for UuidWrapper { - type Identity = Self; - fn type_info() -> Type { - Type::builder() - .path(Path::new("UuidWrapper", module_path!())) - .composite(Fields::unnamed().field(|f| f.ty::<[u8; 16]>().type_name("Uuid"))) - } -} - -#[derive( - Serialize, - Deserialize, - Decode, - Encode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct NamespaceId { external_id: ExternalId, - uuid: UuidWrapper, + uuid: [u8; 16], } impl core::fmt::Display for NamespaceId { @@ -759,7 +688,7 @@ impl core::fmt::Display for NamespaceId { impl NamespaceId { pub fn from_external_id(external_id: impl AsRef, uuid: Uuid) -> Self { - Self { external_id: external_id.as_ref().into(), uuid: uuid.into() } + Self { external_id: external_id.as_ref().into(), uuid: uuid.into_bytes() } } } @@ -770,8 +699,8 @@ impl ExternalIdPart for NamespaceId { } impl UuidPart for NamespaceId { - fn uuid_part(&self) -> &Uuid { - &self.uuid.0 + fn uuid_part(&self) -> Uuid { + Uuid::from_bytes(self.uuid) } } @@ -798,7 +727,7 @@ impl TryFrom for NamespaceId { match iri.path_components().collect::>().as_slice() { [_, external_id, uuid] => Ok(Self { external_id: ExternalId::from(external_id), - uuid: Uuid::parse_str(uuid).map_err(ParseIriError::UnparsableUuid)?.into(), + uuid: Uuid::parse_str(uuid).map_err(ParseIriError::UnparsableUuid)?.into_bytes(), }), _ => Err(ParseIriError::UnparsableIri(iri.to_string())), @@ -808,23 +737,19 @@ impl TryFrom for NamespaceId { impl From<&NamespaceId> for UriAbsoluteString { fn from(val: &NamespaceId) -> Self { - Chronicle::namespace(&val.external_id, &val.uuid.0).into() - } -} - -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, + Chronicle::namespace(&val.external_id, &val.uuid_part()) + } +} + +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct EntityId(ExternalId); @@ -876,7 +801,7 @@ impl TryFrom for EntityId { impl From<&EntityId> for UriAbsoluteString { fn from(val: &EntityId) -> Self { - Chronicle::entity(&val.0).into() + Chronicle::entity(&val.0) } } @@ -897,19 +822,15 @@ impl From for EntityId { } } -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct AgentId(ExternalId); @@ -980,19 +901,15 @@ impl From for AgentId { } } -#[derive( - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, - PartialEq, - Eq, - Hash, - Debug, - Clone, - Ord, - PartialOrd, +#[derive(Serialize, Deserialize, PartialEq, Eq, Hash, Debug, Clone, Ord, PartialOrd)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] pub struct ActivityId(ExternalId); @@ -1044,7 +961,7 @@ impl TryFrom for ActivityId { impl From<&ActivityId> for UriAbsoluteString { fn from(val: &ActivityId) -> Self { - Chronicle::activity(&val.0).into() + Chronicle::activity(&val.0) } } diff --git a/crates/common/src/prov/model/contradiction.rs b/crates/common/src/prov/model/contradiction.rs index 2ef602dfc..d5030a6b0 100644 --- a/crates/common/src/prov/model/contradiction.rs +++ b/crates/common/src/prov/model/contradiction.rs @@ -1,5 +1,4 @@ use chrono::{DateTime, Utc}; -use scale_info::TypeInfo; #[cfg(not(feature = "std"))] use parity_scale_codec::{alloc::string::String, alloc::vec::Vec}; @@ -12,9 +11,11 @@ use crate::{ prov::{operations::TimeWrapper, ChronicleIri, NamespaceId}, }; -use parity_scale_codec::{Decode, Encode}; - -#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Encode, Decode, TypeInfo)] +#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] pub struct Contradiction { pub(crate) id: ChronicleIri, pub(crate) namespace: NamespaceId, @@ -113,7 +114,11 @@ impl Contradiction { } } -#[derive(Debug, Clone, Encode, Decode, TypeInfo, Serialize, Deserialize, Eq, PartialEq)] +#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] pub enum ContradictionDetail { AttributeValueChange { name: String, value: Attribute, attempted: Attribute }, StartAlteration { value: TimeWrapper, attempted: TimeWrapper }, diff --git a/crates/common/src/prov/model/json_ld/from_json_ld.rs b/crates/common/src/prov/model/json_ld/from_json_ld.rs index b45f2fb76..b05a4b5e8 100644 --- a/crates/common/src/prov/model/json_ld/from_json_ld.rs +++ b/crates/common/src/prov/model/json_ld/from_json_ld.rs @@ -1,8 +1,8 @@ use chrono::{DateTime, Utc}; use futures::{future::BoxFuture, FutureExt}; -use iref::{Iri, IriBuf, IriRef}; -use iri_string::types::{IriAbsoluteString, UriAbsoluteStr, UriAbsoluteString}; +use iref::{IriBuf}; +use iri_string::types::{IriAbsoluteString}; use json_ld::{ syntax::IntoJsonWithContextMeta, Indexed, Loader, Node, Profile, RemoteDocument, Term, }; @@ -26,7 +26,7 @@ use crate::{ WasInformedBy, }, vocab::{Chronicle, ChronicleOperations, Prov}, - ActivityId, AgentId, DomaintypeId, EntityId, ExternalIdPart, NamespaceId, Role, UuidPart, + ActivityId, AgentId, DomaintypeId, EntityId, ExternalIdPart, NamespaceId, Role, }, }; @@ -96,10 +96,10 @@ fn extract_reference_ids>( ids } -fn extract_scalar_prop<'a, I: Into + Clone>( +fn extract_scalar_prop + Clone>( iri: I, - node: &'a Node, -) -> Result<&'a Indexed, ()>, ProcessorError> { + node: &Node, +) -> Result<&Indexed, ()>, ProcessorError> { if let Some(object) = node.get_any(&id_from_iri_string(iri.clone())) { Ok(object) } else { @@ -192,7 +192,7 @@ impl ProvModel { if let serde_json::Value::Object(map) = as_json(node) { if let Some(serde_json::Value::Array(array)) = map.get(Chronicle::Value.as_str()) { if array.len() == 1 { - let o = array.get(0).unwrap(); + let o = array.first().unwrap(); let serde_object = &o["@value"]; if let serde_json::Value::Object(object) = serde_object { @@ -676,13 +676,7 @@ impl ChronicleOperation { object.value().inner().as_node().ok_or(ProcessorError::NotANode(json.clone()))?; if o.has_type(&id_from_iri_string(ChronicleOperations::CreateNamespace)) { let namespace = o.namespace(); - let external_id = namespace.external_id_part().to_owned(); - let uuid = namespace.uuid_part().to_owned(); - Ok(ChronicleOperation::CreateNamespace(CreateNamespace { - id: namespace, - external_id, - uuid: uuid.into(), - })) + Ok(ChronicleOperation::CreateNamespace(CreateNamespace { id: namespace })) } else if o.has_type(&id_from_iri_string(ChronicleOperations::AgentExists)) { let namespace = o.namespace(); let agent = o.agent(); diff --git a/crates/common/src/prov/model/json_ld/to_json_ld.rs b/crates/common/src/prov/model/json_ld/to_json_ld.rs index 1c8a0dda0..257df56bc 100644 --- a/crates/common/src/prov/model/json_ld/to_json_ld.rs +++ b/crates/common/src/prov/model/json_ld/to_json_ld.rs @@ -7,14 +7,12 @@ use parity_scale_codec::{ }; use super::ExpandedJson; -use crate::prov::operations::*; -use crate::prov::ProvModel; use crate::{ attributes::{Attribute, Attributes}, prov::{ - operations::{ChronicleOperation, CreateNamespace, DerivationType}, + operations::{ChronicleOperation, CreateNamespace, DerivationType, *}, vocab::{Chronicle, ChronicleOperations, Prov}, - ChronicleIri, ExternalIdPart, FromCompact, UuidPart, + ChronicleIri, ExternalIdPart, FromCompact, ProvModel, UuidPart, }, }; pub trait ToJson { @@ -215,7 +213,7 @@ impl ToJson for ProvModel { for ((namespace, id), activity) in self.activities.iter() { let mut typ = vec![Prov::Activity.de_compact()]; - if let Some(x) = activity.domaintypeid.as_ref() { + if let Some(x) = activity.domaintype_id.as_ref() { typ.push(x.de_compact()) } @@ -276,7 +274,7 @@ impl ToJson for ProvModel { let mut values = Vec::new(); values.push(json!({ - "@id": Value::String(activity.namespaceid.de_compact()), + "@id": Value::String(activity.namespace_id.de_compact()), })); activitydoc.insert(Chronicle::HasNamespace.to_string(), Value::Array(values)); @@ -360,7 +358,7 @@ impl ToJson for ProvModel { entitydoc.insert(Prov::WasGeneratedBy.to_string(), Value::Array(ids)); } - let entity_key = (entity.namespaceid.clone(), entity.id.clone()); + let entity_key = (entity.namespace_id.clone(), entity.id.clone()); if let Some(attributions) = self.attribution.get(&entity_key) { let mut ids = Vec::new(); @@ -382,7 +380,7 @@ impl ToJson for ProvModel { let mut values = Vec::new(); values.push(json!({ - "@id": Value::String(entity.namespaceid.de_compact()), + "@id": Value::String(entity.namespace_id.de_compact()), })); entitydoc.insert(Chronicle::HasNamespace.to_string(), Value::Array(values)); diff --git a/crates/common/src/prov/model/mod.rs b/crates/common/src/prov/model/mod.rs index 9b48f76a5..52a274e73 100644 --- a/crates/common/src/prov/model/mod.rs +++ b/crates/common/src/prov/model/mod.rs @@ -2,9 +2,6 @@ mod contradiction; pub use contradiction::Contradiction; #[cfg(feature = "json-ld")] pub mod json_ld; -pub mod transaction; - -use parity_scale_codec::{Decode, Encode}; use core::{convert::Infallible, fmt::Debug}; #[cfg(not(feature = "std"))] @@ -13,7 +10,6 @@ use parity_scale_codec::{ alloc::string::String, alloc::vec::Vec, }; -use scale_info::TypeInfo; #[cfg(not(feature = "std"))] use scale_info::{ prelude::borrow::ToOwned, prelude::string::ToString, prelude::sync::Arc, prelude::*, @@ -31,7 +27,6 @@ use thiserror::Error; use thiserror_no_std::Error; use tracing::{instrument, trace}; -pub use transaction::ChronicleTransaction; use uuid::Uuid; use crate::{ @@ -48,14 +43,14 @@ use super::{ StartActivity, TimeWrapper, WasAssociatedWith, WasGeneratedBy, WasInformedBy, }, ActivityId, AgentId, AssociationId, AttributionId, ChronicleIri, DelegationId, DomaintypeId, - EntityId, ExternalId, ExternalIdPart, NamespaceId, Role, UuidPart, UuidWrapper, + EntityId, ExternalId, ExternalIdPart, NamespaceId, Role, UuidPart, }; +#[cfg(feature = "json-ld")] #[derive(Error, Debug)] pub enum ProcessorError { #[error("Invalid address")] Address, - #[cfg(feature = "json-ld")] #[error("Json Ld Error {0}")] Compaction(#[from] json_ld::CompactionError), #[error("Contradiction {0}")] @@ -64,7 +59,6 @@ pub enum ProcessorError { Expansion { inner: String }, #[error("IdentityError {0}")] Identity(#[from] IdentityError), - #[cfg(feature = "json-ld")] #[error("Invalid IRI {0}")] IRef(#[from] iref::Error), #[error("Not a Chronicle IRI {0}")] @@ -91,6 +85,39 @@ pub enum ProcessorError { Utf8(#[from] core::str::Utf8Error), } +#[cfg(not(feature = "json-ld"))] +#[derive(Error, Debug)] +pub enum ProcessorError { + #[error("Invalid address")] + Address, + #[error("Contradiction {0}")] + Contradiction(Contradiction), + #[error("IdentityError {0}")] + Identity(#[from] IdentityError), + #[error("Not a Chronicle IRI {0}")] + NotAChronicleIri(#[from] id::ParseIriError), + #[error("Missing @id {object:?}")] + MissingId { object: serde_json::Value }, + #[error("Missing property {iri}:{object:?}")] + MissingProperty { iri: String, object: serde_json::Value }, + #[error("Json LD object is not a node {0}")] + NotANode(serde_json::Value), + #[error("Chronicle value is not a JSON object")] + NotAnObject, + #[error("OpaExecutorError: {0}")] + OpaExecutor(#[from] anyhow::Error), + #[error("Malformed JSON {0}")] + SerdeJson(#[from] serde_json::Error), + #[error("Unparsable date/time {0}")] + SubmissionFormat(#[from] PayloadError), + #[error("Submission body format: {0}")] + Time(#[from] chrono::ParseError), + #[error("Tokio Error")] + Tokio, + #[error("State is not valid utf8 {0}")] + Utf8(#[from] core::str::Utf8Error), +} + #[derive(Error, Debug)] pub enum PayloadError { #[error("No list of Chronicle operations")] @@ -115,46 +142,71 @@ pub enum ChronicleTransactionIdError { InvalidTransactionId { id: String }, } -#[derive(Serialize, Deserialize, Encode, Decode, PartialEq, Eq, Debug, Clone)] -pub struct ChronicleTransactionId(String); +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)] +pub struct ChronicleTransactionId([u8; 16]); impl core::fmt::Display for ChronicleTransactionId { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - f.write_str(&self.0) + f.write_str(&hex::encode(self.0)) } } impl From for ChronicleTransactionId { fn from(u: Uuid) -> Self { - Self(u.to_string()) + Self(u.into_bytes()) } } -impl From<&str> for ChronicleTransactionId { - fn from(s: &str) -> Self { - Self(s.to_owned()) +impl From<[u8; 16]> for ChronicleTransactionId { + fn from(u: [u8; 16]) -> Self { + Self(u) } } -impl ChronicleTransactionId { - pub fn as_str(&self) -> &str { - &self.0 +impl std::convert::TryFrom for ChronicleTransactionId { + type Error = hex::FromHexError; + + fn try_from(s: String) -> Result { + Self::try_from(s.as_str()) } } -#[derive(Debug, Clone, Encode, Decode, TypeInfo, PartialEq, Eq, Serialize, Deserialize)] +impl std::convert::TryFrom<&str> for ChronicleTransactionId { + type Error = hex::FromHexError; + + fn try_from(s: &str) -> Result { + let bytes = hex::decode(s)?; + let mut array = [0; 16]; + array.copy_from_slice(&bytes[0..16]); + Ok(Self(array)) + } +} + +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Namespace { pub id: NamespaceId, - pub uuid: UuidWrapper, + pub uuid: [u8; 16], pub external_id: ExternalId, } impl Namespace { pub fn new(id: NamespaceId, uuid: Uuid, external_id: &ExternalId) -> Self { - Self { id, uuid: uuid.into(), external_id: external_id.to_owned() } + Self { id, uuid: uuid.into_bytes(), external_id: external_id.to_owned() } } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TypeInfo)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Agent { pub id: AgentId, pub namespaceid: NamespaceId, @@ -188,12 +240,16 @@ impl Agent { } } -#[derive(Debug, Clone, Encode, Decode, TypeInfo, PartialEq, Eq, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Activity { pub id: ActivityId, - pub namespaceid: NamespaceId, + pub namespace_id: NamespaceId, pub external_id: ExternalId, - pub domaintypeid: Option, + pub domaintype_id: Option, pub attributes: BTreeMap, pub started: Option, pub ended: Option, @@ -201,36 +257,40 @@ pub struct Activity { impl Activity { pub fn has_attributes(self, attributes: Attributes) -> Self { - let Self { id, namespaceid, external_id, started, ended, .. } = self; + let Self { id, namespace_id, external_id, started, ended, .. } = self; Self { id, - namespaceid, + namespace_id, external_id, started, ended, - domaintypeid: attributes.typ, + domaintype_id: attributes.typ, attributes: attributes.attributes, } } // Create a prototypical agent from its IRI, we can only determine external_id - pub fn exists(namespaceid: NamespaceId, id: ActivityId) -> Self { + pub fn exists(namespace_id: NamespaceId, id: ActivityId) -> Self { Self { - namespaceid, + namespace_id, external_id: id.external_id_part().to_owned(), id, started: None, ended: None, - domaintypeid: None, + domaintype_id: None, attributes: BTreeMap::new(), } } } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode, TypeInfo)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Entity { pub id: EntityId, - pub namespaceid: NamespaceId, + pub namespace_id: NamespaceId, pub external_id: ExternalId, pub domaintypeid: Option, pub attributes: BTreeMap, @@ -238,10 +298,10 @@ pub struct Entity { impl Entity { pub fn has_attributes(self, attributes: Attributes) -> Self { - let Self { id, namespaceid, external_id, .. } = self; + let Self { id, namespace_id: namespaceid, external_id, .. } = self; Self { id, - namespaceid, + namespace_id: namespaceid, external_id, domaintypeid: attributes.typ, attributes: attributes.attributes, @@ -252,26 +312,17 @@ impl Entity { Self { external_id: id.external_id_part().to_owned(), id, - namespaceid, + namespace_id: namespaceid, domaintypeid: None, attributes: BTreeMap::new(), } } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct Derivation { pub generated_id: EntityId, @@ -280,19 +331,10 @@ pub struct Derivation { pub typ: DerivationType, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct Delegation { pub namespace_id: NamespaceId, @@ -327,20 +369,12 @@ impl Delegation { } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] + pub struct Association { pub namespace_id: NamespaceId, pub id: AssociationId, @@ -366,76 +400,40 @@ impl Association { } } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct Usage { pub activity_id: ActivityId, pub entity_id: EntityId, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct Generation { pub activity_id: ActivityId, pub generated_id: EntityId, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - PartialOrd, - Ord, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct GeneratedEntity { pub entity_id: EntityId, pub generated_id: ActivityId, } -#[derive( - Debug, - Clone, - PartialEq, - Eq, - Hash, - Ord, - PartialOrd, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) )] pub struct Attribution { pub namespace_id: NamespaceId, @@ -467,7 +465,11 @@ type NamespacedAgent = NamespacedId; type NamespacedEntity = NamespacedId; type NamespacedActivity = NamespacedId; -#[derive(Debug, Default, Clone, PartialEq, Eq, Encode, Decode, TypeInfo)] +#[cfg_attr( + feature = "parity-encoding", + derive(scale_info::TypeInfo, parity_scale_codec::Encode, parity_scale_codec::Decode) +)] +#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq)] pub struct ProvModel { pub namespaces: BTreeMap>, pub agents: BTreeMap>, @@ -484,6 +486,62 @@ pub struct ProvModel { pub usage: BTreeMap>>, } +#[cfg(feature = "parity-encoding")] +pub mod provmodel_protocol { + use super::*; + #[derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + Debug, + Default, + Clone, + Serialize, + Deserialize, + PartialEq, + Eq, + )] + pub struct ProvModelV1 { + pub namespaces: BTreeMap>, /* We need NamespaceIdV1 / + * NamespaceV1 etc, recursively + * until there are only primitive + * types */ + pub agents: BTreeMap>, + pub acted_on_behalf_of: BTreeMap>>, + pub delegation: BTreeMap>>, + pub entities: BTreeMap>, + pub derivation: BTreeMap>>, + pub generation: BTreeMap>>, + pub attribution: BTreeMap>>, + pub activities: BTreeMap>, + pub was_informed_by: BTreeMap>>, + pub generated: BTreeMap>>, + pub association: BTreeMap>>, + pub usage: BTreeMap>>, + } + + impl From for ProvModel { + fn from(value: ProvModelV1) -> Self { + ProvModel { + namespaces: value.namespaces, + agents: value.agents, + acted_on_behalf_of: value.acted_on_behalf_of, + delegation: value.delegation, + entities: value.entities, + derivation: value.derivation, + generation: value.generation, + attribution: value.attribution, + activities: value.activities, + was_informed_by: value.was_informed_by, + generated: value.generated, + association: value.association, + usage: value.usage, + } + } + } +} + +#[cfg(feature = "parity-encoding")] // TODO: We can make these structures reasonably bounded (and copy ids with interning) - though JSON // attributes may need some handwaving impl parity_scale_codec::MaxEncodedLen for ProvModel { @@ -683,7 +741,7 @@ impl ProvModel { ns.clone(), Namespace { id: ns.clone(), - uuid: uuid.to_owned().into(), + uuid: uuid.into_bytes(), external_id: namespace_name.to_owned(), } .into(), @@ -769,11 +827,7 @@ impl ProvModel { pub fn apply(&mut self, tx: &ChronicleOperation) -> Result<(), Contradiction> { let tx = tx.to_owned(); match tx { - ChronicleOperation::CreateNamespace(CreateNamespace { - id, - external_id: _, - uuid: _, - }) => { + ChronicleOperation::CreateNamespace(CreateNamespace { id }) => { self.namespace_context(&id); Ok(()) }, @@ -828,22 +882,20 @@ impl ProvModel { activity.and_then(|activity| activity.started), activity.and_then(|activity| activity.ended), ) { - (Some(TimeWrapper(started)), _) if started != time.0 => { + (Some(TimeWrapper(started)), _) if started != time.0 => return Err(Contradiction::start_date_alteration( id.into(), namespace, started, time.0, - )) - }, - (_, Some(TimeWrapper(ended))) if ended < time.0 => { + )), + (_, Some(TimeWrapper(ended))) if ended < time.0 => return Err(Contradiction::invalid_range( id.into(), namespace, time.0, ended, - )) - }, + )), _ => {}, }; @@ -864,22 +916,20 @@ impl ProvModel { activity.and_then(|activity| activity.started), activity.and_then(|activity| activity.ended), ) { - (_, Some(TimeWrapper(ended))) if ended != time.0 => { + (_, Some(TimeWrapper(ended))) if ended != time.0 => return Err(Contradiction::end_date_alteration( id.into(), namespace, ended, time.0, - )) - }, - (Some(TimeWrapper(started)), _) if started > time.0 => { + )), + (Some(TimeWrapper(started)), _) if started > time.0 => return Err(Contradiction::invalid_range( id.into(), namespace, started, time.0, - )) - }, + )), _ => {}, }; @@ -1025,7 +1075,7 @@ impl ProvModel { }; self.modify_activity(&namespace, &id, move |activity| { - activity.domaintypeid = attributes.typ.clone(); + activity.domaintype_id = attributes.typ.clone(); activity.attributes = attributes.attributes; }); @@ -1101,11 +1151,11 @@ impl ProvModel { pub(crate) fn add_activity(&mut self, activity: Activity) { self.activities - .insert((activity.namespaceid.clone(), activity.id.clone()), activity.into()); + .insert((activity.namespace_id.clone(), activity.id.clone()), activity.into()); } pub(crate) fn add_entity(&mut self, entity: Entity) { self.entities - .insert((entity.namespaceid.clone(), entity.id.clone()), entity.into()); + .insert((entity.namespace_id.clone(), entity.id.clone()), entity.into()); } } diff --git a/crates/common/src/prov/model/proptest.rs b/crates/common/src/prov/model/proptest.rs index 7d9d50459..431930677 100644 --- a/crates/common/src/prov/model/proptest.rs +++ b/crates/common/src/prov/model/proptest.rs @@ -599,7 +599,6 @@ proptest! { let serialized_prov = prov_from_json_ld(lhs_json.clone()); - prop_assert_eq!(&prov, &serialized_prov, "Prov reserialisation compact: \n{} expanded \n {}", serde_json::to_string_pretty(&lhs_json).unwrap(), serde_json::to_string_pretty(&lhs_json_expanded).unwrap()); diff --git a/crates/common/src/prov/model/transaction/mod.rs b/crates/common/src/prov/model/transaction/mod.rs deleted file mode 100644 index ffb3f159f..000000000 --- a/crates/common/src/prov/model/transaction/mod.rs +++ /dev/null @@ -1,70 +0,0 @@ -pub mod v1; -pub mod v2; - -// This is the current version. -pub use v2::ChronicleTransaction; - -impl From for v2::ChronicleTransaction { - fn from(transaction: v1::ChronicleTransaction) -> Self { - v2::ChronicleTransaction::new(transaction.tx, transaction.identity) - } -} - -pub trait HasVersion { - fn get_version(&self) -> u16; -} - -impl HasVersion for v1::ChronicleTransaction { - fn get_version(&self) -> u16 { - 1 - } -} - -impl HasVersion for v2::ChronicleTransaction { - fn get_version(&self) -> u16 { - 2 - } -} - -pub const CURRENT_VERSION: u16 = 2; - -pub trait ToChronicleTransaction { - fn to_current(self) -> ChronicleTransaction; -} - -impl ToChronicleTransaction for v1::ChronicleTransaction { - fn to_current(self) -> ChronicleTransaction { - self.into() - } -} - -impl ToChronicleTransaction for v2::ChronicleTransaction { - fn to_current(self) -> ChronicleTransaction { - self - } -} - -#[cfg(test)] -mod test { - use super::{HasVersion, ToChronicleTransaction}; - use crate::identity::SignedIdentity; - - #[test] - fn transaction_versions() { - let transaction_v1 = - super::v1::ChronicleTransaction::new(Vec::default(), SignedIdentity::new_no_identity()); - let transaction_v2: super::v2::ChronicleTransaction = transaction_v1.clone().into(); - let transaction_current = transaction_v2.clone(); - - // check that the above sequence ends at the current version - assert_eq!(super::CURRENT_VERSION, transaction_current.get_version()); - - // check the reported version numbers - assert_eq!(1, transaction_v1.get_version()); - assert_eq!(2, transaction_v2.get_version()); - - // check the conversions to current - assert_eq!(transaction_current, transaction_v1.to_current()); - assert_eq!(transaction_current, transaction_v2.to_current()); - } -} diff --git a/crates/common/src/prov/model/transaction/v1/mod.rs b/crates/common/src/prov/model/transaction/v1/mod.rs deleted file mode 100644 index fc5be7345..000000000 --- a/crates/common/src/prov/model/transaction/v1/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::{identity::SignedIdentity, prov::operations::ChronicleOperation}; -#[cfg(not(feature = "std"))] -use parity_scale_codec::alloc::vec::Vec; - -#[derive(PartialEq, Eq, Debug, Clone)] -pub struct ChronicleTransaction { - pub tx: Vec, - pub identity: SignedIdentity, -} - -impl ChronicleTransaction { - pub fn new(tx: Vec, identity: SignedIdentity) -> Self { - Self { tx, identity } - } -} diff --git a/crates/common/src/prov/model/transaction/v2/mod.rs b/crates/common/src/prov/model/transaction/v2/mod.rs deleted file mode 100644 index fc5be7345..000000000 --- a/crates/common/src/prov/model/transaction/v2/mod.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::{identity::SignedIdentity, prov::operations::ChronicleOperation}; -#[cfg(not(feature = "std"))] -use parity_scale_codec::alloc::vec::Vec; - -#[derive(PartialEq, Eq, Debug, Clone)] -pub struct ChronicleTransaction { - pub tx: Vec, - pub identity: SignedIdentity, -} - -impl ChronicleTransaction { - pub fn new(tx: Vec, identity: SignedIdentity) -> Self { - Self { tx, identity } - } -} diff --git a/crates/common/src/prov/operations.rs b/crates/common/src/prov/operations.rs index 046973ddf..7df8cd708 100644 --- a/crates/common/src/prov/operations.rs +++ b/crates/common/src/prov/operations.rs @@ -13,31 +13,22 @@ use diesel::{ #[cfg(not(feature = "std"))] use parity_scale_codec::alloc::string::String; -use parity_scale_codec::{Decode, Encode, Error, Input}; -use scale_info::{build::Fields, Path, Type, TypeInfo}; -use uuid::Uuid; - use crate::attributes::Attributes; use super::{ ActivityId, AgentId, AssociationId, AttributionId, DelegationId, EntityId, ExternalId, - NamespaceId, Role, UuidWrapper, + NamespaceId, Role, }; -#[derive( - Debug, - Copy, - Clone, - PartialEq, - Ord, - PartialOrd, - Eq, - Hash, - Serialize, - Deserialize, - Encode, - Decode, - TypeInfo, +#[derive(Debug, Copy, Clone, PartialEq, Ord, PartialOrd, Eq, Hash, Serialize, Deserialize)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) )] #[cfg_attr(feature = "diesel-bindings", derive(AsExpression, SqlType, QueryId))] #[cfg_attr(feature = "diesel-bindings", diesel(sql_type = Integer))] @@ -112,20 +103,36 @@ impl DerivationType { } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct CreateNamespace { pub id: NamespaceId, - pub external_id: ExternalId, - pub uuid: UuidWrapper, } impl CreateNamespace { - pub fn new(id: NamespaceId, external_id: impl AsRef, uuid: Uuid) -> Self { - Self { id, external_id: external_id.as_ref().into(), uuid: uuid.into() } + pub fn new(id: NamespaceId) -> Self { + Self { id } } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct AgentExists { pub namespace: NamespaceId, pub external_id: ExternalId, @@ -137,7 +144,16 @@ impl AgentExists { } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct ActsOnBehalfOf { pub id: DelegationId, pub role: Option, @@ -170,8 +186,16 @@ impl ActsOnBehalfOf { } } } - -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct ActivityExists { pub namespace: NamespaceId, pub external_id: ExternalId, @@ -184,6 +208,10 @@ impl TimeWrapper { pub fn to_rfc3339(&self) -> String { self.0.to_rfc3339() } + + pub fn naive_utc(&self) -> NaiveDateTime { + self.0.naive_utc() + } } impl core::fmt::Display for TimeWrapper { @@ -198,7 +226,22 @@ impl From> for TimeWrapper { } } -impl Encode for TimeWrapper { +#[cfg(feature = "parity-encoding")] +impl scale_encode::EncodeAsType for TimeWrapper { + fn encode_as_type_to( + &self, + type_id: u32, + types: &scale_info::PortableRegistry, + out: &mut scale_encode::Vec, + ) -> Result<(), scale_encode::Error> { + let timestamp = self.0.timestamp(); + let subsec_nanos = self.0.timestamp_subsec_nanos(); + (timestamp, subsec_nanos).encode_as_type_to(type_id, types, out) + } +} + +#[cfg(feature = "parity-encoding")] +impl parity_scale_codec::Encode for TimeWrapper { fn encode_to(&self, dest: &mut T) { let timestamp = self.0.timestamp(); let subsec_nanos = self.0.timestamp_subsec_nanos(); @@ -206,8 +249,11 @@ impl Encode for TimeWrapper { } } -impl Decode for TimeWrapper { - fn decode(input: &mut I) -> Result { +#[cfg(feature = "parity-encoding")] +impl parity_scale_codec::Decode for TimeWrapper { + fn decode( + input: &mut I, + ) -> Result { let (timestamp, subsec_nanos) = <(i64, u32)>::decode(input)?; let datetime = Utc.from_utc_datetime( @@ -219,53 +265,110 @@ impl Decode for TimeWrapper { } } -impl TypeInfo for TimeWrapper { +#[cfg(feature = "parity-encoding")] +impl scale_info::TypeInfo for TimeWrapper { type Identity = Self; - fn type_info() -> Type { - Type::builder().path(Path::new("TimeWrapper", module_path!())).composite( - Fields::unnamed() - .field(|f| f.ty::().type_name("Timestamp")) - .field(|f| f.ty::().type_name("SubsecNanos")), - ) + fn type_info() -> scale_info::Type { + scale_info::Type::builder() + .path(scale_info::Path::new("TimeWrapper", module_path!())) + .composite( + scale_info::build::Fields::unnamed() + .field(|f| f.ty::().type_name("Timestamp")) + .field(|f| f.ty::().type_name("SubsecNanos")), + ) } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct StartActivity { pub namespace: NamespaceId, pub id: ActivityId, pub time: TimeWrapper, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct EndActivity { pub namespace: NamespaceId, pub id: ActivityId, pub time: TimeWrapper, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct ActivityUses { pub namespace: NamespaceId, pub id: EntityId, pub activity: ActivityId, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct EntityExists { pub namespace: NamespaceId, pub external_id: ExternalId, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct WasGeneratedBy { pub namespace: NamespaceId, pub id: EntityId, pub activity: ActivityId, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct EntityDerive { pub namespace: NamespaceId, pub id: EntityId, @@ -274,7 +377,16 @@ pub struct EntityDerive { pub typ: DerivationType, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct WasAssociatedWith { pub id: AssociationId, pub role: Option, @@ -300,7 +412,16 @@ impl WasAssociatedWith { } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct WasAttributedTo { pub id: AttributionId, pub role: Option, @@ -326,21 +447,48 @@ impl WasAttributedTo { } } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub struct WasInformedBy { pub namespace: NamespaceId, pub activity: ActivityId, pub informing_activity: ActivityId, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub enum SetAttributes { Entity { namespace: NamespaceId, id: EntityId, attributes: Attributes }, Agent { namespace: NamespaceId, id: AgentId, attributes: Attributes }, Activity { namespace: NamespaceId, id: ActivityId, attributes: Attributes }, } -#[derive(Serialize, Deserialize, Encode, Decode, TypeInfo, PartialEq, Eq, Debug, Clone)] +#[cfg_attr( + feature = "parity-encoding", + derive( + scale_info::TypeInfo, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_encode::EncodeAsType + ) +)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)] pub enum ChronicleOperation { CreateNamespace(CreateNamespace), AgentExists(AgentExists), diff --git a/crates/common/src/prov/vocab.rs b/crates/common/src/prov/vocab.rs index 64228c57e..8b4fa3f89 100644 --- a/crates/common/src/prov/vocab.rs +++ b/crates/common/src/prov/vocab.rs @@ -1,5 +1,5 @@ mod chronicle_operations { - use iri_string::types::{IriAbsoluteString, UriAbsoluteString}; + use iri_string::types::{UriAbsoluteString}; #[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum ChronicleOperations { @@ -78,50 +78,49 @@ mod chronicle_operations { impl AsRef for ChronicleOperations { fn as_ref(&self) -> &'static str { match self { - ChronicleOperations::ActivityExists => &ACTIVITY_EXISTS, - ChronicleOperations::ActivityName => &ACTIVITY_NAME, - ChronicleOperations::StartActivity => &START_ACTIVITY, - ChronicleOperations::StartActivityTime => &START_ACTIVITY_TIME, - ChronicleOperations::EndActivity => &END_ACTIVITY, - ChronicleOperations::EndActivityTime => &END_ACTIVITY_TIME, - ChronicleOperations::WasAssociatedWith => &WAS_ASSOCIATED_WITH, - ChronicleOperations::WasAttributedTo => &WAS_ATTRIBUTED_TO, - ChronicleOperations::ActivityUses => &ACTIVITY_USES, - ChronicleOperations::EntityName => &ENTITY_NAME, - ChronicleOperations::Locator => &LOCATOR, - ChronicleOperations::Role => &ROLE, - ChronicleOperations::EntityExists => &ENTITY_EXISTS, - ChronicleOperations::WasGeneratedBy => &WAS_GENERATED_BY, - ChronicleOperations::EntityDerive => &ENTITY_DERIVE, - ChronicleOperations::DerivationType => &DERIVATION_TYPE, - ChronicleOperations::UsedEntityName => &USED_ENTITY_NAME, - ChronicleOperations::SetAttributes => &SET_ATTRIBUTES, - ChronicleOperations::Attributes => &ATTRIBUTES, - ChronicleOperations::Attribute => &ATTRIBUTE, - ChronicleOperations::DomaintypeId => &DOMAINTYPE_ID, - ChronicleOperations::WasInformedBy => &WAS_INFORMED_BY, - ChronicleOperations::InformingActivityName => &INFORMING_ACTIVITY_NAME, - ChronicleOperations::Generated => &GENERATED, - ChronicleOperations::CreateNamespace => &CREATE_NAMESPACE, - ChronicleOperations::NamespaceName => &NAMESPACE_NAME, - ChronicleOperations::NamespaceUuid => &NAMESPACE_UUID, - ChronicleOperations::AgentExists => &AGENT_EXISTS, - ChronicleOperations::AgentName => &AGENT_NAME, - ChronicleOperations::AgentUuid => &AGENT_UUID, - ChronicleOperations::AgentActsOnBehalfOf => &AGENT_ACTS_ON_BEHALF_OF, - ChronicleOperations::DelegateId => &DELEGATE_ID, - ChronicleOperations::ResponsibleId => &RESPONSIBLE_ID, + ChronicleOperations::ActivityExists => ACTIVITY_EXISTS, + ChronicleOperations::ActivityName => ACTIVITY_NAME, + ChronicleOperations::StartActivity => START_ACTIVITY, + ChronicleOperations::StartActivityTime => START_ACTIVITY_TIME, + ChronicleOperations::EndActivity => END_ACTIVITY, + ChronicleOperations::EndActivityTime => END_ACTIVITY_TIME, + ChronicleOperations::WasAssociatedWith => WAS_ASSOCIATED_WITH, + ChronicleOperations::WasAttributedTo => WAS_ATTRIBUTED_TO, + ChronicleOperations::ActivityUses => ACTIVITY_USES, + ChronicleOperations::EntityName => ENTITY_NAME, + ChronicleOperations::Locator => LOCATOR, + ChronicleOperations::Role => ROLE, + ChronicleOperations::EntityExists => ENTITY_EXISTS, + ChronicleOperations::WasGeneratedBy => WAS_GENERATED_BY, + ChronicleOperations::EntityDerive => ENTITY_DERIVE, + ChronicleOperations::DerivationType => DERIVATION_TYPE, + ChronicleOperations::UsedEntityName => USED_ENTITY_NAME, + ChronicleOperations::SetAttributes => SET_ATTRIBUTES, + ChronicleOperations::Attributes => ATTRIBUTES, + ChronicleOperations::Attribute => ATTRIBUTE, + ChronicleOperations::DomaintypeId => DOMAINTYPE_ID, + ChronicleOperations::WasInformedBy => WAS_INFORMED_BY, + ChronicleOperations::InformingActivityName => INFORMING_ACTIVITY_NAME, + ChronicleOperations::Generated => GENERATED, + ChronicleOperations::CreateNamespace => CREATE_NAMESPACE, + ChronicleOperations::NamespaceName => NAMESPACE_NAME, + ChronicleOperations::NamespaceUuid => NAMESPACE_UUID, + ChronicleOperations::AgentExists => AGENT_EXISTS, + ChronicleOperations::AgentName => AGENT_NAME, + ChronicleOperations::AgentUuid => AGENT_UUID, + ChronicleOperations::AgentActsOnBehalfOf => AGENT_ACTS_ON_BEHALF_OF, + ChronicleOperations::DelegateId => DELEGATE_ID, + ChronicleOperations::ResponsibleId => RESPONSIBLE_ID, } } } #[cfg(feature = "json-ld")] - impl Into for ChronicleOperations { - fn into(self) -> IriAbsoluteString { - UriAbsoluteString::try_from(self.as_str().to_string()) - .unwrap() - .try_into() + impl From for iri_string::types::IriAbsoluteString { + fn from(val: ChronicleOperations) -> Self { + UriAbsoluteString::try_from(val.as_str().to_string()) .unwrap() + .into() } } @@ -141,9 +140,9 @@ mod chronicle_operations { pub use chronicle_operations::ChronicleOperations; mod prov { - use iri_string::types::{IriAbsoluteString, UriAbsoluteString}; + use iri_string::types::{UriAbsoluteString}; - use crate::prov::FromCompact; + #[derive(Clone, Copy, PartialEq, Eq, Hash)] pub enum Prov { @@ -207,44 +206,43 @@ mod prov { impl AsRef for Prov { fn as_ref(&self) -> &'static str { match self { - Prov::Agent => &AGENT, - Prov::Entity => &ENTITY, - Prov::Activity => &ACTIVITY, - Prov::WasAssociatedWith => &WAS_ASSOCIATED_WITH, - Prov::QualifiedAssociation => &QUALIFIED_ASSOCIATION, - Prov::QualifiedAttribution => &QUALIFIED_ATTRIBUTION, - Prov::Association => &ASSOCIATION, - Prov::Attribution => &ATTRIBUTION, - Prov::Responsible => &RESPONSIBLE, - Prov::WasGeneratedBy => &WAS_GENERATED_BY, - Prov::Used => &USED, - Prov::WasAttributedTo => &WAS_ATTRIBUTED_TO, - Prov::StartedAtTime => &STARTED_AT_TIME, - Prov::EndedAtTime => &ENDED_AT_TIME, - Prov::WasDerivedFrom => &WAS_DERIVED_FROM, - Prov::HadPrimarySource => &HAD_PRIMARY_SOURCE, - Prov::WasQuotedFrom => &WAS_QUOTED_FROM, - Prov::WasRevisionOf => &WAS_REVISION_OF, - Prov::ActedOnBehalfOf => &ACTED_ON_BEHALF_OF, - Prov::QualifiedDelegation => &QUALIFIED_DELEGATION, - Prov::Delegation => &DELEGATION, - Prov::Delegate => &DELEGATE, - Prov::HadRole => &HAD_ROLE, - Prov::HadActivity => &HAD_ACTIVITY, - Prov::HadEntity => &HAD_ENTITY, - Prov::WasInformedBy => &WAS_INFORMED_BY, - Prov::Generated => &GENERATED, + Prov::Agent => AGENT, + Prov::Entity => ENTITY, + Prov::Activity => ACTIVITY, + Prov::WasAssociatedWith => WAS_ASSOCIATED_WITH, + Prov::QualifiedAssociation => QUALIFIED_ASSOCIATION, + Prov::QualifiedAttribution => QUALIFIED_ATTRIBUTION, + Prov::Association => ASSOCIATION, + Prov::Attribution => ATTRIBUTION, + Prov::Responsible => RESPONSIBLE, + Prov::WasGeneratedBy => WAS_GENERATED_BY, + Prov::Used => USED, + Prov::WasAttributedTo => WAS_ATTRIBUTED_TO, + Prov::StartedAtTime => STARTED_AT_TIME, + Prov::EndedAtTime => ENDED_AT_TIME, + Prov::WasDerivedFrom => WAS_DERIVED_FROM, + Prov::HadPrimarySource => HAD_PRIMARY_SOURCE, + Prov::WasQuotedFrom => WAS_QUOTED_FROM, + Prov::WasRevisionOf => WAS_REVISION_OF, + Prov::ActedOnBehalfOf => ACTED_ON_BEHALF_OF, + Prov::QualifiedDelegation => QUALIFIED_DELEGATION, + Prov::Delegation => DELEGATION, + Prov::Delegate => DELEGATE, + Prov::HadRole => HAD_ROLE, + Prov::HadActivity => HAD_ACTIVITY, + Prov::HadEntity => HAD_ENTITY, + Prov::WasInformedBy => WAS_INFORMED_BY, + Prov::Generated => GENERATED, } } } #[cfg(feature = "json-ld")] - impl Into for Prov { - fn into(self) -> IriAbsoluteString { - UriAbsoluteString::try_from(self.as_str().to_string()) - .unwrap() - .try_into() + impl From for iri_string::types::IriAbsoluteString { + fn from(val: Prov) -> Self { + UriAbsoluteString::try_from(val.as_str().to_string()) .unwrap() + .into() } } @@ -264,7 +262,7 @@ mod prov { pub use prov::Prov; mod chronicle { - use iri_string::types::{IriAbsoluteString, UriAbsoluteString}; + use iri_string::types::{UriAbsoluteString}; #[cfg(not(feature = "std"))] use parity_scale_codec::alloc::string::String; #[cfg(not(feature = "std"))] @@ -287,20 +285,19 @@ mod chronicle { impl AsRef for Chronicle { fn as_ref(&self) -> &'static str { match self { - Chronicle::Namespace => &NAMESPACE, - Chronicle::HasNamespace => &HAS_NAMESPACE, - Chronicle::Value => &VALUE, + Chronicle::Namespace => NAMESPACE, + Chronicle::HasNamespace => HAS_NAMESPACE, + Chronicle::Value => VALUE, } } } #[cfg(feature = "json-ld")] - impl Into for Chronicle { - fn into(self) -> IriAbsoluteString { - UriAbsoluteString::try_from(self.as_str().to_string()) - .unwrap() - .try_into() + impl From for iri_string::types::IriAbsoluteString { + fn from(val: Chronicle) -> Self { + UriAbsoluteString::try_from(val.as_str().to_string()) .unwrap() + .into() } } @@ -316,7 +313,8 @@ mod chronicle { } } - /// Operations to format specific Iri kinds, using percentage encoding to ensure they are infallible + /// Operations to format specific Iri kinds, using percentage encoding to ensure they are + /// infallible impl Chronicle { pub const LONG_PREFIX: &'static str = "http://btp.works/chronicle/ns#"; pub const PREFIX: &'static str = "chronicle:"; diff --git a/crates/common/tree.txt b/crates/common/tree.txt new file mode 100644 index 000000000..0f048f06f --- /dev/null +++ b/crates/common/tree.txt @@ -0,0 +1,465 @@ +common v0.7.5 (/Users/ryan/code/chronicle/crates/common) +├── anyhow v1.0.75 +├── async-trait v0.1.74 (proc-macro) +│ ├── proc-macro2 v1.0.69 +│ │ └── unicode-ident v1.0.12 +│ ├── quote v1.0.33 +│ │ └── proc-macro2 v1.0.69 (*) +│ └── syn v2.0.38 +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── unicode-ident v1.0.12 +├── chrono v0.4.31 +│ ├── iana-time-zone v0.1.58 +│ │ └── core-foundation-sys v0.8.4 +│ ├── num-traits v0.2.17 +│ │ └── libm v0.2.8 +│ │ [build-dependencies] +│ │ └── autocfg v1.1.0 +│ └── serde v1.0.190 +│ └── serde_derive v1.0.190 (proc-macro) +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── syn v2.0.38 (*) +├── futures v0.3.29 +│ ├── futures-channel v0.3.29 +│ │ ├── futures-core v0.3.29 +│ │ └── futures-sink v0.3.29 +│ ├── futures-core v0.3.29 +│ ├── futures-executor v0.3.29 +│ │ ├── futures-core v0.3.29 +│ │ ├── futures-task v0.3.29 +│ │ └── futures-util v0.3.29 +│ │ ├── futures-channel v0.3.29 (*) +│ │ ├── futures-core v0.3.29 +│ │ ├── futures-io v0.3.29 +│ │ ├── futures-macro v0.3.29 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── futures-sink v0.3.29 +│ │ ├── futures-task v0.3.29 +│ │ ├── memchr v2.6.4 +│ │ ├── pin-project-lite v0.2.13 +│ │ ├── pin-utils v0.1.0 +│ │ └── slab v0.4.9 +│ │ [build-dependencies] +│ │ └── autocfg v1.1.0 +│ ├── futures-io v0.3.29 +│ ├── futures-sink v0.3.29 +│ ├── futures-task v0.3.29 +│ └── futures-util v0.3.29 (*) +├── glob v0.3.1 +├── hex v0.4.3 +├── iref v2.2.3 +│ ├── pct-str v1.2.0 +│ │ └── utf8-decode v1.0.1 +│ └── smallvec v1.11.1 +├── iref-enum v2.1.0 (proc-macro) +│ ├── iref v2.2.3 (*) +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── syn v1.0.109 +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── unicode-ident v1.0.12 +├── k256 v0.11.6 +│ ├── cfg-if v1.0.0 +│ ├── ecdsa v0.14.8 +│ │ ├── der v0.6.1 +│ │ │ ├── const-oid v0.9.5 +│ │ │ ├── pem-rfc7468 v0.6.0 +│ │ │ │ └── base64ct v1.6.0 +│ │ │ └── zeroize v1.6.0 +│ │ ├── elliptic-curve v0.12.3 +│ │ │ ├── base16ct v0.1.1 +│ │ │ ├── crypto-bigint v0.4.9 +│ │ │ │ ├── generic-array v0.14.7 +│ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ └── getrandom v0.2.10 +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ └── libc v0.2.149 +│ │ │ │ ├── subtle v2.4.1 +│ │ │ │ └── zeroize v1.6.0 +│ │ │ ├── der v0.6.1 (*) +│ │ │ ├── digest v0.10.7 +│ │ │ │ ├── block-buffer v0.10.4 +│ │ │ │ │ └── generic-array v0.14.7 (*) +│ │ │ │ ├── crypto-common v0.1.6 +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ └── subtle v2.4.1 +│ │ │ ├── ff v0.12.1 +│ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ └── subtle v2.4.1 +│ │ │ ├── generic-array v0.14.7 (*) +│ │ │ ├── group v0.12.1 +│ │ │ │ ├── ff v0.12.1 (*) +│ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ └── subtle v2.4.1 +│ │ │ ├── pem-rfc7468 v0.6.0 (*) +│ │ │ ├── pkcs8 v0.9.0 +│ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ └── spki v0.6.0 +│ │ │ │ ├── base64ct v1.6.0 +│ │ │ │ └── der v0.6.1 (*) +│ │ │ ├── rand_core v0.6.4 (*) +│ │ │ ├── sec1 v0.3.0 +│ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ ├── pkcs8 v0.9.0 (*) +│ │ │ │ ├── serdect v0.1.0 +│ │ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ ├── subtle v2.4.1 +│ │ │ │ └── zeroize v1.6.0 +│ │ │ ├── serdect v0.1.0 (*) +│ │ │ ├── subtle v2.4.1 +│ │ │ └── zeroize v1.6.0 +│ │ ├── rfc6979 v0.3.1 +│ │ │ ├── crypto-bigint v0.4.9 (*) +│ │ │ ├── hmac v0.12.1 +│ │ │ │ └── digest v0.10.7 (*) +│ │ │ └── zeroize v1.6.0 +│ │ ├── serdect v0.1.0 (*) +│ │ └── signature v1.6.4 +│ │ ├── digest v0.10.7 (*) +│ │ └── rand_core v0.6.4 (*) +│ ├── elliptic-curve v0.12.3 (*) +│ ├── serdect v0.1.0 (*) +│ └── sha2 v0.10.8 +│ ├── cfg-if v1.0.0 +│ ├── cpufeatures v0.2.11 +│ │ └── libc v0.2.149 +│ └── digest v0.10.7 (*) +├── lazy_static v1.4.0 +├── locspan v0.7.16 +├── macro-attr-2018 v3.0.0 +├── mime v0.3.17 +├── newtype-derive-2018 v0.2.1 +│ └── generics v0.5.0 +├── parity-scale-codec v3.6.5 +│ ├── arrayvec v0.7.4 +│ ├── byte-slice-cast v1.2.2 +│ ├── impl-trait-for-tuples v0.2.2 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ ├── parity-scale-codec-derive v3.6.5 (proc-macro) +│ │ ├── proc-macro-crate v1.1.3 +│ │ │ ├── thiserror v1.0.50 +│ │ │ │ └── thiserror-impl v1.0.50 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ └── toml v0.5.11 +│ │ │ └── serde v1.0.190 (*) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ └── serde v1.0.190 (*) +├── percent-encoding v2.3.0 +├── scale-info v2.10.0 +│ ├── cfg-if v1.0.0 +│ ├── derive_more v0.99.17 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ └── scale-info-derive v2.10.0 (proc-macro) +│ ├── proc-macro-crate v1.1.3 (*) +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── syn v1.0.109 (*) +├── serde v1.0.190 (*) +├── serde_derive v1.0.190 (proc-macro) (*) +├── serde_json v1.0.107 +│ ├── itoa v1.0.9 +│ ├── ryu v1.0.15 +│ └── serde v1.0.190 (*) +├── static-iref v2.0.0 (proc-macro) +│ └── iref v2.2.3 (*) +├── thiserror v1.0.50 (*) +├── thiserror-no-std v2.0.2 +│ └── thiserror-impl-no-std v2.0.2 (proc-macro) +│ ├── proc-macro2 v1.0.69 (*) +│ ├── quote v1.0.33 (*) +│ └── syn v1.0.109 (*) +├── tracing v0.1.40 +│ ├── pin-project-lite v0.2.13 +│ ├── tracing-attributes v0.1.27 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v2.0.38 (*) +│ └── tracing-core v0.1.32 +│ └── once_cell v1.18.0 +├── url v2.4.1 +│ ├── form_urlencoded v1.2.0 +│ │ └── percent-encoding v2.3.0 +│ ├── idna v0.4.0 +│ │ ├── unicode-bidi v0.3.13 +│ │ └── unicode-normalization v0.1.22 +│ │ └── tinyvec v1.6.0 +│ │ └── tinyvec_macros v0.1.1 +│ └── percent-encoding v2.3.0 +└── uuid v1.5.0 + └── serde v1.0.190 (*) +[build-dependencies] +├── glob v0.3.1 +├── lazy_static v1.4.0 +└── serde_json v1.0.107 (*) +[dev-dependencies] +├── criterion v0.5.1 +│ ├── anes v0.1.6 +│ ├── cast v0.3.0 +│ ├── ciborium v0.2.1 +│ │ ├── ciborium-io v0.2.1 +│ │ ├── ciborium-ll v0.2.1 +│ │ │ ├── ciborium-io v0.2.1 +│ │ │ └── half v1.8.2 +│ │ └── serde v1.0.190 (*) +│ ├── clap v4.4.7 +│ │ └── clap_builder v4.4.7 +│ │ ├── anstyle v1.0.4 +│ │ └── clap_lex v0.6.0 +│ ├── criterion-plot v0.5.0 +│ │ ├── cast v0.3.0 +│ │ └── itertools v0.10.5 +│ │ └── either v1.9.0 +│ ├── futures v0.3.29 (*) +│ ├── is-terminal v0.4.9 +│ │ └── rustix v0.38.21 +│ │ ├── bitflags v2.4.1 +│ │ ├── errno v0.3.5 +│ │ │ └── libc v0.2.149 +│ │ └── libc v0.2.149 +│ ├── itertools v0.10.5 (*) +│ ├── num-traits v0.2.17 (*) +│ ├── once_cell v1.18.0 +│ ├── oorandom v11.1.3 +│ ├── plotters v0.3.5 +│ │ ├── num-traits v0.2.17 (*) +│ │ ├── plotters-backend v0.3.5 +│ │ └── plotters-svg v0.3.5 +│ │ └── plotters-backend v0.3.5 +│ ├── rayon v1.8.0 +│ │ ├── either v1.9.0 +│ │ └── rayon-core v1.12.0 +│ │ ├── crossbeam-deque v0.8.3 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── crossbeam-epoch v0.9.15 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ ├── crossbeam-utils v0.8.16 +│ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ ├── memoffset v0.9.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── autocfg v1.1.0 +│ │ │ │ └── scopeguard v1.2.0 +│ │ │ │ [build-dependencies] +│ │ │ │ └── autocfg v1.1.0 +│ │ │ └── crossbeam-utils v0.8.16 (*) +│ │ └── crossbeam-utils v0.8.16 (*) +│ ├── regex v1.10.2 +│ │ ├── aho-corasick v1.1.2 +│ │ │ └── memchr v2.6.4 +│ │ ├── memchr v2.6.4 +│ │ ├── regex-automata v0.4.3 +│ │ │ ├── aho-corasick v1.1.2 (*) +│ │ │ ├── memchr v2.6.4 +│ │ │ └── regex-syntax v0.8.2 +│ │ └── regex-syntax v0.8.2 +│ ├── serde v1.0.190 (*) +│ ├── serde_derive v1.0.190 (proc-macro) (*) +│ ├── serde_json v1.0.107 (*) +│ ├── tinytemplate v1.2.1 +│ │ ├── serde v1.0.190 (*) +│ │ └── serde_json v1.0.107 (*) +│ ├── tokio v1.33.0 +│ │ ├── bytes v1.5.0 +│ │ ├── libc v0.2.149 +│ │ ├── mio v0.8.9 +│ │ │ └── libc v0.2.149 +│ │ ├── num_cpus v1.16.0 +│ │ │ └── libc v0.2.149 +│ │ ├── parking_lot v0.12.1 +│ │ │ ├── lock_api v0.4.11 +│ │ │ │ └── scopeguard v1.2.0 +│ │ │ │ [build-dependencies] +│ │ │ │ └── autocfg v1.1.0 +│ │ │ └── parking_lot_core v0.9.9 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── libc v0.2.149 +│ │ │ └── smallvec v1.11.1 +│ │ ├── pin-project-lite v0.2.13 +│ │ ├── signal-hook-registry v1.4.1 +│ │ │ └── libc v0.2.149 +│ │ ├── socket2 v0.5.5 +│ │ │ └── libc v0.2.149 +│ │ └── tokio-macros v2.1.0 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v2.0.38 (*) +│ └── walkdir v2.4.0 +│ └── same-file v1.0.6 +├── insta v1.34.0 +│ ├── console v0.15.7 +│ │ ├── lazy_static v1.4.0 +│ │ └── libc v0.2.149 +│ ├── lazy_static v1.4.0 +│ ├── linked-hash-map v0.5.6 +│ ├── pest v2.7.5 +│ │ ├── memchr v2.6.4 +│ │ ├── thiserror v1.0.50 (*) +│ │ └── ucd-trie v0.1.6 +│ ├── pest_derive v2.7.5 (proc-macro) +│ │ ├── pest v2.7.5 (*) +│ │ └── pest_generator v2.7.5 +│ │ ├── pest v2.7.5 (*) +│ │ ├── pest_meta v2.7.5 +│ │ │ ├── once_cell v1.18.0 +│ │ │ └── pest v2.7.5 (*) +│ │ │ [build-dependencies] +│ │ │ └── sha2 v0.10.8 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── cpufeatures v0.2.11 (*) +│ │ │ └── digest v0.10.7 +│ │ │ ├── block-buffer v0.10.4 (*) +│ │ │ └── crypto-common v0.1.6 +│ │ │ ├── generic-array v0.14.7 (*) +│ │ │ └── typenum v1.17.0 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v2.0.38 (*) +│ ├── serde v1.0.190 (*) +│ ├── similar v2.3.0 +│ ├── toml v0.5.11 (*) +│ └── yaml-rust v0.4.5 +│ └── linked-hash-map v0.5.6 +├── mockito v1.2.0 +│ ├── assert-json-diff v2.0.2 +│ │ ├── serde v1.0.190 (*) +│ │ └── serde_json v1.0.107 (*) +│ ├── colored v2.0.4 +│ │ ├── is-terminal v0.4.9 (*) +│ │ └── lazy_static v1.4.0 +│ ├── futures v0.3.29 (*) +│ ├── hyper v0.14.27 +│ │ ├── bytes v1.5.0 +│ │ ├── futures-channel v0.3.29 (*) +│ │ ├── futures-core v0.3.29 +│ │ ├── futures-util v0.3.29 (*) +│ │ ├── h2 v0.3.21 +│ │ │ ├── bytes v1.5.0 +│ │ │ ├── fnv v1.0.7 +│ │ │ ├── futures-core v0.3.29 +│ │ │ ├── futures-sink v0.3.29 +│ │ │ ├── futures-util v0.3.29 (*) +│ │ │ ├── http v0.2.9 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ ├── fnv v1.0.7 +│ │ │ │ └── itoa v1.0.9 +│ │ │ ├── indexmap v1.9.3 +│ │ │ │ └── hashbrown v0.12.3 +│ │ │ │ [build-dependencies] +│ │ │ │ └── autocfg v1.1.0 +│ │ │ ├── slab v0.4.9 (*) +│ │ │ ├── tokio v1.33.0 (*) +│ │ │ ├── tokio-util v0.7.10 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ ├── futures-sink v0.3.29 +│ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ └── tracing v0.1.40 (*) +│ │ │ └── tracing v0.1.40 (*) +│ │ ├── http v0.2.9 (*) +│ │ ├── http-body v0.4.5 +│ │ │ ├── bytes v1.5.0 +│ │ │ ├── http v0.2.9 (*) +│ │ │ └── pin-project-lite v0.2.13 +│ │ ├── httparse v1.8.0 +│ │ ├── httpdate v1.0.3 +│ │ ├── itoa v1.0.9 +│ │ ├── pin-project-lite v0.2.13 +│ │ ├── socket2 v0.4.10 +│ │ │ └── libc v0.2.149 +│ │ ├── tokio v1.33.0 (*) +│ │ ├── tower-service v0.3.2 +│ │ ├── tracing v0.1.40 (*) +│ │ └── want v0.3.1 +│ │ └── try-lock v0.2.4 +│ ├── log v0.4.20 +│ ├── rand v0.8.5 +│ │ ├── libc v0.2.149 +│ │ ├── rand_chacha v0.3.1 +│ │ │ ├── ppv-lite86 v0.2.17 +│ │ │ └── rand_core v0.6.4 (*) +│ │ └── rand_core v0.6.4 (*) +│ ├── regex v1.10.2 (*) +│ ├── serde_json v1.0.107 (*) +│ ├── serde_urlencoded v0.7.1 +│ │ ├── form_urlencoded v1.2.0 (*) +│ │ ├── itoa v1.0.9 +│ │ ├── ryu v1.0.15 +│ │ └── serde v1.0.190 (*) +│ ├── similar v2.3.0 +│ └── tokio v1.33.0 (*) +├── proptest v1.3.1 +│ ├── bit-set v0.5.3 +│ │ └── bit-vec v0.6.3 +│ ├── bit-vec v0.6.3 +│ ├── bitflags v2.4.1 +│ ├── lazy_static v1.4.0 +│ ├── num-traits v0.2.17 (*) +│ ├── rand v0.8.5 (*) +│ ├── rand_chacha v0.3.1 (*) +│ ├── rand_xorshift v0.3.0 +│ │ └── rand_core v0.6.4 (*) +│ ├── regex-syntax v0.7.5 +│ ├── rusty-fork v0.3.0 +│ │ ├── fnv v1.0.7 +│ │ ├── quick-error v1.2.3 +│ │ ├── tempfile v3.8.1 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── fastrand v2.0.1 +│ │ │ └── rustix v0.38.21 (*) +│ │ └── wait-timeout v0.2.0 +│ │ └── libc v0.2.149 +│ ├── tempfile v3.8.1 (*) +│ └── unarray v0.1.4 +├── tempfile v3.8.1 (*) +├── testcontainers v0.14.0 +│ ├── bollard-stubs v1.41.0 +│ │ ├── chrono v0.4.31 (*) +│ │ ├── serde v1.0.190 (*) +│ │ └── serde_with v1.14.0 +│ │ ├── serde v1.0.190 (*) +│ │ └── serde_with_macros v1.5.2 (proc-macro) +│ │ ├── darling v0.13.4 +│ │ │ ├── darling_core v0.13.4 +│ │ │ │ ├── fnv v1.0.7 +│ │ │ │ ├── ident_case v1.0.1 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ ├── strsim v0.10.0 +│ │ │ │ └── syn v1.0.109 (*) +│ │ │ └── darling_macro v0.13.4 (proc-macro) +│ │ │ ├── darling_core v0.13.4 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ ├── futures v0.3.29 (*) +│ ├── hex v0.4.3 +│ ├── hmac v0.12.1 (*) +│ ├── log v0.4.20 +│ ├── rand v0.8.5 (*) +│ ├── serde v1.0.190 (*) +│ ├── serde_json v1.0.107 (*) +│ └── sha2 v0.10.8 (*) +└── tokio v1.33.0 (*) diff --git a/crates/embedded-substrate/Cargo.toml b/crates/embedded-substrate/Cargo.toml new file mode 100644 index 000000000..767a72dbc --- /dev/null +++ b/crates/embedded-substrate/Cargo.toml @@ -0,0 +1,15 @@ +[package] +edition = "2021" +name = "embedded-substrate" +version = "0.1.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +node-chronicle = { path = "../../node/node-chronicle" } +sc-cli = { version = "0.33.0" } +sp-io = { version = "27.0.0" } +sp-runtime = { version = "28.0.0" } +subxt = { version = "0.32", features = ["substrate-compat"] } +tempfile = { version = "3" } +tokio = { workspace = true } diff --git a/crates/embedded-substrate/src/lib.rs b/crates/embedded-substrate/src/lib.rs new file mode 100644 index 000000000..f10e8448e --- /dev/null +++ b/crates/embedded-substrate/src/lib.rs @@ -0,0 +1,149 @@ +use std::time::Duration; + +use futures::{pin_mut, FutureExt}; +use node_chronicle::{cli::Cli, service}; +use sc_cli::{print_node_infos, CliConfiguration, Signals, SubstrateCli}; +use subxt::{ + config::ExtrinsicParams, + utils::{AccountId32, MultiAddress, MultiSignature}, +}; +use tempfile::TempDir; +use tokio::{ + select, + sync::oneshot::{channel, Sender}, +}; + +pub struct EmbeddedSubstrate { + shutdown: Option>, + state: TempDir, + rpc_port: u16, +} + +impl EmbeddedSubstrate { + pub async fn connect(&self) -> Result, SubxtClientError> + where + T: subxt::Config, + T: subxt::Config, + T: subxt::Config
>, + T: subxt::Config, + T: subxt::Config, + >::OtherParams: Default, + { + SubstrateClient::connect(format!("ws://127.0.0.1:{}", self.rpc_port)).await + } +} + +impl Drop for EmbeddedSubstrate { + fn drop(&mut self) { + if let Some(shutdown) = self.shutdown.take() { + if let Err(e) = shutdown.send(()) { + tracing::error!("Failed to send shutdown signal: {}", e); + } + } else { + tracing::warn!("Shutdown signal was already taken"); + } + } +} + +// Utilise the CLI run command to bring up a substrate-chronicle dev mode node with a new runtime +// thread. Execute node until receipt of a drop channel message or signal +pub async fn embedded_dev_node_rpc_on_port(port: u16) -> Result { + let (live_tx, live_rx) = channel::<()>(); + let (tx, rx) = channel(); + let tmp_dir = tempfile::tempdir().unwrap(); + let tmp_path = format!("{}", tmp_dir.path().to_string_lossy()); + + std::thread::spawn(move || { + let cli = Cli::from_iter([ + "--chain dev", + "--force-authoring", + "--alice", + &*format!("--rpc-port={}", port), + "--rpc-cors=all", + &*format!("-d{}", tmp_path), + ]); + + let tokio_runtime = + tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap(); + + let signals = tokio_runtime + .block_on(async { Signals::capture() }) + .map_err(|e| tracing::error!("{}", e)) + .unwrap(); + + let config = cli + .create_configuration(&cli.run, tokio_runtime.handle().clone()) + .map_err(|e| tracing::error!("{}", e)) + .unwrap(); + + print_node_infos::(&config); + + cli.run + .init(&"https://chronicle.works".to_owned(), &"2.0.dev".to_owned(), |_, _| {}, &config) + .unwrap(); + + let mut task_manager = tokio_runtime + .block_on(async move { service::new_full(config).map_err(sc_cli::Error::Service) }) + .map_err(|e| tracing::error!("{}", e)) + .unwrap(); + + live_tx.send(()).unwrap(); + + let task_manager = tokio_runtime.block_on(async move { + let signal_exit = signals.future().fuse(); + let task_exit = task_manager.future().fuse(); + let drop_exit = async move { + let _ = rx.await; + tracing::error!("Shutdown message"); + }; + + pin_mut!(signal_exit, drop_exit); + + select! { + _ = signal_exit => {}, + _ = drop_exit => {}, + _ = task_exit => {}, + } + + task_manager + }); + + let task_registry = task_manager.into_task_registry(); + // Give all futures 60 seconds to shutdown, before tokio "leaks" them. + let shutdown_timeout = Duration::from_secs(60); + tokio_runtime.shutdown_timeout(shutdown_timeout); + + let running_tasks = task_registry.running_tasks(); + + if !running_tasks.is_empty() { + tracing::error!("Detected running(potentially stalled) tasks on shutdown:"); + running_tasks.iter().for_each(|(task, count)| { + let instances_desc = + if *count > 1 { format!("with {} instances ", count) } else { "".to_string() }; + + if task.is_default_group() { + tracing::error!( + "Task \"{}\" was still running {}after waiting {} seconds to finish.", + task.name, + instances_desc, + shutdown_timeout.as_secs(), + ); + } else { + tracing::error!( + "Task \"{}\" (Group: {}) was still running {}after waiting {} seconds to finish.", + task.name, + task.group, + instances_desc, + shutdown_timeout.as_secs(), + ); + } + }); + } + }); + + tracing::info!("Await substrate boot"); + let _ = live_rx.await; + tracing::info!("Substrate booted"); + + Ok(EmbeddedSubstrate { shutdown: tx.into(), rpc_port: port, state: tmp_dir }) +} diff --git a/crates/opa-tp-protocol/build.rs b/crates/opa-tp-protocol/build.rs deleted file mode 100644 index 1a99e734b..000000000 --- a/crates/opa-tp-protocol/build.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::{env, fs, io::Result, path::PathBuf}; - -fn main() -> Result<()> { - let protos = glob::glob("./src/protos/*.proto") - .unwrap() - .map(|x| x.unwrap()) - .collect::>(); - prost_build::compile_protos(&protos, &["./src/protos"])?; - - let out_str = env::var("OUT_DIR").unwrap(); - let out_path = PathBuf::from(&out_str); - let mut out_path = out_path.ancestors().nth(3).unwrap().to_owned(); - out_path.push("assets"); - - if !out_path.exists() { - fs::create_dir(&out_path).expect("Could not create assets dir"); - } - - Ok(()) -} diff --git a/crates/opa-tp-protocol/src/address.rs b/crates/opa-tp-protocol/src/address.rs deleted file mode 100644 index 0cd9134b3..000000000 --- a/crates/opa-tp-protocol/src/address.rs +++ /dev/null @@ -1,24 +0,0 @@ -use hex; -use lazy_static::lazy_static; -use openssl::sha::Sha256; - -lazy_static! { - pub static ref PREFIX: String = { - let mut sha = Sha256::new(); - sha.update("opa-tp".as_bytes()); - hex::encode(sha.finish())[..6].to_string() - }; -} - -pub static VERSION: &str = "1.0"; -pub static FAMILY: &str = "opa-tp"; - -pub fn hash_and_append(addr: impl AsRef) -> String { - let mut sha = Sha256::new(); - sha.update(addr.as_ref().as_bytes()); - format!("{}{}", &*PREFIX, hex::encode(sha.finish())) -} - -pub trait HasSawtoothAddress { - fn get_address(&self) -> String; -} diff --git a/crates/opa-tp-protocol/src/events.rs b/crates/opa-tp-protocol/src/events.rs deleted file mode 100644 index ec7787772..000000000 --- a/crates/opa-tp-protocol/src/events.rs +++ /dev/null @@ -1,50 +0,0 @@ -use async_stl_client::{ - error::SawtoothCommunicationError, - ledger::{LedgerEvent, Span}, -}; -use prost::Message; -use serde_json::json; - -use crate::{ - messages::{self, OpaEvent}, - state::OpaOperationEvent, -}; - -#[async_trait::async_trait] -impl LedgerEvent for OpaOperationEvent { - async fn deserialize(buf: &[u8]) -> Result<(Self, Span), SawtoothCommunicationError> - where - Self: Sized, - { - let ev = OpaEvent::decode(buf)?; - if let Some(payload) = ev.payload { - match payload { - messages::opa_event::Payload::Operation(value) => { - let value = serde_json::from_str(&value)?; - Ok((value, Span::Span(ev.span_id))) - }, - messages::opa_event::Payload::Error(value) => - Ok((OpaOperationEvent::Error(value), Span::Span(ev.span_id))), - } - } else { - Err(SawtoothCommunicationError::MalformedMessage) - } - } -} - -pub fn opa_event(span_id: u64, value: OpaOperationEvent) -> Result, serde_json::Error> { - Ok(OpaEvent { - version: crate::PROTOCOL_VERSION.to_string(), - span_id, - payload: { - match value { - OpaOperationEvent::Error(e) => Some(messages::opa_event::Payload::Error( - serde_json::to_string(&json!({ "error": e }))?, - )), - value => - Some(messages::opa_event::Payload::Operation(serde_json::to_string(&value)?)), - } - }, - } - .encode_to_vec()) -} diff --git a/crates/opa-tp-protocol/src/lib.rs b/crates/opa-tp-protocol/src/lib.rs deleted file mode 100644 index c695ee43a..000000000 --- a/crates/opa-tp-protocol/src/lib.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![cfg_attr(feature = "strict", deny(warnings))] - -use async_stl_client::{ - ledger::SawtoothLedger, - zmq_client::{RetryingRequestResponseChannel, ZmqRequestResponseSawtoothChannel}, -}; -use state::OpaOperationEvent; -use transaction::OpaSubmitTransaction; -pub mod address; -pub mod events; -pub mod state; -pub mod submission; -pub mod transaction; - -pub use async_stl_client; - -static PROTOCOL_VERSION: &str = "1"; - -pub type OpaLedger = SawtoothLedger< - RetryingRequestResponseChannel, - OpaOperationEvent, - OpaSubmitTransaction, ->; - -// generated from ./protos/ -pub mod messages { - #![allow(clippy::derive_partial_eq_without_eq)] - - include!(concat!(env!("OUT_DIR"), "/_.rs")); -} diff --git a/crates/opa-tp-protocol/src/protos/event.proto b/crates/opa-tp-protocol/src/protos/event.proto deleted file mode 100644 index 8d576db59..000000000 --- a/crates/opa-tp-protocol/src/protos/event.proto +++ /dev/null @@ -1,10 +0,0 @@ -syntax = "proto3"; - -message OPAEvent { - string version = 1; - uint64 span_id = 2; - oneof payload { - string operation = 3; - string error = 4; - } -} diff --git a/crates/opa-tp-protocol/src/protos/submission.proto b/crates/opa-tp-protocol/src/protos/submission.proto deleted file mode 100644 index 9f3e1e9bb..000000000 --- a/crates/opa-tp-protocol/src/protos/submission.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; - -// This message is used to bootstrap the root key for a newly created authz tp, -// it can only be executed once -message BootstrapRoot { string public_key = 1; } - -message RegisterKey { - string public_key = 1; - string id = 2; - bool overwrite_existing = 3; -} - -// Rotate the key with name to the new public key, the SignedOperation for this -// message must be signed by the old key. The signature must be valid for -// the new one, to demonstrate ownership of both keys -message RotateKey { - message NewPublicKey { - bytes public_key = 1; - string id = 2; - } - NewPublicKey payload = 1; - string previous_signing_key = 4; - bytes previous_signature = 5; - string new_signing_key = 6; - bytes new_signature = 7; -} - -// Set the policy with name to the new policy, the SignedOperation for this must -// be signed by the root key -message SetPolicy { - string id = 1; - bytes policy = 2; -} - -// An OPA TP operation and its signature -message SignedOperation { - message Payload { - oneof operation { - RegisterKey register_key = 1; - RotateKey rotate_key = 2; - SetPolicy set_policy = 3; - } - } - - Payload payload = 1; - string verifying_key = 4; - bytes signature = 5; -} - -message Submission { - string version = 1; - uint64 span_id = 2; - oneof payload { - BootstrapRoot bootstrap_root = 3; - SignedOperation signed_operation = 4; - } -} diff --git a/crates/opa-tp-protocol/src/state.rs b/crates/opa-tp-protocol/src/state.rs deleted file mode 100644 index c1edb4bc7..000000000 --- a/crates/opa-tp-protocol/src/state.rs +++ /dev/null @@ -1,74 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::address::{hash_and_append, HasSawtoothAddress}; - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct KeyRegistration { - // Der encoded public key - pub key: String, - pub version: u64, -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct Keys { - pub id: String, - pub current: KeyRegistration, - pub expired: Option, -} - -impl HasSawtoothAddress for Keys { - fn get_address(&self) -> String { - key_address(&self.id) - } -} - -pub fn policy_address(id: impl AsRef) -> String { - hash_and_append(format!("opa:policy:binary:{}", id.as_ref())) -} - -pub fn policy_meta_address(id: impl AsRef) -> String { - hash_and_append(format!("opa:policy:meta:{}", id.as_ref())) -} - -pub fn key_address(id: impl AsRef) -> String { - hash_and_append(format!("opa:keys:{}", id.as_ref())) -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub struct PolicyMeta { - pub id: String, - pub hash: String, - pub policy_address: String, -} - -impl HasSawtoothAddress for PolicyMeta { - fn get_address(&self) -> String { - policy_address(&self.id) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] -pub enum OpaOperationEvent { - PolicyUpdate(PolicyMeta), - KeyUpdate(Keys), - - Error(String), -} - -impl From for OpaOperationEvent { - fn from(v: String) -> Self { - Self::Error(v) - } -} - -impl From for OpaOperationEvent { - fn from(v: Keys) -> Self { - Self::KeyUpdate(v) - } -} - -impl From for OpaOperationEvent { - fn from(v: PolicyMeta) -> Self { - Self::PolicyUpdate(v) - } -} diff --git a/crates/opa-tp-protocol/src/transaction.rs b/crates/opa-tp-protocol/src/transaction.rs deleted file mode 100644 index 19ffb6ce7..000000000 --- a/crates/opa-tp-protocol/src/transaction.rs +++ /dev/null @@ -1,163 +0,0 @@ -use std::{convert::Infallible, sync::Arc}; - -use async_stl_client::{ - ledger::{LedgerTransaction, TransactionId}, - sawtooth::MessageBuilder, -}; -use chronicle_signing::{BatcherKnownKeyNamesSigner, ChronicleSigning, SecretError}; -use k256::ecdsa::VerifyingKey; -use prost::Message; - -use crate::{ - async_stl_client::sawtooth::TransactionPayload, - messages::Submission, - state::{key_address, policy_address, policy_meta_address}, -}; - -#[derive(Debug, Clone)] -pub enum OpaSubmitTransaction { - BootstrapRoot(Submission, ChronicleSigning), - RotateRoot(Submission, ChronicleSigning), - RegisterKey(Submission, ChronicleSigning, String, bool), - RotateKey(Submission, ChronicleSigning, String), - SetPolicy(Submission, ChronicleSigning, String), -} - -impl OpaSubmitTransaction { - pub fn bootstrap_root(submission: Submission, sawtooth_signer: &ChronicleSigning) -> Self { - Self::BootstrapRoot(submission, sawtooth_signer.to_owned()) - } - - pub fn rotate_root(submission: Submission, sawtooth_signer: &ChronicleSigning) -> Self { - Self::RotateRoot(submission, sawtooth_signer.to_owned()) - } - - pub fn register_key( - name: impl AsRef, - submission: Submission, - sawtooth_signer: &ChronicleSigning, - overwrite_existing: bool, - ) -> Self { - Self::RegisterKey( - submission, - sawtooth_signer.to_owned(), - name.as_ref().to_owned(), - overwrite_existing, - ) - } - - pub fn rotate_key( - name: impl AsRef, - submission: Submission, - sawtooth_signer: &ChronicleSigning, - ) -> Self { - Self::RegisterKey(submission, sawtooth_signer.to_owned(), name.as_ref().to_owned(), false) - } - - pub fn set_policy( - name: impl AsRef, - submission: Submission, - sawtooth_signer: &ChronicleSigning, - ) -> Self { - Self::SetPolicy(submission, sawtooth_signer.to_owned(), name.as_ref().to_owned()) - } -} - -#[async_trait::async_trait] -impl TransactionPayload for OpaSubmitTransaction { - type Error = Infallible; - - /// Envelope a payload of `ChronicleOperations` and `SignedIdentity` in a `Submission` protocol - /// buffer, along with placeholders for protocol version info and a tracing span id. - async fn to_bytes(&self) -> Result, Infallible> { - Ok(match self { - Self::BootstrapRoot(submission, _) => submission, - Self::RotateRoot(submission, _) => submission, - Self::RegisterKey(submission, _, _, _) => submission, - Self::RotateKey(submission, _, _) => submission, - Self::SetPolicy(submission, _, _) => submission, - } - .encode_to_vec()) - } -} - -#[async_trait::async_trait] -impl LedgerTransaction for OpaSubmitTransaction { - type Error = SecretError; - - async fn sign(&self, bytes: Arc>) -> Result, Self::Error> { - let signer = match self { - Self::BootstrapRoot(_, signer) => signer, - Self::RotateRoot(_, signer) => signer, - Self::RegisterKey(_, signer, _, _) => signer, - Self::RotateKey(_, signer, _) => signer, - Self::SetPolicy(_, signer, _) => signer, - }; - signer.batcher_sign(&bytes).await - } - - async fn verifying_key(&self) -> Result { - let signer = match self { - Self::BootstrapRoot(_, signer) => signer, - Self::RotateRoot(_, signer) => signer, - Self::RegisterKey(_, signer, _, _) => signer, - Self::RotateKey(_, signer, _) => signer, - Self::SetPolicy(_, signer, _) => signer, - }; - - signer.batcher_verifying().await - } - - fn addresses(&self) -> Vec { - match self { - Self::BootstrapRoot(_, _) => { - vec![key_address("root")] - }, - Self::RotateRoot(_, _) => { - vec![key_address("root")] - }, - Self::RegisterKey(_, _, name, _) => { - vec![key_address("root"), key_address(name.clone())] - }, - Self::RotateKey(_, _, name) => { - vec![key_address("root"), key_address(name.clone())] - }, - Self::SetPolicy(_, _, name) => { - vec![ - key_address("root"), - policy_meta_address(name.clone()), - policy_address(name.clone()), - ] - }, - } - } - - async fn as_sawtooth_tx( - &self, - message_builder: &MessageBuilder, - ) -> Result<(async_stl_client::messages::Transaction, TransactionId), Self::Error> { - let signer = match self { - Self::BootstrapRoot(_, signer) => signer, - Self::RotateRoot(_, signer) => signer, - Self::RegisterKey(_, signer, _, _) => signer, - Self::RotateKey(_, signer, _) => signer, - Self::SetPolicy(_, signer, _) => signer, - } - .clone(); - - message_builder - .make_sawtooth_transaction( - self.addresses(), - self.addresses(), - vec![], - self, - signer.batcher_verifying().await?, - |bytes| { - let signer = signer.clone(); - let bytes = bytes.to_vec(); - async move { signer.batcher_sign(&bytes).await } - }, - ) - .await - } -} diff --git a/crates/opa-tp/Cargo.toml b/crates/opa-tp/Cargo.toml index cb53d3a7a..59f21016d 100644 --- a/crates/opa-tp/Cargo.toml +++ b/crates/opa-tp/Cargo.toml @@ -18,7 +18,6 @@ doc = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-stl-client = { workspace = true } async-trait = { workspace = true } bytes = { workspace = true } chronicle-signing = { workspace = true } @@ -35,7 +34,9 @@ k256 = { workspace = true, features = [ "std", "pem", ] } -opa-tp-protocol = { path = "../opa-tp-protocol" } +parity-scale-codec = { version = "3.6.5", default-features = false, features = [ + "derive", +] } prost = { workspace = true } sawtooth-sdk = { workspace = true } serde_json = { workspace = true } diff --git a/crates/opa-tp/src/lib.rs b/crates/opa-tp/src/lib.rs index dd3ac41c7..77e714f0e 100644 --- a/crates/opa-tp/src/lib.rs +++ b/crates/opa-tp/src/lib.rs @@ -1,3 +1,4 @@ //! Library exports for use in test and embedding contexts. pub mod abstract_tp; +pub mod messages; pub mod tp; diff --git a/crates/pallet-chronicle/Cargo.toml b/crates/pallet-chronicle/Cargo.toml index 6b28e7212..8c0a9ead9 100644 --- a/crates/pallet-chronicle/Cargo.toml +++ b/crates/pallet-chronicle/Cargo.toml @@ -7,22 +7,24 @@ version = "0.7.5" [dependencies] -common = {path = "../common", default-features=false, features=["parity"]} +common = {path = "../common", default-features=false, features=["parity-encoding"]} parity-scale-codec = { version="3.6.5", default-features = false, features = ["derive"] } uuid = {version="1.5.0", default-features=false} -sp-std = { version="11.0.0", default-features = false} +sp-std = { version="12.0.0", default-features = false} scale-info = { version="2.10.0", default-features = false, features = ["derive"] } -frame-support = { version="24.0.0", default-features=false } -frame-system = { version= "24.0.0",default-features=false } -frame-benchmarking = { version = "24.0.0", default-features = false, optional=true} +frame-support = { version="25.0.0", default-features=false } +sp-core = {version="25.0.0", default-features=false } +frame-system = { version= "25.0.0",default-features=false } +frame-benchmarking = { version = "25.0.0", default-features = false, optional=true} tracing = {version="0.1.40", default-features=false, features=["attributes"]} newtype-derive-2018 = {workspace=true} macro-attr-2018 = {workspace=true} [dev-dependencies] -sp-runtime = { version="27.0.0"} -sp-io = {version="26.0.0" } -sp-core = {version="24.0.0"} +uuid = {version="1.5.0", default-features=true} +sp-runtime = { version="28.0.0"} +sp-io = {version="27.0.0" } +sp-core = {version="25.0.0"} chronicle-telemetry = {path="../chronicle-telemetry"} [features] diff --git a/crates/pallet-chronicle/src/lib.rs b/crates/pallet-chronicle/src/lib.rs index ff00c99ca..9365e7707 100644 --- a/crates/pallet-chronicle/src/lib.rs +++ b/crates/pallet-chronicle/src/lib.rs @@ -15,19 +15,22 @@ mod mock; #[cfg(test)] mod tests; -#[cfg(feature = "runtime-benchmarks")] -mod benchmarking; +//#[cfg(feature = "runtime-benchmarks")] +//mod benchmarking; pub mod weights; -pub use common::prov::*; + +pub mod chronicle_core { + pub use common::{ledger::*, prov::*}; +} pub use weights::*; #[frame_support::pallet] pub mod pallet { use super::*; + use common::ledger::OperationSubmission; use frame_support::pallet_prelude::*; use frame_system::pallet_prelude::*; - use sp_std::collections::btree_set::BTreeSet; - use sp_std::vec::Vec; + use sp_std::{collections::btree_set::BTreeSet, vec::Vec}; #[pallet::pallet] pub struct Pallet(_); @@ -40,10 +43,7 @@ pub mod pallet { /// Type representing the weight of this pallet type WeightInfo: WeightInfo; - type OperationList: Parameter - + Into> - + From> - + parity_scale_codec::Codec; + type OperationSubmission: Parameter + Into + parity_scale_codec::Codec; } // The pallet's runtime storage items. // https://docs.substrate.io/main-docs/build/runtime-storage/ @@ -53,13 +53,21 @@ pub mod pallet { // https://docs.substrate.io/main-docs/build/runtime-storage/#declaring-storage-items pub type Provenance = StorageMap<_, Twox128, LedgerAddress, common::prov::ProvModel>; + // The pallet's runtime storage items. + // https://docs.substrate.io/main-docs/build/runtime-storage/ + #[pallet::storage] + #[pallet::getter(fn get_value)] + // Learn more about declaring storage items: + // https://docs.substrate.io/main-docs/build/runtime-storage/#declaring-storage-items + pub type Something = StorageValue<_, u32>; + // Pallets use events to inform users when important changes are made. // https://docs.substrate.io/main-docs/build/events-errors/ #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - Applied(common::prov::ProvModel), - Contradiction(common::prov::Contradiction), + Applied(common::prov::ProvModel, common::identity::SignedIdentity, [u8; 16]), + Contradiction(common::prov::Contradiction, common::identity::SignedIdentity, [u8; 16]), } // Errors inform users that something went wrong. @@ -89,7 +97,6 @@ pub mod pallet { match error { common::prov::ProcessorError::Address => Error::Address, common::prov::ProcessorError::Contradiction { .. } => Error::Contradiction, - common::prov::ProcessorError::Expansion { .. } => Error::Expansion, common::prov::ProcessorError::Identity(_) => Error::Identity, common::prov::ProcessorError::NotAChronicleIri { .. } => Error::NotAChronicleIri, common::prov::ProcessorError::MissingId { .. } => Error::MissingId, @@ -102,7 +109,7 @@ pub mod pallet { common::prov::ProcessorError::Time(_) => Error::Time, common::prov::ProcessorError::Tokio => Error::Tokio, common::prov::ProcessorError::Utf8(_) => Error::Utf8, - _ => unreachable!(), //TODO: NOT THIS + _ => unimplemented!(), } } } @@ -112,20 +119,26 @@ pub mod pallet { // Dispatchable functions must be annotated with a weight and must return a DispatchResult. #[pallet::call] impl Pallet { - /// An example dispatchable that takes a singles value as a parameter, writes the value to - /// storage and emits an event. This function must be dispatched by a signed extrinsic. + // Apply a vector of chronicle operations, yielding an event that indicates state change or + // contradiction #[pallet::call_index(0)] - #[pallet::weight(T::WeightInfo::apply())] - pub fn apply(origin: OriginFor, operations: T::OperationList) -> DispatchResult { + #[pallet::weight({ + let weight = T::WeightInfo::apply(); + let dispatch_class = DispatchClass::Normal; + let pays_fee = Pays::No; + (weight, dispatch_class, pays_fee) + })] + pub fn apply(origin: OriginFor, operations: T::OperationSubmission) -> DispatchResult { // Check that the extrinsic was signed and get the signer. // This function will return an error if the extrinsic is not signed. // https://docs.substrate.io/main-docs/build/origins/ - let who = ensure_signed(origin)?; + let _who = ensure_signed(origin)?; - // Get operations and load their dependencies - let ops: Vec = operations.into(); + let sub = operations.into(); - let deps = ops.iter().flat_map(|tx| tx.dependencies()).collect::>(); + // Get operations and load their dependencies + let deps = + sub.operations.iter().flat_map(|tx| tx.dependencies()).collect::>(); let initial_input_models: Vec<_> = deps .into_iter() @@ -138,15 +151,20 @@ pub mod pallet { let mut model = common::prov::ProvModel::default(); - for op in ops { + for op in sub.operations.iter() { let res = op.process(model, state.input()); match res { - // A contradiction raises an event, not an error and shortcuts processing - contradiction attempts are useful provenance - // and should not be a purely operational concern + // A contradiction raises an event, not an error and shortcuts processing - + // contradiction attempts are useful provenance and should not be a purely + // operational concern Err(common::prov::ProcessorError::Contradiction(source)) => { tracing::info!(contradiction = %source); - Self::deposit_event(Event::::Contradiction(source)); + Self::deposit_event(Event::::Contradiction( + source, + (*sub.identity).clone(), + sub.correlation_id, + )); return Ok(()); }, @@ -177,7 +195,7 @@ pub mod pallet { } // Emit an event. - Self::deposit_event(Event::Applied(delta)); + Self::deposit_event(Event::Applied(delta, (*sub.identity).clone(), sub.correlation_id)); // Return a successful DispatchResultWithPostInfo Ok(()) } diff --git a/crates/pallet-chronicle/src/mock.rs b/crates/pallet-chronicle/src/mock.rs index 4d9424fdc..574578839 100644 --- a/crates/pallet-chronicle/src/mock.rs +++ b/crates/pallet-chronicle/src/mock.rs @@ -1,58 +1,56 @@ use crate as pallet_template; +use common::ledger::OperationSubmission; use frame_support::traits::{ConstU16, ConstU64}; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentityLookup}, - BuildStorage, + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test - { - System: frame_system, - ChronicleModule: pallet_template, - } + pub enum Test + { + System: frame_system, + ChronicleModule: pallet_template, + } ); impl frame_system::Config for Test { - type BaseCallFilter = frame_support::traits::Everything; - type BlockWeights = (); - type BlockLength = (); - type DbWeight = (); - type RuntimeOrigin = RuntimeOrigin; - type RuntimeCall = RuntimeCall; - type Nonce = u64; - type Hash = H256; - type Hashing = BlakeTwo256; - type AccountId = u64; - type Lookup = IdentityLookup; - type Block = Block; - type RuntimeEvent = RuntimeEvent; - type BlockHashCount = ConstU64<250>; - type Version = (); - type PalletInfo = PalletInfo; - type AccountData = (); - type OnNewAccount = (); - type OnKilledAccount = (); - type SystemWeightInfo = (); - type SS58Prefix = ConstU16<42>; - type OnSetCode = (); - type MaxConsumers = frame_support::traits::ConstU32<16>; + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Nonce = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<250>; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; } impl pallet_template::Config for Test { - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); - type OperationList = Vec; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); + type OperationSubmission = OperationSubmission; } // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::::default() - .build_storage() - .unwrap() - .into() + frame_system::GenesisConfig::::default().build_storage().unwrap().into() } diff --git a/crates/pallet-chronicle/src/tests.rs b/crates/pallet-chronicle/src/tests.rs index 3d9b18b95..7b93c4519 100644 --- a/crates/pallet-chronicle/src/tests.rs +++ b/crates/pallet-chronicle/src/tests.rs @@ -1,7 +1,10 @@ use crate::{mock::*, Event}; -use common::prov::{ - operations::{ChronicleOperation, CreateNamespace}, - ExternalId, NamespaceId, +use common::{ + ledger::OperationSubmission, + prov::{ + operations::{ChronicleOperation, CreateNamespace}, + NamespaceId, + }, }; use frame_support::assert_ok; use uuid::Uuid; @@ -11,10 +14,18 @@ fn it_works_for_default_value() { new_test_ext().execute_with(|| { // Go past genesis block so events get deposited System::set_block_number(1); + let op = OperationSubmission::new_anonymous(vec![]); // Dispatch a signed extrinsic. - assert_ok!(ChronicleModule::apply(RuntimeOrigin::signed(1), vec![])); + assert_ok!(ChronicleModule::apply(RuntimeOrigin::signed(1), op.clone())); // Assert that the correct event was deposited - System::assert_last_event(Event::Applied(common::prov::ProvModel::default()).into()); + System::assert_last_event( + Event::Applied( + common::prov::ProvModel::default(), + common::identity::SignedIdentity::new_no_identity(), + op.correlation_id, + ) + .into(), + ); }); } @@ -24,20 +35,27 @@ fn single_operation() { new_test_ext().execute_with(|| { // Go past genesis block so events get deposited System::set_block_number(1); - let uuid = Uuid::new_v4(); + let uuid = Uuid::from_u128(0u128); let op = ChronicleOperation::CreateNamespace(CreateNamespace { id: NamespaceId::from_external_id("test", uuid), - external_id: ExternalId::from("test"), - uuid: uuid.into(), }); + + let sub = OperationSubmission::new_anonymous(vec![op.clone()]); // Dispatch our operation - assert_ok!(ChronicleModule::apply(RuntimeOrigin::signed(1), vec![op.clone()])); + assert_ok!(ChronicleModule::apply(RuntimeOrigin::signed(1), sub.clone(),)); // Apply that operation to a new prov model for assertion - // the pallet execution should produce an identical delta let mut delta_model = common::prov::ProvModel::default(); delta_model.apply(&op).unwrap(); // Assert that the delta is correct - System::assert_last_event(Event::Applied(delta_model).into()); + System::assert_last_event( + Event::Applied( + delta_model, + common::identity::SignedIdentity::new_no_identity(), + sub.correlation_id, + ) + .into(), + ); }); } diff --git a/crates/pallet-opa/Cargo.toml b/crates/pallet-opa/Cargo.toml new file mode 100644 index 000000000..ca96f78e2 --- /dev/null +++ b/crates/pallet-opa/Cargo.toml @@ -0,0 +1,61 @@ +[package] +edition = "2021" +name = "pallet-opa" +version = "0.7.5" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] + +common = { path = "../common", default-features = false, features = [ + "parity-encoding", +] } +frame-benchmarking = { version = "25.0.0", default-features = false, optional = true } +frame-support = { version = "25.0.0", default-features = false } +frame-system = { version = "25.0.0", default-features = false } +k256 = { version = "0.11", default-features = false, features = [ + "arithmetic", + "ecdsa", + "pkcs8", + "pem", +] } +macro-attr-2018 = { workspace = true } +newtype-derive-2018 = { workspace = true } +parity-scale-codec = { version = "3.6.5", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.10.0", default-features = false, features = [ + "derive", +] } +serde = { version = "1", default-features = false } +serde_json = { version = "1", default-features = false, features = ["alloc"] } +sp-core = { version = "25.0.0", default-features = false } +sp-std = { version = "12.0.0", default-features = false } +tracing = { version = "0.1.40", default-features = false, features = [ + "attributes", +] } +uuid = { version = "1.5", default-features = false } + +[dev-dependencies] +chronicle-telemetry = { path = "../chronicle-telemetry" } +sp-core = { version = "25.0.0" } +sp-io = { version = "27.0.0" } +sp-runtime = { version = "28.0.0" } +uuid = { version = "1.5.0", default-features = true } + +[features] +default = ["std"] +runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"] +std = [ + "common/std", + "k256/std", + "parity-scale-codec/std", + "uuid/std", + "sp-std/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "frame-benchmarking/std", + "tracing/std", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/crates/pallet-opa/src/lib.rs b/crates/pallet-opa/src/lib.rs new file mode 100644 index 000000000..a8bbb78fb --- /dev/null +++ b/crates/pallet-opa/src/lib.rs @@ -0,0 +1,370 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +use core::convert::Infallible; + +/// Re-export types required for runtime +pub use common::prov::*; +use common::{ + k256::ecdsa::{Signature, VerifyingKey}, + opa::{ + codec::{NewPublicKeyV1, OpaSubmissionV1, PayloadV1, SignedOperationV1}, + key_address, policy_address, policy_meta_address, BootstrapRoot, KeyRegistration, Keys, + OpaSubmission, Operation, Payload, PolicyMeta, RegisterKey, RotateKey, SetPolicy, + SignedOperation, SignedOperationPayload, + }, +}; + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +//#[cfg(feature = "runtime-benchmarks")] +//mod benchmarking; +pub mod weights; + +pub mod chronicle_core { + pub use common::{ledger::*, prov::*}; +} +use parity_scale_codec::Encode; +use sp_core::blake2_128; +use tracing::{error, instrument}; +pub use weights::*; + +#[derive(Debug)] +enum OpaError { + OperationSignatureVerification, + MalformedMessage, + InvalidSigningKey, + InvalidOperation, +} + +impl From for OpaError { + fn from(_: Infallible) -> Self { + unreachable!() + } +} + +// Verifies the submission. +// Keys == None indicates that the opa tp is not bootstrapped, so the bootstrap +// operation can be performed, otherwise this will be an error +// If the system has been bootstrapped, then the current key must match the signing +// key of the operation +#[instrument(skip(submission, root_keys), ret(Debug))] +fn verify_signed_operation( + submission: &OpaSubmissionV1, + root_keys: &Option, +) -> Result<(), OpaError> { + use k256::ecdsa::signature::Verifier; + match &submission.payload { + PayloadV1::BootstrapRoot(_) => Ok(()), + PayloadV1::SignedOperation(SignedOperationV1 { payload, verifying_key, signature }) => { + if root_keys.is_none() { + error!("No registered root keys for signature verification"); + return Err(OpaError::OperationSignatureVerification); + } + let payload_bytes = payload.encode(); + let signature: Signature = k256::ecdsa::signature::Signature::from_bytes(signature) + .map_err(|e| { + error!(signature = ?signature, signature_load_error = ?e); + OpaError::OperationSignatureVerification + })?; + let signing_key = ::from_public_key_pem( + verifying_key.as_str(), + ) + .map_err(|e| { + error!(verifying_key = ?verifying_key, key_load_error = ?e); + OpaError::OperationSignatureVerification + })?; + if let Err(e) = signing_key.verify(&payload_bytes, &signature) { + error!(signature = ?signature, verify_error = ?e); + return Err(OpaError::OperationSignatureVerification); + } + + if *verifying_key == root_keys.as_ref().unwrap().current.key { + Ok(()) + } else { + error!(verifying_key = ?verifying_key, current_key = ?root_keys.as_ref().unwrap().current.key, "Invalid signing key"); + Err(OpaError::InvalidSigningKey) + } + }, + } +} + +// Either apply our bootstrap operation or our signed operation +#[instrument(skip(payload), ret(Debug))] +fn apply_signed_operation(payload: Payload) -> Result<(), OpaError> { + use scale_info::prelude::string::ToString; + match payload { + Payload::BootstrapRoot(BootstrapRoot { public_key }) => { + let existing_key = pallet::KeyStore::::try_get(key_address("root")); + + if existing_key.is_ok() { + error!("OPA TP has already been bootstrapped"); + return Err(OpaError::InvalidOperation); + } + + let keys = Keys { + id: "root".to_string(), + current: KeyRegistration { key: public_key, version: 0 }, + expired: None, + }; + + pallet::KeyStore::::set(key_address("root"), Some(keys.clone().into())); + + pallet::Pallet::::deposit_event(pallet::Event::::KeyUpdate(keys.into())); + + Ok(()) + }, + Payload::SignedOperation(SignedOperation { + payload: SignedOperationPayload { operation }, + verifying_key: _, + signature: _, + }) => apply_signed_operation_payload::(operation), + _ => { + error!(malformed_message = ?payload); + Err(OpaError::MalformedMessage) + }, + } +} + +#[instrument(skip(payload), ret(Debug))] +fn apply_signed_operation_payload(payload: Operation) -> Result<(), OpaError> { + match payload { + Operation::RegisterKey(RegisterKey { public_key, id, overwrite_existing }) => { + if id == "root" { + error!("Cannot register a key with the id 'root'"); + return Err(OpaError::InvalidOperation); + } + + let existing_key = pallet::KeyStore::::try_get(key_address(&id)); + + if existing_key.is_ok() { + if overwrite_existing { + tracing::debug!("Registration replaces existing key"); + } else { + error!("Key already registered"); + return Err(OpaError::InvalidOperation); + } + } + + let keys = Keys { + id, + current: KeyRegistration { key: public_key, version: 0 }, + expired: None, + }; + + pallet::KeyStore::::set(key_address(&keys.id), Some(keys.clone().into())); + + pallet::Pallet::::deposit_event(pallet::Event::::KeyUpdate(keys.try_into()?)); + + Ok(()) + }, + Operation::RotateKey(RotateKey { + payload, + previous_signing_key, + previous_signature, + new_signing_key, + new_signature, + }) => { + // Get current key registration from state + let existing_key = pallet::KeyStore::::try_get(key_address(&payload.id)); + + if existing_key.is_err() { + error!("No key to rotate"); + return Err(OpaError::InvalidOperation); + } + + let existing_key = existing_key.unwrap(); + + if previous_signing_key != existing_key.current.key { + error!("Key does not match current key"); + return Err(OpaError::InvalidOperation); + } + + let payload_id = payload.id.clone(); + let payload_bytes: NewPublicKeyV1 = payload.into(); + // Verify the previous key and signature + let payload_bytes = payload_bytes.encode(); + let previous_signature = Signature::try_from(&*previous_signature) + .map_err(|_| OpaError::OperationSignatureVerification)?; + let previous_key = ::from_public_key_pem( + previous_signing_key.as_str(), + ) + .map_err(|_| OpaError::OperationSignatureVerification)?; + + k256::ecdsa::signature::Verifier::verify( + &previous_key, + &payload_bytes, + &previous_signature, + ) + .map_err(|_| OpaError::OperationSignatureVerification)?; + + //Verify the new key and signature + let new_signature = Signature::try_from(&*new_signature) + .map_err(|_| OpaError::OperationSignatureVerification)?; + let new_key = ::from_public_key_pem( + new_signing_key.as_str(), + ) + .map_err(|_| OpaError::OperationSignatureVerification)?; + + k256::ecdsa::signature::Verifier::verify(&new_key, &payload_bytes, &new_signature) + .map_err(|_| OpaError::OperationSignatureVerification)?; + + //Store new keys + let keys = Keys { + id: payload_id, + current: KeyRegistration { + key: new_signing_key, + version: existing_key.current.version + 1, + }, + expired: Some(KeyRegistration { + key: previous_signing_key, + version: existing_key.current.version, + }), + }; + + pallet::KeyStore::::set(key_address(&keys.id), Some(keys.clone().into())); + + pallet::Pallet::::deposit_event(pallet::Event::::KeyUpdate(keys.into())); + + Ok(()) + }, + Operation::SetPolicy(SetPolicy { policy, id }) => { + let hash = blake2_128(policy.as_bytes()); + + let meta = PolicyMeta { + id: id.clone(), + hash: hash.into(), + policy_address: policy_address(&*id), + }; + + pallet::PolicyMetaStore::::set(policy_meta_address(&*id), Some(meta.clone().into())); + + pallet::PolicyStore::::set(policy_address(&*id), Some(policy.into())); + + pallet::Pallet::::deposit_event(pallet::Event::::PolicyUpdate(meta.into())); + + Ok(()) + }, + } +} + +fn root_keys_from_state() -> Result, OpaError> { + let existing_key = pallet::KeyStore::::try_get(key_address("root")); + + if let Ok(existing_key) = existing_key { + Ok(Some(existing_key.try_into()?)) + } else { + Ok(None) + } +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + pub struct Pallet(_); + + /// Configure the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + /// Type representing the weight of this pallet + type WeightInfo: WeightInfo; + + type OpaSubmission: Parameter + + Into + + parity_scale_codec::Codec; + } + // The pallet's runtime storage items. + // https://docs.substrate.io/main-docs/build/runtime-storage/ + #[pallet::storage] + #[pallet::getter(fn policy)] + // Learn more about declaring storage items: + // https://docs.substrate.io/main-docs/build/runtime-storage/#declaring-storage-items + pub type PolicyStore = + StorageMap<_, Twox128, common::opa::PolicyAddress, common::opa::codec::PolicyV1>; + #[pallet::storage] + #[pallet::getter(fn policy_meta)] + pub type PolicyMetaStore = + StorageMap<_, Twox128, common::opa::PolicyMetaAddress, common::opa::codec::PolicyMetaV1>; + #[pallet::storage] + #[pallet::getter(fn key)] + pub type KeyStore = + StorageMap<_, Twox128, common::opa::KeyAddress, common::opa::codec::KeysV1>; + + // Pallets use events to inform users when important changes are made. + // https://docs.substrate.io/main-docs/build/events-errors/ + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + PolicyUpdate(common::opa::codec::PolicyMetaV1), + KeyUpdate(common::opa::codec::KeysV1), + } + + // Errors inform users that something went wrong. + #[pallet::error] + pub enum Error { + OperationSignatureVerification, + MalformedMessage, + InvalidSigningKey, + JsonSerialize, + InvalidOperation, + } + + impl From for Error { + fn from(error: OpaError) -> Self { + match error { + OpaError::OperationSignatureVerification => Error::OperationSignatureVerification, + OpaError::MalformedMessage => Error::MalformedMessage, + OpaError::InvalidSigningKey => Error::InvalidSigningKey, + OpaError::JsonSerialize => Error::JsonSerialize, + OpaError::InvalidOperation => Error::InvalidOperation, + } + } + } + + // Dispatchable functions allows users to interact with the pallet and invoke state changes. + // These functions materialize as "extrinsics", which are often compared to transactions. + // Dispatchable functions must be annotated with a weight and must return a DispatchResult. + #[pallet::call] + impl Pallet { + // Apply a vector of chronicle operations, yielding an event that indicates state change or + // contradiction + #[pallet::call_index(0)] + #[pallet::weight(T::WeightInfo::apply())] + pub fn apply(origin: OriginFor, submission: T::OpaSubmission) -> DispatchResult { + // Check that the extrinsic was signed and get the signer. + // This function will return an error if the extrinsic is not signed. + // https://docs.substrate.io/main-docs/build/origins/ + let _who = ensure_signed(origin)?; + + // We need to validate the submission's own internal signatures at the codec level + let submission: OpaSubmissionV1 = submission.into(); + + super::verify_signed_operation::( + &submission, + &super::root_keys_from_state::().map_err(Error::::from)?, + ) + .map_err(Error::::from)?; + + let submission: OpaSubmission = submission.into(); + + super::apply_signed_operation::(submission.payload).map_err(Error::::from)?; + + // Return a successful DispatchResultWithPostInfo + Ok(()) + } + } +} diff --git a/crates/pallet-opa/src/main.rs b/crates/pallet-opa/src/main.rs new file mode 100644 index 000000000..a30eb952c --- /dev/null +++ b/crates/pallet-opa/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/crates/pallet-opa/src/mock.rs b/crates/pallet-opa/src/mock.rs new file mode 100644 index 000000000..ccaf1614d --- /dev/null +++ b/crates/pallet-opa/src/mock.rs @@ -0,0 +1,59 @@ +use crate as pallet_template; +use common::{ + ledger::OperationSubmission, + opa::{codec::OpaSubmissionV1, OpaSubmission}, +}; +use frame_support::traits::{ConstU16, ConstU64}; +use sp_core::H256; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, +}; + +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + ChronicleModule: pallet_template, + } +); + +impl frame_system::Config for Test { + type BaseCallFilter = frame_support::traits::Everything; + type BlockWeights = (); + type BlockLength = (); + type DbWeight = (); + type RuntimeOrigin = RuntimeOrigin; + type RuntimeCall = RuntimeCall; + type Nonce = u64; + type Hash = H256; + type Hashing = BlakeTwo256; + type AccountId = u64; + type Lookup = IdentityLookup; + type Block = Block; + type RuntimeEvent = RuntimeEvent; + type BlockHashCount = ConstU64<250>; + type Version = (); + type PalletInfo = PalletInfo; + type AccountData = (); + type OnNewAccount = (); + type OnKilledAccount = (); + type SystemWeightInfo = (); + type SS58Prefix = ConstU16<42>; + type OnSetCode = (); + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl pallet_template::Config for Test { + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); + type OpaSubmission = OpaSubmissionV1; +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + frame_system::GenesisConfig::::default().build_storage().unwrap().into() +} diff --git a/crates/pallet-opa/src/tests.rs b/crates/pallet-opa/src/tests.rs new file mode 100644 index 000000000..e255d1b7d --- /dev/null +++ b/crates/pallet-opa/src/tests.rs @@ -0,0 +1,10 @@ +use crate::{mock::*, Event}; +use common::{ + ledger::OperationSubmission, + prov::{ + operations::{ChronicleOperation, CreateNamespace}, + NamespaceId, + }, +}; +use frame_support::assert_ok; +use uuid::Uuid; diff --git a/crates/pallet-opa/src/weights.rs b/crates/pallet-opa/src/weights.rs new file mode 100644 index 000000000..c2b102ef7 --- /dev/null +++ b/crates/pallet-opa/src/weights.rs @@ -0,0 +1,66 @@ +//! Autogenerated weights for pallet_template +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-04-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Alexs-MacBook-Pro-2.local`, CPU: `` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024 + +// Executed Command: +// ../../target/release/node-template +// benchmark +// pallet +// --chain +// dev +// --pallet +// pallet_template +// --extrinsic +// * +// --steps=50 +// --repeat=20 +// --wasm-execution=compiled +// --output +// pallets/template/src/weights.rs +// --template +// ../../.maintain/frame-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for pallet_template. +pub trait WeightInfo { + fn apply() -> Weight; +} + +/// Weights for pallet_template using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: TemplateModule Something (r:0 w:1) + /// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn apply() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: TemplateModule Something (r:0 w:1) + /// Proof: TemplateModule Something (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) + fn apply() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 8_000_000 picoseconds. + Weight::from_parts(9_000_000, 0) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } +} diff --git a/crates/pallet-opa/tree.txt b/crates/pallet-opa/tree.txt new file mode 100644 index 000000000..c4b35efba --- /dev/null +++ b/crates/pallet-opa/tree.txt @@ -0,0 +1,1257 @@ +pallet-chronicle v0.7.5 (/Users/ryan/code/chronicle/crates/pallet-chronicle) +├── common v0.7.5 (/Users/ryan/code/chronicle/crates/common) +│ ├── anyhow v1.0.75 +│ ├── async-trait v0.1.74 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 +│ │ │ └── unicode-ident v1.0.12 +│ │ ├── quote v1.0.33 +│ │ │ └── proc-macro2 v1.0.69 (*) +│ │ └── syn v2.0.38 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── unicode-ident v1.0.12 +│ ├── chrono v0.4.31 +│ │ ├── js-sys v0.3.64 +│ │ │ └── wasm-bindgen v0.2.87 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ └── wasm-bindgen-macro v0.2.87 (proc-macro) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── wasm-bindgen-macro-support v0.2.87 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ ├── syn v2.0.38 (*) +│ │ │ ├── wasm-bindgen-backend v0.2.87 +│ │ │ │ ├── bumpalo v3.14.0 +│ │ │ │ ├── log v0.4.20 +│ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ ├── syn v2.0.38 (*) +│ │ │ │ └── wasm-bindgen-shared v0.2.87 +│ │ │ └── wasm-bindgen-shared v0.2.87 +│ │ ├── num-traits v0.2.17 +│ │ │ [build-dependencies] +│ │ │ └── autocfg v1.1.0 +│ │ ├── serde v1.0.190 +│ │ │ └── serde_derive v1.0.190 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ └── wasm-bindgen v0.2.87 (*) +│ ├── futures v0.3.29 +│ │ ├── futures-channel v0.3.29 +│ │ │ ├── futures-core v0.3.29 +│ │ │ └── futures-sink v0.3.29 +│ │ ├── futures-core v0.3.29 +│ │ ├── futures-executor v0.3.29 +│ │ │ ├── futures-core v0.3.29 +│ │ │ ├── futures-task v0.3.29 +│ │ │ ├── futures-util v0.3.29 +│ │ │ │ ├── futures-channel v0.3.29 (*) +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ ├── futures-io v0.3.29 +│ │ │ │ ├── futures-macro v0.3.29 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── futures-sink v0.3.29 +│ │ │ │ ├── futures-task v0.3.29 +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ ├── pin-utils v0.1.0 +│ │ │ │ └── slab v0.4.9 +│ │ │ │ [build-dependencies] +│ │ │ │ └── autocfg v1.1.0 +│ │ │ └── num_cpus v1.16.0 +│ │ │ └── libc v0.2.149 +│ │ ├── futures-io v0.3.29 +│ │ ├── futures-sink v0.3.29 +│ │ ├── futures-task v0.3.29 +│ │ └── futures-util v0.3.29 (*) +│ ├── glob v0.3.1 +│ ├── hex v0.4.3 +│ ├── iref v2.2.3 +│ │ ├── pct-str v1.2.0 +│ │ │ └── utf8-decode v1.0.1 +│ │ └── smallvec v1.11.1 +│ ├── iref-enum v2.1.0 (proc-macro) +│ │ ├── iref v2.2.3 +│ │ │ ├── pct-str v1.2.0 +│ │ │ │ └── utf8-decode v1.0.1 +│ │ │ └── smallvec v1.11.1 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── unicode-ident v1.0.12 +│ ├── k256 v0.11.6 +│ │ ├── cfg-if v1.0.0 +│ │ ├── ecdsa v0.14.8 +│ │ │ ├── der v0.6.1 +│ │ │ │ └── const-oid v0.9.5 +│ │ │ ├── elliptic-curve v0.12.3 +│ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ ├── crypto-bigint v0.4.9 +│ │ │ │ │ ├── generic-array v0.14.7 +│ │ │ │ │ │ ├── typenum v1.17.0 +│ │ │ │ │ │ └── zeroize v1.6.0 +│ │ │ │ │ │ └── zeroize_derive v1.4.2 (proc-macro) +│ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ └── getrandom v0.2.10 +│ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ ├── digest v0.10.7 +│ │ │ │ │ ├── block-buffer v0.10.4 +│ │ │ │ │ │ └── generic-array v0.14.7 (*) +│ │ │ │ │ ├── const-oid v0.9.5 +│ │ │ │ │ ├── crypto-common v0.1.6 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── ff v0.12.1 +│ │ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ ├── group v0.12.1 +│ │ │ │ │ ├── ff v0.12.1 (*) +│ │ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── pkcs8 v0.9.0 +│ │ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ │ └── spki v0.6.0 +│ │ │ │ │ └── der v0.6.1 (*) +│ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ ├── sec1 v0.3.0 +│ │ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── subtle v2.4.1 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── rfc6979 v0.3.1 +│ │ │ │ ├── crypto-bigint v0.4.9 (*) +│ │ │ │ ├── hmac v0.12.1 +│ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ └── signature v1.6.4 +│ │ │ ├── digest v0.10.7 (*) +│ │ │ └── rand_core v0.6.4 (*) +│ │ ├── elliptic-curve v0.12.3 (*) +│ │ └── sha2 v0.10.8 +│ │ ├── cfg-if v1.0.0 +│ │ └── digest v0.10.7 (*) +│ ├── lazy_static v1.4.0 +│ ├── locspan v0.7.16 +│ ├── macro-attr-2018 v3.0.0 +│ ├── mime v0.3.17 +│ ├── newtype-derive-2018 v0.2.1 +│ │ └── generics v0.5.1 +│ ├── parity-scale-codec v3.6.5 +│ │ ├── arrayvec v0.7.4 +│ │ ├── byte-slice-cast v1.2.2 +│ │ ├── bytes v1.5.0 +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── parity-scale-codec-derive v3.6.5 (proc-macro) +│ │ │ ├── proc-macro-crate v1.1.3 +│ │ │ │ ├── thiserror v1.0.50 +│ │ │ │ │ └── thiserror-impl v1.0.50 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ └── toml v0.5.11 +│ │ │ │ └── serde v1.0.190 +│ │ │ │ └── serde_derive v1.0.190 (proc-macro) (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ └── serde v1.0.190 (*) +│ ├── percent-encoding v2.3.0 +│ ├── scale-info v2.10.0 +│ │ ├── cfg-if v1.0.0 +│ │ ├── derive_more v0.99.17 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info-derive v2.10.0 (proc-macro) +│ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ └── serde v1.0.190 (*) +│ ├── serde v1.0.190 (*) +│ ├── serde_derive v1.0.190 (proc-macro) (*) +│ ├── serde_json v1.0.108 +│ │ ├── itoa v1.0.9 +│ │ ├── ryu v1.0.15 +│ │ └── serde v1.0.190 (*) +│ ├── static-iref v2.0.0 (proc-macro) +│ │ └── iref v2.2.3 (*) +│ ├── thiserror v1.0.50 +│ │ └── thiserror-impl v1.0.50 (proc-macro) (*) +│ ├── thiserror-no-std v2.0.2 +│ │ └── thiserror-impl-no-std v2.0.2 (proc-macro) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ ├── tracing v0.1.40 +│ │ ├── pin-project-lite v0.2.13 +│ │ ├── tracing-attributes v0.1.27 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ └── tracing-core v0.1.32 +│ │ └── once_cell v1.18.0 +│ ├── url v2.4.1 +│ │ ├── form_urlencoded v1.2.0 +│ │ │ └── percent-encoding v2.3.0 +│ │ ├── idna v0.4.0 +│ │ │ ├── unicode-bidi v0.3.13 +│ │ │ └── unicode-normalization v0.1.22 +│ │ │ └── tinyvec v1.6.0 +│ │ │ └── tinyvec_macros v0.1.1 +│ │ ├── percent-encoding v2.3.0 +│ │ └── serde v1.0.190 (*) +│ └── uuid v1.5.0 +│ └── serde v1.0.190 (*) +│ [build-dependencies] +│ ├── glob v0.3.1 +│ ├── lazy_static v1.4.0 +│ └── serde_json v1.0.108 +│ ├── itoa v1.0.9 +│ ├── ryu v1.0.15 +│ └── serde v1.0.190 (*) +├── frame-support v24.0.0 +│ ├── aquamarine v0.3.2 (proc-macro) +│ │ ├── include_dir v0.7.3 +│ │ │ └── include_dir_macros v0.7.3 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ └── quote v1.0.33 (*) +│ │ ├── itertools v0.10.5 +│ │ │ └── either v1.9.0 +│ │ ├── proc-macro-error v1.0.4 +│ │ │ ├── proc-macro-error-attr v1.0.4 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ └── quote v1.0.33 (*) +│ │ │ │ [build-dependencies] +│ │ │ │ └── version_check v0.9.4 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ │ [build-dependencies] +│ │ │ └── version_check v0.9.4 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v1.0.109 (*) +│ ├── bitflags v1.3.2 +│ ├── docify v0.2.6 +│ │ └── docify_macros v0.2.6 (proc-macro) +│ │ ├── common-path v1.0.0 +│ │ ├── derive-syn-parse v0.1.5 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── once_cell v1.18.0 +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ ├── regex v1.10.2 +│ │ │ ├── aho-corasick v1.1.2 +│ │ │ │ └── memchr v2.6.4 +│ │ │ ├── memchr v2.6.4 +│ │ │ ├── regex-automata v0.4.3 +│ │ │ │ ├── aho-corasick v1.1.2 (*) +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ └── regex-syntax v0.8.2 +│ │ │ └── regex-syntax v0.8.2 +│ │ ├── syn v2.0.38 (*) +│ │ ├── termcolor v1.3.0 +│ │ ├── toml v0.7.8 +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── serde_spanned v0.6.4 +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ ├── toml_datetime v0.6.5 +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ └── toml_edit v0.19.15 +│ │ │ ├── indexmap v2.0.2 +│ │ │ │ ├── equivalent v1.0.1 +│ │ │ │ └── hashbrown v0.14.2 +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── serde_spanned v0.6.4 (*) +│ │ │ ├── toml_datetime v0.6.5 (*) +│ │ │ └── winnow v0.5.17 +│ │ └── walkdir v2.4.0 +│ │ └── same-file v1.0.6 +│ ├── environmental v1.1.4 +│ ├── frame-metadata v16.0.0 +│ │ ├── cfg-if v1.0.0 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ └── scale-info v2.10.0 (*) +│ ├── frame-support-procedural v19.0.0 (proc-macro) +│ │ ├── Inflector v0.11.4 +│ │ │ ├── lazy_static v1.4.0 +│ │ │ └── regex v1.10.2 (*) +│ │ ├── cfg-expr v0.15.5 +│ │ │ └── smallvec v1.11.1 +│ │ ├── derive-syn-parse v0.1.5 (proc-macro) (*) +│ │ ├── expander v2.0.0 +│ │ │ ├── blake2 v0.10.6 +│ │ │ │ └── digest v0.10.7 +│ │ │ │ ├── block-buffer v0.10.4 +│ │ │ │ │ └── generic-array v0.14.7 +│ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ ├── crypto-common v0.1.6 +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ └── subtle v2.4.1 +│ │ │ ├── fs-err v2.9.0 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── frame-support-procedural-tools v8.0.0 +│ │ │ ├── frame-support-procedural-tools-derive v9.0.0 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── itertools v0.10.5 (*) +│ │ ├── macro_magic v0.4.2 +│ │ │ ├── macro_magic_core v0.4.2 +│ │ │ │ ├── const-random v0.1.16 +│ │ │ │ │ └── const-random-macro v0.1.16 (proc-macro) +│ │ │ │ │ ├── getrandom v0.2.10 +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ └── libc v0.2.149 +│ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ └── tiny-keccak v2.0.2 +│ │ │ │ │ └── crunchy v0.2.2 +│ │ │ │ ├── derive-syn-parse v0.1.5 (proc-macro) (*) +│ │ │ │ ├── macro_magic_core_macros v0.4.3 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── macro_magic_macros v0.4.2 (proc-macro) +│ │ │ │ ├── macro_magic_core v0.4.2 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── proc-macro-warning v0.4.2 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v2.0.38 (*) +│ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ ├── k256 v0.13.1 +│ │ ├── cfg-if v1.0.0 +│ │ ├── ecdsa v0.16.8 +│ │ │ ├── der v0.7.8 +│ │ │ │ ├── const-oid v0.9.5 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── digest v0.10.7 (*) +│ │ │ ├── elliptic-curve v0.13.6 +│ │ │ │ ├── base16ct v0.2.0 +│ │ │ │ ├── crypto-bigint v0.5.3 +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ ├── ff v0.13.0 +│ │ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ ├── group v0.13.0 +│ │ │ │ │ ├── ff v0.13.0 (*) +│ │ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ ├── sec1 v0.7.3 +│ │ │ │ │ ├── base16ct v0.2.0 +│ │ │ │ │ ├── der v0.7.8 (*) +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── subtle v2.4.1 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── rfc6979 v0.4.0 +│ │ │ │ ├── hmac v0.12.1 (*) +│ │ │ │ └── subtle v2.4.1 +│ │ │ └── signature v2.1.0 +│ │ │ ├── digest v0.10.7 (*) +│ │ │ └── rand_core v0.6.4 (*) +│ │ ├── elliptic-curve v0.13.6 (*) +│ │ └── sha2 v0.10.8 (*) +│ ├── log v0.4.20 +│ ├── macro_magic v0.4.2 +│ │ └── macro_magic_macros v0.4.2 (proc-macro) (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── paste v1.0.14 (proc-macro) +│ ├── scale-info v2.10.0 (*) +│ ├── serde v1.0.190 (*) +│ ├── serde_json v1.0.108 (*) +│ ├── smallvec v1.11.1 +│ ├── sp-api v22.0.0 +│ │ ├── log v0.4.20 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-api-proc-macro v11.0.0 (proc-macro) +│ │ │ ├── Inflector v0.11.4 (*) +│ │ │ ├── blake2 v0.10.6 (*) +│ │ │ ├── expander v2.0.0 (*) +│ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── sp-core v24.0.0 +│ │ │ ├── array-bytes v6.1.0 +│ │ │ ├── bitflags v1.3.2 +│ │ │ ├── blake2 v0.10.6 +│ │ │ │ └── digest v0.10.7 (*) +│ │ │ ├── bounded-collections v0.1.9 +│ │ │ │ ├── log v0.4.20 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ ├── bs58 v0.5.0 +│ │ │ ├── dyn-clonable v0.9.0 +│ │ │ │ ├── dyn-clonable-impl v0.9.0 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v1.0.109 (*) +│ │ │ │ └── dyn-clone v1.0.14 +│ │ │ ├── ed25519-zebra v3.1.0 +│ │ │ │ ├── curve25519-dalek v3.2.0 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── digest v0.9.0 +│ │ │ │ │ │ └── generic-array v0.14.7 (*) +│ │ │ │ │ ├── rand_core v0.5.1 +│ │ │ │ │ │ └── getrandom v0.1.16 +│ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── hashbrown v0.12.3 +│ │ │ │ │ └── ahash v0.7.7 +│ │ │ │ │ └── once_cell v1.18.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ ├── hex v0.4.3 +│ │ │ │ ├── rand_core v0.6.4 (*) +│ │ │ │ ├── sha2 v0.9.9 +│ │ │ │ │ ├── block-buffer v0.9.0 +│ │ │ │ │ │ └── generic-array v0.14.7 (*) +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ ├── digest v0.9.0 (*) +│ │ │ │ │ └── opaque-debug v0.3.0 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── futures v0.3.29 (*) +│ │ │ ├── hash-db v0.16.0 +│ │ │ ├── hash256-std-hasher v0.15.2 +│ │ │ │ └── crunchy v0.2.2 +│ │ │ ├── impl-serde v0.4.0 +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ ├── lazy_static v1.4.0 +│ │ │ ├── libsecp256k1 v0.7.1 +│ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ ├── base64 v0.13.1 +│ │ │ │ ├── digest v0.9.0 (*) +│ │ │ │ ├── hmac-drbg v0.3.0 +│ │ │ │ │ ├── digest v0.9.0 (*) +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ └── hmac v0.8.1 +│ │ │ │ │ ├── crypto-mac v0.8.0 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ └── digest v0.9.0 (*) +│ │ │ │ ├── libsecp256k1-core v0.3.0 +│ │ │ │ │ ├── crunchy v0.2.2 +│ │ │ │ │ ├── digest v0.9.0 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── rand v0.8.5 +│ │ │ │ │ ├── rand_chacha v0.3.1 +│ │ │ │ │ │ ├── ppv-lite86 v0.2.17 +│ │ │ │ │ │ └── rand_core v0.6.4 (*) +│ │ │ │ │ └── rand_core v0.6.4 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sha2 v0.9.9 (*) +│ │ │ │ └── typenum v1.17.0 +│ │ │ │ [build-dependencies] +│ │ │ │ ├── libsecp256k1-gen-ecmult v0.3.0 +│ │ │ │ │ └── libsecp256k1-core v0.3.0 +│ │ │ │ │ ├── crunchy v0.2.2 +│ │ │ │ │ ├── digest v0.9.0 +│ │ │ │ │ │ └── generic-array v0.14.7 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ └── libsecp256k1-gen-genmult v0.3.0 +│ │ │ │ └── libsecp256k1-core v0.3.0 (*) +│ │ │ ├── log v0.4.20 +│ │ │ ├── merlin v2.0.1 +│ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ ├── keccak v0.1.4 +│ │ │ │ ├── rand_core v0.5.1 (*) +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── parking_lot v0.12.1 +│ │ │ │ ├── lock_api v0.4.11 +│ │ │ │ │ └── scopeguard v1.2.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── autocfg v1.1.0 +│ │ │ │ └── parking_lot_core v0.9.9 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ └── smallvec v1.11.1 +│ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ ├── primitive-types v0.12.2 +│ │ │ │ ├── fixed-hash v0.8.0 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ │ ├── rustc-hex v2.1.0 +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ ├── impl-codec v0.6.0 +│ │ │ │ │ └── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── impl-serde v0.4.0 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ └── uint v0.9.5 +│ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ ├── crunchy v0.2.2 +│ │ │ │ ├── hex v0.4.3 +│ │ │ │ └── static_assertions v1.1.0 +│ │ │ ├── rand v0.8.5 (*) +│ │ │ ├── regex v1.10.2 +│ │ │ │ ├── aho-corasick v1.1.2 +│ │ │ │ │ └── memchr v2.6.4 +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ ├── regex-automata v0.4.3 +│ │ │ │ │ ├── aho-corasick v1.1.2 (*) +│ │ │ │ │ ├── memchr v2.6.4 +│ │ │ │ │ └── regex-syntax v0.8.2 +│ │ │ │ └── regex-syntax v0.8.2 +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── schnorrkel v0.9.1 +│ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ ├── arrayvec v0.5.2 +│ │ │ │ ├── curve25519-dalek v2.1.3 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── digest v0.8.1 +│ │ │ │ │ │ └── generic-array v0.12.4 +│ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ ├── rand_core v0.5.1 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── getrandom v0.1.16 (*) +│ │ │ │ ├── merlin v2.0.1 (*) +│ │ │ │ ├── rand v0.7.3 +│ │ │ │ │ ├── getrandom v0.1.16 (*) +│ │ │ │ │ ├── rand_chacha v0.2.2 +│ │ │ │ │ │ ├── ppv-lite86 v0.2.17 +│ │ │ │ │ │ └── rand_core v0.5.1 (*) +│ │ │ │ │ └── rand_core v0.5.1 (*) +│ │ │ │ ├── rand_core v0.5.1 (*) +│ │ │ │ ├── sha2 v0.8.2 +│ │ │ │ │ ├── block-buffer v0.7.3 +│ │ │ │ │ │ ├── block-padding v0.1.5 +│ │ │ │ │ │ │ └── byte-tools v0.3.1 +│ │ │ │ │ │ ├── byte-tools v0.3.1 +│ │ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ │ └── generic-array v0.12.4 (*) +│ │ │ │ │ ├── digest v0.8.1 (*) +│ │ │ │ │ ├── fake-simd v0.1.2 +│ │ │ │ │ └── opaque-debug v0.2.3 +│ │ │ │ ├── subtle v2.4.1 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── secp256k1 v0.24.3 +│ │ │ │ └── secp256k1-sys v0.6.1 +│ │ │ │ [build-dependencies] +│ │ │ │ └── cc v1.0.83 +│ │ │ │ └── libc v0.2.149 +│ │ │ ├── secrecy v0.8.0 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── sp-core-hashing v12.0.0 +│ │ │ │ ├── blake2b_simd v1.0.2 +│ │ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ │ └── constant_time_eq v0.3.0 +│ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ ├── sha2 v0.10.8 (*) +│ │ │ │ ├── sha3 v0.10.8 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ └── keccak v0.1.4 +│ │ │ │ └── twox-hash v1.6.3 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ └── static_assertions v1.1.0 +│ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── sp-externalities v0.22.0 +│ │ │ │ ├── environmental v1.1.4 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ └── sp-storage v16.0.0 +│ │ │ │ ├── impl-serde v0.4.0 (*) +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── ref-cast v1.0.20 +│ │ │ │ │ └── ref-cast-impl v1.0.20 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ │ │ │ └── sp-std v11.0.0 +│ │ │ ├── sp-runtime-interface v20.0.0 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── primitive-types v0.12.2 (*) +│ │ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ │ ├── sp-runtime-interface-proc-macro v14.0.0 (proc-macro) +│ │ │ │ │ ├── Inflector v0.11.4 (*) +│ │ │ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ ├── sp-storage v16.0.0 (*) +│ │ │ │ ├── sp-tracing v13.0.0 +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ ├── tracing-core v0.1.32 (*) +│ │ │ │ │ └── tracing-subscriber v0.2.25 +│ │ │ │ │ ├── ansi_term v0.12.1 +│ │ │ │ │ ├── chrono v0.4.31 (*) +│ │ │ │ │ ├── lazy_static v1.4.0 +│ │ │ │ │ ├── matchers v0.0.1 +│ │ │ │ │ │ └── regex-automata v0.1.10 +│ │ │ │ │ │ └── regex-syntax v0.6.29 +│ │ │ │ │ ├── regex v1.10.2 (*) +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── serde_json v1.0.108 (*) +│ │ │ │ │ ├── sharded-slab v0.1.7 +│ │ │ │ │ │ └── lazy_static v1.4.0 +│ │ │ │ │ ├── smallvec v1.11.1 +│ │ │ │ │ ├── thread_local v1.1.7 +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ └── once_cell v1.18.0 +│ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ ├── tracing-core v0.1.32 (*) +│ │ │ │ │ ├── tracing-log v0.1.4 +│ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ │ └── tracing-core v0.1.32 (*) +│ │ │ │ │ └── tracing-serde v0.1.3 +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ └── tracing-core v0.1.32 (*) +│ │ │ │ ├── sp-wasm-interface v17.0.0 +│ │ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ └── wasmtime v8.0.1 +│ │ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ │ ├── bincode v1.3.3 +│ │ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ ├── indexmap v1.9.3 +│ │ │ │ │ │ ├── hashbrown v0.12.3 (*) +│ │ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── autocfg v1.1.0 +│ │ │ │ │ ├── libc v0.2.149 +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ ├── object v0.30.4 +│ │ │ │ │ │ ├── crc32fast v1.3.2 +│ │ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ │ ├── hashbrown v0.13.2 +│ │ │ │ │ │ │ └── ahash v0.8.6 +│ │ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ │ ├── getrandom v0.2.10 (*) +│ │ │ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ │ │ └── zerocopy v0.7.20 +│ │ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ └── memchr v2.6.4 +│ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ │ │ ├── psm v0.1.21 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── cc v1.0.83 (*) +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── target-lexicon v0.12.12 +│ │ │ │ │ ├── wasmparser v0.102.0 +│ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ └── url v2.4.1 (*) +│ │ │ │ │ ├── wasmtime-environ v8.0.1 +│ │ │ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ │ │ ├── cranelift-entity v0.95.1 +│ │ │ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ │ │ ├── gimli v0.27.3 +│ │ │ │ │ │ │ ├── fallible-iterator v0.2.0 +│ │ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ │ └── stable_deref_trait v1.2.0 +│ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ ├── object v0.30.4 (*) +│ │ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ │ ├── target-lexicon v0.12.12 +│ │ │ │ │ │ ├── thiserror v1.0.50 (*) +│ │ │ │ │ │ ├── wasmparser v0.102.0 (*) +│ │ │ │ │ │ └── wasmtime-types v8.0.1 +│ │ │ │ │ │ ├── cranelift-entity v0.95.1 (*) +│ │ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ │ ├── thiserror v1.0.50 (*) +│ │ │ │ │ │ └── wasmparser v0.102.0 (*) +│ │ │ │ │ ├── wasmtime-jit v8.0.1 +│ │ │ │ │ │ ├── addr2line v0.19.0 +│ │ │ │ │ │ │ └── gimli v0.27.3 (*) +│ │ │ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ │ │ ├── bincode v1.3.3 (*) +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ ├── cpp_demangle v0.3.5 +│ │ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ │ ├── gimli v0.27.3 (*) +│ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ ├── object v0.30.4 (*) +│ │ │ │ │ │ ├── rustc-demangle v0.1.23 +│ │ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ │ ├── target-lexicon v0.12.12 +│ │ │ │ │ │ ├── wasmtime-environ v8.0.1 (*) +│ │ │ │ │ │ ├── wasmtime-jit-icache-coherence v8.0.1 +│ │ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ │ └── wasmtime-runtime v8.0.1 +│ │ │ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ ├── libc v0.2.149 +│ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ ├── memfd v0.6.4 +│ │ │ │ │ │ │ └── rustix v0.38.21 +│ │ │ │ │ │ │ ├── bitflags v2.4.1 +│ │ │ │ │ │ │ ├── errno v0.3.5 +│ │ │ │ │ │ │ └── libc v0.2.149 +│ │ │ │ │ │ ├── memoffset v0.8.0 +│ │ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ │ └── autocfg v1.1.0 +│ │ │ │ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ │ │ ├── wasmtime-asm-macros v8.0.1 +│ │ │ │ │ │ │ └── cfg-if v1.0.0 +│ │ │ │ │ │ ├── wasmtime-environ v8.0.1 (*) +│ │ │ │ │ │ └── wasmtime-jit-debug v8.0.1 +│ │ │ │ │ │ └── once_cell v1.18.0 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── cc v1.0.83 (*) +│ │ │ │ │ └── wasmtime-runtime v8.0.1 (*) +│ │ │ │ └── static_assertions v1.1.0 +│ │ │ ├── sp-std v11.0.0 +│ │ │ ├── sp-storage v16.0.0 (*) +│ │ │ ├── ss58-registry v1.43.0 +│ │ │ │ └── num-format v0.4.4 +│ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ └── itoa v1.0.9 +│ │ │ │ [build-dependencies] +│ │ │ │ ├── Inflector v0.11.4 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── serde_json v1.0.108 (*) +│ │ │ │ └── unicode-xid v0.2.4 +│ │ │ ├── substrate-bip39 v0.4.5 +│ │ │ │ ├── hmac v0.11.0 +│ │ │ │ │ ├── crypto-mac v0.11.1 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ └── digest v0.9.0 (*) +│ │ │ │ ├── pbkdf2 v0.8.0 +│ │ │ │ │ └── crypto-mac v0.11.1 (*) +│ │ │ │ ├── schnorrkel v0.9.1 (*) +│ │ │ │ ├── sha2 v0.9.9 (*) +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── thiserror v1.0.50 (*) +│ │ │ ├── tiny-bip39 v1.0.0 +│ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ ├── hmac v0.12.1 (*) +│ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ ├── pbkdf2 v0.11.0 +│ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ ├── rustc-hash v1.1.0 +│ │ │ │ ├── sha2 v0.10.8 (*) +│ │ │ │ ├── thiserror v1.0.50 (*) +│ │ │ │ ├── unicode-normalization v0.1.22 (*) +│ │ │ │ ├── wasm-bindgen v0.2.87 (*) +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── tracing v0.1.40 (*) +│ │ │ └── zeroize v1.6.0 (*) +│ │ ├── sp-metadata-ir v0.3.0 +│ │ │ ├── frame-metadata v16.0.0 (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-runtime v27.0.0 +│ │ │ ├── either v1.9.0 +│ │ │ ├── hash256-std-hasher v0.15.2 (*) +│ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ ├── log v0.4.20 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ ├── rand v0.8.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── sp-application-crypto v26.0.0 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ ├── sp-io v26.0.0 +│ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ ├── ed25519-dalek v2.0.0 +│ │ │ │ │ │ ├── curve25519-dalek v4.1.1 +│ │ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ │ ├── platforms v3.1.2 +│ │ │ │ │ │ │ └── rustc_version v0.4.0 +│ │ │ │ │ │ │ └── semver v1.0.20 +│ │ │ │ │ │ ├── ed25519 v2.2.3 +│ │ │ │ │ │ │ └── signature v2.1.0 (*) +│ │ │ │ │ │ └── sha2 v0.10.8 (*) +│ │ │ │ │ ├── libsecp256k1 v0.7.1 (*) +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── secp256k1 v0.24.3 (*) +│ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ │ │ ├── sp-keystore v0.30.0 +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── parking_lot v0.12.1 (*) +│ │ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ │ │ │ └── thiserror v1.0.50 (*) +│ │ │ │ │ ├── sp-runtime-interface v20.0.0 (*) +│ │ │ │ │ ├── sp-state-machine v0.31.0 +│ │ │ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── parking_lot v0.12.1 (*) +│ │ │ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ │ │ ├── smallvec v1.11.1 +│ │ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ │ │ │ ├── sp-panic-handler v11.0.0 +│ │ │ │ │ │ │ ├── backtrace v0.3.69 +│ │ │ │ │ │ │ │ ├── addr2line v0.21.0 +│ │ │ │ │ │ │ │ │ └── gimli v0.28.0 +│ │ │ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ │ │ ├── libc v0.2.149 +│ │ │ │ │ │ │ │ ├── miniz_oxide v0.7.1 +│ │ │ │ │ │ │ │ │ └── adler v1.0.2 +│ │ │ │ │ │ │ │ ├── object v0.32.1 +│ │ │ │ │ │ │ │ │ └── memchr v2.6.4 +│ │ │ │ │ │ │ │ └── rustc-demangle v0.1.23 +│ │ │ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ │ │ └── cc v1.0.83 (*) +│ │ │ │ │ │ │ ├── lazy_static v1.4.0 +│ │ │ │ │ │ │ └── regex v1.10.2 (*) +│ │ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ │ ├── sp-trie v25.0.0 +│ │ │ │ │ │ │ ├── ahash v0.8.6 (*) +│ │ │ │ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ │ │ │ ├── hashbrown v0.13.2 (*) +│ │ │ │ │ │ │ ├── lazy_static v1.4.0 +│ │ │ │ │ │ │ ├── memory-db v0.32.0 +│ │ │ │ │ │ │ │ └── hash-db v0.16.0 +│ │ │ │ │ │ │ ├── nohash-hasher v0.2.0 +│ │ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ │ ├── parking_lot v0.12.1 (*) +│ │ │ │ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ │ │ │ ├── schnellru v0.2.1 +│ │ │ │ │ │ │ │ ├── ahash v0.8.6 (*) +│ │ │ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ │ │ └── hashbrown v0.13.2 (*) +│ │ │ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ │ │ ├── thiserror v1.0.50 (*) +│ │ │ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ │ │ ├── trie-db v0.28.0 +│ │ │ │ │ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ │ │ │ │ ├── hashbrown v0.13.2 (*) +│ │ │ │ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ │ │ │ ├── rustc-hex v2.1.0 +│ │ │ │ │ │ │ │ └── smallvec v1.11.1 +│ │ │ │ │ │ │ └── trie-root v0.18.0 +│ │ │ │ │ │ │ └── hash-db v0.16.0 +│ │ │ │ │ │ ├── thiserror v1.0.50 (*) +│ │ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ │ └── trie-db v0.28.0 (*) +│ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ ├── sp-tracing v13.0.0 (*) +│ │ │ │ │ ├── sp-trie v25.0.0 (*) +│ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ └── tracing-core v0.1.32 (*) +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── rustversion v1.0.14 (proc-macro) +│ │ │ │ └── sp-std v11.0.0 +│ │ │ ├── sp-arithmetic v19.0.0 +│ │ │ │ ├── integer-sqrt v0.1.5 +│ │ │ │ │ └── num-traits v0.2.17 (*) +│ │ │ │ ├── num-traits v0.2.17 (*) +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ └── static_assertions v1.1.0 +│ │ │ ├── sp-core v24.0.0 (*) +│ │ │ ├── sp-io v26.0.0 (*) +│ │ │ ├── sp-std v11.0.0 +│ │ │ └── sp-weights v23.0.0 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── smallvec v1.11.1 +│ │ │ ├── sp-arithmetic v19.0.0 (*) +│ │ │ ├── sp-core v24.0.0 (*) +│ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-std v11.0.0 +│ │ └── sp-version v25.0.0 +│ │ ├── impl-serde v0.4.0 (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── sp-core-hashing-proc-macro v12.0.0 (proc-macro) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ ├── sp-core-hashing v12.0.0 +│ │ │ │ ├── blake2b_simd v1.0.2 +│ │ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ │ └── constant_time_eq v0.3.0 +│ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ ├── sha2 v0.10.8 +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ ├── cpufeatures v0.2.11 +│ │ │ │ │ │ └── libc v0.2.149 +│ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ ├── sha3 v0.10.8 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ └── keccak v0.1.4 +│ │ │ │ │ └── cpufeatures v0.2.11 (*) +│ │ │ │ └── twox-hash v1.6.3 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ └── static_assertions v1.1.0 +│ │ │ └── syn v2.0.38 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-std v11.0.0 +│ │ └── sp-version-proc-macro v11.0.0 (proc-macro) +│ │ ├── parity-scale-codec v3.6.5 +│ │ │ ├── arrayvec v0.7.4 +│ │ │ ├── byte-slice-cast v1.2.2 +│ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ ├── parity-scale-codec-derive v3.6.5 (proc-macro) (*) +│ │ │ └── serde v1.0.190 (*) +│ │ ├── proc-macro2 v1.0.69 (*) +│ │ ├── quote v1.0.33 (*) +│ │ └── syn v2.0.38 (*) +│ ├── sp-arithmetic v19.0.0 (*) +│ ├── sp-core v24.0.0 (*) +│ ├── sp-core-hashing-proc-macro v12.0.0 (proc-macro) (*) +│ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ ├── sp-genesis-builder v0.3.0 +│ │ ├── serde_json v1.0.108 (*) +│ │ ├── sp-api v22.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── sp-inherents v22.0.0 +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── sp-io v26.0.0 (*) +│ ├── sp-metadata-ir v0.3.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ ├── sp-staking v22.0.0 +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-core v24.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── sp-std v11.0.0 +│ ├── sp-tracing v13.0.0 (*) +│ ├── sp-weights v23.0.0 (*) +│ ├── static_assertions v1.1.0 +│ └── tt-call v1.0.9 +├── frame-system v24.0.0 +│ ├── cfg-if v1.0.0 +│ ├── frame-support v24.0.0 (*) +│ ├── log v0.4.20 +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── serde v1.0.190 (*) +│ ├── sp-core v24.0.0 (*) +│ ├── sp-io v26.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ ├── sp-std v11.0.0 +│ ├── sp-version v25.0.0 (*) +│ └── sp-weights v23.0.0 (*) +├── macro-attr-2018 v3.0.0 +├── newtype-derive-2018 v0.2.1 (*) +├── parity-scale-codec v3.6.5 (*) +├── scale-info v2.10.0 (*) +├── sp-std v11.0.0 +├── tracing v0.1.40 (*) +└── uuid v1.5.0 (*) +[dev-dependencies] +├── chronicle-telemetry v0.7.5 (/Users/ryan/code/chronicle/crates/chronicle-telemetry) +│ ├── cfg-if v1.0.0 +│ ├── console-subscriber v0.1.10 +│ │ ├── console-api v0.5.0 +│ │ │ ├── prost v0.11.9 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ └── prost-derive v0.11.9 (proc-macro) +│ │ │ │ ├── anyhow v1.0.75 +│ │ │ │ ├── itertools v0.10.5 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v1.0.109 (*) +│ │ │ ├── prost-types v0.11.9 +│ │ │ │ └── prost v0.11.9 (*) +│ │ │ ├── tonic v0.9.2 +│ │ │ │ ├── async-trait v0.1.74 (proc-macro) (*) +│ │ │ │ ├── axum v0.6.20 +│ │ │ │ │ ├── async-trait v0.1.74 (proc-macro) (*) +│ │ │ │ │ ├── axum-core v0.3.4 +│ │ │ │ │ │ ├── async-trait v0.1.74 (proc-macro) (*) +│ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ │ │ ├── http v0.2.9 +│ │ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ │ ├── fnv v1.0.7 +│ │ │ │ │ │ │ └── itoa v1.0.9 +│ │ │ │ │ │ ├── http-body v0.4.5 +│ │ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ │ ├── http v0.2.9 (*) +│ │ │ │ │ │ │ └── pin-project-lite v0.2.13 +│ │ │ │ │ │ ├── mime v0.3.17 +│ │ │ │ │ │ ├── tower-layer v0.3.2 +│ │ │ │ │ │ └── tower-service v0.3.2 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── rustversion v1.0.14 (proc-macro) +│ │ │ │ │ ├── bitflags v1.3.2 +│ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ │ ├── http v0.2.9 (*) +│ │ │ │ │ ├── http-body v0.4.5 (*) +│ │ │ │ │ ├── hyper v0.14.27 +│ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ ├── futures-channel v0.3.29 (*) +│ │ │ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ │ │ ├── h2 v0.3.21 +│ │ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ │ ├── fnv v1.0.7 +│ │ │ │ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ │ │ │ ├── futures-sink v0.3.29 +│ │ │ │ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ │ │ │ ├── http v0.2.9 (*) +│ │ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ │ ├── slab v0.4.9 (*) +│ │ │ │ │ │ │ ├── tokio v1.33.0 +│ │ │ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ │ │ ├── mio v0.8.9 +│ │ │ │ │ │ │ │ ├── num_cpus v1.16.0 (*) +│ │ │ │ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ │ │ │ └── tokio-macros v2.1.0 (proc-macro) +│ │ │ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ │ ├── tokio-util v0.7.10 +│ │ │ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ │ │ │ │ ├── futures-sink v0.3.29 +│ │ │ │ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ │ │ │ │ └── tracing v0.1.40 (*) +│ │ │ │ │ │ │ └── tracing v0.1.40 (*) +│ │ │ │ │ │ ├── http v0.2.9 (*) +│ │ │ │ │ │ ├── http-body v0.4.5 (*) +│ │ │ │ │ │ ├── httparse v1.8.0 +│ │ │ │ │ │ ├── httpdate v1.0.3 +│ │ │ │ │ │ ├── itoa v1.0.9 +│ │ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ │ ├── socket2 v0.4.10 +│ │ │ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ │ │ ├── tower-service v0.3.2 +│ │ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ │ └── want v0.3.1 +│ │ │ │ │ │ └── try-lock v0.2.4 +│ │ │ │ │ ├── itoa v1.0.9 +│ │ │ │ │ ├── matchit v0.7.3 +│ │ │ │ │ ├── memchr v2.6.4 +│ │ │ │ │ ├── mime v0.3.17 +│ │ │ │ │ ├── percent-encoding v2.3.0 +│ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── sync_wrapper v0.1.2 +│ │ │ │ │ ├── tower v0.4.13 +│ │ │ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ │ │ ├── indexmap v1.9.3 (*) +│ │ │ │ │ │ ├── pin-project v1.1.3 +│ │ │ │ │ │ │ └── pin-project-internal v1.1.3 (proc-macro) +│ │ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ │ ├── rand v0.8.5 (*) +│ │ │ │ │ │ ├── slab v0.4.9 (*) +│ │ │ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ │ │ ├── tokio-util v0.7.10 (*) +│ │ │ │ │ │ ├── tower-layer v0.3.2 +│ │ │ │ │ │ ├── tower-service v0.3.2 +│ │ │ │ │ │ └── tracing v0.1.40 (*) +│ │ │ │ │ ├── tower-layer v0.3.2 +│ │ │ │ │ └── tower-service v0.3.2 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── rustversion v1.0.14 (proc-macro) +│ │ │ │ ├── base64 v0.21.5 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ ├── futures-util v0.3.29 (*) +│ │ │ │ ├── h2 v0.3.21 (*) +│ │ │ │ ├── http v0.2.9 (*) +│ │ │ │ ├── http-body v0.4.5 (*) +│ │ │ │ ├── hyper v0.14.27 (*) +│ │ │ │ ├── hyper-timeout v0.4.1 +│ │ │ │ │ ├── hyper v0.14.27 (*) +│ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ │ └── tokio-io-timeout v1.2.0 +│ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ └── tokio v1.33.0 (*) +│ │ │ │ ├── percent-encoding v2.3.0 +│ │ │ │ ├── pin-project v1.1.3 (*) +│ │ │ │ ├── prost v0.11.9 (*) +│ │ │ │ ├── tokio v1.33.0 (*) +│ │ │ │ ├── tokio-stream v0.1.14 +│ │ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ └── tokio v1.33.0 (*) +│ │ │ │ ├── tower v0.4.13 (*) +│ │ │ │ ├── tower-layer v0.3.2 +│ │ │ │ ├── tower-service v0.3.2 +│ │ │ │ └── tracing v0.1.40 (*) +│ │ │ └── tracing-core v0.1.32 (*) +│ │ ├── crossbeam-channel v0.5.8 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ └── crossbeam-utils v0.8.16 +│ │ │ └── cfg-if v1.0.0 +│ │ ├── crossbeam-utils v0.8.16 (*) +│ │ ├── futures v0.3.29 (*) +│ │ ├── hdrhistogram v7.5.2 +│ │ │ ├── base64 v0.13.1 +│ │ │ ├── byteorder v1.5.0 +│ │ │ ├── flate2 v1.0.28 +│ │ │ │ ├── crc32fast v1.3.2 (*) +│ │ │ │ └── miniz_oxide v0.7.1 (*) +│ │ │ ├── nom v7.1.3 +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ └── minimal-lexical v0.2.1 +│ │ │ └── num-traits v0.2.17 (*) +│ │ ├── humantime v2.1.0 +│ │ ├── prost-types v0.11.9 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── serde_json v1.0.108 (*) +│ │ ├── thread_local v1.1.7 (*) +│ │ ├── tokio v1.33.0 (*) +│ │ ├── tokio-stream v0.1.14 (*) +│ │ ├── tonic v0.9.2 (*) +│ │ ├── tracing v0.1.40 (*) +│ │ ├── tracing-core v0.1.32 (*) +│ │ └── tracing-subscriber v0.3.17 +│ │ ├── matchers v0.1.0 +│ │ │ └── regex-automata v0.1.10 (*) +│ │ ├── nu-ansi-term v0.46.0 +│ │ │ └── overload v0.1.1 +│ │ ├── once_cell v1.18.0 +│ │ ├── regex v1.10.2 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── serde_json v1.0.108 (*) +│ │ ├── sharded-slab v0.1.7 (*) +│ │ ├── smallvec v1.11.1 +│ │ ├── thread_local v1.1.7 (*) +│ │ ├── tracing v0.1.40 (*) +│ │ ├── tracing-core v0.1.32 (*) +│ │ ├── tracing-log v0.1.4 (*) +│ │ └── tracing-serde v0.1.3 (*) +│ ├── tracing v0.1.40 (*) +│ ├── tracing-elastic-apm v3.2.3 +│ │ ├── anyhow v1.0.75 +│ │ ├── base64 v0.13.1 +│ │ ├── fxhash v0.2.1 +│ │ │ └── byteorder v1.5.0 +│ │ ├── rand v0.8.5 (*) +│ │ ├── reqwest v0.11.22 +│ │ │ ├── base64 v0.21.5 +│ │ │ ├── bytes v1.5.0 +│ │ │ ├── futures-core v0.3.29 +│ │ │ ├── futures-util v0.3.29 (*) +│ │ │ ├── http v0.2.9 (*) +│ │ │ ├── js-sys v0.3.64 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── serde_json v1.0.108 (*) +│ │ │ ├── serde_urlencoded v0.7.1 +│ │ │ │ ├── form_urlencoded v1.2.0 (*) +│ │ │ │ ├── itoa v1.0.9 +│ │ │ │ ├── ryu v1.0.15 +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ ├── tower-service v0.3.2 +│ │ │ ├── url v2.4.1 (*) +│ │ │ ├── wasm-bindgen v0.2.87 (*) +│ │ │ ├── wasm-bindgen-futures v0.4.37 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ ├── js-sys v0.3.64 (*) +│ │ │ │ └── wasm-bindgen v0.2.87 (*) +│ │ │ └── web-sys v0.3.64 +│ │ │ ├── js-sys v0.3.64 (*) +│ │ │ └── wasm-bindgen v0.2.87 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── serde_json v1.0.108 (*) +│ │ ├── tokio v1.33.0 (*) +│ │ ├── tracing v0.1.40 (*) +│ │ ├── tracing-subscriber v0.3.17 (*) +│ │ └── version v3.0.0 +│ ├── tracing-log v0.1.4 (*) +│ ├── tracing-subscriber v0.3.17 (*) +│ └── url v2.4.1 (*) +├── sp-core v24.0.0 (*) +└── sp-runtime v27.0.0 (*) diff --git a/crates/protocol-abstract/Cargo.toml b/crates/protocol-abstract/Cargo.toml new file mode 100644 index 000000000..9a9a05ab4 --- /dev/null +++ b/crates/protocol-abstract/Cargo.toml @@ -0,0 +1,18 @@ +[package] +edition = "2021" +name = "protocol-abstract" +version = "0.1.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +anyhow = { workspace = true } +async-trait = { workspace = true } +futures = { workspace = true } +k256 = { workspace = true } +pallet-chronicle = { path = "../pallet-chronicle" } +serde = { workspace = true } +subxt = { version = "0.32", features = ["substrate-compat"] } +thiserror = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/crates/protocol-abstract/src/abstract_ledger.rs b/crates/protocol-abstract/src/abstract_ledger.rs new file mode 100644 index 000000000..a21c35302 --- /dev/null +++ b/crates/protocol-abstract/src/abstract_ledger.rs @@ -0,0 +1,207 @@ +use std::{convert::Infallible, str::FromStr}; + +use futures::{stream::BoxStream, TryFutureExt}; +use pallet_chronicle::ChronicleTransactionId; +use subxt::ext::sp_core::H256; +use thiserror::Error; +use tracing::instrument; + +trait Config { + type Hash: Sized + Send + Sync; +} + +#[derive(Debug, Error)] +pub enum BlockIdError { + #[error("Parse {0}")] + Parse(#[from] anyhow::Error), +} +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum BlockId { + Unknown, //Block ids can be null, empty string etc + Block(H256), //ToDo - trait +} + +impl From for BlockId { + fn from(hash: H256) -> Self { + BlockId::Block(hash) + } +} + +impl TryFrom<&str> for BlockId { + type Error = BlockIdError; + + #[instrument(level = "trace", skip(s), err)] + fn try_from(s: &str) -> Result { + let hash = H256::from_str(s).map_err(|e| BlockIdError::Parse(anyhow::Error::new(e)))?; + Ok(BlockId::Block(hash)) + } +} + +impl std::fmt::Display for BlockId { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + BlockId::Unknown => f.write_str("Unknown"), + BlockId::Block(hash) => f.write_str(&format!("{:?}", hash)), + } + } +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct Position(u32); + +impl From for Position { + fn from(height: u32) -> Self { + Position(height) + } +} + +impl PartialOrd for Position { + fn partial_cmp(&self, other: &Self) -> Option { + let (Position(x), Position(y)) = (self, other); + x.partial_cmp(y) + } +} + +impl Position { + pub fn new(height: u32) -> Self { + Position(height) + } + + pub fn map(&self, f: F) -> T + where + F: FnOnce(&u32) -> T, + { + f(&self.0) + } + + pub fn distance(&self, other: &Self) -> u32 { + let (Position(x), Position(y)) = (self, other); + x.saturating_sub(*y) + } +} + +impl std::fmt::Display for Position { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Position(x) => f.write_str(&format!("{}", x)), + } + } +} + +// Type that can contain a distributed tracing span for transaction processors +// that support it +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum Span { + Span(u64), + NotTraced, +} + +// An application specific ledger event with its corresponding transaction id, +// block height and trace span +pub type LedgerEventContext = (Event, ChronicleTransactionId, BlockId, Position, Span); + +#[async_trait::async_trait] +pub trait LedgerEvent { + type Error: std::error::Error; + async fn deserialize(buf: &[u8]) -> Result<(Self, Span), Self::Error> + where + Self: Sized; +} + +#[async_trait::async_trait] +impl LedgerEvent for () { + type Error = Infallible; + async fn deserialize(_buf: &[u8]) -> Result<(Self, Span), Self::Error> { + Ok(((), Span::NotTraced)) + } +} + +pub trait MessageBuilder {} + +#[async_trait::async_trait] +pub trait LedgerTransaction { + type Error: std::error::Error + Send + Sync + 'static; + type Payload: Sized + Send + Sync; + async fn as_payload(&self) -> Result; +} + +#[async_trait::async_trait] +pub trait LedgerWriter { + type Error: std::error::Error; + type Transaction: LedgerTransaction; + type Submittable: Sized; + + // Minimally process the transaction offline to get a transaction id and submittable type + async fn pre_submit( + &self, + tx: Self::Transaction, + ) -> Result<(Self::Submittable, ChronicleTransactionId), Self::Error>; + + // Submit is used to submit a transaction to the ledger + async fn do_submit( + &self, + submittable: Self::Submittable, + ) -> Result; +} + +pub struct BlockingLedgerReader +where + R: LedgerReader + Send, +{ + reader: R, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum FromBlock { + // Do not attempt to catch up, start from the current head + Head, + // Discover the first useful block and start from there + First, + // Start from the given block + BlockId(BlockId), +} + +impl BlockingLedgerReader +where + R: LedgerReader + Send, +{ + pub fn new(reader: R) -> Self { + Self { reader } + } + + pub fn get_state_entry(&self, address: &str) -> Result, R::Error> { + tokio::runtime::Handle::current().block_on(self.reader.get_state_entry(address)) + } + + pub fn block_height(&self) -> Result<(Position, BlockId), R::Error> { + tokio::runtime::Handle::current().block_on(self.reader.block_height()) + } + + pub fn state_updates( + &self, + from_block: FromBlock, + number_of_blocks: Option, + ) -> Result>, R::Error> { + tokio::runtime::Handle::current() + .block_on(self.reader.state_updates(from_block, number_of_blocks)) + } +} + +#[async_trait::async_trait] +pub trait LedgerReader { + type Event: LedgerEvent; + type Error: std::error::Error; + /// Get the state entry at `address` + async fn get_state_entry(&self, address: &str) -> Result, Self::Error>; + // Get the block height of the ledger, and the id of the highest block + async fn block_height(&self) -> Result<(Position, BlockId), Self::Error>; + /// Subscribe to state updates from this ledger, starting at `offset`, and + /// ending the stream after `number_of_blocks` blocks have been processed. + async fn state_updates( + &self, + // The block to start from + from_block: FromBlock, + // The number of blocks to process before ending the stream + number_of_blocks: Option, + ) -> Result>, Self::Error>; +} diff --git a/crates/protocol-abstract/src/lib.rs b/crates/protocol-abstract/src/lib.rs new file mode 100644 index 000000000..634907139 --- /dev/null +++ b/crates/protocol-abstract/src/lib.rs @@ -0,0 +1,3 @@ +mod abstract_ledger; + +pub use abstract_ledger::*; diff --git a/crates/protocol-substrate-chronicle/Cargo.toml b/crates/protocol-substrate-chronicle/Cargo.toml new file mode 100644 index 000000000..3713ce200 --- /dev/null +++ b/crates/protocol-substrate-chronicle/Cargo.toml @@ -0,0 +1,31 @@ +[package] +edition = "2021" +name = "protocol-substrate-chronicle" +version = "0.1.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +async-trait = { workspace = true } +clap_builder = { version = "*" } +futures = { workspace = true } +k256 = { workspace = true } +serde = { workspace = true } +subxt = { version = "0.32", features = ["substrate-compat"] } +thiserror = { workspace = true } +tracing = { workspace = true } +uuid = { workspace = true } +#local dependencies +chronicle-signing = { path = "../chronicle-signing" } +common = { path = "../common", features = ["parity-encoding"] } +pallet-chronicle = { path = "../pallet-chronicle" } +protocol-abstract = { path = "../protocol-abstract" } + + +[dev-dependencies] +chronicle-telemetry = { path = "../chronicle-telemetry" } +embedded-substrate = { path = "../embedded-substrate" } +uuid = { workspace = true } + +[features] +default = [] diff --git a/crates/protocol-substrate-chronicle/src/lib.rs b/crates/protocol-substrate-chronicle/src/lib.rs new file mode 100644 index 000000000..f88ebbb38 --- /dev/null +++ b/crates/protocol-substrate-chronicle/src/lib.rs @@ -0,0 +1,7 @@ +mod subxt_client; + +pub mod protocol { + pub use protocol_abstract::*; +} + +pub use subxt_client::*; diff --git a/crates/protocol-substrate-chronicle/src/subxt_client.rs b/crates/protocol-substrate-chronicle/src/subxt_client.rs new file mode 100644 index 000000000..513826c5d --- /dev/null +++ b/crates/protocol-substrate-chronicle/src/subxt_client.rs @@ -0,0 +1,643 @@ +use std::{convert::Infallible, sync::Arc}; + +use chronicle_signing::{ + ChronicleSigner, ChronicleSigning, OwnedSecret, SecretError, + BATCHER_NAMESPACE, BATCHER_PK, +}; +use common::{ + identity::{SignedIdentity}, + ledger::OperationSubmission, +}; +use futures::{ + stream::{self, BoxStream}, + FutureExt, StreamExt, TryFutureExt, TryStreamExt, +}; + +use pallet_chronicle::{ + operations::{ChronicleOperation}, + ChronicleTransactionId, +}; +use subxt::{ + backend::{ + BackendExt, + }, + config::{ExtrinsicParams, Hasher}, + ext::{ + codec::{Decode, Encode}, + sp_core::{blake2_256, Pair, H256}, + }, +}; + +use subxt::{ + tx::{Payload, Signer, SubmittableExtrinsic}, + utils::{AccountId32, MultiAddress, MultiSignature}, + OnlineClient, +}; + +use protocol_abstract::{ + BlockId, FromBlock, LedgerEvent, LedgerEventContext, LedgerReader, LedgerTransaction, + LedgerWriter, Position, Span, +}; + +#[derive(Clone)] +pub struct SubstrateClient { + client: OnlineClient, +} + +impl SubstrateClient +where + C: subxt::Config, + C: subxt::Config
>, + C: subxt::Config, + >::OtherParams: Default, +{ + pub async fn connect(url: impl AsRef) -> Result { + Ok(Self { client: OnlineClient::from_url(url).await? }) + } + + pub async fn create_extrinsic + Send>( + &self, + signer: &S, + operations: OperationSubmission, + ) -> Result<(SubmittableExtrinsic>, [u8; 16]), subxt::Error> { + let correlation_id = operations.correlation_id; + let payload = Payload::new("Chronicle", "apply", common::ledger::ApplyArgs { operations }); + + self.client + .tx() + .create_signed(&payload, signer, Default::default()) + .await + .map(|extrinsic| (extrinsic, correlation_id)) + } + + pub async fn send_extrinsic( + &self, + extrinsic: (SubmittableExtrinsic>, [u8; 16]), + ) -> Result { + extrinsic + .0 + .submit_and_watch() + .and_then(|progress| progress.wait_for_finalized_success()) + .await + .map(|_| extrinsic.1.into()) + .map_err(|e| (e, ChronicleTransactionId::from(extrinsic.1))) + } +} + +pub struct SubstrateTransaction { + correlation_id: uuid::Uuid, + key: subxt::ext::sp_core::ecdsa::Pair, //We need the batcher key to sign transactions + identity: Arc, + operations: Arc>, +} + +impl SubstrateTransaction { + pub async fn new( + signer: &ChronicleSigning, + identity: SignedIdentity, + operations: impl IntoIterator, + ) -> Result { + Ok(Self { + correlation_id: uuid::Uuid::new_v4(), + key: subxt::ext::sp_core::ecdsa::Pair::from_seed_slice( + &signer.copy_signing_key(BATCHER_NAMESPACE, BATCHER_PK).await?.to_bytes(), + ) + .unwrap(), + identity: identity.into(), + operations: Arc::new(operations.into_iter().collect::>()), + }) + } +} + +pub struct SubstrateMessageBuilder; + +#[async_trait::async_trait] +impl LedgerTransaction for SubstrateTransaction { + type Error = Infallible; + type Payload = OperationSubmission; + + async fn as_payload(&self) -> Result { + Ok(OperationSubmission { + correlation_id: self.correlation_id.into_bytes(), + identity: self.identity.clone(), + operations: self.operations.clone(), + }) + } +} + +///Subxt signer needs to be infallible, so we need to keep a copy of key material here +impl Signer for SubstrateTransaction +where + T: subxt::Config, + T: subxt::Config, + T: subxt::Config
::AccountId, ()>>, + T: subxt::Config, +{ + // The account id for an ecdsa key is the blake2_256 hash of the compressed public key + fn account_id(&self) -> AccountId32 { + AccountId32::from(blake2_256(&self.key.public().0)) + } + + fn address(&self) -> MultiAddress<::AccountId, ()> { + MultiAddress::Id(>::account_id(self)) + } + + fn sign(&self, signer_payload: &[u8]) -> MultiSignature { + self.key.sign(signer_payload).into() + } +} + +pub enum SubstrateEvent { + Committed { + diff: common::prov::ProvModel, + identity: SignedIdentity, + correlation_id: [u8; 16], + }, + Contradicted { + contradiction: common::prov::Contradiction, + identity: SignedIdentity, + correlation_id: [u8; 16], + }, +} + +impl SubstrateEvent { + pub fn new_committed( + diff: common::prov::ProvModel, + identity: SignedIdentity, + correlation_id: [u8; 16], + ) -> Self { + SubstrateEvent::Committed { diff, identity, correlation_id } + } + + pub fn new_contradicted( + contradiction: common::prov::Contradiction, + identity: SignedIdentity, + correlation_id: [u8; 16], + ) -> Self { + SubstrateEvent::Contradicted { contradiction, identity, correlation_id } + } + + pub fn correlation_id(&self) -> [u8; 16] { + match self { + Self::Committed { correlation_id, .. } => *correlation_id, + Self::Contradicted { correlation_id, .. } => *correlation_id, + } + } +} + +#[async_trait::async_trait] +impl LedgerEvent for SubstrateEvent { + type Error = Infallible; + + async fn deserialize(_buf: &[u8]) -> Result<(Self, Span), Self::Error> + where + Self: Sized, + { + unimplemented!() + } +} + +#[derive(Debug, thiserror::Error)] +pub enum SubxtClientError { + #[error("Subxt error: {0}")] + SubxtError(#[from] subxt::Error), + + #[error("Invalid block")] + InvalidBlock, + + #[error("Codec: {0}")] + Codec(#[from] subxt::ext::codec::Error), +} + +impl From for SubxtClientError { + fn from(_value: Infallible) -> Self { + unreachable!() + } +} + +impl SubstrateClient +where + C: subxt::Config, + C: subxt::Config
, + H: subxt::config::Header + Send + Sync, + H: Decode, + H: Encode, + H: subxt::config::Header, +{ + // Return child blocks of from_block, limiting to num_blocks if not none + async fn block_hashes_from( + &self, + from_block: C::Hash, + num_blocks: Option, + ) -> Result>, SubxtClientError> { + // Get the block at hash + let block = self.client.blocks().at(from_block).await?; + + let from_block_num = block.number(); + + let hashes = stream::unfold( + (self.client.clone(), from_block_num), + move |(client, block_num)| async move { + if let Some(num_blocks) = num_blocks { + if num_blocks == block_num { + return None; + } + } + + let block_hash: Result = client + .backend() + .call_decoding( + "chain_getBlockHash", + Some(&vec![block_num].encode()), + subxt::utils::H256::zero(), + ) + .await + .map_err(SubxtClientError::from); + + Some((block_hash, (client, block_num + 1))) + }, + ); + + Ok(Box::pin(hashes)) + } + // Return events from `number_of_blocks` blocks from the client, starting at `from_block` + async fn events_for_block( + &self, + from_block: C::Hash, + ) -> Result>, SubxtClientError> { + let header = self.client.backend().block_header(from_block).await?; + let block_num = match header { + Some(header) => Ok(header.number()), + None => { + tracing::error!("Block header is None"); + Err(SubxtClientError::InvalidBlock) + }, + }?; + + let events_for_block = match self.client.events().at(from_block).await { + Ok(events) => Ok(events), + Err(e) => { + tracing::error!("Failed to get events for block: {}", e); + Err(SubxtClientError::InvalidBlock) + }, + }?; + + let events_for_block = + stream::unfold(events_for_block.iter(), |mut events_for_block| async move { + match events_for_block.next() { + Some(Ok(event)) => match Self::extract_event(event) { + Ok(Some(event)) => Some((event, events_for_block)), + _ => None, + }, + Some(Err(e)) => { + tracing::error!("Cannot fetch event {}", e); + None + }, + _ => None, + } + }); + + let event_stream = events_for_block.map(move |event| { + let correlation_id = event.correlation_id(); + ( + event, + ChronicleTransactionId::from(correlation_id), + BlockId::Block(from_block), + Position::from(block_num), + Span::NotTraced, + ) + }); + + Ok(event_stream.boxed()) + } + + async fn stream_finalized_events( + &self, + ) -> Result>, SubxtClientError> { + let blocks = self.client.blocks().subscribe_finalized().await?; + + let parsed_events = blocks + .map_err(SubxtClientError::from) + .and_then(|block| async move { + let block_num = block.number(); + let block_hash = block.hash(); + + let events = block.events().await.map_err(SubxtClientError::from); + + match events { + Err(e) => Err(e), + Ok(events) => { + let events = events + .iter() + .filter_map(|event| { + event + .map_err(SubxtClientError::from) + .and_then(Self::extract_event) + .transpose() + .map(|event| { + event.map(|event| { + let correlation_id = event.correlation_id(); + ( + event, + ChronicleTransactionId::from(correlation_id), + BlockId::Block(block_hash), + Position::from(block_num), + Span::NotTraced, + ) + }) + }) + }) + .collect::>(); + Ok(stream::iter(events)) + }, + } + }) + .boxed(); + + //Unfold and terminate stream on error + let flattened_stream = stream::unfold(parsed_events, |mut parsed_events| async move { + match parsed_events.next().await { + Some(Ok(events)) => Some((events, parsed_events)), + Some(Err(e)) => { + tracing::error!("Subscription error {}", e); + None + }, + _ => None, + } + }) + .flatten() + .boxed(); + + // Terminate on parse error in flattened stream, + let flattened_stream = + stream::unfold(flattened_stream, |mut flattened_stream| async move { + match flattened_stream.next().await { + Some(Err(e)) => { + tracing::error!("Event parse error {}", e); + None + }, + Some(Ok(event)) => Some((event, flattened_stream)), + None => None, + } + }) + .boxed(); + + Ok(flattened_stream) + } + + async fn historical_events( + &self, + from_block: C::Hash, + num_blocks: Option, + ) -> Result>, SubxtClientError> { + let from_block_clone = self; + let block_hashes = from_block_clone.block_hashes_from(from_block, num_blocks).await?; + + let events = stream::unfold( + (block_hashes, self), + move |(mut block_hashes, self_clone)| async move { + let next_block_hash = block_hashes.next().await; + match next_block_hash { + Some(Ok(block_hash)) => { + let events = self_clone.events_for_block(block_hash).await; + match events { + Ok(events) => Some((events, (block_hashes, self_clone))), + Err(e) => { + tracing::error!("Subscription error {}", e); + None + }, + } + }, + Some(Err(e)) => { + tracing::error!("Subscription error {}", e); + None + }, + _ => None, + } + }, + ) + .flatten() + .boxed(); + + Ok(events) + } + + fn extract_event( + event: subxt::events::EventDetails, + ) -> Result, SubxtClientError> { + type Applied = (common::prov::ProvModel, common::identity::SignedIdentity, [u8; 16]); + type Contradicted = + (common::prov::Contradiction, common::identity::SignedIdentity, [u8; 16]); + match (event.pallet_name(), event.variant_name(), event.field_bytes()) { + ("Chronicle", "Applied", mut event_bytes) => match Applied::decode(&mut event_bytes) { + Ok((prov_model, identity, correlation_id)) => + Ok(Some(SubstrateEvent::new_committed(prov_model, identity, correlation_id))), + Err(e) => { + tracing::error!("Failed to decode ProvModel: {}", e); + Err(e.into()) + }, + }, + ("Chronicle", "Contradicted", mut event_bytes) => { + match Contradicted::decode(&mut event_bytes) { + Ok((contradiction, identity, correlation_id)) => Ok( + SubstrateEvent::new_contradicted(contradiction, identity, correlation_id) + .into(), + ), + Err(e) => { + tracing::error!("Failed to decode Contradiction: {}", e); + Err(e.into()) + }, + } + }, + (_pallet, _event, _) => Ok(None), + } + } +} + +#[async_trait::async_trait] +impl LedgerWriter for SubstrateClient +where + C: subxt::Config
>, + C: subxt::Config, + C: subxt::Config, + C: subxt::Config, + >::OtherParams: Default, + >::OtherParams: Send, +{ + type Error = SubxtClientError; + type Transaction = SubstrateTransaction; + type Submittable = (SubmittableExtrinsic>, [u8; 16]); + + async fn pre_submit( + &self, + tx: Self::Transaction, + ) -> Result<(Self::Submittable, ChronicleTransactionId), Self::Error> { + let (ext, id) = self.create_extrinsic(&tx, tx.as_payload().await?).await?; + + Ok(((ext, id), id.into())) + } + + async fn do_submit( + &self, + submittable: Self::Submittable, + ) -> Result { + self.send_extrinsic(submittable).await.map_err(|(e, id)| (e.into(), id)) + } +} + +#[async_trait::async_trait] +impl LedgerReader for SubstrateClient +where + C: subxt::Config, + C: subxt::Config
, + H: subxt::config::Header + Send + Sync, + H: Decode, + H: Encode, + H: subxt::config::Header, +{ + type Event = SubstrateEvent; + + type Error = SubxtClientError; + + /// Get the state entry at `address` + async fn get_state_entry(&self, _address: &str) -> Result, Self::Error> { + unimplemented!() + } + // Get the block height of the ledger, and the id of the highest block + async fn block_height(&self) -> Result<(Position, BlockId), Self::Error> { + let block = self.client.blocks().at_latest().await?; + + Ok((Position::from(block.number()), BlockId::from(block.hash()))) + } + /// Subscribe to state updates from this ledger, starting at `offset`, and + /// ending the stream after `number_of_blocks` blocks have been processed. + async fn state_updates( + &self, + // The block to start from + from_block: FromBlock, + // The number of blocks to process before ending the stream + number_of_blocks: Option, + ) -> Result>, Self::Error> { + // If fromblock is not head, then load in historical blocks and yield up to number_of_blocks + // events + let historical = match from_block { + FromBlock::Head => stream::empty().boxed(), + FromBlock::First => self + .historical_events(self.client.backend().genesis_hash().await?, number_of_blocks) + .await? + .boxed(), + FromBlock::BlockId(BlockId::Block(hash)) => + self.historical_events(hash, number_of_blocks).await?.boxed(), + FromBlock::BlockId(BlockId::Unknown) => self + .historical_events(self.client.backend().genesis_hash().await?, number_of_blocks) + .await? + .boxed(), + }; + + let all = historical.chain(self.stream_finalized_events().await?); + + //TODO: only take number_of_blocks worth of events before closing the stream + + Ok(all.boxed()) + } +} + +#[cfg(test)] +pub mod test_runtime { + use chronicle_signing::{ + chronicle_secret_names, ChronicleSecretsOptions, ChronicleSigning, BATCHER_NAMESPACE, + CHRONICLE_NAMESPACE, + }; + use common::identity::SignedIdentity; + use futures::StreamExt; + use pallet_chronicle::{ + operations::{ChronicleOperation, CreateNamespace}, + ExternalId, NamespaceId, + }; + use subxt::{ + ext::sp_core::{Pair, Public}, + PolkadotConfig, + }; + use uuid::Uuid; + + use crate::subxt_client::SubstrateTransaction; + + use super::*; + + fn get_from_seed(seed: &str) -> [u8; 32] { + let k = TPublic::Pair::from_string(&format!("//{}", seed), None) + .expect("static values are valid; qed"); + let mut buf = [0; 32]; + buf.copy_from_slice(&k.to_raw_vec()); + + buf + } + + #[tokio::test] + pub async fn connect() { + use protocol_abstract::{LedgerReader, LedgerWriter}; + //chronicle_telemetry::telemetry(None, chronicle_telemetry::ConsoleLogging::Pretty); + let handle = embedded_dev_node_rpc_on_port(2003).await.unwrap(); + + let client = handle.connect::().await.unwrap(); + + let mut events = + client.state_updates(protocol_abstract::FromBlock::Head, None).await.unwrap(); + + let signing = ChronicleSigning::new( + chronicle_secret_names(), + vec![ + ( + CHRONICLE_NAMESPACE.to_string(), + ChronicleSecretsOptions::seeded( + vec![( + "chronicle-pk".to_string(), + get_from_seed::("Chronicle"), + )] + .into_iter() + .collect(), + ), + ), + ( + BATCHER_NAMESPACE.to_string(), + ChronicleSecretsOptions::seeded( + vec![( + "batcher-pk".to_string(), + get_from_seed::("Chronicle"), + )] + .into_iter() + .collect(), + ), + ), + ], + ) + .await + .unwrap(); + + let (submit, id) = client + .pre_submit( + SubstrateTransaction::new( + &signing, + SignedIdentity::new_no_identity(), + vec![ChronicleOperation::CreateNamespace(CreateNamespace::new( + NamespaceId::from_external_id(&ExternalId::from("test"), Uuid::default()), + ))], + ) + .await + .unwrap(), + ) + .await + .unwrap(); + + let res = client.do_submit(submit).await.unwrap(); + + let (ev, id, block, pos, _) = events.next().await.unwrap(); + + match ev { + crate::subxt_client::SubstrateEvent::Committed { diff, .. } => { + tracing::info!("{:?}", diff) + }, + crate::subxt_client::SubstrateEvent::Contradicted { .. } => panic!("Contradicted"), + } + } +} diff --git a/crates/opa-tp-protocol/Cargo.toml b/crates/protocol-substrate-opa/Cargo.toml similarity index 82% rename from crates/opa-tp-protocol/Cargo.toml rename to crates/protocol-substrate-opa/Cargo.toml index b43e68b2e..4618e4147 100644 --- a/crates/opa-tp-protocol/Cargo.toml +++ b/crates/protocol-substrate-opa/Cargo.toml @@ -1,23 +1,22 @@ [package] -build = "build.rs" edition = "2021" -name = "opa-tp-protocol" +name = "protocol-substrate-opa" version = "0.7.5" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-stl-client = { workspace = true } async-trait = { workspace = true } chronicle-signing = { workspace = true } +common = { path = "../common" } derivative = { workspace = true } futures = { workspace = true } hex = { workspace = true } k256 = { workspace = true } lazy_static = { workspace = true } openssl = { workspace = true } -prost = { workspace = true } -prost-types = { workspace = true } +pallet-opa = { path = "../pallet-opa", default-features = false } +protocol-abstract = { path = "../protocol-abstract" } rand = { workspace = true } rand_core = { workspace = true } serde = { workspace = true, features = ["derive"] } diff --git a/crates/protocol-substrate-opa/src/lib.rs b/crates/protocol-substrate-opa/src/lib.rs new file mode 100644 index 000000000..6c1391753 --- /dev/null +++ b/crates/protocol-substrate-opa/src/lib.rs @@ -0,0 +1,73 @@ +#![cfg_attr(feature = "strict", deny(warnings))] + +use std::convert::Infallible; + +use futures::stream::BoxStream; +use pallet_opa::ChronicleTransactionId; +use protocol_abstract::{ + BlockId, FromBlock, LedgerEvent, LedgerEventContext, LedgerReader, LedgerWriter, Position, Span, +}; +use state::OpaOperationEvent; +pub mod state; +//pub mod submission; +pub mod transaction; + +static PROTOCOL_VERSION: &str = "1"; + +pub enum OpaEvent {} + +pub enum OpaLedger {} + +#[async_trait::async_trait] +impl LedgerReader for OpaLedger { + type Event = OpaOperationEvent; + type Error = Infallible; + async fn get_state_entry(&self, address: &str) -> Result, Self::Error> { + unimplemented!() + } + async fn block_height(&self) -> Result<(Position, BlockId), Self::Error> { + unimplemented!() + } + async fn state_updates( + &self, + // The block to start from + from_block: FromBlock, + // The number of blocks to process before ending the stream + number_of_blocks: Option, + ) -> Result>, Self::Error> { + unimplemented!() + } +} + +#[async_trait::async_trait] +impl LedgerWriter for OpaLedger { + type Error = Infallible; + type Transaction = transaction::OpaSubmitTransaction; + type Submittable = (); + + // Minimally process the transaction to get a transaction id and submittable type + async fn pre_submit( + &self, + tx: Self::Transaction, + ) -> Result<(Self::Submittable, ChronicleTransactionId), Self::Error> { + unimplemented!() + } + + // Submit is used to submit a transaction to the ledger + async fn do_submit( + &self, + submittable: Self::Submittable, + ) -> Result { + unimplemented!() + } +} + +#[async_trait::async_trait] +impl LedgerEvent for OpaOperationEvent { + type Error = Infallible; + async fn deserialize( + buf: &[u8], + ) -> Result<(Self, Span), ::Error> { + unimplemented!() + } +} diff --git a/crates/opa-tp-protocol/src/submission.rs b/crates/protocol-substrate-opa/src/submission.rs similarity index 68% rename from crates/opa-tp-protocol/src/submission.rs rename to crates/protocol-substrate-opa/src/submission.rs index 6724eaa6d..a5acd0f0d 100644 --- a/crates/opa-tp-protocol/src/submission.rs +++ b/crates/protocol-substrate-opa/src/submission.rs @@ -3,7 +3,6 @@ use std::{ sync::{Arc, Mutex}, }; -use crate::{messages, PROTOCOL_VERSION}; use chronicle_signing::{ ChronicleSigning, OpaKnownKeyNamesSigner, SecretError, WithSecret, OPA_NAMESPACE, }; @@ -13,20 +12,21 @@ use k256::{ schnorr::signature::Signer, PublicKey, }; -use prost::Message; -fn bootstrap_root(public_key: VerifyingKey) -> messages::BootstrapRoot { +fn bootstrap_root(public_key: VerifyingKey) -> pallet_opa::messages::BootstrapRoot { let public_key: PublicKey = public_key.into(); - messages::BootstrapRoot { public_key: public_key.to_public_key_pem(LineEnding::CRLF).unwrap() } + pallet_opa::messages::BootstrapRoot { + public_key: public_key.to_public_key_pem(LineEnding::CRLF).unwrap(), + } } fn register_key( id: impl AsRef, public_key: &VerifyingKey, overwrite_existing: bool, -) -> messages::RegisterKey { +) -> pallet_opa::messages::RegisterKey { let public_key: PublicKey = public_key.into(); - messages::RegisterKey { + pallet_opa::messages::RegisterKey { id: id.as_ref().to_string(), public_key: public_key.to_public_key_pem(LineEnding::CRLF).unwrap(), overwrite_existing, @@ -37,8 +37,8 @@ fn rotate_key( id: impl AsRef, old_key: &SigningKey, new_key: &SigningKey, -) -> messages::RotateKey { - let new_key_message = messages::rotate_key::NewPublicKey { +) -> pallet_opa::messages::RotateKey { + let new_key_message = pallet_opa::messages::NewPublicKey { id: id.as_ref().to_string(), public_key: new_key.to_bytes().to_vec(), }; @@ -53,7 +53,7 @@ fn rotate_key( let new_verifying_key = new_key.verifying_key(); let new_verifying_public_key: PublicKey = new_verifying_key.into(); - messages::RotateKey { + pallet_opa::messages::RotateKey { payload: Some(new_key_message), previous_signature: old_signature.to_vec(), previous_signing_key: old_verifying_public_key.to_public_key_pem(LineEnding::CRLF).unwrap(), @@ -62,15 +62,15 @@ fn rotate_key( } } -fn set_policy(id: impl AsRef, policy: Vec) -> messages::SetPolicy { - messages::SetPolicy { id: id.as_ref().to_owned(), policy } +fn set_policy(id: impl AsRef, policy: Vec) -> pallet_opa::messages::SetPolicy { + pallet_opa::messages::SetPolicy { id: id.as_ref().to_owned(), policy } } enum BuildingMessage { - BootstrapRoot(messages::BootstrapRoot), - RegisterKey(messages::SignedOperation), - RotateKey(messages::SignedOperation), - SetPolicy(messages::SignedOperation), + BootstrapRoot(pallet_opa::messages::BootstrapRoot), + RegisterKey(pallet_opa::messages::SignedOperation), + RotateKey(pallet_opa::messages::SignedOperation), + SetPolicy(pallet_opa::messages::SignedOperation), } pub struct SubmissionBuilder { @@ -88,19 +88,17 @@ impl SubmissionBuilder { signer: &ChronicleSigning, overwrite_existing: bool, ) -> Result { - let operation = messages::signed_operation::Payload { - operation: Some(messages::signed_operation::payload::Operation::RegisterKey( - register_key( - id, - &signer.verifying_key(OPA_NAMESPACE, new_key).await?, - overwrite_existing, - ), - )), + let operation = pallet_opa::messages::SignedOperationPayload { + operation: Some(pallet_opa::messages::Operation::RegisterKey(register_key( + id, + &signer.verifying_key(OPA_NAMESPACE, new_key).await?, + overwrite_existing, + ))), }; let signature = signer.opa_sign(&operation.encode_to_vec()).await?; let key: PublicKey = signer.opa_verifying().await?.into(); - let signed_operation = messages::SignedOperation { + let signed_operation = pallet_opa::messages::SignedOperation { payload: Some(operation), signature: signature.to_vec(), verifying_key: key.to_public_key_pem(LineEnding::CRLF).unwrap(), @@ -133,8 +131,8 @@ impl SubmissionBuilder { let new_key = extract_key.lock().unwrap().borrow().clone().unwrap(); - let operation = messages::signed_operation::Payload { - operation: Some(messages::signed_operation::payload::Operation::RotateKey(rotate_key( + let operation = pallet_opa::messages::SignedOperationPayload { + operation: Some(pallet_opa::messages::Operation::RotateKey(rotate_key( id, &old_key, &new_key, ))), }; @@ -142,7 +140,7 @@ impl SubmissionBuilder { let signature = signer.opa_sign(&operation.encode_to_vec()).await?; let key: PublicKey = signer.opa_verifying().await?.into(); - let signed_operation = messages::SignedOperation { + let signed_operation = pallet_opa::messages::SignedOperation { payload: Some(operation), signature, verifying_key: key.to_public_key_pem(LineEnding::CRLF).unwrap(), @@ -155,15 +153,15 @@ impl SubmissionBuilder { policy: Vec, signer: &ChronicleSigning, ) -> Result { - let operation = messages::signed_operation::Payload { - operation: Some(messages::signed_operation::payload::Operation::SetPolicy(set_policy( + let operation = pallet_opa::messages::SignedOperationPayload { + operation: Some(pallet_opa::messages::SignedOperationPayload::SetPolicy(set_policy( id, policy, ))), }; let signature = signer.opa_sign(&operation.encode_to_vec()).await?; let key: PublicKey = signer.opa_verifying().await?.into(); - let signed_operation = messages::SignedOperation { + let signed_operation = pallet_opa::messages::SignedOperation { payload: Some(operation), signature, verifying_key: key.to_public_key_pem(LineEnding::CRLF).unwrap(), @@ -172,24 +170,24 @@ impl SubmissionBuilder { Ok(Self { message: Some(BuildingMessage::SetPolicy(signed_operation)) }) } - pub fn build(mut self, span_id: u64) -> messages::Submission { - let mut submission = messages::Submission::default(); + pub fn build(mut self, span_id: u64) -> pallet_opa::messages::Submission { + let mut submission = pallet_opa::messages::Submission::default(); match self.message.take().unwrap() { BuildingMessage::BootstrapRoot(message) => { - submission.payload = Some(messages::submission::Payload::BootstrapRoot(message)); + submission.payload = Some(pallet_opa::messages::Payload::BootstrapRoot(message)); }, BuildingMessage::RotateKey(message) => { - submission.payload = Some(messages::submission::Payload::SignedOperation(message)); + submission.payload = Some(pallet_opa::messages::Payload::SignedOperation(message)); }, BuildingMessage::SetPolicy(message) => { - submission.payload = Some(messages::submission::Payload::SignedOperation(message)); + submission.payload = Some(pallet_opa::messages::Payload::SignedOperation(message)); }, BuildingMessage::RegisterKey(message) => { - submission.payload = Some(messages::submission::Payload::SignedOperation(message)); + submission.payload = Some(pallet_opa::messages::Payload::SignedOperation(message)); }, }; submission.span_id = span_id; - submission.version = PROTOCOL_VERSION.to_string(); + submission.version = "1.0"; submission } diff --git a/crates/protocol-substrate-opa/src/transaction.rs b/crates/protocol-substrate-opa/src/transaction.rs new file mode 100644 index 000000000..b1e280eb3 --- /dev/null +++ b/crates/protocol-substrate-opa/src/transaction.rs @@ -0,0 +1,66 @@ +use std::{convert::Infallible, sync::Arc}; + +use chronicle_signing::{BatcherKnownKeyNamesSigner, ChronicleSigning, SecretError}; +use k256::ecdsa::VerifyingKey; +use pallet_opa::messages::*; +use protocol_abstract::LedgerTransaction; + +use crate::state::{key_address, policy_address, policy_meta_address}; + +#[derive(Debug, Clone)] +pub enum OpaSubmitTransaction { + BootstrapRoot(Submission, ChronicleSigning), + RotateRoot(Submission, ChronicleSigning), + RegisterKey(Submission, ChronicleSigning, String, bool), + RotateKey(Submission, ChronicleSigning, String), + SetPolicy(Submission, ChronicleSigning, String), +} + +impl OpaSubmitTransaction { + pub fn bootstrap_root(submission: Submission, sawtooth_signer: &ChronicleSigning) -> Self { + Self::BootstrapRoot(submission, sawtooth_signer.to_owned()) + } + + pub fn rotate_root(submission: Submission, sawtooth_signer: &ChronicleSigning) -> Self { + Self::RotateRoot(submission, sawtooth_signer.to_owned()) + } + + pub fn register_key( + name: impl AsRef, + submission: Submission, + sawtooth_signer: &ChronicleSigning, + overwrite_existing: bool, + ) -> Self { + Self::RegisterKey( + submission, + sawtooth_signer.to_owned(), + name.as_ref().to_owned(), + overwrite_existing, + ) + } + + pub fn rotate_key( + name: impl AsRef, + submission: Submission, + sawtooth_signer: &ChronicleSigning, + ) -> Self { + Self::RegisterKey(submission, sawtooth_signer.to_owned(), name.as_ref().to_owned(), false) + } + + pub fn set_policy( + name: impl AsRef, + submission: Submission, + sawtooth_signer: &ChronicleSigning, + ) -> Self { + Self::SetPolicy(submission, sawtooth_signer.to_owned(), name.as_ref().to_owned()) + } +} + +#[async_trait::async_trait] +impl LedgerTransaction for OpaSubmitTransaction { + type Error = SecretError; + type Payload = OpaSubmitTransaction; + async fn as_payload(&self) -> Result { + Ok(self.clone()) + } +} diff --git a/crates/runtime-api-chronicle/Cargo.toml b/crates/runtime-api-chronicle/Cargo.toml new file mode 100644 index 000000000..cef0b2de0 --- /dev/null +++ b/crates/runtime-api-chronicle/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "runtime-api-chronicle" +version = "1.0.0" +edition = "2021" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +sp-api = { version = "23.0.0", default-features = false } +sp-core = { version = "25.0.0", default-features = false } + +#Local dependencies +common = {path="../common", default-features=false, features=["parity-encoding"]} + +[features] +default = ["std"] +std = [ + "sp-api/std", + "common/std" +] diff --git a/crates/runtime-api-chronicle/src/lib.rs b/crates/runtime-api-chronicle/src/lib.rs new file mode 100644 index 000000000..cdcb71087 --- /dev/null +++ b/crates/runtime-api-chronicle/src/lib.rs @@ -0,0 +1,14 @@ +#![cfg_attr(not(feature = "std"), no_std)] +pub type Hash = sp_core::H256; + +pub mod chronicle_core { + pub use common::*; +} + +// Here we declare the runtime API. It is implemented it the `impl` block in +// runtime file (the `runtime/src/lib.rs`) +sp_api::decl_runtime_apis! { + pub trait ChronicleApi { + fn placeholder() -> u32; + } +} diff --git a/crates/sawtooth-tp/Cargo.toml b/crates/sawtooth-tp/Cargo.toml index 4d844c826..bbe3b119b 100644 --- a/crates/sawtooth-tp/Cargo.toml +++ b/crates/sawtooth-tp/Cargo.toml @@ -18,7 +18,6 @@ version = "0.7.5" async-stl-client = { workspace = true } async-trait = { workspace = true } bytes = { workspace = true } -chronicle-protocol = { path = "../chronicle-protocol" } chronicle-signing = { workspace = true } chronicle-telemetry = { path = "../chronicle-telemetry" } clap = { workspace = true } diff --git a/node/node-chronicle/Cargo.toml b/node/node-chronicle/Cargo.toml index bb31c7626..ddff0b35e 100644 --- a/node/node-chronicle/Cargo.toml +++ b/node/node-chronicle/Cargo.toml @@ -1,79 +1,82 @@ [package] -name = "node-chronicle" -version = "4.0.0-dev" +authors = ["Substrate DevHub "] +build = "build.rs" description = "A fresh FRAME-based Substrate node, ready for hacking." -authors = ["Substrate DevHub "] -homepage = "https://substrate.io/" -edition = "2021" -license = "MIT-0" -publish = false -repository = "https://github.com/substrate-developer-hub/substrate-node-template/" -build = "build.rs" +edition = "2021" +homepage = "https://substrate.io/" +license = "MIT-0" +name = "node-chronicle" +publish = false +repository = "https://github.com/substrate-developer-hub/substrate-node-template/" +version = "4.0.0-dev" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [[bin]] name = "node-chronicle" +path = "src/main.rs" -[dependencies] -clap = { version = "4.4.2", features = ["derive"] } -futures = { version = "0.3.21", features = ["thread-pool"]} +[lib] +name = "node_chronicle" +path = "src/lib.rs" -sc-cli = { version = "0.32.0" } -sp-core = { version= "24.0.0" } -sc-executor = { version = "0.28.0" } -sc-network = { version = "0.30.0" } -sc-service = { version = "0.31.0" } -sc-telemetry = { version = "11.0.0" } -sc-transaction-pool = { version = "24.0.0" } -sc-transaction-pool-api = { version = "24.0.0" } -sc-offchain = { version = "25.0.0" } -sc-statement-store = { version = "6.0.0" } -sc-consensus-aura = { version = "0.30.0" } -sp-consensus-aura = { version = "0.28.0" } -sc-consensus = { version = "0.29.0" } -sc-consensus-grandpa = { version = "0.15.0" } -sp-consensus-grandpa = { version = "9.0.0" } -sc-client-api = { version = "24.0.0" } -sp-runtime = { version = "27.0.0" } -sp-io = { version = "26.0.0" } -sp-timestamp = { version = "22.0.0" } -sp-inherents = { version = "22.0.0" } -sp-keyring = { version = "27.0.0" } -frame-system = { version = "24.0.0" } -pallet-transaction-payment = { version = "24.0.0", default-features = false } +[dependencies] +clap = { version = "4.4.2", features = ["derive"] } +frame-system = { version = "25.0.0" } +futures = { version = "0.3.21", features = ["thread-pool"] } +sc-cli = { version = "0.33.0" } +sc-client-api = { version = "25.0.0" } +sc-consensus = { version = "0.30.0" } +sc-consensus-aura = { version = "0.31.0" } +sc-consensus-grandpa = { version = "0.16.0" } +sc-executor = { version = "0.29.0" } +sc-network = { version = "0.31.0" } +sc-offchain = { version = "26.0.0" } +sc-service = { version = "0.32.0" } +sc-statement-store = { version = "7.0.0" } +sc-telemetry = { version = "12.0.0" } +sc-transaction-pool = { version = "25.0.0" } +sc-transaction-pool-api = { version = "25.0.0" } +sp-consensus-aura = { version = "0.29.0" } +sp-consensus-grandpa = { version = "10.0.0" } +sp-core = { version = "25.0.0" } +sp-inherents = { version = "23.0.0" } +sp-io = { version = "27.0.0" } +sp-keyring = { version = "28.0.0" } +sp-runtime = { version = "28.0.0" } +sp-timestamp = { version = "23.0.0" } +tracing = { workspace = true } # These dependencies are used for the node template's RPCs -jsonrpsee = { version = "0.16.3", features = ["server"] } -sp-api = { version = "22.0.0" } -sc-rpc-api = { version = "0.29.0" } -sp-blockchain = { version = "24.0.0" } -sp-block-builder = { version = "22.0.0" } -sc-basic-authorship = { version = "0.30.0" } -substrate-frame-rpc-system = { version = "24.0.0" } -pallet-transaction-payment-rpc = { version = "26.0.0" } +jsonrpsee = { version = "0.16", features = ["server"] } +sc-basic-authorship = { version = "0.31.0" } +sc-rpc-api = { version = "0.30.0" } +sp-api = { version = "23.0.0" } +sp-block-builder = { version = "23.0.0" } +sp-blockchain = { version = "25.0.0" } +substrate-frame-rpc-system = { version = "25.0.0" } # These dependencies are used for runtime benchmarking -frame-benchmarking = { version = "24.0.0" } -frame-benchmarking-cli = { version = "28.0.0" } +frame-benchmarking = { version = "25.0.0" } +frame-benchmarking-cli = { version = "29.0.0" } # Local Dependencies runtime-chronicle = { path = "../runtime-chronicle" } # CLI-specific dependencies -try-runtime-cli = { version = "0.34.0", optional = true } +try-runtime-cli = { version = "0.35.0", optional = true } [build-dependencies] -substrate-build-script-utils = { version = "8.0.0" } +substrate-build-script-utils = { version = "9.0.0" } [features] default = [] # Dependencies that are only required if runtime benchmarking should be build. runtime-benchmarks = [ - "runtime-chronicle/runtime-benchmarks", - "frame-benchmarking/runtime-benchmarks", - "frame-benchmarking-cli/runtime-benchmarks", + "runtime-chronicle/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-benchmarking-cli/runtime-benchmarks", ] # Enable features that allow the runtime to be tried and debugged. Name might be subject to change # in the near future. diff --git a/node/node-chronicle/src/benchmarking.rs b/node/node-chronicle/src/benchmarking.rs index 848237244..17d3b32b8 100644 --- a/node/node-chronicle/src/benchmarking.rs +++ b/node/node-chronicle/src/benchmarking.rs @@ -4,7 +4,7 @@ use crate::service::FullClient; -use runtime::{AccountId, Balance, BalancesCall, SystemCall}; +use runtime::{AccountId, Balance, SystemCall}; use runtime_chronicle as runtime; use sc_cli::Result; use sc_client_api::BlockBackend; @@ -68,30 +68,6 @@ impl TransferKeepAliveBuilder { } } -impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { - fn pallet(&self) -> &str { - "balances" - } - - fn extrinsic(&self) -> &str { - "transfer_keep_alive" - } - - fn build(&self, nonce: u32) -> std::result::Result { - let acc = Sr25519Keyring::Bob.pair(); - let extrinsic: OpaqueExtrinsic = create_benchmark_extrinsic( - self.client.as_ref(), - acc, - BalancesCall::transfer_keep_alive { dest: self.dest.clone().into(), value: self.value } - .into(), - nonce, - ) - .into(); - - Ok(extrinsic) - } -} - /// Create a transaction using the given `call`. /// /// Note: Should only be used for benchmarking. @@ -118,9 +94,8 @@ pub fn create_benchmark_extrinsic( period, best_block.saturated_into(), )), - frame_system::CheckNonce::::from(nonce), + runtime_chronicle::no_nonce_fees::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), - pallet_transaction_payment::ChargeTransactionPayment::::from(0), ); let raw_payload = runtime::SignedPayload::from_raw( @@ -134,7 +109,6 @@ pub fn create_benchmark_extrinsic( best_hash, (), (), - (), ), ); let signature = raw_payload.using_encoded(|e| sender.sign(e)); diff --git a/node/node-chronicle/src/chain_spec.rs b/node/node-chronicle/src/chain_spec.rs index 608eefdfb..3a18f2860 100644 --- a/node/node-chronicle/src/chain_spec.rs +++ b/node/node-chronicle/src/chain_spec.rs @@ -1,8 +1,9 @@ use runtime_chronicle::{ - AccountId, AuraConfig, BalancesConfig, GrandpaConfig, RuntimeGenesisConfig, Signature, - SudoConfig, SystemConfig, WASM_BINARY, + AccountId, AuraConfig, GrandpaConfig, RuntimeGenesisConfig, Signature, SudoConfig, + SystemConfig, WASM_BINARY, }; use sc_service::ChainType; +use sc_telemetry::log; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519, Pair, Public}; @@ -28,7 +29,9 @@ pub fn get_account_id_from_seed(seed: &str) -> AccountId where AccountPublic: From<::Public>, { - AccountPublic::from(get_from_seed::(seed)).into_account() + let account = AccountPublic::from(get_from_seed::(seed)).into_account(); + + account } /// Generate an Aura authority key. @@ -38,7 +41,7 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { pub fn development_config() -> Result { let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - + log::info!("development configuration"); Ok(ChainSpec::from_genesis( // Name "Development", @@ -53,12 +56,6 @@ pub fn development_config() -> Result { // Sudo account get_account_id_from_seed::("Alice"), // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - ], true, ) }, @@ -79,6 +76,7 @@ pub fn development_config() -> Result { pub fn local_testnet_config() -> Result { let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; + log::info!("testnet configuration"); Ok(ChainSpec::from_genesis( // Name "Local Testnet", @@ -93,20 +91,6 @@ pub fn local_testnet_config() -> Result { // Sudo account get_account_id_from_seed::("Alice"), // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - ], true, ) }, @@ -129,7 +113,6 @@ fn testnet_genesis( wasm_binary: &[u8], initial_authorities: Vec<(AuraId, GrandpaId)>, root_key: AccountId, - endowed_accounts: Vec, _enable_println: bool, ) -> RuntimeGenesisConfig { RuntimeGenesisConfig { @@ -138,10 +121,6 @@ fn testnet_genesis( code: wasm_binary.to_vec(), ..Default::default() }, - balances: BalancesConfig { - // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), - }, aura: AuraConfig { authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), }, @@ -153,6 +132,5 @@ fn testnet_genesis( // Assign network admin rights. key: Some(root_key), }, - transaction_payment: Default::default(), } } diff --git a/node/node-chronicle/src/command.rs b/node/node-chronicle/src/command.rs index cae7ab7b8..cc8ae6814 100644 --- a/node/node-chronicle/src/command.rs +++ b/node/node-chronicle/src/command.rs @@ -5,7 +5,7 @@ use crate::{ service, }; use frame_benchmarking_cli::{BenchmarkCmd, ExtrinsicFactory, SUBSTRATE_REFERENCE_HARDWARE}; -use runtime_chronicle::{Block, EXISTENTIAL_DEPOSIT}; +use runtime_chronicle::Block; use sc_cli::SubstrateCli; use sc_service::PartialComponents; use sp_keyring::Sr25519Keyring; @@ -40,8 +40,8 @@ impl SubstrateCli for Cli { fn load_spec(&self, id: &str) -> Result, String> { Ok(match id { - "dev" => Box::new(chain_spec::development_config()?), - "" | "local" => Box::new(chain_spec::local_testnet_config()?), + "" | "dev" => Box::new(chain_spec::development_config()?), + "local" => Box::new(chain_spec::local_testnet_config()?), path => Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), }) @@ -153,18 +153,7 @@ pub fn run() -> sc_cli::Result<()> { ) }, BenchmarkCmd::Extrinsic(cmd) => { - let PartialComponents { client, .. } = service::new_partial(&config)?; - // Register the *Remark* and *TKA* builders. - let ext_factory = ExtrinsicFactory(vec![ - Box::new(RemarkBuilder::new(client.clone())), - Box::new(TransferKeepAliveBuilder::new( - client.clone(), - Sr25519Keyring::Alice.to_account_id(), - EXISTENTIAL_DEPOSIT, - )), - ]); - - cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) + todo!() // use chronicle here }, BenchmarkCmd::Machine(cmd) => cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), diff --git a/node/node-chronicle/src/lib.rs b/node/node-chronicle/src/lib.rs index f117b8aae..98fb4a23e 100644 --- a/node/node-chronicle/src/lib.rs +++ b/node/node-chronicle/src/lib.rs @@ -1,3 +1,6 @@ +pub mod benchmarking; pub mod chain_spec; +pub mod cli; +pub mod command; pub mod rpc; pub mod service; diff --git a/node/node-chronicle/src/rpc.rs b/node/node-chronicle/src/rpc.rs index 00a2c4a1a..b222af1f6 100644 --- a/node/node-chronicle/src/rpc.rs +++ b/node/node-chronicle/src/rpc.rs @@ -35,18 +35,15 @@ where C: HeaderBackend + HeaderMetadata + 'static, C: Send + Sync + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi, - C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + 'static, { - use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use substrate_frame_rpc_system::{System, SystemApiServer}; let mut module = RpcModule::new(()); let FullDeps { client, pool, deny_unsafe } = deps; module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?; - module.merge(TransactionPayment::new(client).into_rpc())?; // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed diff --git a/node/runtime-chronicle/Cargo.toml b/node/runtime-chronicle/Cargo.toml index 60dd683db..363f6acbe 100644 --- a/node/runtime-chronicle/Cargo.toml +++ b/node/runtime-chronicle/Cargo.toml @@ -1,114 +1,111 @@ [package] -name = "runtime-chronicle" -version = "4.0.0" +authors = ["Substrate DevHub "] description = "A fresh FRAME-based Substrate node, ready for hacking." -authors = ["Substrate DevHub "] -homepage = "https://substrate.io/" -edition = "2021" -license = "MIT-0" -publish = false +edition = "2021" +homepage = "https://substrate.io/" +license = "MIT-0" +name = "runtime-chronicle" +publish = false +version = "4.0.0" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -parity-scale-codec = { version="3.6.5", default-features = false, features = ["derive"] } -scale-info = { version="2.10.0", default-features = false, features = ["derive"] } -pallet-aura = { version = "23.0.0", default-features=false } -pallet-balances = { version = "24.0.0", default-features = false } -frame-support = { version="24.0.0" , default-features=false } -pallet-grandpa = { version = "24.0.0", default-features = false } -pallet-sudo = { version = "24.0.0", default-features = false } -frame-system = { version= "24.0.0", default-features=false } -frame-try-runtime = { version= "0.30.0", default-features = false, optional=true} -pallet-timestamp = { version = "23.0.0", default-features=false } -pallet-transaction-payment = { version ="24.0.0",default-features=false} -frame-executive = { version = "24.0.0", default-features = false } -sp-api = { version = "22.0.0", default-features = false } -sp-block-builder = { version = "22.0.0", default-features = false } -sp-consensus-aura = { version = "0.28.0", default-features = false } -sp-consensus-grandpa = { version = "9.0.0", default-features = false} -sp-core = { version="24.0.0" ,default-features=false } -sp-inherents = { version = "22.0.0", default-features = false } -sp-offchain = { version = "22.0.0", default-features = false } -sp-runtime = { version="27.0.0", default-features = false} -sp-session = { version = "23.0.0", default-features = false} -sp-std = { version="11.0.0", default-features = false} -sp-transaction-pool = { version = "22.0.0", default-features = false} -sp-version = { version = "25.0.0", default-features = false} +frame-executive = { version = "25.0.0", default-features = false } +frame-support = { version = "25.0.0", default-features = false } +frame-system = { version = "25.0.0", default-features = false } +frame-try-runtime = { version = "0.31.0", default-features = false, optional = true } +pallet-aura = { version = "24.0.0", default-features = false } +pallet-grandpa = { version = "25.0.0", default-features = false } +pallet-sudo = { version = "25.0.0", default-features = false } +pallet-timestamp = { version = "24.0.0", default-features = false } +parity-scale-codec = { version = "3.6.5", default-features = false, features = [ + "derive", +] } +scale-info = { version = "2.10.0", default-features = false, features = [ + "derive", +] } +sp-api = { version = "23.0.0", default-features = false } +sp-block-builder = { version = "23.0.0", default-features = false } +sp-consensus-aura = { version = "0.29.0", default-features = false } +sp-consensus-grandpa = { version = "10.0.0", default-features = false } +sp-core = { version = "25.0.0", default-features = false } +sp-inherents = { version = "23.0.0", default-features = false } +sp-offchain = { version = "23.0.0", default-features = false } +sp-runtime = { version = "28.0.0", default-features = false } +sp-session = { version = "24.0.0", default-features = false } +sp-std = { version = "12.0.0", default-features = false } +sp-transaction-pool = { version = "23.0.0", default-features = false } +sp-version = { version = "26.0.0", default-features = false } # Used for the node template's RPCs -frame-system-rpc-runtime-api = { version = "22.0.0", default-features = false} -pallet-transaction-payment-rpc-runtime-api = { version = "24.0.0", default-features = false} +frame-system-rpc-runtime-api = { version = "23.0.0", default-features = false } # Used for runtime benchmarking -frame-benchmarking = { version = "24.0.0", default-features = false, optional=true} -frame-system-benchmarking = { version = "24.0.0", default-features = false, optional=true} +frame-benchmarking = { version = "25.0.0", default-features = false, optional = true } +frame-system-benchmarking = { version = "25.0.0", default-features = false, optional = true } # Local Dependencies -pallet-chronicle = { default-features = false, path = "../../crates/pallet-chronicle"} +pallet-chronicle = { default-features = false, path = "../../crates/pallet-chronicle" } +runtime-api-chronicle = { default-features = false, path = "../../crates/runtime-api-chronicle" } [build-dependencies] -substrate-wasm-builder = { version = "13.0.0", optional = true } +substrate-wasm-builder = { version = "14.0.0", optional = true } [features] default = ["std"] -std = [ - "pallet-chronicle/std", - "frame-try-runtime?/std", - "frame-system-benchmarking?/std", - "frame-benchmarking?/std", - "parity-scale-codec/std", - "scale-info/std", - "frame-executive/std", - "frame-support/std", - "frame-system-rpc-runtime-api/std", - "frame-system/std", - "frame-try-runtime/std", - "pallet-aura/std", - "pallet-balances/std", - "pallet-grandpa/std", - "pallet-sudo/std", - "pallet-chronicle/std", - "pallet-timestamp/std", - "pallet-transaction-payment-rpc-runtime-api/std", - "pallet-transaction-payment/std", - "sp-api/std", - "sp-block-builder/std", - "sp-consensus-aura/std", - "sp-consensus-grandpa/std", - "sp-core/std", - "sp-inherents/std", - "sp-offchain/std", - "sp-runtime/std", - "sp-session/std", - "sp-std/std", - "sp-transaction-pool/std", - "sp-version/std", - "substrate-wasm-builder", -] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-support/runtime-benchmarks", - "frame-system-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "pallet-balances/runtime-benchmarks", - "pallet-grandpa/runtime-benchmarks", - "pallet-sudo/runtime-benchmarks", - "pallet-chronicle/runtime-benchmarks", - "pallet-timestamp/runtime-benchmarks", - "sp-runtime/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "pallet-grandpa/runtime-benchmarks", + "pallet-sudo/runtime-benchmarks", + "pallet-chronicle/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", + "sp-runtime/runtime-benchmarks", +] +std = [ + "pallet-chronicle/std", + "runtime-api-chronicle/std", + "frame-try-runtime?/std", + "frame-system-benchmarking?/std", + "frame-benchmarking?/std", + "parity-scale-codec/std", + "scale-info/std", + "frame-executive/std", + "frame-support/std", + "frame-system-rpc-runtime-api/std", + "frame-system/std", + "frame-try-runtime/std", + "pallet-aura/std", + "pallet-grandpa/std", + "pallet-sudo/std", + "pallet-chronicle/std", + "pallet-timestamp/std", + "sp-api/std", + "sp-block-builder/std", + "sp-consensus-aura/std", + "sp-consensus-grandpa/std", + "sp-core/std", + "sp-inherents/std", + "sp-offchain/std", + "sp-runtime/std", + "sp-session/std", + "sp-std/std", + "sp-transaction-pool/std", + "sp-version/std", + "substrate-wasm-builder", ] try-runtime = [ - "frame-try-runtime/try-runtime", - "frame-executive/try-runtime", - "frame-system/try-runtime", - "frame-support/try-runtime", - "pallet-aura/try-runtime", - "pallet-balances/try-runtime", - "pallet-grandpa/try-runtime", - "pallet-sudo/try-runtime", - "pallet-chronicle/try-runtime", - "pallet-timestamp/try-runtime", - "pallet-transaction-payment/try-runtime", + "frame-try-runtime/try-runtime", + "frame-executive/try-runtime", + "frame-system/try-runtime", + "frame-support/try-runtime", + "pallet-aura/try-runtime", + "pallet-grandpa/try-runtime", + "pallet-sudo/try-runtime", + "pallet-chronicle/try-runtime", + "pallet-timestamp/try-runtime", ] diff --git a/node/runtime-chronicle/src/lib.rs b/node/runtime-chronicle/src/lib.rs index 1d43cbba4..bb24a1b5e 100644 --- a/node/runtime-chronicle/src/lib.rs +++ b/node/runtime-chronicle/src/lib.rs @@ -6,7 +6,6 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use pallet_chronicle::operations; use pallet_grandpa::AuthorityId as GrandpaId; use sp_api::impl_runtime_apis; use sp_consensus_aura::sr25519::AuthorityId as AuraId; @@ -23,6 +22,7 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; use sp_version::RuntimeVersion; +pub mod no_nonce_fees; // A few exports that help ease life for downstream crates. pub use frame_support::{ @@ -40,9 +40,7 @@ pub use frame_support::{ StorageValue, }; pub use frame_system::Call as SystemCall; -pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; -use pallet_transaction_payment::{ConstFeeMultiplier, CurrencyAdapter, Multiplier}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; pub use sp_runtime::{Perbill, Permill}; @@ -61,7 +59,7 @@ pub type Signature = MultiSignature; pub type AccountId = <::Signer as IdentifyAccount>::AccountId; /// Balance of an account. -pub type Balance = u128; +pub type Balance = (); /// Index of a transaction in the chain. pub type Nonce = u32; @@ -97,8 +95,8 @@ pub mod opaque { // https://docs.substrate.io/main-docs/build/upgrade#runtime-versioning #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("node-template"), - impl_name: create_runtime_str!("node-template"), + spec_name: create_runtime_str!("runtime-chronicle"), + impl_name: create_runtime_str!("runtime-chronicle"), authoring_version: 1, // The version of the runtime specification. A full node will not attempt to use its native // runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`, @@ -154,6 +152,7 @@ parameter_types! { // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { + type AccountData = (); /// The basic call filter to use in dispatchable. type BaseCallFilter = frame_support::traits::Everything; /// The block type for the runtime. @@ -193,7 +192,6 @@ impl frame_system::Config for Runtime { /// What to do if an account is fully reaped from the system. type OnKilledAccount = (); /// The data to be stored in an account. - type AccountData = pallet_balances::AccountData; /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = (); /// This is used as an identifier of the chain. 42 is the generic substrate prefix. @@ -230,40 +228,6 @@ impl pallet_timestamp::Config for Runtime { type WeightInfo = (); } -/// Existential deposit. -pub const EXISTENTIAL_DEPOSIT: u128 = 500; - -impl pallet_balances::Config for Runtime { - type MaxLocks = ConstU32<50>; - type MaxReserves = (); - type ReserveIdentifier = [u8; 8]; - /// The type for recording an account's balance. - type Balance = Balance; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - type DustRemoval = (); - type ExistentialDeposit = ConstU128; - type AccountStore = System; - type WeightInfo = pallet_balances::weights::SubstrateWeight; - type FreezeIdentifier = (); - type MaxFreezes = (); - type RuntimeHoldReason = (); - type MaxHolds = (); -} - -parameter_types! { - pub FeeMultiplier: Multiplier = Multiplier::one(); -} - -impl pallet_transaction_payment::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type OnChargeTransaction = CurrencyAdapter; - type OperationalFeeMultiplier = ConstU8<5>; - type WeightToFee = IdentityFee; - type LengthToFee = IdentityFee; - type FeeMultiplierUpdate = ConstFeeMultiplier; -} - impl pallet_sudo::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeCall = RuntimeCall; @@ -274,7 +238,7 @@ impl pallet_sudo::Config for Runtime { impl pallet_chronicle::Config for Runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = pallet_chronicle::weights::SubstrateWeight; - type OperationList = Vec; + type OperationSubmission = pallet_chronicle::chronicle_core::OperationSubmission; } // Create the runtime by composing the FRAME pallets that were previously configured. @@ -284,10 +248,7 @@ construct_runtime!( Timestamp: pallet_timestamp, Aura: pallet_aura, Grandpa: pallet_grandpa, - Balances: pallet_balances, - TransactionPayment: pallet_transaction_payment, Sudo: pallet_sudo, - // Include the custom logic from the pallet-template in the runtime. Chronicle: pallet_chronicle, } ); @@ -298,6 +259,7 @@ pub type Address = sp_runtime::MultiAddress; pub type Header = generic::Header; /// Block type as expected by this runtime. pub type Block = generic::Block; + /// The SignedExtension to the basic transaction logic. pub type SignedExtra = ( frame_system::CheckNonZeroSender, @@ -305,9 +267,8 @@ pub type SignedExtra = ( frame_system::CheckTxVersion, frame_system::CheckGenesis, frame_system::CheckEra, - frame_system::CheckNonce, + no_nonce_fees::CheckNonce, frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, ); /// Unchecked extrinsic type as expected by this runtime. @@ -333,7 +294,6 @@ mod benches { define_benchmarks!( [frame_benchmarking, BaselineBench::] [frame_system, SystemBench::] - [pallet_balances, Balances] [pallet_timestamp, Timestamp] [pallet_sudo, Sudo] [pallet_chronicle, Chronicle] @@ -341,6 +301,13 @@ mod benches { } impl_runtime_apis! { + impl runtime_api_chronicle::ChronicleApi for Runtime { + // Purely to keep runtime api dependencies in place + fn placeholder() -> u32 { + 0 + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION @@ -464,49 +431,6 @@ impl_runtime_apis! { } } - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi for Runtime { - fn query_info( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details( - uxt: ::Extrinsic, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentCallApi - for Runtime - { - fn query_call_info( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::RuntimeDispatchInfo { - TransactionPayment::query_call_info(call, len) - } - fn query_call_fee_details( - call: RuntimeCall, - len: u32, - ) -> pallet_transaction_payment::FeeDetails { - TransactionPayment::query_call_fee_details(call, len) - } - fn query_weight_to_fee(weight: Weight) -> Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> Balance { - TransactionPayment::length_to_fee(length) - } - } #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { diff --git a/node/runtime-chronicle/src/no_nonce_fees.rs b/node/runtime-chronicle/src/no_nonce_fees.rs new file mode 100644 index 000000000..69dcdaeb3 --- /dev/null +++ b/node/runtime-chronicle/src/no_nonce_fees.rs @@ -0,0 +1,106 @@ +use frame_support::dispatch::DispatchInfo; +use frame_system::{Account, Config}; +use parity_scale_codec::{Decode, Encode}; +use scale_info::TypeInfo; +use sp_runtime::{ + traits::{DispatchInfoOf, Dispatchable, One, SignedExtension, Zero}, + transaction_validity::{ + InvalidTransaction, TransactionLongevity, TransactionValidity, TransactionValidityError, + ValidTransaction, + }, +}; +use sp_std::vec; + +/// Nonce check and increment to give replay protection for transactions. +/// +/// # Transaction Validity +/// +/// This extension affects `requires` and `provides` tags of validity, but DOES NOT +/// set the `priority` field. Make sure that AT LEAST one of the signed extension sets +/// some kind of priority upon validating transactions. +#[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub struct CheckNonce(#[codec(compact)] pub T::Nonce); + +impl CheckNonce { + /// utility constructor. Used only in client/factory code. + pub fn from(nonce: T::Nonce) -> Self { + Self(nonce) + } +} + +impl sp_std::fmt::Debug for CheckNonce { + #[cfg(feature = "std")] + fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + write!(f, "CheckNonce({})", self.0) + } + + #[cfg(not(feature = "std"))] + fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { + Ok(()) + } +} + +impl SignedExtension for CheckNonce +where + T::RuntimeCall: Dispatchable, +{ + type AccountId = T::AccountId; + type Call = T::RuntimeCall; + type AdditionalSigned = (); + type Pre = (); + const IDENTIFIER: &'static str = "CheckNonce"; + + fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { + Ok(()) + } + + fn pre_dispatch( + self, + who: &Self::AccountId, + _call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> Result<(), TransactionValidityError> { + let mut account = Account::::get(who); + if self.0 != account.nonce { + return Err(if self.0 < account.nonce { + InvalidTransaction::Stale + } else { + InvalidTransaction::Future + } + .into()) + } + account.nonce += T::Nonce::one(); + Account::::insert(who, account); + Ok(()) + } + + fn validate( + &self, + who: &Self::AccountId, + _call: &Self::Call, + _info: &DispatchInfoOf, + _len: usize, + ) -> TransactionValidity { + let account = Account::::get(who); + if self.0 < account.nonce { + return InvalidTransaction::Stale.into() + } + + let provides = vec![Encode::encode(&(who, self.0))]; + let requires = if account.nonce < self.0 { + vec![Encode::encode(&(who, self.0 - One::one()))] + } else { + vec![] + }; + + Ok(ValidTransaction { + priority: 0, + requires, + provides, + longevity: TransactionLongevity::max_value(), + propagate: true, + }) + } +} diff --git a/node/runtime-chronicle/tree.txt b/node/runtime-chronicle/tree.txt new file mode 100644 index 000000000..d72bd583d --- /dev/null +++ b/node/runtime-chronicle/tree.txt @@ -0,0 +1,896 @@ +runtime-chronicle v4.0.0 (/Users/ryan/code/chronicle/node/runtime-chronicle) +├── frame-executive v24.0.0 +│ ├── frame-support v24.0.0 +│ │ ├── aquamarine v0.3.2 (proc-macro) +│ │ │ ├── include_dir v0.7.3 +│ │ │ │ └── include_dir_macros v0.7.3 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 +│ │ │ │ │ └── unicode-ident v1.0.12 +│ │ │ │ └── quote v1.0.33 +│ │ │ │ └── proc-macro2 v1.0.69 (*) +│ │ │ ├── itertools v0.10.5 +│ │ │ │ └── either v1.9.0 +│ │ │ ├── proc-macro-error v1.0.4 +│ │ │ │ ├── proc-macro-error-attr v1.0.4 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ └── quote v1.0.33 (*) +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v1.0.109 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── unicode-ident v1.0.12 +│ │ │ │ [build-dependencies] +│ │ │ │ └── version_check v0.9.4 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── bitflags v1.3.2 +│ │ ├── docify v0.2.6 +│ │ │ └── docify_macros v0.2.6 (proc-macro) +│ │ │ ├── common-path v1.0.0 +│ │ │ ├── derive-syn-parse v0.1.5 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v1.0.109 (*) +│ │ │ ├── once_cell v1.18.0 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ ├── regex v1.10.2 +│ │ │ │ ├── aho-corasick v1.1.2 +│ │ │ │ │ └── memchr v2.6.4 +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ ├── regex-automata v0.4.3 +│ │ │ │ │ ├── aho-corasick v1.1.2 (*) +│ │ │ │ │ ├── memchr v2.6.4 +│ │ │ │ │ └── regex-syntax v0.8.2 +│ │ │ │ └── regex-syntax v0.8.2 +│ │ │ ├── syn v2.0.38 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── unicode-ident v1.0.12 +│ │ │ ├── termcolor v1.3.0 +│ │ │ ├── toml v0.7.8 +│ │ │ │ ├── serde v1.0.190 +│ │ │ │ │ └── serde_derive v1.0.190 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── serde_spanned v0.6.4 +│ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ ├── toml_datetime v0.6.5 +│ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ └── toml_edit v0.19.15 +│ │ │ │ ├── indexmap v2.0.2 +│ │ │ │ │ ├── equivalent v1.0.1 +│ │ │ │ │ └── hashbrown v0.14.2 +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── serde_spanned v0.6.4 (*) +│ │ │ │ ├── toml_datetime v0.6.5 (*) +│ │ │ │ └── winnow v0.5.17 +│ │ │ └── walkdir v2.4.0 +│ │ │ └── same-file v1.0.6 +│ │ ├── environmental v1.1.4 +│ │ ├── frame-metadata v16.0.0 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── parity-scale-codec v3.6.5 +│ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ ├── byte-slice-cast v1.2.2 +│ │ │ │ ├── bytes v1.5.0 +│ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v1.0.109 (*) +│ │ │ │ ├── parity-scale-codec-derive v3.6.5 (proc-macro) +│ │ │ │ │ ├── proc-macro-crate v1.1.3 +│ │ │ │ │ │ ├── thiserror v1.0.50 +│ │ │ │ │ │ │ └── thiserror-impl v1.0.50 (proc-macro) +│ │ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ └── toml v0.5.11 +│ │ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v1.0.109 (*) +│ │ │ │ └── serde v1.0.190 +│ │ │ │ └── serde_derive v1.0.190 (proc-macro) (*) +│ │ │ └── scale-info v2.10.0 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── derive_more v0.99.17 (proc-macro) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v1.0.109 (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info-derive v2.10.0 (proc-macro) +│ │ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v1.0.109 (*) +│ │ │ └── serde v1.0.190 (*) +│ │ ├── frame-support-procedural v19.0.0 (proc-macro) +│ │ │ ├── Inflector v0.11.4 +│ │ │ │ ├── lazy_static v1.4.0 +│ │ │ │ └── regex v1.10.2 (*) +│ │ │ ├── cfg-expr v0.15.5 +│ │ │ │ └── smallvec v1.11.1 +│ │ │ ├── derive-syn-parse v0.1.5 (proc-macro) (*) +│ │ │ ├── expander v2.0.0 +│ │ │ │ ├── blake2 v0.10.6 +│ │ │ │ │ └── digest v0.10.7 +│ │ │ │ │ ├── block-buffer v0.10.4 +│ │ │ │ │ │ └── generic-array v0.14.7 +│ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ │ ├── crypto-common v0.1.6 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── fs-err v2.9.0 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── frame-support-procedural-tools v8.0.0 +│ │ │ │ ├── frame-support-procedural-tools-derive v9.0.0 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── itertools v0.10.5 (*) +│ │ │ ├── macro_magic v0.4.2 +│ │ │ │ ├── macro_magic_core v0.4.2 +│ │ │ │ │ ├── const-random v0.1.16 +│ │ │ │ │ │ └── const-random-macro v0.1.16 (proc-macro) +│ │ │ │ │ │ ├── getrandom v0.2.10 +│ │ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ │ └── libc v0.2.149 +│ │ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ │ └── tiny-keccak v2.0.2 +│ │ │ │ │ │ └── crunchy v0.2.2 +│ │ │ │ │ ├── derive-syn-parse v0.1.5 (proc-macro) (*) +│ │ │ │ │ ├── macro_magic_core_macros v0.4.3 (proc-macro) +│ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── macro_magic_macros v0.4.2 (proc-macro) +│ │ │ │ │ ├── macro_magic_core v0.4.2 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── proc-macro-warning v0.4.2 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ ├── k256 v0.13.1 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── ecdsa v0.16.8 +│ │ │ │ ├── der v0.7.8 +│ │ │ │ │ ├── const-oid v0.9.5 +│ │ │ │ │ └── zeroize v1.6.0 +│ │ │ │ │ └── zeroize_derive v1.4.2 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── digest v0.10.7 +│ │ │ │ │ ├── block-buffer v0.10.4 +│ │ │ │ │ │ └── generic-array v0.14.7 +│ │ │ │ │ │ ├── typenum v1.17.0 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ │ ├── const-oid v0.9.5 +│ │ │ │ │ ├── crypto-common v0.1.6 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ ├── elliptic-curve v0.13.6 +│ │ │ │ │ ├── base16ct v0.2.0 +│ │ │ │ │ ├── crypto-bigint v0.5.3 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ ├── ff v0.13.0 +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ ├── group v0.13.0 +│ │ │ │ │ │ ├── ff v0.13.0 (*) +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ ├── sec1 v0.7.3 +│ │ │ │ │ │ ├── base16ct v0.2.0 +│ │ │ │ │ │ ├── der v0.7.8 (*) +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── rfc6979 v0.4.0 +│ │ │ │ │ ├── hmac v0.12.1 +│ │ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ └── signature v2.1.0 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ └── rand_core v0.6.4 +│ │ │ ├── elliptic-curve v0.13.6 (*) +│ │ │ └── sha2 v0.10.8 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ └── digest v0.10.7 (*) +│ │ ├── log v0.4.20 +│ │ ├── macro_magic v0.4.2 +│ │ │ └── macro_magic_macros v0.4.2 (proc-macro) (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── paste v1.0.14 (proc-macro) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── serde_json v1.0.107 +│ │ │ ├── itoa v1.0.9 +│ │ │ ├── ryu v1.0.15 +│ │ │ └── serde v1.0.190 (*) +│ │ ├── smallvec v1.11.1 +│ │ ├── sp-api v22.0.0 +│ │ │ ├── log v0.4.20 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── sp-api-proc-macro v11.0.0 (proc-macro) +│ │ │ │ ├── Inflector v0.11.4 (*) +│ │ │ │ ├── blake2 v0.10.6 (*) +│ │ │ │ ├── expander v2.0.0 (*) +│ │ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── sp-core v24.0.0 +│ │ │ │ ├── array-bytes v6.1.0 +│ │ │ │ ├── bitflags v1.3.2 +│ │ │ │ ├── blake2 v0.10.6 +│ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ ├── bounded-collections v0.1.9 +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ ├── bs58 v0.5.0 +│ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ ├── hash256-std-hasher v0.15.2 +│ │ │ │ │ └── crunchy v0.2.2 +│ │ │ │ ├── impl-serde v0.4.0 +│ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ ├── log v0.4.20 +│ │ │ │ ├── merlin v2.0.1 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── keccak v0.1.4 +│ │ │ │ │ ├── rand_core v0.5.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ │ ├── primitive-types v0.12.2 +│ │ │ │ │ ├── fixed-hash v0.8.0 +│ │ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ │ ├── impl-codec v0.6.0 +│ │ │ │ │ │ └── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── impl-serde v0.4.0 (*) +│ │ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ │ └── uint v0.9.5 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── crunchy v0.2.2 +│ │ │ │ │ ├── hex v0.4.3 +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── schnorrkel v0.9.1 +│ │ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ │ ├── arrayvec v0.5.2 +│ │ │ │ │ ├── curve25519-dalek v2.1.3 +│ │ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ │ ├── digest v0.8.1 +│ │ │ │ │ │ │ └── generic-array v0.12.4 +│ │ │ │ │ │ │ └── typenum v1.17.0 +│ │ │ │ │ │ ├── rand_core v0.5.1 +│ │ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ ├── merlin v2.0.1 (*) +│ │ │ │ │ ├── rand_core v0.5.1 +│ │ │ │ │ ├── sha2 v0.8.2 +│ │ │ │ │ │ ├── block-buffer v0.7.3 +│ │ │ │ │ │ │ ├── block-padding v0.1.5 +│ │ │ │ │ │ │ │ └── byte-tools v0.3.1 +│ │ │ │ │ │ │ ├── byte-tools v0.3.1 +│ │ │ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ │ │ └── generic-array v0.12.4 (*) +│ │ │ │ │ │ ├── digest v0.8.1 (*) +│ │ │ │ │ │ ├── fake-simd v0.1.2 +│ │ │ │ │ │ └── opaque-debug v0.2.3 +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── secrecy v0.8.0 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sp-core-hashing v12.0.0 +│ │ │ │ │ ├── blake2b_simd v1.0.2 +│ │ │ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ │ │ └── constant_time_eq v0.3.0 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ ├── sha2 v0.10.8 (*) +│ │ │ │ │ ├── sha3 v0.10.8 +│ │ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ │ └── keccak v0.1.4 +│ │ │ │ │ └── twox-hash v1.6.3 +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── sp-runtime-interface v20.0.0 +│ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── primitive-types v0.12.2 (*) +│ │ │ │ │ ├── sp-externalities v0.22.0 +│ │ │ │ │ │ ├── environmental v1.1.4 +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ │ └── sp-storage v16.0.0 +│ │ │ │ │ │ ├── impl-serde v0.4.0 (*) +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── ref-cast v1.0.20 +│ │ │ │ │ │ │ └── ref-cast-impl v1.0.20 (proc-macro) +│ │ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ │ │ │ │ │ └── sp-std v11.0.0 +│ │ │ │ │ ├── sp-runtime-interface-proc-macro v14.0.0 (proc-macro) +│ │ │ │ │ │ ├── Inflector v0.11.4 (*) +│ │ │ │ │ │ ├── proc-macro-crate v1.1.3 (*) +│ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ ├── sp-storage v16.0.0 (*) +│ │ │ │ │ ├── sp-tracing v13.0.0 +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ │ ├── tracing v0.1.40 +│ │ │ │ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ │ │ │ ├── tracing-attributes v0.1.27 (proc-macro) +│ │ │ │ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ │ │ │ └── tracing-core v0.1.32 +│ │ │ │ │ │ └── tracing-core v0.1.32 +│ │ │ │ │ ├── sp-wasm-interface v17.0.0 +│ │ │ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ └── sp-std v11.0.0 +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ ├── sp-storage v16.0.0 (*) +│ │ │ │ ├── ss58-registry v1.43.0 +│ │ │ │ │ [build-dependencies] +│ │ │ │ │ ├── Inflector v0.11.4 (*) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── serde_json v1.0.107 +│ │ │ │ │ │ ├── itoa v1.0.9 +│ │ │ │ │ │ ├── ryu v1.0.15 +│ │ │ │ │ │ └── serde v1.0.190 (*) +│ │ │ │ │ └── unicode-xid v0.2.4 +│ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ ├── sp-metadata-ir v0.3.0 +│ │ │ │ ├── frame-metadata v16.0.0 (*) +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ └── sp-std v11.0.0 +│ │ │ ├── sp-runtime v27.0.0 +│ │ │ │ ├── either v1.9.0 +│ │ │ │ ├── hash256-std-hasher v0.15.2 (*) +│ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ ├── log v0.4.20 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── paste v1.0.14 (proc-macro) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── sp-application-crypto v26.0.0 +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ ├── sp-io v26.0.0 +│ │ │ │ │ │ ├── bytes v1.5.0 +│ │ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ │ │ │ ├── sp-runtime-interface v20.0.0 (*) +│ │ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ │ ├── sp-tracing v13.0.0 (*) +│ │ │ │ │ │ ├── tracing v0.1.40 (*) +│ │ │ │ │ │ └── tracing-core v0.1.32 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── rustversion v1.0.14 (proc-macro) +│ │ │ │ │ └── sp-std v11.0.0 +│ │ │ │ ├── sp-arithmetic v19.0.0 +│ │ │ │ │ ├── integer-sqrt v0.1.5 +│ │ │ │ │ │ └── num-traits v0.2.17 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── autocfg v1.1.0 +│ │ │ │ │ ├── num-traits v0.2.17 (*) +│ │ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ ├── sp-io v26.0.0 (*) +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ └── sp-weights v23.0.0 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── serde v1.0.190 (*) +│ │ │ │ ├── smallvec v1.11.1 +│ │ │ │ ├── sp-arithmetic v19.0.0 (*) +│ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ │ │ │ └── sp-std v11.0.0 +│ │ │ ├── sp-std v11.0.0 +│ │ │ └── sp-version v25.0.0 +│ │ │ ├── impl-serde v0.4.0 (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── sp-core-hashing-proc-macro v12.0.0 (proc-macro) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ ├── sp-core-hashing v12.0.0 +│ │ │ │ │ ├── blake2b_simd v1.0.2 +│ │ │ │ │ │ ├── arrayref v0.3.7 +│ │ │ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ │ │ └── constant_time_eq v0.3.0 +│ │ │ │ │ ├── byteorder v1.5.0 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ ├── sha2 v0.10.8 +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ ├── cpufeatures v0.2.11 +│ │ │ │ │ │ │ └── libc v0.2.149 +│ │ │ │ │ │ └── digest v0.10.7 (*) +│ │ │ │ │ ├── sha3 v0.10.8 +│ │ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ │ └── keccak v0.1.4 +│ │ │ │ │ │ └── cpufeatures v0.2.11 (*) +│ │ │ │ │ └── twox-hash v1.6.3 +│ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ └── static_assertions v1.1.0 +│ │ │ │ └── syn v2.0.38 (*) +│ │ │ ├── sp-runtime v27.0.0 (*) +│ │ │ ├── sp-std v11.0.0 +│ │ │ └── sp-version-proc-macro v11.0.0 (proc-macro) +│ │ │ ├── parity-scale-codec v3.6.5 +│ │ │ │ ├── arrayvec v0.7.4 +│ │ │ │ ├── byte-slice-cast v1.2.2 +│ │ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ │ ├── parity-scale-codec-derive v3.6.5 (proc-macro) (*) +│ │ │ │ └── serde v1.0.190 (*) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── sp-arithmetic v19.0.0 (*) +│ │ ├── sp-core v24.0.0 (*) +│ │ ├── sp-core-hashing-proc-macro v12.0.0 (proc-macro) (*) +│ │ ├── sp-debug-derive v11.0.0 (proc-macro) (*) +│ │ ├── sp-genesis-builder v0.3.0 +│ │ │ ├── serde_json v1.0.107 (*) +│ │ │ ├── sp-api v22.0.0 (*) +│ │ │ ├── sp-runtime v27.0.0 (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-inherents v22.0.0 +│ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-io v26.0.0 (*) +│ │ ├── sp-metadata-ir v0.3.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-staking v22.0.0 +│ │ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ ├── sp-core v24.0.0 (*) +│ │ │ ├── sp-runtime v27.0.0 (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-std v11.0.0 +│ │ ├── sp-tracing v13.0.0 (*) +│ │ ├── sp-weights v23.0.0 (*) +│ │ ├── static_assertions v1.1.0 +│ │ └── tt-call v1.0.9 +│ ├── frame-system v24.0.0 +│ │ ├── cfg-if v1.0.0 +│ │ ├── frame-support v24.0.0 (*) +│ │ ├── log v0.4.20 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── sp-core v24.0.0 (*) +│ │ ├── sp-io v26.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-std v11.0.0 +│ │ ├── sp-version v25.0.0 (*) +│ │ └── sp-weights v23.0.0 (*) +│ ├── log v0.4.20 +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-core v24.0.0 (*) +│ ├── sp-io v26.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ ├── sp-std v11.0.0 +│ └── sp-tracing v13.0.0 (*) +├── frame-support v24.0.0 (*) +├── frame-system v24.0.0 (*) +├── frame-system-rpc-runtime-api v22.0.0 +│ ├── parity-scale-codec v3.6.5 (*) +│ └── sp-api v22.0.0 (*) +├── pallet-aura v23.0.0 +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── log v0.4.20 +│ ├── pallet-timestamp v23.0.0 +│ │ ├── docify v0.2.6 (*) +│ │ ├── frame-support v24.0.0 (*) +│ │ ├── frame-system v24.0.0 (*) +│ │ ├── log v0.4.20 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-inherents v22.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-std v11.0.0 +│ │ ├── sp-storage v16.0.0 (*) +│ │ └── sp-timestamp v22.0.0 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── sp-inherents v22.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-application-crypto v26.0.0 (*) +│ ├── sp-consensus-aura v0.28.0 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-api v22.0.0 (*) +│ │ ├── sp-application-crypto v26.0.0 (*) +│ │ ├── sp-consensus-slots v0.28.0 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── sp-std v11.0.0 +│ │ │ └── sp-timestamp v22.0.0 (*) +│ │ ├── sp-inherents v22.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-std v11.0.0 +│ │ └── sp-timestamp v22.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-std v11.0.0 +├── pallet-balances v24.0.0 +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── log v0.4.20 +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-std v11.0.0 +├── pallet-chronicle v0.7.5 (/Users/ryan/code/chronicle/crates/pallet-chronicle) +│ ├── common v0.7.5 (/Users/ryan/code/chronicle/crates/common) +│ │ ├── anyhow v1.0.75 +│ │ ├── async-trait v0.1.74 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v2.0.38 (*) +│ │ ├── chrono v0.4.31 +│ │ │ ├── js-sys v0.3.64 +│ │ │ │ └── wasm-bindgen v0.2.87 +│ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ └── wasm-bindgen-macro v0.2.87 (proc-macro) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ └── wasm-bindgen-macro-support v0.2.87 +│ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ ├── syn v2.0.38 (*) +│ │ │ │ ├── wasm-bindgen-backend v0.2.87 +│ │ │ │ │ ├── bumpalo v3.14.0 +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ ├── syn v2.0.38 (*) +│ │ │ │ │ └── wasm-bindgen-shared v0.2.87 +│ │ │ │ └── wasm-bindgen-shared v0.2.87 +│ │ │ ├── num-traits v0.2.17 (*) +│ │ │ ├── serde v1.0.190 (*) +│ │ │ └── wasm-bindgen v0.2.87 (*) +│ │ ├── futures v0.3.29 +│ │ │ ├── futures-channel v0.3.29 +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ └── futures-sink v0.3.29 +│ │ │ ├── futures-core v0.3.29 +│ │ │ ├── futures-executor v0.3.29 +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ ├── futures-task v0.3.29 +│ │ │ │ └── futures-util v0.3.29 +│ │ │ │ ├── futures-channel v0.3.29 (*) +│ │ │ │ ├── futures-core v0.3.29 +│ │ │ │ ├── futures-io v0.3.29 +│ │ │ │ ├── futures-macro v0.3.29 (proc-macro) +│ │ │ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ │ │ ├── quote v1.0.33 (*) +│ │ │ │ │ └── syn v2.0.38 (*) +│ │ │ │ ├── futures-sink v0.3.29 +│ │ │ │ ├── futures-task v0.3.29 +│ │ │ │ ├── memchr v2.6.4 +│ │ │ │ ├── pin-project-lite v0.2.13 +│ │ │ │ ├── pin-utils v0.1.0 +│ │ │ │ └── slab v0.4.9 +│ │ │ │ [build-dependencies] +│ │ │ │ └── autocfg v1.1.0 +│ │ │ ├── futures-io v0.3.29 +│ │ │ ├── futures-sink v0.3.29 +│ │ │ ├── futures-task v0.3.29 +│ │ │ └── futures-util v0.3.29 (*) +│ │ ├── glob v0.3.1 +│ │ ├── hex v0.4.3 +│ │ ├── iref v2.2.3 +│ │ │ ├── pct-str v1.2.0 +│ │ │ │ └── utf8-decode v1.0.1 +│ │ │ └── smallvec v1.11.1 +│ │ ├── iref-enum v2.1.0 (proc-macro) +│ │ │ ├── iref v2.2.3 +│ │ │ │ ├── pct-str v1.2.0 +│ │ │ │ │ └── utf8-decode v1.0.1 +│ │ │ │ └── smallvec v1.11.1 +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── k256 v0.11.6 +│ │ │ ├── cfg-if v1.0.0 +│ │ │ ├── ecdsa v0.14.8 +│ │ │ │ ├── der v0.6.1 +│ │ │ │ │ └── const-oid v0.9.5 +│ │ │ │ ├── elliptic-curve v0.12.3 +│ │ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ │ ├── crypto-bigint v0.4.9 +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ │ ├── ff v0.12.1 +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ ├── group v0.12.1 +│ │ │ │ │ │ ├── ff v0.12.1 (*) +│ │ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ │ └── subtle v2.4.1 +│ │ │ │ │ ├── pkcs8 v0.9.0 +│ │ │ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ │ │ └── spki v0.6.0 +│ │ │ │ │ │ └── der v0.6.1 (*) +│ │ │ │ │ ├── rand_core v0.6.4 +│ │ │ │ │ ├── sec1 v0.3.0 +│ │ │ │ │ │ ├── base16ct v0.1.1 +│ │ │ │ │ │ ├── der v0.6.1 (*) +│ │ │ │ │ │ ├── generic-array v0.14.7 (*) +│ │ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ │ ├── subtle v2.4.1 +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ ├── rfc6979 v0.3.1 +│ │ │ │ │ ├── crypto-bigint v0.4.9 (*) +│ │ │ │ │ ├── hmac v0.12.1 (*) +│ │ │ │ │ └── zeroize v1.6.0 (*) +│ │ │ │ └── signature v1.6.4 +│ │ │ │ ├── digest v0.10.7 (*) +│ │ │ │ └── rand_core v0.6.4 +│ │ │ ├── elliptic-curve v0.12.3 (*) +│ │ │ └── sha2 v0.10.8 (*) +│ │ ├── lazy_static v1.4.0 +│ │ ├── locspan v0.7.16 +│ │ ├── macro-attr-2018 v3.0.0 +│ │ ├── mime v0.3.17 +│ │ ├── newtype-derive-2018 v0.2.1 +│ │ │ └── generics v0.5.0 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── percent-encoding v2.3.0 +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── serde_derive v1.0.190 (proc-macro) (*) +│ │ ├── serde_json v1.0.107 (*) +│ │ ├── static-iref v2.0.0 (proc-macro) +│ │ │ └── iref v2.2.3 (*) +│ │ ├── thiserror v1.0.50 +│ │ │ └── thiserror-impl v1.0.50 (proc-macro) (*) +│ │ ├── thiserror-no-std v2.0.2 +│ │ │ └── thiserror-impl-no-std v2.0.2 (proc-macro) +│ │ │ ├── proc-macro2 v1.0.69 (*) +│ │ │ ├── quote v1.0.33 (*) +│ │ │ └── syn v1.0.109 (*) +│ │ ├── tracing v0.1.40 (*) +│ │ ├── url v2.4.1 +│ │ │ ├── form_urlencoded v1.2.0 +│ │ │ │ └── percent-encoding v2.3.0 +│ │ │ ├── idna v0.4.0 +│ │ │ │ ├── unicode-bidi v0.3.13 +│ │ │ │ └── unicode-normalization v0.1.22 +│ │ │ │ └── tinyvec v1.6.0 +│ │ │ │ └── tinyvec_macros v0.1.1 +│ │ │ └── percent-encoding v2.3.0 +│ │ └── uuid v1.5.0 +│ │ └── serde v1.0.190 (*) +│ │ [build-dependencies] +│ │ ├── glob v0.3.1 +│ │ ├── lazy_static v1.4.0 +│ │ └── serde_json v1.0.107 (*) +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── macro-attr-2018 v3.0.0 +│ ├── newtype-derive-2018 v0.2.1 (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-std v11.0.0 +│ ├── tracing v0.1.40 (*) +│ └── uuid v1.5.0 (*) +├── pallet-grandpa v24.0.0 +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── log v0.4.20 +│ ├── pallet-authorship v24.0.0 +│ │ ├── frame-support v24.0.0 (*) +│ │ ├── frame-system v24.0.0 (*) +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── pallet-session v24.0.0 +│ │ ├── frame-support v24.0.0 (*) +│ │ ├── frame-system v24.0.0 (*) +│ │ ├── impl-trait-for-tuples v0.2.2 (proc-macro) (*) +│ │ ├── log v0.4.20 +│ │ ├── pallet-timestamp v23.0.0 (*) +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── sp-core v24.0.0 (*) +│ │ ├── sp-io v26.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ ├── sp-session v23.0.0 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── scale-info v2.10.0 (*) +│ │ │ ├── sp-api v22.0.0 (*) +│ │ │ ├── sp-core v24.0.0 (*) +│ │ │ ├── sp-staking v22.0.0 (*) +│ │ │ └── sp-std v11.0.0 +│ │ ├── sp-staking v22.0.0 (*) +│ │ ├── sp-state-machine v0.31.0 +│ │ │ ├── hash-db v0.16.0 +│ │ │ ├── log v0.4.20 +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ ├── smallvec v1.11.1 +│ │ │ ├── sp-core v24.0.0 (*) +│ │ │ ├── sp-externalities v0.22.0 (*) +│ │ │ ├── sp-std v11.0.0 +│ │ │ ├── sp-trie v25.0.0 +│ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ ├── memory-db v0.32.0 +│ │ │ │ │ └── hash-db v0.16.0 +│ │ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ │ ├── scale-info v2.10.0 (*) +│ │ │ │ ├── sp-core v24.0.0 (*) +│ │ │ │ ├── sp-std v11.0.0 +│ │ │ │ ├── trie-db v0.28.0 +│ │ │ │ │ ├── hash-db v0.16.0 +│ │ │ │ │ ├── hashbrown v0.13.2 +│ │ │ │ │ │ └── ahash v0.8.6 +│ │ │ │ │ │ ├── cfg-if v1.0.0 +│ │ │ │ │ │ ├── once_cell v1.18.0 +│ │ │ │ │ │ └── zerocopy v0.7.20 +│ │ │ │ │ │ [build-dependencies] +│ │ │ │ │ │ └── version_check v0.9.4 +│ │ │ │ │ ├── log v0.4.20 +│ │ │ │ │ └── smallvec v1.11.1 +│ │ │ │ └── trie-root v0.18.0 +│ │ │ │ └── hash-db v0.16.0 +│ │ │ └── trie-db v0.28.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-application-crypto v26.0.0 (*) +│ ├── sp-consensus-grandpa v9.0.0 +│ │ ├── finality-grandpa v0.16.2 +│ │ │ ├── either v1.9.0 +│ │ │ ├── futures v0.3.29 (*) +│ │ │ ├── num-traits v0.2.17 (*) +│ │ │ ├── parity-scale-codec v3.6.5 (*) +│ │ │ └── scale-info v2.10.0 (*) +│ │ ├── log v0.4.20 +│ │ ├── parity-scale-codec v3.6.5 (*) +│ │ ├── scale-info v2.10.0 (*) +│ │ ├── serde v1.0.190 (*) +│ │ ├── sp-api v22.0.0 (*) +│ │ ├── sp-application-crypto v26.0.0 (*) +│ │ ├── sp-core v24.0.0 (*) +│ │ ├── sp-runtime v27.0.0 (*) +│ │ └── sp-std v11.0.0 +│ ├── sp-core v24.0.0 (*) +│ ├── sp-io v26.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ ├── sp-session v23.0.0 (*) +│ ├── sp-staking v22.0.0 (*) +│ └── sp-std v11.0.0 +├── pallet-sudo v24.0.0 +│ ├── docify v0.2.6 (*) +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-io v26.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-std v11.0.0 +├── pallet-timestamp v23.0.0 (*) +├── pallet-transaction-payment v24.0.0 +│ ├── frame-support v24.0.0 (*) +│ ├── frame-system v24.0.0 (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── scale-info v2.10.0 (*) +│ ├── sp-core v24.0.0 (*) +│ ├── sp-io v26.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-std v11.0.0 +├── pallet-transaction-payment-rpc-runtime-api v24.0.0 +│ ├── pallet-transaction-payment v24.0.0 (*) +│ ├── parity-scale-codec v3.6.5 (*) +│ ├── sp-api v22.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-weights v23.0.0 (*) +├── parity-scale-codec v3.6.5 (*) +├── scale-info v2.10.0 (*) +├── sp-api v22.0.0 (*) +├── sp-block-builder v22.0.0 +│ ├── sp-api v22.0.0 (*) +│ ├── sp-inherents v22.0.0 (*) +│ ├── sp-runtime v27.0.0 (*) +│ └── sp-std v11.0.0 +├── sp-consensus-aura v0.28.0 (*) +├── sp-consensus-grandpa v9.0.0 (*) +├── sp-core v24.0.0 (*) +├── sp-inherents v22.0.0 (*) +├── sp-offchain v22.0.0 +│ ├── sp-api v22.0.0 (*) +│ ├── sp-core v24.0.0 (*) +│ └── sp-runtime v27.0.0 (*) +├── sp-runtime v27.0.0 (*) +├── sp-session v23.0.0 (*) +├── sp-std v11.0.0 +├── sp-transaction-pool v22.0.0 +│ ├── sp-api v22.0.0 (*) +│ └── sp-runtime v27.0.0 (*) +└── sp-version v25.0.0 (*)