diff --git a/.gitignore b/.gitignore index 30cb36ee..69d45124 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ target .gdb_history .DS_Store +.vscode diff --git a/Cargo.lock b/Cargo.lock index a55fbe55..3eea02e5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,11 +14,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ - "gimli 0.26.2", + "gimli", ] [[package]] @@ -27,7 +27,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ - "gimli 0.27.3", + "gimli", ] [[package]] @@ -71,6 +71,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" dependencies = [ "cfg-if", + "getrandom 0.2.10", "once_cell", "version_check", ] @@ -255,9 +256,9 @@ dependencies = [ [[package]] name = "array-bytes" -version = "4.2.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" +checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" [[package]] name = "arrayref" @@ -310,7 +311,7 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" name = "avail-core" version = "0.5.1" dependencies = [ - "beefy-merkle-tree", + "binary-merkle-tree", "derive_more", "frame-support", "hash256-std-hasher", @@ -355,16 +356,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "base58" -version = "0.1.0" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base58" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" +checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" [[package]] name = "base58check" @@ -372,7 +373,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee2fe4c9a0c84515f136aaae2466744a721af6d63339c18689d9e995d74d99b" dependencies = [ - "base58 0.1.0", + "base58", "sha2 0.8.2", ] @@ -401,13 +402,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" [[package]] -name = "beefy-merkle-tree" +name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "sp-api", - "sp-beefy", - "sp-runtime", + "hash-db", + "log", ] [[package]] @@ -477,6 +477,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.7.3" @@ -527,6 +538,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "bounded-collections" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" +dependencies = [ + "log", + "parity-scale-codec", + "scale-info", + "serde", +] + [[package]] name = "bs58" version = "0.4.0" @@ -586,9 +609,9 @@ checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" [[package]] name = "cfg-expr" -version = "0.10.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aacacf4d96c24b2ad6eb8ee6df040e4f27b0d0b39a5710c30091baa830485db" +checksum = "b40ccee03b5175c18cde8f37e7d2a33bcef6f8ec8f7cc0d81090d1bb380949c9" dependencies = [ "smallvec", ] @@ -648,15 +671,6 @@ dependencies = [ "inout", ] -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" -dependencies = [ - "cfg-if", -] - [[package]] name = "clap" version = "4.3.11" @@ -694,7 +708,7 @@ dependencies = [ "digest 0.10.7", "getrandom 0.2.10", "hmac 0.12.1", - "k256", + "k256 0.11.6", "lazy_static", "serde", "sha2 0.10.7", @@ -745,6 +759,34 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" +[[package]] +name = "const-random" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +dependencies = [ + "getrandom 0.2.10", + "once_cell", + "proc-macro-hack", + "tiny-keccak", +] + +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "convert_case" version = "0.4.0" @@ -786,9 +828,9 @@ dependencies = [ [[package]] name = "cranelift-entity" -version = "0.88.2" +version = "0.95.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87a0f1b2fdc18776956370cf8d9b009ded3f855350c480c1c52142510961f352" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" dependencies = [ "serde", ] @@ -898,6 +940,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +dependencies = [ + "generic-array 0.14.7", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -973,6 +1027,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "derivative" version = "2.2.0" @@ -995,6 +1059,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -1033,16 +1108,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - [[package]] name = "dusk-bls12_381" version = "0.11.3" @@ -1126,10 +1196,24 @@ version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.7", + "digest 0.10.7", + "elliptic-curve 0.13.5", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -1138,7 +1222,7 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" dependencies = [ - "signature", + "signature 1.6.4", ] [[package]] @@ -1179,16 +1263,35 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", - "crypto-bigint", - "der", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", "digest 0.10.7", - "ff", + "ff 0.12.1", "generic-array 0.14.7", - "group", - "pkcs8", + "group 0.12.1", + "pkcs8 0.9.0", "rand_core 0.6.4", - "sec1", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.2", + "digest 0.10.7", + "ff 0.13.0", + "generic-array 0.14.7", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -1205,17 +1308,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.1" @@ -1317,11 +1409,11 @@ dependencies = [ "bytes", "chrono", "convert_case 0.6.0", - "elliptic-curve", + "elliptic-curve 0.12.3", "ethabi", "generic-array 0.14.7", "hex", - "k256", + "k256 0.11.6", "open-fastrlp", "proc-macro2", "rand 0.8.5", @@ -1345,7 +1437,7 @@ dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve", + "elliptic-curve 0.12.3", "eth-keystore", "ethers-core", "hex", @@ -1354,6 +1446,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "expander" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 2.0.25", +] + [[package]] name = "fake-simd" version = "0.1.2" @@ -1385,6 +1490,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -1403,11 +1518,20 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +dependencies = [ + "percent-encoding", +] + [[package]] name = "frame-metadata" -version = "15.1.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" +checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ "cfg-if", "parity-scale-codec", @@ -1418,15 +1542,16 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bitflags 1.3.2", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", - "k256", + "k256 0.13.1", "log", - "once_cell", + "macro_magic", "parity-scale-codec", "paste", "scale-info", @@ -1436,6 +1561,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", + "sp-debug-derive", "sp-inherents", "sp-io", "sp-runtime", @@ -1450,39 +1576,49 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "cfg-expr", + "derive-syn-parse", + "expander", "frame-support-procedural-tools", "itertools 0.10.5", + "macro_magic", + "proc-macro-warning", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] +[[package]] +name = "fs-err" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" + [[package]] name = "funty" version = "2.0.0" @@ -1596,6 +1732,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1624,20 +1761,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", + "indexmap 1.9.3", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - [[package]] name = "glob" version = "0.3.1" @@ -1650,7 +1782,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -1663,9 +1806,9 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hash-db" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" [[package]] name = "hash256-std-hasher" @@ -1799,6 +1942,16 @@ dependencies = [ "cc", ] +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -1885,12 +2038,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "io-lifetimes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -1953,12 +2100,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ "cfg-if", - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.7", "sha3", ] +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if", + "ecdsa 0.16.8", + "elliptic-curve 0.13.5", + "once_cell", + "sha2 0.10.7", +] + [[package]] name = "kate" version = "0.8.1" @@ -2087,9 +2247,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.0.46" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" @@ -2118,14 +2278,8 @@ name = "log" version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" dependencies = [ - "hashbrown 0.12.3", + "serde", ] [[package]] @@ -2137,6 +2291,54 @@ dependencies = [ "libc", ] +[[package]] +name = "macro_magic" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +dependencies = [ + "macro_magic_core", + "macro_magic_macros", + "quote", + "syn 2.0.25", +] + +[[package]] +name = "macro_magic_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +dependencies = [ + "const-random", + "derive-syn-parse", + "macro_magic_core_macros", + "proc-macro2", + "quote", + "syn 2.0.25", +] + +[[package]] +name = "macro_magic_core_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.25", +] + +[[package]] +name = "macro_magic_macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +dependencies = [ + "macro_magic_core", + "quote", + "syn 2.0.25", +] + [[package]] name = "matchers" version = "0.0.1" @@ -2162,11 +2364,20 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memfd" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +dependencies = [ + "rustix 0.37.23", +] + [[package]] name = "memoffset" -version = "0.6.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" dependencies = [ "autocfg", ] @@ -2182,20 +2393,13 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ "hash-db", - "hashbrown 0.12.3", ] -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - [[package]] name = "merlin" version = "2.0.1" @@ -2307,12 +2511,12 @@ name = "nomad-signature" version = "0.1.3" dependencies = [ "byte-slice-cast", - "elliptic-curve", + "elliptic-curve 0.12.3", "ethers-core", "frame-support", "generic-array 0.14.7", "hex", - "k256", + "k256 0.11.6", "parity-scale-codec", "scale-info", "serde", @@ -2369,7 +2573,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", - "num-bigint", "num-integer", "num-traits", ] @@ -2396,12 +2599,12 @@ dependencies = [ [[package]] name = "object" -version = "0.29.0" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "crc32fast", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "indexmap 1.9.3", "memchr", ] @@ -2517,7 +2720,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.1", ] [[package]] @@ -2558,6 +2761,12 @@ dependencies = [ "sha2 0.10.7", ] +[[package]] +name = "percent-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" + [[package]] name = "pin-project-lite" version = "0.2.10" @@ -2576,8 +2785,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der", - "spki", + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.7", + "spki 0.7.2", ] [[package]] @@ -2649,6 +2868,23 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro-warning" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.25", +] + [[package]] name = "proc-macro2" version = "1.0.64" @@ -2901,11 +3137,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -2965,16 +3211,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.14" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6380889b07a03b5ecf1d44dc9ede6fd2145d84b502a2a9ca0b03c48e0cc3220f" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ "bitflags 1.3.2", - "errno 0.2.8", - "io-lifetimes 0.7.5", + "errno", + "io-lifetimes", "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", ] [[package]] @@ -2984,8 +3230,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", - "errno 0.3.1", - "io-lifetimes 1.0.11", + "errno", + "io-lifetimes", "libc", "linux-raw-sys 0.3.8", "windows-sys 0.48.0", @@ -2998,7 +3244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" dependencies = [ "bitflags 2.3.3", - "errno 0.3.1", + "errno", "libc", "linux-raw-sys 0.4.3", "windows-sys 0.48.0", @@ -3081,6 +3327,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "schnellru" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +dependencies = [ + "ahash 0.8.3", + "cfg-if", + "hashbrown 0.13.2", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -3123,10 +3380,24 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", - "der", + "base16ct 0.1.1", + "der 0.6.1", + "generic-array 0.14.7", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.7", "generic-array 0.14.7", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -3260,6 +3531,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + [[package]] name = "simba" version = "0.8.1" @@ -3291,13 +3572,16 @@ checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", "parity-scale-codec", + "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", + "sp-metadata-ir", "sp-runtime", "sp-state-machine", "sp-std", @@ -3309,19 +3593,21 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "sp-application-crypto" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -3333,8 +3619,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "16.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "integer-sqrt", "num-traits", @@ -3345,32 +3631,16 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-beefy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-core" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "21.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", - "base58 0.2.0", "bitflags 1.3.2", "blake2", + "bounded-collections", + "bs58", "dyn-clonable", "ed25519-zebra", "futures", @@ -3383,6 +3653,7 @@ dependencies = [ "merlin 2.0.1", "parity-scale-codec", "parking_lot", + "paste", "primitive-types", "rand 0.8.5", "regex", @@ -3401,48 +3672,47 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.7", "sha2 0.10.7", "sha3", - "sp-std", "twox-hash", ] [[package]] name = "sp-core-hashing-proc-macro" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "9.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "proc-macro2", "quote", "sp-core-hashing", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "sp-debug-derive" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "sp-externalities" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "0.19.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "environmental", "parity-scale-codec", @@ -3453,12 +3723,12 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", - "sp-core", + "scale-info", "sp-runtime", "sp-std", "thiserror", @@ -3466,16 +3736,16 @@ dependencies = [ [[package]] name = "sp-io" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "23.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "ed25519", "ed25519-dalek", - "futures", "libsecp256k1", "log", "parity-scale-codec", + "rustversion", "secp256k1", "sp-core", "sp-externalities", @@ -3491,42 +3761,31 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "0.27.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "async-trait", - "futures", - "merlin 2.0.1", "parity-scale-codec", "parking_lot", - "schnorrkel", "sp-core", "sp-externalities", "thiserror", ] [[package]] -name = "sp-mmr-primitives" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +name = "sp-metadata-ir" +version = "0.1.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "ckb-merkle-mountain-range", - "log", + "frame-metadata", "parity-scale-codec", "scale-info", - "serde", - "sp-api", - "sp-core", - "sp-debug-derive", - "sp-runtime", "sp-std", - "thiserror", ] [[package]] name = "sp-panic-handler" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "backtrace", "lazy_static", @@ -3535,8 +3794,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "24.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "either", "hash256-std-hasher", @@ -3557,8 +3816,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "17.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -3575,23 +3834,25 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "11.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", + "serde", "sp-core", "sp-runtime", "sp-std", @@ -3599,8 +3860,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.13.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "0.28.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -3615,17 +3876,18 @@ dependencies = [ "sp-trie", "thiserror", "tracing", + "trie-db", ] [[package]] name = "sp-std" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "sp-storage" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -3637,8 +3899,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "10.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-std", @@ -3649,19 +3911,19 @@ dependencies = [ [[package]] name = "sp-trie" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ - "ahash 0.7.6", + "ahash 0.8.3", "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "lazy_static", - "lru", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot", "scale-info", + "schnellru", "sp-core", "sp-std", "thiserror", @@ -3672,8 +3934,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "5.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "22.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -3689,32 +3951,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "8.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.25", ] [[package]] name = "sp-wasm-interface" -version = "7.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "14.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ + "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", "sp-std", - "wasmi", "wasmtime", ] [[package]] name = "sp-weights" -version = "4.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.37#6fa7fe1326ecaab9921c2c3888530ad679cfbb87" +version = "20.0.0" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -3733,7 +3995,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.7", ] [[package]] @@ -4072,12 +4344,12 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.24.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "004e1e8f92535694b4cb1444dc5a8073ecf0815e3357f729638b9f8fc4062908" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ "hash-db", - "hashbrown 0.12.3", + "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -4085,9 +4357,9 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ "hash-db", ] @@ -4134,6 +4406,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" +[[package]] +name = "unicode-bidi" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" + [[package]] name = "unicode-ident" version = "1.0.10" @@ -4161,6 +4439,17 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "url" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + [[package]] name = "uuid" version = "0.8.2" @@ -4268,53 +4557,21 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[package]] -name = "wasmi" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c326c93fbf86419608361a2c925a31754cf109da1b8b55737070b4d6669422" -dependencies = [ - "parity-wasm", - "wasmi-validation", - "wasmi_core", -] - -[[package]] -name = "wasmi-validation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ff416ad1ff0c42e5a926ed5d5fab74c0f098749aa0ad8b2a34b982ce0e867b" -dependencies = [ - "parity-wasm", -] - -[[package]] -name = "wasmi_core" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d20cb3c59b788653d99541c646c561c9dd26506f25c0cebfe810659c54c6d7" -dependencies = [ - "downcast-rs", - "libm", - "memory_units", - "num-rational", - "num-traits", -] - [[package]] name = "wasmparser" -version = "0.89.1" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5d3e08b13876f96dd55608d03cd4883a0545884932d5adf11925876c96daef" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ "indexmap 1.9.3", + "url", ] [[package]] name = "wasmtime" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad5af6ba38311282f2a21670d96e78266e8c8e2f38cbcd52c254df6ccbc7731" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", @@ -4322,7 +4579,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "log", - "object 0.29.0", + "object 0.30.4", "once_cell", "paste", "psm", @@ -4332,30 +4589,30 @@ dependencies = [ "wasmtime-environ", "wasmtime-jit", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-asm-macros" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45de63ddfc8b9223d1adc8f7b2ee5f35d1f6d112833934ad7ea66e4f4339e597" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ "cfg-if", ] [[package]] name = "wasmtime-environ" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb881c61f4f627b5d45c54e629724974f8a8890d455bcbe634330cc27309644" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.26.2", + "gimli", "indexmap 1.9.3", "log", - "object 0.29.0", + "object 0.30.4", "serde", "target-lexicon", "thiserror", @@ -4365,42 +4622,52 @@ dependencies = [ [[package]] name = "wasmtime-jit" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1985c628011fe26adf5e23a5301bdc79b245e0e338f14bb58b39e4e25e4d8681" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" dependencies = [ - "addr2line 0.17.0", + "addr2line 0.19.0", "anyhow", "bincode", "cfg-if", "cpp_demangle", - "gimli 0.26.2", + "gimli", "log", - "object 0.29.0", + "object 0.30.4", "rustc-demangle", - "rustix 0.35.14", "serde", "target-lexicon", - "thiserror", "wasmtime-environ", + "wasmtime-jit-icache-coherence", "wasmtime-runtime", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-jit-debug" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f671b588486f5ccec8c5a3dba6b4c07eac2e66ab8c60e6f4e53717c77f709731" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "once_cell", ] +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "wasmtime-runtime" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8f92ad4b61736339c29361da85769ebc200f184361959d1792832e592a1afd" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", @@ -4409,22 +4676,22 @@ dependencies = [ "libc", "log", "mach", - "memoffset 0.6.5", + "memfd", + "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.35.14", - "thiserror", + "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", - "windows-sys 0.36.1", + "windows-sys 0.45.0", ] [[package]] name = "wasmtime-types" -version = "1.0.2" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23d61cb4c46e837b431196dd06abb11731541021916d03476a178b54dc07aeb" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" dependencies = [ "cranelift-entity", "serde", @@ -4479,27 +4746,32 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.1", ] [[package]] name = "windows-sys" -version = "0.36.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", + "windows-targets 0.42.2", ] [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.1", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", @@ -4510,15 +4782,6 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.48.1" @@ -4546,12 +4809,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4564,12 +4821,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4582,12 +4833,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4600,12 +4845,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4630,12 +4869,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" diff --git a/Cargo.toml b/Cargo.toml index 78b33c31..3d99282c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,28 +9,28 @@ members = [ "nomad/merkle", ] [patch.crates-io] -# Substrate (polkadot-v0.9.37). -sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-core-hashing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-weights = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } -sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" } +# Substrate (polkadot-v1.0.0). +sp-core = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-core-hashing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-io = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-std = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-application-crypto = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-storage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-debug-derive = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-arithmetic = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-trie = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-runtime-interface = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-weights = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +frame-support = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-externalities = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-inherents = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-staking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-state-machine = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-tracing = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-version = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } +sp-wasm-interface = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } [profile.dev.package] nalgebra = { opt-level = 3 } diff --git a/core/Cargo.toml b/core/Cargo.toml index cab64c4c..9fdff3d5 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -11,12 +11,12 @@ derive_more = { version = "0.99.17", default-features = false, features = ["cons hash256-std-hasher = { version = "0.15.2", default-features = false } hex = { version = "0.4", optional = true, default-features = false, features = ["alloc", "serde"] } log = { version = "0.4.8", default-features = false } -serde = { version = "1", optional = true, features = ["derive"] } +serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"], optional = true } static_assertions = "1.1.0" thiserror-no-std = "2.0.2" # Substrate -beefy-merkle-tree = { git = "https://github.com/paritytech/substrate.git/", branch = "polkadot-v0.9.37", default-features = false, optional = true } +binary-merkle-tree = { git = "https://github.com/paritytech/substrate.git/", branch = "polkadot-v1.0.0", default-features = false, optional = true } codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "max-encoded-len"] } scale-info = { version = "2", default-features = false, features = ["derive"] } sp-arithmetic = { version = "*", default-features = false } @@ -27,8 +27,8 @@ sp-trie = { version = "*", default-features = false } # Substrate Runtime frame-support = { version = "4.0.0-dev", default-features = false, optional = true } -sp-runtime = { version = "7", default-features = false, optional = true } -sp-runtime-interface = { version = "7", default-features = false, optional = true } +sp-runtime = { version = "24", default-features = false, optional = true } +sp-runtime-interface = { version = "17", default-features = false, optional = true } [dev-dependencies] hex-literal = "0.3.4" @@ -38,7 +38,7 @@ test-case = "1.2.3" [features] default = ["std"] std = [ - "serde", + "serde/std", "hex", "codec/std", "scale-info/std", @@ -49,17 +49,18 @@ std = [ "sp-trie/std", "sp-arithmetic/std", "hash256-std-hasher/std", - "beefy-merkle-tree?/std", + "binary-merkle-tree?/std", "derive_more/display", "sp-runtime-interface?/std", "sp-runtime?/std", "frame-support?/std", ] runtime = [ + "serde", "sp-runtime-interface", "sp-runtime", "frame-support", - "beefy-merkle-tree", + "binary-merkle-tree", ] header-backward-compatibility-test = [] @@ -67,3 +68,8 @@ try-runtime = [ "runtime", "sp-runtime/try-runtime", ] +serde = [ + "dep:serde", + "hex/serde", + "log/serde", +] diff --git a/core/src/app_extrinsic.rs b/core/src/app_extrinsic.rs index 76e8db2a..f1b0e5b7 100644 --- a/core/src/app_extrinsic.rs +++ b/core/src/app_extrinsic.rs @@ -2,7 +2,7 @@ use crate::traits::GetAppId; use codec::{Decode, Encode}; use derive_more::Constructor; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::RuntimeDebug; use sp_std::vec::Vec; @@ -11,10 +11,10 @@ use crate::AppId; /// Raw Extrinsic with application id. #[derive(Clone, TypeInfo, Default, Encode, Decode, RuntimeDebug, Constructor)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct AppExtrinsic { pub app_id: AppId, - #[cfg_attr(feature = "std", serde(with = "hex"))] + #[cfg_attr(feature = "serde", serde(with = "hex"))] pub data: Vec, } diff --git a/core/src/asdr.rs b/core/src/asdr.rs index 9f9e2bab..8e0c382b 100644 --- a/core/src/asdr.rs +++ b/core/src/asdr.rs @@ -28,6 +28,8 @@ use sp_runtime::{ }, transaction_validity::{InvalidTransaction, TransactionValidityError}, }; +#[cfg(all(not(feature = "std"), feature = "serde"))] +use sp_std::alloc::format; use sp_std::{ convert::TryFrom, fmt::{Debug, Formatter, Result as FmtResult}, @@ -46,6 +48,9 @@ use crate::{traits::GetAppId, AppId, OpaqueExtrinsic}; /// the decoding fails. pub const EXTRINSIC_FORMAT_VERSION: u8 = 4; +/// The `SingaturePayload` of `UncheckedExtrinsic`. +type AppUncheckedSignaturePayload = (Address, Signature, Extra); + /// A extrinsic right from the external world. This is unchecked and so /// can contain a signature. #[derive(PartialEq, Eq, Clone)] @@ -56,7 +61,7 @@ where /// The signature, address, number of extrinsics have come before from /// the same signer and an era describing the longevity of this transaction, /// if this is a signed extrinsic. - pub signature: Option<(Address, Signature, Extra)>, + pub signature: Option>, /// The function that should be called. pub function: Call, } @@ -142,12 +147,12 @@ where } } -impl Extrinsic - for AppUncheckedExtrinsic +impl + Extrinsic for AppUncheckedExtrinsic { type Call = Call; - type SignaturePayload = (Address, Signature, Extra); + type SignaturePayload = AppUncheckedSignaturePayload; fn is_signed(&self) -> Option { Some(self.signature.is_some()) @@ -407,7 +412,7 @@ where { } -#[cfg(feature = "std")] +#[cfg(feature = "serde")] impl serde::Serialize for AppUncheckedExtrinsic { @@ -420,7 +425,7 @@ impl s } } -#[cfg(feature = "std")] +#[cfg(feature = "serde")] impl<'a, Address: Decode, Signature: Decode, Call: Decode, Extra: SignedExtension> serde::Deserialize<'a> for AppUncheckedExtrinsic { @@ -468,7 +473,10 @@ where impl frame_support::traits::ExtrinsicCall for AppUncheckedExtrinsic where - Extra: SignedExtension, + Address: TypeInfo, + Call: TypeInfo, + Signature: TypeInfo, + Extra: SignedExtension + TypeInfo, { fn call(&self) -> &Self::Call { &self.function diff --git a/core/src/da_block.rs b/core/src/da_block.rs new file mode 100644 index 00000000..cc352c96 --- /dev/null +++ b/core/src/da_block.rs @@ -0,0 +1,169 @@ +// This file is part of Substrate. + +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Generic implementation of a DA block and associated items. + +#[cfg(feature = "std")] +use std::fmt; + +use crate::traits::{DaHeaderProvider, ExtendedBlock, ExtendedHeader}; +use codec::{Codec, Decode, Encode}; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; +use sp_core::RuntimeDebug; +use sp_runtime::{ + traits::{ + self, Block as BlockT, Header as HeaderT, MaybeSerialize, MaybeSerializeDeserialize, + Member, NumberFor, + }, + Justifications, +}; +use sp_std::prelude::*; + +/// Something to identify a block. +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] +pub enum BlockId { + /// Identify by block header hash. + Hash(Block::Hash), + /// Identify by block number. + Number(NumberFor), +} + +impl BlockId { + /// Create a block ID from a hash. + pub const fn hash(hash: Block::Hash) -> Self { + BlockId::Hash(hash) + } + + /// Create a block ID from a number. + pub const fn number(number: NumberFor) -> Self { + BlockId::Number(number) + } + + /// Check if this block ID refers to the pre-genesis state. + pub fn is_pre_genesis(&self) -> bool { + match self { + BlockId::Hash(hash) => hash == &Default::default(), + BlockId::Number(_) => false, + } + } + + /// Create a block ID for a pre-genesis state. + pub fn pre_genesis() -> Self { + BlockId::Hash(Default::default()) + } +} + +impl Copy for BlockId {} + +#[cfg(feature = "std")] +impl fmt::Display for BlockId { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{:?}", self) + } +} + +/// Abstraction over a substrate block. +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug, scale_info::TypeInfo)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", serde(deny_unknown_fields))] +pub struct DaBlock { + /// The block header. + pub header: Header, + /// The accompanying extrinsics. + pub extrinsics: Vec, +} + +impl traits::HeaderProvider for DaBlock +where + Header: HeaderT, +{ + type HeaderT = Header; +} + +impl BlockT for DaBlock +where + Header: HeaderT + MaybeSerializeDeserialize, + Extrinsic: Member + Codec + MaybeSerializeDeserialize + traits::Extrinsic, +{ + type Extrinsic = Extrinsic; + type Header = Header; + type Hash = ::Hash; + + fn header(&self) -> &Self::Header { + &self.header + } + fn extrinsics(&self) -> &[Self::Extrinsic] { + &self.extrinsics[..] + } + fn deconstruct(self) -> (Self::Header, Vec) { + (self.header, self.extrinsics) + } + fn new(header: Self::Header, extrinsics: Vec) -> Self { + DaBlock { header, extrinsics } + } + fn encode_from(header: &Self::Header, extrinsics: &[Self::Extrinsic]) -> Vec { + (header, extrinsics).encode() + } +} + +/// Abstraction over a substrate block and justification. +#[derive(PartialEq, Eq, Clone, Encode, Decode, RuntimeDebug)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", serde(deny_unknown_fields))] +pub struct SignedBlock { + /// Full block. + pub block: Block, + /// Block justification. + pub justifications: Option, +} + +impl ExtendedBlock for DaBlock +where + Header: HeaderT + + MaybeSerializeDeserialize + + ExtendedHeader< +
::Number, +
::Hash, + sp_runtime::Digest, + Extension, + >, + Extrinsic: Member + Codec + traits::Extrinsic + MaybeSerializeDeserialize, +{ + type DaHeader = Header; +} + +impl + DaHeaderProvider< +
::Number, +
::Hash, + sp_runtime::Digest, + Extension, + > for DaBlock +where + Header: HeaderT + + ExtendedHeader< +
::Number, +
::Hash, + sp_runtime::Digest, + Extension, + >, +{ + type DaHeader = Header; +} diff --git a/core/src/data_lookup/compact.rs b/core/src/data_lookup/compact.rs index 5a347479..77215ad9 100644 --- a/core/src/data_lookup/compact.rs +++ b/core/src/data_lookup/compact.rs @@ -5,12 +5,12 @@ use derive_more::Constructor; use scale_info::TypeInfo; use sp_std::vec::Vec; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; #[derive(Copy, Clone, Encode, Decode, TypeInfo, Constructor, Debug)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct DataLookupItem { pub app_id: AppId, #[codec(compact)] @@ -31,7 +31,7 @@ where } #[derive(Encode, Decode, TypeInfo, Constructor, Debug, Clone)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct CompactDataLookup { /// size of the look up #[codec(compact)] diff --git a/core/src/data_lookup/mod.rs b/core/src/data_lookup/mod.rs index d6eb6572..6753af3b 100644 --- a/core/src/data_lookup/mod.rs +++ b/core/src/data_lookup/mod.rs @@ -5,7 +5,7 @@ use sp_core::RuntimeDebug; use sp_std::{ops::Range, vec::Vec}; use thiserror_no_std::Error; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use crate::{ensure, AppId}; @@ -26,9 +26,9 @@ pub enum Error { } #[derive(PartialEq, Eq, Clone, Default, RuntimeDebug)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr( - feature = "std", + feature = "serde", serde(try_from = "CompactDataLookup", into = "CompactDataLookup") )] pub struct DataLookup { diff --git a/core/src/data_proof.rs b/core/src/data_proof.rs index b8b33ec0..1ba6d3c7 100644 --- a/core/src/data_proof.rs +++ b/core/src/data_proof.rs @@ -1,15 +1,15 @@ #[cfg(feature = "runtime")] -use beefy_merkle_tree::MerkleProof; +use binary_merkle_tree::MerkleProof; use codec::{Decode, Encode}; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::H256; use sp_std::vec::Vec; use thiserror_no_std::Error; -/// Wrapper of `beefy-merkle-tree::MerkleProof` with codec support. +/// Wrapper of `binary-merkle-tree::MerkleProof` with codec support. #[derive(Clone, Debug, PartialEq, Eq, Encode, Decode, Default)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct DataProof { /// Root hash of generated merkle tree. pub root: H256, @@ -31,7 +31,7 @@ pub struct DataProof { pub leaf: H256, } -/// Conversion error from `beefy-merkle-tree::MerkleProof`. +/// Conversion error from `binary-merkle-tree::MerkleProof`. #[derive(Clone, Copy, Debug, PartialEq, Eq, Error)] pub enum DataProofTryFromError { /// Root cannot be converted into `H256`. @@ -126,7 +126,7 @@ mod test { let leaves = leaves(); let index = min(leaf_index, leaves.len() - 1); - let mut proof = beefy_merkle_tree::merkle_proof::(leaves, index); + let mut proof = binary_merkle_tree::merkle_proof::(leaves, index); proof.leaf_index = leaf_index; proof @@ -188,10 +188,10 @@ mod test { #[test_case(merkle_proof_idx(6) => expected_data_proof_6(); "From merkle proof 6")] #[test_case(merkle_proof_idx(7) => Err(DataProofTryFromError::InvalidLeafIndex); "From invalid leaf index")] #[test_case(invalid_merkle_proof_zero_leaves() => Err(DataProofTryFromError::InvalidNumberOfLeaves); "From invalid number of leaves")] - fn from_beefy( - beefy_proof: MerkleProof>, + fn from_binary( + binary_proof: MerkleProof>, ) -> Result { - let data_proof = DataProof::try_from(&beefy_proof)?; + let data_proof = DataProof::try_from(&binary_proof)?; Ok(data_proof) } } diff --git a/core/src/header/extension/mod.rs b/core/src/header/extension/mod.rs index d6fb76a8..31fa9a28 100644 --- a/core/src/header/extension/mod.rs +++ b/core/src/header/extension/mod.rs @@ -1,6 +1,6 @@ use codec::{Decode, Encode}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::{RuntimeDebug, H256}; #[cfg(feature = "runtime")] @@ -16,7 +16,7 @@ pub mod v_test; /// Header extension data. #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "runtime", derive(PassByCodec))] pub enum HeaderExtension { V1(v1::HeaderExtension), diff --git a/core/src/header/extension/v1.rs b/core/src/header/extension/v1.rs index 3c1a3d58..a2dfc31e 100644 --- a/core/src/header/extension/v1.rs +++ b/core/src/header/extension/v1.rs @@ -1,14 +1,14 @@ use codec::{Decode, Encode}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::{RuntimeDebug, H256}; use crate::{v1::KateCommitment, DataLookup}; #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo, Encode, Decode, Default)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct HeaderExtension { pub commitment: KateCommitment, pub app_lookup: DataLookup, diff --git a/core/src/header/extension/v2.rs b/core/src/header/extension/v2.rs index e45941b3..0b0d0fc7 100644 --- a/core/src/header/extension/v2.rs +++ b/core/src/header/extension/v2.rs @@ -1,14 +1,14 @@ use codec::{Decode, Encode}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::{RuntimeDebug, H256}; use crate::{v2::KateCommitment, DataLookup}; #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo, Encode, Decode, Default)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct HeaderExtension { pub commitment: KateCommitment, pub app_lookup: DataLookup, diff --git a/core/src/header/extension/v_test.rs b/core/src/header/extension/v_test.rs index a7e8b4bf..ef859eea 100644 --- a/core/src/header/extension/v_test.rs +++ b/core/src/header/extension/v_test.rs @@ -1,6 +1,6 @@ use codec::{Decode, Encode}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::{RuntimeDebug, H256}; use sp_std::vec::Vec; @@ -8,7 +8,7 @@ use sp_std::vec::Vec; use crate::{asdr::DataLookup, header::extension::v1, KateCommitment}; #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo, Encode, Decode, Default)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct HeaderExtension { pub new_field: Vec, pub commitment: KateCommitment, diff --git a/core/src/header/mod.rs b/core/src/header/mod.rs index 6798deb4..359b977c 100644 --- a/core/src/header/mod.rs +++ b/core/src/header/mod.rs @@ -17,10 +17,11 @@ //! Data-Avail implementation of a block header. -use codec::{Codec, Decode, Encode}; +use codec::{Codec, Decode, Encode, EncodeLike, FullCodec, MaxEncodedLen}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; +use sp_arithmetic::{traits::Saturating, MultiplyRational}; use sp_core::{hexdisplay::HexDisplay, U256}; use sp_runtime::{ traits::{ @@ -42,13 +43,16 @@ pub use extension::HeaderExtension; /// Abstraction over a block header for a substrate chain. #[derive(PartialEq, Eq, Clone, TypeInfo, Encode, Decode)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(deny_unknown_fields, rename_all = "camelCase"))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[cfg_attr( + feature = "serde", + serde(deny_unknown_fields, rename_all = "camelCase") +)] pub struct Header { /// The parent hash. pub parent_hash: Hash::Output, /// The block number. - #[cfg_attr(feature = "std", serde(with = "number_serde"))] + #[cfg_attr(feature = "serde", serde(with = "number_serde"))] #[codec(compact)] pub number: Number, /// The state trie merkle root @@ -79,7 +83,7 @@ impl fmt::Debug for Header { } /// This module adds serialization support to `Header::number` field. -#[cfg(feature = "std")] +#[cfg(feature = "serde")] mod number_serde { use serde::{Deserializer, Serializer}; @@ -166,8 +170,15 @@ where + Copy + Into + TryFrom - + sp_std::str::FromStr, - Hash: HashT, + + sp_std::str::FromStr + + MultiplyRational + + Saturating + + TypeInfo + + EncodeLike + + MaxEncodedLen + + FullCodec + + Default, + Hash: HashT + TypeInfo, Hash::Output: Default + sp_std::hash::Hash + Copy @@ -178,6 +189,7 @@ where + MaybeDisplay + SimpleBitOps + Codec, + Header: Encode + Decode, { type Hash = ::Output; type Hashing = Hash; diff --git a/core/src/kate_commitment.rs b/core/src/kate_commitment.rs index d2c2710b..7b72f65b 100644 --- a/core/src/kate_commitment.rs +++ b/core/src/kate_commitment.rs @@ -3,11 +3,11 @@ use scale_info::TypeInfo; use sp_core::H256; use sp_std::vec::Vec; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use sp_core::hexdisplay::HexDisplay; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use sp_std::fmt; pub mod v1 { @@ -15,9 +15,9 @@ pub mod v1 { /// Customized extrinsics root to save the commitment. #[derive(PartialEq, Eq, Clone, Default, Encode, Decode, TypeInfo)] - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] - #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] - #[cfg_attr(feature = "std", serde(deny_unknown_fields))] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] + #[cfg_attr(feature = "serde", serde(deny_unknown_fields))] pub struct KateCommitment { /// Rows #[codec(compact)] @@ -31,7 +31,7 @@ pub mod v1 { pub commitment: Vec, } - #[cfg(feature = "std")] + #[cfg(feature = "serde")] impl fmt::Debug for KateCommitment { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.debug_struct("KateCommitment(v1)") @@ -49,9 +49,9 @@ pub mod v2 { /// Customized extrinsics root to save the commitment. #[derive(PartialEq, Eq, Clone, Default, Encode, Decode, TypeInfo)] - #[cfg_attr(feature = "std", derive(Serialize, Deserialize))] - #[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] - #[cfg_attr(feature = "std", serde(deny_unknown_fields))] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] + #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] + #[cfg_attr(feature = "serde", serde(deny_unknown_fields))] pub struct KateCommitment { /// Rows #[codec(compact)] @@ -77,7 +77,7 @@ pub mod v2 { } } - #[cfg(feature = "std")] + #[cfg(feature = "serde")] impl fmt::Debug for KateCommitment { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let commitment = self.commitment.as_slice(); diff --git a/core/src/keccak256.rs b/core/src/keccak256.rs index 5df84883..d07f0d04 100644 --- a/core/src/keccak256.rs +++ b/core/src/keccak256.rs @@ -1,12 +1,12 @@ use scale_info::TypeInfo; use sp_core::{Hasher, RuntimeDebug}; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; -/// Keccak 256 wrapper which supports `beefy-merkle-tree::Hasher`. +/// Keccak 256 wrapper which supports `binary-merkle-tree::Hasher`. #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Keccak256 {} impl Hasher for Keccak256 { diff --git a/core/src/lib.rs b/core/src/lib.rs index 1f15a60b..b7c4463b 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,10 +1,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -#![deny(clippy::integer_arithmetic)] +#![deny(clippy::arithmetic_side_effects)] use codec::{Decode, Encode, MaxEncodedLen}; use derive_more::{Add, Constructor, Deref, Display, Into, Mul}; use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_arithmetic::traits::Zero; use sp_core::RuntimeDebug; @@ -12,6 +12,12 @@ use sp_core::RuntimeDebug; pub mod opaque_extrinsic; pub use opaque_extrinsic::*; +/// DA Block +#[cfg(feature = "runtime")] +pub mod da_block; +#[cfg(feature = "runtime")] +pub use da_block::*; + /// Customized headers. #[cfg(feature = "runtime")] pub mod header; @@ -77,7 +83,7 @@ pub enum InvalidTransactionCustomId { RuntimeDebug, Display, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct AppId(#[codec(compact)] pub u32); impl Zero for AppId { @@ -108,12 +114,12 @@ impl Zero for AppId { MaxEncodedLen, Display, )] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize, Debug))] #[mul(forward)] pub struct BlockLengthColumns(#[codec(compact)] pub u32); /// Strong type for `BlockLength::rows` -#[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize, Debug))] #[derive( Encode, Decode, diff --git a/core/src/opaque_extrinsic.rs b/core/src/opaque_extrinsic.rs index 7d14e459..4aa45551 100644 --- a/core/src/opaque_extrinsic.rs +++ b/core/src/opaque_extrinsic.rs @@ -1,4 +1,5 @@ use codec::{Decode, Encode}; +use scale_info::prelude::format; use scale_info::TypeInfo; use sp_std::vec::Vec; @@ -28,7 +29,7 @@ impl sp_std::fmt::Debug for OpaqueExtrinsic { } } -#[cfg(feature = "std")] +#[cfg(feature = "serde")] impl ::serde::Serialize for OpaqueExtrinsic { fn serialize(&self, seq: S) -> Result where @@ -38,7 +39,7 @@ impl ::serde::Serialize for OpaqueExtrinsic { } } -#[cfg(feature = "std")] +#[cfg(feature = "serde")] impl<'a> ::serde::Deserialize<'a> for OpaqueExtrinsic { fn deserialize(de: D) -> Result where diff --git a/core/src/sha2.rs b/core/src/sha2.rs index f22519e3..3c3e3a91 100644 --- a/core/src/sha2.rs +++ b/core/src/sha2.rs @@ -1,11 +1,11 @@ use scale_info::TypeInfo; -#[cfg(feature = "std")] +#[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use sp_core::{Hasher, RuntimeDebug}; -/// Sha2 256 wrapper which supports `beefy-merkle-tree::Hasher`. +/// Sha2 256 wrapper which supports `binary-merkle-tree::Hasher`. #[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct ShaTwo256 {} impl Hasher for ShaTwo256 { diff --git a/core/src/traits.rs b/core/src/traits.rs index 3be72d0f..136ef3a2 100644 --- a/core/src/traits.rs +++ b/core/src/traits.rs @@ -1,6 +1,5 @@ use codec::{Codec, Decode}; -use sp_arithmetic::traits::AtLeast32BitUnsigned; -use sp_arithmetic::traits::Saturating; +use sp_arithmetic::traits::{AtLeast32BitUnsigned, Saturating}; use sp_core::U256; use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash as StdHash}; @@ -10,6 +9,11 @@ pub use get_app_id::*; pub mod extended_header; pub use extended_header::*; +#[cfg(feature = "runtime")] +pub mod extended_block; +#[cfg(feature = "runtime")] +pub use extended_block::*; + /// Header block number trait. pub trait HeaderBlockNumber: AtLeast32BitUnsigned + Codec + StdHash + Copy + Into + TryFrom + Debug + Eq + Saturating diff --git a/core/src/traits/extended_block.rs b/core/src/traits/extended_block.rs new file mode 100644 index 00000000..535b2d19 --- /dev/null +++ b/core/src/traits/extended_block.rs @@ -0,0 +1,32 @@ +use crate::traits::ExtendedHeader; +use sp_runtime::{ + traits::{Block, Header}, + Digest, +}; + +/// Extended Block trait that extends substrate primitive Block to include ExtendedHeader in the header +pub trait ExtendedBlock: + Block + + DaHeaderProvider< + <::Header as Header>::Number, + <::Header as Header>::Hash, + Digest, + Extension, + DaHeader = >::DaHeader, + > +{ + type DaHeader: Header + + ExtendedHeader< + <::Header as Header>::Number, + <::Header as Header>::Hash, + Digest, + Extension, + >; +} + +// Note: This is a workaround for a compiler bug (https://github.com/rust-lang/rust/issues/96634) +// and should be removed when the compiler bug is fixed. +pub trait DaHeaderProvider { + /// DaHeader type. + type DaHeader: ExtendedHeader; +} diff --git a/kate/src/com.rs b/kate/src/com.rs index 7605b081..a9c55d1c 100644 --- a/kate/src/com.rs +++ b/kate/src/com.rs @@ -173,7 +173,7 @@ pub fn flatten_and_pad_block( assert_eq!(rem, 0); } - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] // SAFETY: `chunk_size` comes from `NonZeroU32::get(...)` so we can safetly use `/`. let last = block_dims_size.saturating_sub(padded_block.len()) / chunk_size; for _ in 0..last { @@ -214,6 +214,7 @@ pub fn get_block_dimensions( // we must minimize number of rows, to minimize header size // (performance wise it doesn't matter) let nz_max_cols = NonZeroU32::new(max_cols.0).ok_or(Error::ZeroDimension)?; + #[allow(clippy::arithmetic_side_effects)] let (cols, rows) = if total_cells > max_cols.0 { (max_cols, BlockLengthRows(total_cells / nz_max_cols)) } else { diff --git a/kate/src/gridgen/mod.rs b/kate/src/gridgen/mod.rs index 1e0b006d..c6a7d1a3 100644 --- a/kate/src/gridgen/mod.rs +++ b/kate/src/gridgen/mod.rs @@ -174,9 +174,9 @@ impl EvaluationGrid { // SAFETY: `origin_dims.rows is NonZeroU16` // Compiler checks that `Dimensions::rows()` returns a `NonZeroU16` using the expression // `NonZeroU16::get(x)` instead of `x.get()`. - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] let h_mul: usize = rows / usize::from(NonZeroU16::get(orig_dims.rows())); - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] let row_from_lineal_index = |cols, lineal_index| { let lineal_index = usize::try_from(lineal_index).map_err(|_| AppRowError::LinealIndexOverflows)?; @@ -195,7 +195,7 @@ impl EvaluationGrid { // SAFETY: This won't overflow because `h_mul = rows / orig_dim.rows()` and `*_y < rows) debug_assert!(start_y < rows); debug_assert!(end_y < rows); - #[allow(clippy::integer_arithmetic)] + #[allow(clippy::arithmetic_side_effects)] let (new_start_y, new_end_y) = (start_y * h_mul, end_y * h_mul); let app_rows = (new_start_y..=new_end_y) @@ -365,7 +365,7 @@ pub struct CellBlock { /// `mp_grid_dims` is the size of the multiproof grid, which `x,y` lies in. /// For example, a 256x256 grid could be converted to a 4x4 target size multiproof grid, by making 16 multiproofs /// of size 64x64. -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] pub fn multiproof_block( x: usize, y: usize, @@ -395,6 +395,7 @@ pub fn multiproof_block( /// Dimensions of the multiproof grid. These are guarenteed to cleanly divide `grid_dims`. /// `target_dims` must cleanly divide `grid_dims`. +#[allow(clippy::arithmetic_side_effects)] pub fn multiproof_dims(grid: Dimensions, target: Dimensions) -> Option { let cols = min(grid.cols(), target.cols()); let rows = min(grid.rows(), target.rows()); @@ -446,7 +447,7 @@ pub fn domain_points(n: usize) -> Result, Error> { } /// SAFETY: As `multiple` is a `NonZeroU16` we can safetly make the following ops. -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] fn round_up_to_multiple(input: usize, multiple: NonZeroU16) -> usize { let multiple: usize = multiple.get().into(); let n_multiples = input.saturating_add(multiple - 1) / multiple; @@ -465,7 +466,7 @@ pub(crate) fn pad_to_bls_scalar(a: impl AsRef<[u8]>) -> Result } #[cfg(test)] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] mod unit_tests { use super::*; use proptest::{prop_assert_eq, proptest}; diff --git a/kate/src/lib.rs b/kate/src/lib.rs index fe936054..7eb670f3 100644 --- a/kate/src/lib.rs +++ b/kate/src/lib.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -#![deny(clippy::integer_arithmetic)] +#![deny(clippy::arithmetic_side_effects)] use avail_core::{BlockLengthColumns, BlockLengthRows}; use core::{ @@ -179,7 +179,7 @@ pub mod gridgen; /// There is a unit test to ensure this formula match with the current /// IEC 9797 1 algorithm we implemented. See `fn pad_iec_9797_1` #[inline] -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] fn padded_len_of_pad_iec_9797_1(len: u32) -> u32 { let len_plus_one = len.saturating_add(1); let offset = (DATA_CHUNK_SIZE - (len_plus_one as usize % DATA_CHUNK_SIZE)) % DATA_CHUNK_SIZE; @@ -189,7 +189,7 @@ fn padded_len_of_pad_iec_9797_1(len: u32) -> u32 { } /// Calculates the padded len based of initial `len`. -#[allow(clippy::integer_arithmetic)] +#[allow(clippy::arithmetic_side_effects)] pub fn padded_len(len: u32, chunk_size: NonZeroU32) -> u32 { let iec_9797_1_len = padded_len_of_pad_iec_9797_1(len); diff --git a/nomad/base/Cargo.toml b/nomad/base/Cargo.toml index af0a7f65..0d590b28 100644 --- a/nomad/base/Cargo.toml +++ b/nomad/base/Cargo.toml @@ -14,7 +14,8 @@ codec = { package = "parity-scale-codec", version = "3", default-features = fals scale-info = { version = "2", default-features = false, features = ["derive"] } sp-core = { version = "*", default-features = false } -sp-runtime = { version = "7", default-features = false, optional = true } +# Substrate runtime +sp-runtime = { version = "24", default-features = false, optional = true } # Eth ethers-signers = { version = "1", optional = true } diff --git a/nomad/core/Cargo.toml b/nomad/core/Cargo.toml index 62dd0cb1..12672efe 100644 --- a/nomad/core/Cargo.toml +++ b/nomad/core/Cargo.toml @@ -15,7 +15,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"] } sp-core = { version = "*", default-features = false } sp-std = { version = "*", default-features = false } -sp-runtime = { version = "7", default-features = false, optional = true } +sp-runtime = { version = "24", default-features = false, optional = true } # Eth ethers-core = { version = "1", optional = true } diff --git a/nomad/signature/Cargo.toml b/nomad/signature/Cargo.toml index ac75e038..dceddcef 100644 --- a/nomad/signature/Cargo.toml +++ b/nomad/signature/Cargo.toml @@ -22,7 +22,7 @@ scale-info = { version = "2", default-features = false, features = ["derive"] } sp-core = { version = "*", default-features = false } frame-support = { version = "4.0.0-dev", default-features = false } -sp-runtime = { version = "7", default-features = false } +sp-runtime = { version = "24", default-features = false } # Eth ethers-core = { version = "1", default-features = false, optional = true } diff --git a/nomad/signature/src/signature.rs b/nomad/signature/src/signature.rs index 6c87b074..058f01b7 100644 --- a/nomad/signature/src/signature.rs +++ b/nomad/signature/src/signature.rs @@ -15,8 +15,11 @@ use k256::{ PublicKey as K256PublicKey, }; use scale_info::TypeInfo; -use sp_core::{Hasher as _, H160, H256, U256}; -use sp_runtime::{traits::Keccak256, RuntimeDebug}; +use sp_core::{H160, H256, U256}; +use sp_runtime::{ + traits::{Hash, Keccak256}, + RuntimeDebug, +}; use thiserror_no_std::Error; #[cfg(feature = "std")] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ab25d60e..5d7d273a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2022-11-15" +channel = "stable-2023-08-24" components = ["rustfmt", "clippy", "llvm-tools-preview"] profile = "minimal" targets = ["wasm32-unknown-unknown"]