diff --git a/Cargo.lock b/Cargo.lock index da4b4dddaea5c02672a2fea468caa677282fa8f2..c352488b7528088a6b44d5643ed751fde5d70bb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -866,9 +866,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbc37d37da9e5bce8173f3a41b71d9bf3c674deebbaceacd0ebdabde76efb03" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1100,6 +1100,7 @@ dependencies = [ "smallvec", "sp-arithmetic 6.0.0", "sp-consensus-babe", + "sp-consensus-grandpa", "sp-core 7.0.0", "sp-membership", "sp-runtime 7.0.0", @@ -1442,9 +1443,9 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.3.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7394a21d012ce5c850497fb774b167d81b99f060025fbf06ee92b9848bd97eb2" +checksum = "2a011bbe2c35ce9c1f143b7af6f94f29a167beb4cd1d29e6740ce836f723120e" dependencies = [ "nix 0.26.2", "windows-sys 0.48.0", @@ -1904,6 +1905,7 @@ dependencies = [ "sc-client-db", "sc-consensus", "sc-consensus-babe", + "sc-consensus-grandpa", "sc-consensus-manual-seal", "sc-executor", "sc-keystore", @@ -1922,6 +1924,7 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-grandpa", "sp-core 7.0.0", "sp-inherents", "sp-io 7.0.0", @@ -1934,6 +1937,7 @@ dependencies = [ "sp-storage 7.0.0", "sp-timestamp", "sp-transaction-pool", + "sp-transaction-storage-proof", "sp-trie 7.0.0", "substrate-build-script-utils", "substrate-frame-rpc-system", @@ -1966,7 +1970,7 @@ name = "duniter-live-tests" version = "3.0.0" dependencies = [ "anyhow", - "hex-literal", + "hex-literal 0.3.4", "parity-scale-codec", "sp-core 7.0.0", "subxt 0.28.0", @@ -2699,9 +2703,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f5b6908aecca5812a4569056285e58c666588c9573ee59765bf1d3692699e2" +checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" dependencies = [ "rustix 0.37.19", "windows-sys 0.48.0", @@ -2908,7 +2912,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-atomic-swap", "pallet-authority-discovery", @@ -2975,7 +2979,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-atomic-swap", "pallet-authority-discovery", @@ -3278,7 +3282,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal", + "hex-literal 0.4.1", "log", "pallet-atomic-swap", "pallet-authority-discovery", @@ -3457,6 +3461,12 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "hkdf" version = "0.12.3" @@ -4955,9 +4965,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -7709,6 +7719,46 @@ dependencies = [ "sp-runtime 7.0.0", ] +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/duniter/substrate?branch=duniter-substrate-v0.9.42#87ef489034ca2b15c4f30da387e06b1f6716d9a2" +dependencies = [ + "ahash 0.8.3", + "array-bytes", + "async-trait", + "dyn-clone", + "finality-grandpa", + "fork-tree", + "futures 0.3.28", + "futures-timer", + "log", + "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", + "sc-client-api", + "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto 7.0.0", + "sp-arithmetic 6.0.0", + "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core 7.0.0", + "sp-keystore 0.13.0", + "sp-runtime 7.0.0", + "substrate-prometheus-endpoint", + "thiserror", +] + [[package]] name = "sc-consensus-manual-seal" version = "0.10.0-dev" @@ -7958,6 +8008,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sc-network-gossip" +version = "0.10.0-dev" +source = "git+https://github.com/duniter/substrate?branch=duniter-substrate-v0.9.42#87ef489034ca2b15c4f30da387e06b1f6716d9a2" +dependencies = [ + "ahash 0.8.3", + "futures 0.3.28", + "futures-timer", + "libp2p", + "log", + "lru 0.8.1", + "sc-network", + "sc-network-common", + "sc-peerset", + "sp-runtime 7.0.0", + "substrate-prometheus-endpoint", + "tracing", +] + [[package]] name = "sc-network-light" version = "0.10.0-dev" @@ -10240,7 +10309,6 @@ dependencies = [ "futures 0.3.28", "getrandom 0.2.9", "hex", - "jsonrpsee", "parity-scale-codec", "parking_lot 0.12.1", "scale-decode 0.4.0", @@ -10270,7 +10338,6 @@ dependencies = [ "getrandom 0.2.9", "hex", "impl-serde", - "jsonrpsee", "parity-scale-codec", "parking_lot 0.12.1", "primitive-types", @@ -10281,9 +10348,7 @@ dependencies = [ "scale-value 0.7.0", "serde", "serde_json", - "sp-core 7.0.0", "sp-core-hashing 8.0.0", - "sp-runtime 7.0.0", "subxt-macro 0.28.0", "subxt-metadata 0.28.0", "thiserror", @@ -10688,7 +10753,7 @@ dependencies = [ "autocfg", "bytes", "libc", - "mio 0.8.7", + "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.9", diff --git a/Cargo.toml b/Cargo.toml index 5980986794496164df8c864ec5c5673248f4cf34..e1d6273dd4a7c1a74cdd9c283895b516b1c56585 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,66 +64,69 @@ pallet-oneshot-account = { path = 'pallets/oneshot-account' } sp-membership = { path = 'primitives/membership' } # crates.io dependencies -async-io = "1.6.0" -clap = { version = "4.0.15", features = ["derive"] } -clap_complete = { version = "4" } -futures = { version = "0.3.28", features = ["compat"] } -hex = "0.4.3" -jsonrpsee = { version = "0.16.2", features = ["server"] } -lazy_static = "1.4.0" -log = "0.4" -maplit = '1.0.2' -memmap2 = "0.5.10" -serde = "1.0" -serde_json = "1.0.64" -tracing-core = "0.1.28" -enum-as-inner = "=0.5.1" #https://github.com/bluejekyll/trust-dns/issues/1946 +async-io = { version = "1.6.0", default-features = false } +clap = { version = "4.0.9", default-features = false, features = ["derive"] } +clap_complete = { version = "4", default-features = false } +futures = { version = "0.3.28", default-features = false, features = ["compat"] } +hex = { version = "0.4.3", default-features = false } +jsonrpsee = { version = "0.16.2", default-features = false, features = ["server"] } +lazy_static = { version = "1.4.0", default-features = false } +log = { version = "0.4", default-features = false } +maplit = { version = '1.0.2', default-features = false } +memmap2 = { version = "0.5.10", default-features = false } +serde = { version = "1.0", default-features = false } +serde_json = { version = "1.0.64", default-features = false } +tracing-core = { version = "0.1.28", default-features = false } +enum-as-inner = { version = "=0.5.1", default-features = false } #https://github.com/bluejekyll/trust-dns/issues/1946 # substrate dependencies -frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -frame-benchmarking-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } +frame-benchmarking = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } frame-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } -pallet-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } +pallet-grandpa = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } pallet-transaction-payment = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-basic-authorship = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-chain-spec = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } +pallet-transaction-payment-rpc = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-basic-authorship = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-chain-spec = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } sc-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } -sc-client-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -babe = { package = "sc-consensus-babe", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -manual-seal = { package = "sc-consensus-manual-seal", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } +sc-client-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +babe = { package = "sc-consensus-babe", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +manual-seal = { package = "sc-consensus-manual-seal", git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } sc-client-db = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } -sc-executor = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-network = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-network-common = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-rpc-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } +sc-executor = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-network = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-network-common = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-rpc-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } sc-service = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } -sc-telemetry = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sc-transaction-pool-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-authority-discovery = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-block-builder = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-blockchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-consensus-babe = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-core = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-inherents = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-io = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-offchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-runtime = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-session = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-storage = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-timestamp = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -substrate-frame-rpc-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -try-runtime-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", optional = true } +sc-telemetry = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sc-transaction-pool-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-api = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-authority-discovery = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-transaction-storage-proof = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-block-builder = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-blockchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-consensus = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-consensus-babe = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-consensus-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sc-consensus-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sp-core = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-inherents = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-io = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-offchain = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-keystore = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-runtime = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-session = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-storage = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-timestamp = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-transaction-pool = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +sp-trie = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +try-runtime-cli = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", optional = true, default-features = false } [workspace] resolver = "2" diff --git a/end2end-tests/Cargo.toml b/end2end-tests/Cargo.toml index d162977f2d4b2db222818dd11278679b4330818b..4daba55f0e27f9203d45a36a1b120b5472a36417 100644 --- a/end2end-tests/Cargo.toml +++ b/end2end-tests/Cargo.toml @@ -20,9 +20,9 @@ notify = "4.0" parity-scale-codec = "3.1.5" portpicker = "0.1.1" serde_json = "1.0.64" -sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42" } -subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.32' } -tokio = { version = "1.15.0", features = ["macros"] } +sp-keyring = { git = "https://github.com/duniter/substrate", branch = "duniter-substrate-v0.9.42", default-features = false } +subxt = { git = 'https://github.com/duniter/subxt.git', branch = 'duniter-substrate-v0.9.32', default-features = false } +tokio = { version = "1.15.0", features = ["macros"], default-features = false } [[test]] name = "cucumber_tests" diff --git a/live-tests/Cargo.toml b/live-tests/Cargo.toml index e6c2088f63bbe7a8c29b7a85f34b5eab57eabce7..e4fb3a59cd1653aad23c7b84d3ccb6f8e3ca8f63 100644 --- a/live-tests/Cargo.toml +++ b/live-tests/Cargo.toml @@ -12,6 +12,6 @@ version = '3.0.0' anyhow = "1.0" hex-literal = "0.3" parity-scale-codec = "3.1.5" -sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } -subxt = { git = 'https://github.com/duniter/subxt', branch = 'duniter-substrate-v0.9.42' } -tokio = { version = "1.15.0", features = ["macros"] } +sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +subxt = { git = 'https://github.com/duniter/subxt', branch = 'duniter-substrate-v0.9.42', default-features = false } +tokio = { version = "1.15.0", features = ["macros"], default-features = false } diff --git a/node/src/chain_spec/gdev.rs b/node/src/chain_spec/gdev.rs index d2e91b2764fff306a7959f20c57a12d0ca761976..b4a9640477cfdb22c54217b2ee50653cb8ae16e8 100644 --- a/node/src/chain_spec/gdev.rs +++ b/node/src/chain_spec/gdev.rs @@ -27,8 +27,8 @@ use gdev_runtime::{ use sc_service::ChainType; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{blake2_256, sr25519, Encode, H256}; -use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_membership::MembershipData; use std::collections::BTreeMap; diff --git a/node/src/chain_spec/gtest.rs b/node/src/chain_spec/gtest.rs index 023aef9f39e0ec298e9953a216cbb5bf9e7c11c8..1d3d7dac03a6c37c3e31cd96f98c3a22c18847ff 100644 --- a/node/src/chain_spec/gtest.rs +++ b/node/src/chain_spec/gtest.rs @@ -26,6 +26,7 @@ use gtest_runtime::{ UniversalDividendConfig, WASM_BINARY, }; use jsonrpsee::core::JsonValue; +use sc_consensus_grandpa::AuthorityId as GrandpaId; use sc_network_common::config::MultiaddrWithPeerId; // in the future available in sc_network::config use sc_service::ChainType; use sc_telemetry::TelemetryEndpoints; @@ -33,7 +34,6 @@ use serde::Deserialize; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::AuthorityId as BabeId; use sp_core::{blake2_256, sr25519, Encode, H256}; -use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_membership::MembershipData; use std::collections::BTreeMap; diff --git a/node/src/command/key.rs b/node/src/command/key.rs index 655ebc2071e03add5365637b80dc8540c65d0ef5..6aa6ffe01847ea07ec85fd92869a7539f1693dd1 100644 --- a/node/src/command/key.rs +++ b/node/src/command/key.rs @@ -20,7 +20,7 @@ use sc_cli::{ use sc_keystore::LocalKeystore; use sc_service::config::{BasePath, KeystoreConfig}; use sp_core::crypto::{AccountId32, KeyTypeId, SecretString}; -use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; +use sp_keystore::{Keystore, KeystorePtr}; use std::sync::Arc; #[derive(Debug, clap::Subcommand)] @@ -82,18 +82,17 @@ impl GenSessionKeysCmd { let mut public_keys_bytes = Vec::with_capacity(128); for (key_type_id, crypto_scheme) in KEY_TYPES { let (keystore, public) = match self.keystore_params.keystore_config(&config_dir)? { - (_, KeystoreConfig::Path { path, password }) => { + KeystoreConfig::Path { path, password } => { let public = with_crypto_scheme!(crypto_scheme, to_vec(&suri, password.clone()))?; - let keystore: SyncCryptoStorePtr = - Arc::new(LocalKeystore::open(path, password)?); + let keystore: KeystorePtr = Arc::new(LocalKeystore::open(path, password)?); (keystore, public) } _ => unreachable!("keystore_config always returns path and password; qed"), }; - SyncCryptoStore::insert_unknown(&*keystore, key_type_id, &suri, &public[..]) - .map_err(|_| Error::KeyStoreOperation)?; + Keystore::insert(&*keystore, key_type_id, &suri, &public[..]) + .map_err(|_| Error::KeystoreOperation)?; public_keys_bytes.extend_from_slice(&public[..]); } diff --git a/node/src/service.rs b/node/src/service.rs index 6562b6584d5066396d394da7344140c82f19b519..44005f60da180c607a8965ef80b4f4c6a1877098 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -23,10 +23,11 @@ use async_io::Timer; use common_runtime::Block; use futures::{Stream, StreamExt}; use manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}; -use sc_client_api::BlockBackend; +use sc_client_api::client::BlockBackend; +use sc_consensus_grandpa::SharedVoterState; pub use sc_executor::NativeElseWasmExecutor; -use sc_finality_grandpa::SharedVoterState; use sc_keystore::LocalKeystore; +use sc_network_common::sync::warp::WarpSyncParams; use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sp_core::H256; @@ -193,7 +194,7 @@ pub fn new_chain_ops( } } -type FullGrandpaBlockImport<RuntimeApi, Executor> = sc_finality_grandpa::GrandpaBlockImport< +type FullGrandpaBlockImport<RuntimeApi, Executor> = sc_consensus_grandpa::GrandpaBlockImport< FullBackend, Block, FullClient<RuntimeApi, Executor>, @@ -218,7 +219,11 @@ pub fn new_partial<RuntimeApi, Executor>( FullGrandpaBlockImport<RuntimeApi, Executor>, >, babe::BabeLink<Block>, - sc_finality_grandpa::LinkHalf<Block, FullClient<RuntimeApi, Executor>, FullSelectChain>, + sc_consensus_grandpa::LinkHalf< + Block, + FullClient<RuntimeApi, Executor>, + FullSelectChain, + >, Option<Telemetry>, ), >, @@ -233,11 +238,12 @@ where RuntimeApiCollection<StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>, Executor: sc_executor::NativeExecutionDispatch + 'static, { - if config.keystore_remote.is_some() { + /*if config.keystore_remote.is_some() { return Err(ServiceError::Other( "Remote Keystores are not supported.".to_owned(), )); - } + }*/ + // TODO deprecated ? let telemetry = config .telemetry_endpoints @@ -282,7 +288,7 @@ where client.clone(), ); - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), &(client.clone() as Arc<_>), select_chain.clone(), @@ -296,14 +302,14 @@ where babe::block_import(babe_config, grandpa_block_import, client.clone())?; let import_queue = if consensus_manual { - manual_seal::import_queue( + (manual_seal::import_queue( Box::new(babe_block_import.clone()), &task_manager.spawn_essential_handle(), config.prometheus_registry(), - ) + )) } else { let slot_duration = babe_link.config().slot_duration(); - babe::import_queue( + let (import_queue, _) = babe::import_queue( babe_link.clone(), babe_block_import.clone(), Some(Box::new(justification_import)), @@ -323,7 +329,8 @@ where &task_manager.spawn_essential_handle(), config.prometheus_registry(), telemetry.as_ref().map(|x| x.handle()), - )? + )?; + import_queue }; Ok(sc_service::PartialComponents { @@ -370,7 +377,7 @@ where other: (block_import, babe_link, grandpa_link, mut telemetry), } = new_partial::<RuntimeApi, Executor>(&config, sealing.is_manual_consensus())?; - if let Some(url) = &config.keystore_remote { + /*if let Some(url) = &config.keystore_remote { match remote_keystore(url) { Ok(k) => keystore_container.set_remote_keystore(k), Err(e) => { @@ -380,9 +387,9 @@ where ))) } }; - } + }*/// TODO deprecated ? - let grandpa_protocol_name = sc_finality_grandpa::protocol_standard_name( + let grandpa_protocol_name = sc_consensus_grandpa::protocol_standard_name( &client .block_hash(0) .ok() @@ -393,24 +400,26 @@ where config .network .extra_sets - .push(sc_finality_grandpa::grandpa_peers_set_config( + .push(sc_consensus_grandpa::grandpa_peers_set_config( grandpa_protocol_name.clone(), )); - let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( + let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), Vec::default(), )); - let (network, system_rpc_tx, tx_handler_controller, network_starter) = + //let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + //net_config: net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue, block_announce_validator_builder: None, - warp_sync: Some(warp_sync), + warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), })?; if config.offchain_worker.enabled { @@ -478,7 +487,7 @@ where let babe_consensus_data_provider = manual_seal::consensus::babe::BabeConsensusDataProvider::new( client.clone(), - keystore_container.sync_keystore(), + keystore_container.keystore(), babe_link.epoch_changes().clone(), vec![( sp_consensus_babe::AuthorityId::from( @@ -521,31 +530,32 @@ where let client_clone = client.clone(); let slot_duration = babe_link.config().slot_duration(); let babe_config = babe::BabeParams { - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), client: client.clone(), select_chain, block_import, env: proposer_factory, - sync_oracle: network.clone(), - justification_sync_link: network.clone(), + sync_oracle: sync_service.clone(), + justification_sync_link: sync_service.clone(), create_inherent_data_providers: move |parent, ()| { let client_clone = client_clone.clone(); async move { - let uncles = sc_consensus_uncles::create_uncles_inherent_data_provider( - &*client_clone, - parent, - )?; - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); let slot = - sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( - *timestamp, - slot_duration, - ); - - Ok((slot, timestamp, uncles)) + sp_consensus_babe::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); + + let storage_proof = + sp_transaction_storage_proof::registration::new_data_provider( + &*client_clone, + &parent, + )?; + + Ok((slot, timestamp, storage_proof)) } }, force_authoring, @@ -597,8 +607,9 @@ where config, backend, network: network.clone(), + sync_service: sync_service.clone(), client, - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), task_manager: &mut task_manager, transaction_pool, rpc_builder: rpc_extensions_builder, @@ -610,12 +621,12 @@ where // if the node isn't actively participating in consensus then it doesn't // need a keystore, regardless of which protocol we use below. let keystore = if role.is_authority() { - Some(keystore_container.sync_keystore()) + Some(keystore_container.keystore()) } else { None }; - let grandpa_config = sc_finality_grandpa::Config { + let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), justification_period: 512, @@ -634,11 +645,12 @@ where // and vote data availability than the observer. The observer has not // been tested extensively yet and having most nodes in a network run it // could lead to finality stalls. - let grandpa_config = sc_finality_grandpa::GrandpaParams { + let grandpa_config = sc_consensus_grandpa::GrandpaParams { config: grandpa_config, link: grandpa_link, - network, - voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), + sync: sync_service.clone(), + network: network.clone(), + voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state: SharedVoterState::empty(), telemetry: telemetry.as_ref().map(|x| x.handle()), @@ -649,7 +661,7 @@ where task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", None, - sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, + sc_consensus_grandpa::run_grandpa_voter(grandpa_config)?, ); } @@ -693,7 +705,7 @@ impl client::ExecuteWithClient for RevertConsensus { // Revert consensus-related components. // The operations are not correlated, thus call order is not relevant. babe::revert(client.clone(), self.backend, self.blocks)?; - sc_finality_grandpa::revert(client, self.blocks)?; + sc_consensus_grandpa::revert(client, self.blocks)?; Ok(()) } } diff --git a/node/src/service/client.rs b/node/src/service/client.rs index ca2c0da8221321e93053bffa6c790a526ca65c0c..539493801885b92c31e5212e50d5e84060989bf3 100644 --- a/node/src/service/client.rs +++ b/node/src/service/client.rs @@ -15,7 +15,9 @@ // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. use common_runtime::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index}; -use sc_client_api::{AuxStore, Backend as BackendT, BlockchainEvents, KeyIterator, UsageProvider}; +use sc_client_api::{ + AuxStore, Backend as BackendT, BlockchainEvents, KeysIter, PairsIter, UsageProvider, +}; use sp_api::{CallApiAt, NumberFor, ProvideRuntimeApi}; use sp_blockchain::{HeaderBackend, HeaderMetadata}; use sp_consensus::BlockStatus; @@ -237,28 +239,34 @@ macro_rules! match_client { impl sc_client_api::BlockBackend<Block> for Client { fn block_body( &self, - id: &BlockId<Block>, + hash: <Block as BlockT>::Hash, ) -> sp_blockchain::Result<Option<Vec<<Block as BlockT>::Extrinsic>>> { - match_client!(self, block_body(id)) + match_client!(self, block_body(hash)) } fn block_indexed_body( &self, - id: &BlockId<Block>, + hash: <Block as BlockT>::Hash, ) -> sp_blockchain::Result<Option<Vec<Vec<u8>>>> { - match_client!(self, block_indexed_body(id)) + match_client!(self, block_indexed_body(hash)) } - fn block(&self, id: &BlockId<Block>) -> sp_blockchain::Result<Option<SignedBlock<Block>>> { - match_client!(self, block(id)) + fn block( + &self, + hash: <Block as BlockT>::Hash, + ) -> sp_blockchain::Result<Option<SignedBlock<Block>>> { + match_client!(self, block(hash)) } - fn block_status(&self, id: &BlockId<Block>) -> sp_blockchain::Result<BlockStatus> { - match_client!(self, block_status(id)) + fn block_status(&self, hash: <Block as BlockT>::Hash) -> sp_blockchain::Result<BlockStatus> { + match_client!(self, block_status(hash)) } - fn justifications(&self, id: &BlockId<Block>) -> sp_blockchain::Result<Option<Justifications>> { - match_client!(self, justifications(id)) + fn justifications( + &self, + hash: <Block as BlockT>::Hash, + ) -> sp_blockchain::Result<Option<Justifications>> { + match_client!(self, justifications(hash)) } fn block_hash( @@ -270,17 +278,17 @@ impl sc_client_api::BlockBackend<Block> for Client { fn indexed_transaction( &self, - hash: &<Block as BlockT>::Hash, + id: <Block as BlockT>::Hash, ) -> sp_blockchain::Result<Option<Vec<u8>>> { - match_client!(self, indexed_transaction(hash)) + match_client!(self, indexed_transaction(id)) } - fn has_indexed_transaction( + /*fn has_indexed_transaction( &self, hash: &<Block as BlockT>::Hash, ) -> sp_blockchain::Result<bool> { match_client!(self, has_indexed_transaction(hash)) - } + }*/ fn requires_full_sync(&self) -> bool { match_client!(self, requires_full_sync()) @@ -393,16 +401,15 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for Client { } impl sp_blockchain::HeaderBackend<Block> for Client { - fn header(&self, id: BlockId<Block>) -> sp_blockchain::Result<Option<Header>> { - let id = &id; - match_client!(self, header(id)) + fn header(&self, hash: Hash) -> sp_blockchain::Result<Option<Header>> { + match_client!(self, header(hash)) } fn info(&self) -> sp_blockchain::Info<Block> { match_client!(self, info()) } - fn status(&self, id: BlockId<Block>) -> sp_blockchain::Result<sp_blockchain::BlockStatus> { - match_client!(self, status(id)) + fn status(&self, hash: Hash) -> sp_blockchain::Result<sp_blockchain::BlockStatus> { + match_client!(self, status(hash)) } fn number(&self, hash: Hash) -> sp_blockchain::Result<Option<BlockNumber>> { @@ -417,87 +424,73 @@ impl sp_blockchain::HeaderBackend<Block> for Client { impl sc_client_api::StorageProvider<Block, super::FullBackend> for Client { fn storage( &self, - id: &<Block as BlockT>::Hash, + hash: <Block as BlockT>::Hash, key: &StorageKey, ) -> sp_blockchain::Result<Option<StorageData>> { - match_client!(self, storage(id, key)) + match_client!(self, storage(hash, key)) } fn storage_keys( &self, - id: &<Block as BlockT>::Hash, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result<Vec<StorageKey>> { - match_client!(self, storage_keys(id, key_prefix)) + hash: <Block as BlockT>::Hash, + key_prefix: Option<&StorageKey>, + start_key: Option<&StorageKey>, + ) -> sp_blockchain::Result< + KeysIter<<super::FullBackend as sc_client_api::Backend<Block>>::State, Block>, + > { + match_client!(self, storage_keys(hash, key_prefix, start_key)) } fn storage_hash( &self, - id: &<Block as BlockT>::Hash, + hash: <Block as BlockT>::Hash, key: &StorageKey, ) -> sp_blockchain::Result<Option<<Block as BlockT>::Hash>> { - match_client!(self, storage_hash(id, key)) + match_client!(self, storage_hash(hash, key)) } fn storage_pairs( &self, - id: &<Block as BlockT>::Hash, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result<Vec<(StorageKey, StorageData)>> { - match_client!(self, storage_pairs(id, key_prefix)) - } - - fn storage_keys_iter<'a>( - &self, - id: &<Block as BlockT>::Hash, - prefix: Option<&'a StorageKey>, + hash: <Block as BlockT>::Hash, + key_prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< - KeyIterator<'a, <super::FullBackend as sc_client_api::Backend<Block>>::State, Block>, + PairsIter<<super::FullBackend as sc_client_api::Backend<Block>>::State, Block>, > { - match_client!(self, storage_keys_iter(id, prefix, start_key)) + match_client!(self, storage_pairs(hash, key_prefix, start_key)) } fn child_storage( &self, - id: &<Block as BlockT>::Hash, + hash: <Block as BlockT>::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result<Option<StorageData>> { - match_client!(self, child_storage(id, child_info, key)) + match_client!(self, child_storage(hash, child_info, key)) } fn child_storage_keys( &self, - id: &<Block as BlockT>::Hash, - child_info: &ChildInfo, - key_prefix: &StorageKey, - ) -> sp_blockchain::Result<Vec<StorageKey>> { - match_client!(self, child_storage_keys(id, child_info, key_prefix)) - } - - fn child_storage_keys_iter<'a>( - &self, - id: &<Block as BlockT>::Hash, + hash: <Block as BlockT>::Hash, child_info: ChildInfo, - prefix: Option<&'a StorageKey>, + key_prefix: Option<&StorageKey>, start_key: Option<&StorageKey>, ) -> sp_blockchain::Result< - KeyIterator<'a, <super::FullBackend as sc_client_api::Backend<Block>>::State, Block>, + KeysIter<<super::FullBackend as sc_client_api::Backend<Block>>::State, Block>, > { match_client!( self, - child_storage_keys_iter(id, child_info, prefix, start_key) + child_storage_keys(hash, child_info, key_prefix, start_key) ) } fn child_storage_hash( &self, - id: &<Block as BlockT>::Hash, + hash: <Block as BlockT>::Hash, child_info: &ChildInfo, key: &StorageKey, ) -> sp_blockchain::Result<Option<<Block as BlockT>::Hash>> { - match_client!(self, child_storage_hash(id, child_info, key)) + match_client!(self, child_storage_hash(hash, child_info, key)) } } @@ -519,7 +512,7 @@ pub fn benchmark_inherent_data( // Assume that all runtimes have the `timestamp` pallet. let d = std::time::Duration::from_millis(0); let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); - timestamp.provide_inherent_data(&mut inherent_data)?; + timestamp.provide_inherent_data(&mut inherent_data); Ok(inherent_data) } diff --git a/resources/metadata.scale b/resources/metadata.scale index 6c236f8d95a610f8b1044687302dd08fea17a14d..c7614a61bc7018f92ec836d272de42f7dc6fb4eb 100644 Binary files a/resources/metadata.scale and b/resources/metadata.scale differ diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 28cc88aa72a63b10a91fec431c396aa04e09fb67..f37bc47c73f3b034a8a9c8867c5001640d6311aa 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -83,12 +83,12 @@ pallet-session-benchmarking = { path = '../../pallets/session-benchmarking', def sp-membership = { path = '../../primitives/membership', default-features = false } # Crates.io -codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive"], default-features = false } -log = { version = "0.4.14", default-features = false } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", default-features = false } -serde_derive = { version = "1.0.101", optional = true } -smallvec = "1.6.1" +codec = { package = "parity-scale-codec", version = "3.4.0", features = ["derive"], default-features = false } +log = { version = "0.4.17", default-features = false } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.139", default-features = false } +serde_derive = { version = "1.0.117", optional = true, default-features = false } +smallvec = { version = "1.8.0", default-features = false } # Substrate frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } @@ -108,6 +108,7 @@ pallet-treasury = { git = 'https://github.com/duniter/substrate', branch = 'duni pallet-utility = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } sp-arithmetic = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } sp-consensus-babe = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sp-consensus-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } sp-std = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } diff --git a/runtime/common/src/apis.rs b/runtime/common/src/apis.rs index e31d84d6aaa773ab9792425c06d2f5f8707516b6..acea484d81fcca848a4633db1f9ac553eb380574 100644 --- a/runtime/common/src/apis.rs +++ b/runtime/common/src/apis.rs @@ -98,6 +98,12 @@ macro_rules! runtime_apis { fn metadata() -> OpaqueMetadata { OpaqueMetadata::new(Runtime::metadata().into()) } + fn metadata_at_version(version: u32) -> Option<OpaqueMetadata> { + Runtime::metadata_at_version(version) + } + fn metadata_versions() -> sp_std::vec::Vec<u32> { + Runtime::metadata_versions() + } } impl sp_block_builder::BlockBuilder<Block> for Runtime { @@ -207,6 +213,12 @@ macro_rules! runtime_apis { ) -> pallet_transaction_payment::FeeDetails<Balance> { 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) + } } #[cfg(feature = "try-runtime")] diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index 2d5fbf61e675d9daa2350327fe62a6106f36a5a6..3ea7ecebd0aed2c50ebe4dd872612d05b7135290 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -259,8 +259,11 @@ macro_rules! pallets_config { type WeightInfo = common_runtime::weights::pallet_grandpa::WeightInfo<Runtime>; type MaxAuthorities = MaxAuthorities; - type MaxSetIdSessionEntries = BondingDuration::get() * SessionsPerEra::get(); - } + type MaxSetIdSessionEntries = MaxSetIdSessionEntries; + } +parameter_types! { + pub const MaxSetIdSessionEntries: u32 = 1000;//BondingDuration::get() * SessionsPerEra::get(); +} // ONCHAINĂ‚ GOVERNANCE // @@ -518,6 +521,7 @@ macro_rules! pallets_config { } parameter_types! { pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * DAYS; +pub MaxProposalWeight: Weight = Perbill::from_percent(50) * BlockWeights::get().max_block; } impl pallet_collective::Config<Instance2> for Runtime { type RuntimeOrigin = RuntimeOrigin; @@ -527,6 +531,8 @@ macro_rules! pallets_config { type MaxProposals = frame_support::pallet_prelude::ConstU32<20>; type MaxMembers = frame_support::pallet_prelude::ConstU32<100>; type WeightInfo = common_runtime::weights::pallet_collective::WeightInfo<Runtime>; +type SetMembersOrigin = EnsureRoot<AccountId>; +type MaxProposalWeight = MaxProposalWeight; #[cfg(not(feature = "runtime-benchmarks"))] type DefaultVote = TechnicalCommitteeDefaultVote; #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/g1/Cargo.toml b/runtime/g1/Cargo.toml index 200f8210afb64b3d62f43d87c1301d684fcb9ee4..d6a6a2e4f16188e229e13c1e00d0ca6a17b88d72 100644 --- a/runtime/g1/Cargo.toml +++ b/runtime/g1/Cargo.toml @@ -103,8 +103,8 @@ try-runtime = [ ] [dev-dependencies] -sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } -sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } +sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } [dependencies] # local @@ -124,19 +124,19 @@ sp-membership = { path = '../../primitives/membership', default-features = false pallet-offences = { path = '../../pallets/offences', default-features = false } # crates.io -codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.4.0", features = ["derive"], default-features = false } log = { version = "0.4.17", default-features = false } -hex-literal = { version = '0.3.1', optional = true } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", optional = true, features = ["derive"] } +hex-literal = { version = '0.4.1', default-features = false, optional = true } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.139", default-features = false, optional = true, features = ["derive"] } # substrate -frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', optional = true } +frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } frame-try-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } frame-executive = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } frame-system = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } -frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', optional = true } +frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false} pallet-atomic-swap = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } pallet-authority-discovery = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } diff --git a/runtime/g1/src/parameters.rs b/runtime/g1/src/parameters.rs index c0c276a1180d5c21a6b76a55c4d65df8accb9371..124e57d6d2b4a758e9fba104a8ae1fe0b6774ced 100644 --- a/runtime/g1/src/parameters.rs +++ b/runtime/g1/src/parameters.rs @@ -25,7 +25,7 @@ use sp_runtime::transaction_validity::TransactionPriority; parameter_types! { pub const BlockHashCount: BlockNumber = 2400; /// We allow for 2 seconds of compute with a 6 second average block time. - pub BlockWeights: frame_system::limits::BlockWeights = block_weights((WEIGHT_REF_TIME_PER_SECOND * 2) + pub BlockWeights: frame_system::limits::BlockWeights = block_weights((Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, 0) * 2) .set_proof_size(5 * 1024 * 1024), NORMAL_DISPATCH_RATIO); pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength ::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); diff --git a/runtime/gdev/Cargo.toml b/runtime/gdev/Cargo.toml index a0f2ed026122847dccdf656ac1f9f5541db8e805..16fd2106a68d98155c917adc51401b3b20e4ebb3 100644 --- a/runtime/gdev/Cargo.toml +++ b/runtime/gdev/Cargo.toml @@ -128,8 +128,8 @@ try-runtime = [ ] [dev-dependencies] -sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } -sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } +sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } [dependencies] # local @@ -150,12 +150,12 @@ pallet-upgrade-origin = { path = '../../pallets/upgrade-origin', default-feature sp-membership = { path = '../../primitives/membership', default-features = false } # crates.io -codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.4.0", features = ["derive"], default-features = false } log = { version = "0.4.17", default-features = false } -hex-literal = { version = '0.3.1', optional = true } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", default-features = false } -serde_derive = { version = "1.0.101", optional = true } +hex-literal = { version = '0.4.1', default-features = false, optional = true } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.139", default-features = false } +serde_derive = { version = "1.0.117", default-features = false, optional = true } # substrate frame-try-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } @@ -198,5 +198,5 @@ sp-transaction-pool = { git = 'https://github.com/duniter/substrate', branch = ' sp-version = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } # substrate benchmarking -frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } +frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = false } frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } diff --git a/runtime/gdev/src/parameters.rs b/runtime/gdev/src/parameters.rs index 3308725d0e3ddd127fafbbf34d97ad836caebc86..220511c5cf42e5302e8b1b59a863afb341ba357e 100644 --- a/runtime/gdev/src/parameters.rs +++ b/runtime/gdev/src/parameters.rs @@ -26,7 +26,7 @@ use sp_runtime::transaction_validity::TransactionPriority; parameter_types! { pub const BlockHashCount: BlockNumber = 2400; /// We allow for 2 seconds of compute with a 6 second average block time. - pub BlockWeights: frame_system::limits::BlockWeights = block_weights((WEIGHT_REF_TIME_PER_SECOND * 2) + pub BlockWeights: frame_system::limits::BlockWeights = block_weights((Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, 0) * 2) .set_proof_size(5 * 1024 * 1024), NORMAL_DISPATCH_RATIO); pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength ::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); diff --git a/runtime/gdev/tests/common/mod.rs b/runtime/gdev/tests/common/mod.rs index 438ffa81fad84b4e9ced32960beeef81171b283b..12e708e6513a73290cb2ff11c617d5f5127b72d3 100644 --- a/runtime/gdev/tests/common/mod.rs +++ b/runtime/gdev/tests/common/mod.rs @@ -22,13 +22,13 @@ use frame_support::instances::{Instance1, Instance2}; use frame_support::traits::{GenesisBuild, OnFinalize, OnInitialize}; use gdev_runtime::opaque::SessionKeys; use gdev_runtime::*; +use sc_consensus_grandpa::AuthorityId as GrandpaId; use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId; use sp_consensus_babe::{AuthorityId as BabeId, Slot}; use sp_consensus_vrf::schnorrkel::{VRFOutput, VRFProof}; use sp_core::crypto::IsWrappedBy; use sp_core::sr25519; use sp_core::{Encode, Pair, Public, H256}; -use sp_finality_grandpa::AuthorityId as GrandpaId; use sp_membership::MembershipData; use sp_runtime::testing::{Digest, DigestItem}; use sp_runtime::traits::{IdentifyAccount, Verify}; diff --git a/runtime/gtest/Cargo.toml b/runtime/gtest/Cargo.toml index 63480240d914434455b89181e6247b2e1fa3aaf5..20490d39239b6ce9cafb0fbfe976251126809ae5 100644 --- a/runtime/gtest/Cargo.toml +++ b/runtime/gtest/Cargo.toml @@ -126,8 +126,8 @@ try-runtime = [ ] [dev-dependencies] -sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } -sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42' } +sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } +sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } [dependencies] # local @@ -147,12 +147,12 @@ sp-membership = { path = '../../primitives/membership', default-features = false pallet-offences = { path = '../../pallets/offences', default-features = false } # crates.io -codec = { package = "parity-scale-codec", version = "3.1.5", features = ["derive"], default-features = false } +codec = { package = "parity-scale-codec", version = "3.4.0", features = ["derive"], default-features = false } log = { version = "0.4.17", default-features = false } -hex-literal = { version = '0.3.1', optional = true } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { version = "1.0.101", default-features = false } -serde_derive = { version = "1.0.101", optional = true } +hex-literal = { version = '0.4.1', default-features = false, optional = true } +scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } +serde = { version = "1.0.139", default-features = false } +serde_derive = { version = "1.0.117", default-features = false, optional = true } # substrate frame-try-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } @@ -195,5 +195,5 @@ sp-transaction-pool = { git = 'https://github.com/duniter/substrate', branch = ' sp-version = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false } # substrate benchmarking -frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } +frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = false } frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false, optional = true } diff --git a/runtime/gtest/src/parameters.rs b/runtime/gtest/src/parameters.rs index f747cea139ebd6407bce1be8024d2717944be388..89842447c91c6fe6e8b25e48abefad871c688feb 100644 --- a/runtime/gtest/src/parameters.rs +++ b/runtime/gtest/src/parameters.rs @@ -25,7 +25,7 @@ use sp_runtime::transaction_validity::TransactionPriority; parameter_types! { pub const BlockHashCount: BlockNumber = 2400; /// We allow for 2 seconds of compute with a 6 second average block time. - pub BlockWeights: frame_system::limits::BlockWeights = block_weights((WEIGHT_REF_TIME_PER_SECOND * 2) + pub BlockWeights: frame_system::limits::BlockWeights = block_weights((Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, 0) * 2) .set_proof_size(5 * 1024 * 1024), NORMAL_DISPATCH_RATIO); pub BlockLength: frame_system::limits::BlockLength = frame_system::limits::BlockLength ::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);