Skip to content

Commit

Permalink
Upgrade polkadot v1.16.0 (nodes/rust/duniter-v2s!281)
Browse files Browse the repository at this point in the history
* remove unused deps

* fix https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/241

* remove sp_std dependency

paritytech/polkadot-sdk#2101 This is the commit message #2:

* update metadata

* clean Cargo.toml

* run benchmarks

* update node

* update crates
  • Loading branch information
bgallois authored and Hugo Trentesaux committed Oct 2, 2024
1 parent 370f548 commit 244ce1d
Show file tree
Hide file tree
Showing 160 changed files with 3,172 additions and 3,891 deletions.
2,775 changes: 1,078 additions & 1,697 deletions Cargo.lock

Large diffs are not rendered by default.

166 changes: 82 additions & 84 deletions Cargo.toml

Large diffs are not rendered by default.

174 changes: 87 additions & 87 deletions docs/api/runtime-calls.md

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions docs/api/runtime-errors.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Runtime errors

There are **191** errors from **35** pallets.
There are **190** errors from **35** pallets.

<ul>
<li>System - 0
Expand Down Expand Up @@ -697,13 +697,6 @@ More than `MAX_HASH_UPGRADE_BULK_COUNT` hashes were requested to be upgraded at
Too few hashes were requested to be upgraded (i.e. zero).
</details>
</li>
<li>
<details>
<summary>
<code>NoCost</code> - 8</summary>
No ticket with a cost was returned by [`Config::Consideration`] to store the preimage.
</details>
</li>
</ul>
</li>
<li>TechnicalCommittee - 23
Expand Down
2 changes: 0 additions & 2 deletions docs/api/runtime-errors.po
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ msgid "Preimage.TooMany"
msgstr "More than `MAX_HASH_UPGRADE_BULK_COUNT` hashes were requested to be upgraded at once."
msgid "Preimage.TooFew"
msgstr "Too few hashes were requested to be upgraded (i.e. zero)."
msgid "Preimage.NoCost"
msgstr "No ticket with a cost was returned by [`Config::Consideration`] to store the preimage."
msgid "TechnicalCommittee.NotMember"
msgstr "Account is not a member"
msgid "TechnicalCommittee.DuplicateProposal"
Expand Down
2 changes: 0 additions & 2 deletions end2end-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ std = [
"distance-oracle/std",
"hex/std",
"serde_json/std",
"sp-core-hashing/std",
"sp-core/std",
"sp-runtime/std",
]
Expand All @@ -42,7 +41,6 @@ notify-debouncer-mini = { workspace = true }
portpicker = { workspace = true }
serde_json = { workspace = true }
sp-core = { workspace = true }
sp-core-hashing = { workspace = true }
sp-keyring = { workspace = true }
sp-runtime = { workspace = true }
subxt = { workspace = true, features = [
Expand Down
1 change: 0 additions & 1 deletion live-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ version.workspace = true
anyhow = { workspace = true }
codec = { workspace = true }
countmap = { workspace = true }
hex-literal = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
subxt = { workspace = true, features = [
Expand Down
26 changes: 15 additions & 11 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ embed = []
native = []
runtime-benchmarks = [
"common-runtime/runtime-benchmarks",
"dc-distance/runtime-benchmarks",
"dc-distance?/runtime-benchmarks",
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
Expand All @@ -50,7 +50,7 @@ runtime-benchmarks = [
try-runtime = [
"runtime-benchmarks",
"common-runtime/try-runtime",
"dc-distance/try-runtime",
"dc-distance?/try-runtime",
"distance-oracle?/try-runtime",
"frame-system/try-runtime",
"g1-runtime/try-runtime",
Expand Down Expand Up @@ -113,21 +113,28 @@ async-io = { workspace = true }
bs58 = { workspace = true }
clap = { workspace = true, features = ["derive"] }
clap_complete = { workspace = true }
common-runtime = { workspace = true }
dc-distance = { workspace = true }
distance-oracle = { workspace = true, optional = true }
frame-benchmarking = { workspace = true }
frame-benchmarking-cli = { workspace = true }
frame-system = { workspace = true }
futures = { workspace = true, features = ["compat"] }
g1-runtime = { workspace = true, optional = true }
gdev-runtime = { workspace = true, optional = true }
gtest-runtime = { workspace = true, optional = true }
hex = { workspace = true }
jsonrpsee = { workspace = true, features = ["server"] }
log = { workspace = true }
memmap2 = { workspace = true }
num-format = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }

# Local
common-runtime = { workspace = true }
g1-runtime = { workspace = true, optional = true }
gdev-runtime = { workspace = true, optional = true }
gtest-runtime = { workspace = true, optional = true }
distance-oracle = { workspace = true, optional = true }
dc-distance = { workspace = true, optional = true }

# Substrate
pallet-grandpa = { workspace = true, default-features = true }
pallet-im-online = { workspace = true, default-features = true }
pallet-transaction-payment = { workspace = true, default-features = true }
Expand All @@ -153,9 +160,6 @@ sc-rpc-api = { workspace = true, default-features = true }
sc-telemetry = { workspace = true, default-features = true }
sc-transaction-pool = { workspace = true, default-features = true }
sc-transaction-pool-api = { workspace = true, default-features = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
sp-api = { workspace = true, default-features = true }
sp-authority-discovery = { workspace = true, default-features = true }
sp-block-builder = { workspace = true, default-features = true }
Expand Down
8 changes: 0 additions & 8 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ pub enum Subcommand {
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
Benchmark(Box<frame_benchmarking_cli::BenchmarkCmd>),

/// Try some command against runtime state.
#[cfg(feature = "try-runtime")]
TryRuntime,

/// Try some command against runtime state. Note: `try-runtime` feature must be enabled.
#[cfg(not(feature = "try-runtime"))]
TryRuntime,
}

/// Block authoring scheme to be used by the node
Expand Down
6 changes: 0 additions & 6 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,6 @@ pub fn run() -> sc_cli::Result<()> {
You can enable it with `--features runtime-benchmarks`."
.into())
}
#[cfg(feature = "try-runtime")]
Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()),
#[cfg(not(feature = "try-runtime"))]
Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \
You can enable it with `--features try-runtime`."
.into()),
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node_until_exit(|mut config| async move {
Expand Down
16 changes: 2 additions & 14 deletions node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#![warn(missing_docs)]

pub use sc_rpc_api::DenyUnsafe;

use common_runtime::{AccountId, Balance, Block, BlockNumber, Hash, Index};
use jsonrpsee::RpcModule;
use sc_consensus_babe::{BabeApi, BabeWorkerHandle};
Expand Down Expand Up @@ -70,8 +68,6 @@ pub struct FullDeps<C, P, SC, B> {
pub pool: Arc<P>,
/// The SelectChain Strategy
pub select_chain: SC,
/// Whether to deny unsafe calls
pub deny_unsafe: DenyUnsafe,
/// Manual seal command sink
pub command_sink_opt: Option<
futures::channel::mpsc::Sender<sc_consensus_manual_seal::EngineCommand<sp_core::H256>>,
Expand Down Expand Up @@ -109,7 +105,6 @@ where
client,
pool,
select_chain,
deny_unsafe,
command_sink_opt,
babe,
grandpa,
Expand All @@ -121,14 +116,7 @@ where
keystore,
} = babe;
module.merge(
Babe::new(
client.clone(),
babe_worker_handle,
keystore,
select_chain,
deny_unsafe,
)
.into_rpc(),
Babe::new(client.clone(), babe_worker_handle, keystore, select_chain).into_rpc(),
)?;
}

Expand All @@ -150,7 +138,7 @@ where
.into_rpc(),
)?;

module.merge(System::new(client.clone(), pool, deny_unsafe).into_rpc())?;
module.merge(System::new(client.clone(), pool).into_rpc())?;
module.merge(TransactionPayment::new(client).into_rpc())?;
if let Some(command_sink) = command_sink_opt {
// We provide the rpc handler with the sending end of the channel to allow the rpc
Expand Down
15 changes: 7 additions & 8 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use sc_consensus_grandpa::{FinalityProofProvider, SharedVoterState};
use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams};
use sc_rpc::SubscriptionTaskExecutor;
use sc_service::{
error::Error as ServiceError, Configuration, PartialComponents, TaskManager, WarpSyncParams,
error::Error as ServiceError, Configuration, PartialComponents, TaskManager, WarpSyncConfig,
};
use sc_telemetry::{Telemetry, TelemetryWorker};
use sp_consensus_babe::inherents::InherentDataProvider;
Expand Down Expand Up @@ -193,9 +193,9 @@ where
.transpose()?;

#[cfg(feature = "native")]
let executor = sc_service::new_native_or_wasm_executor(config);
let executor = sc_service::new_native_or_wasm_executor(&config.executor);
#[cfg(not(feature = "native"))]
let executor = sc_service::new_wasm_executor(config);
let executor = sc_service::new_wasm_executor(&config.executor);

let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, _>(
Expand Down Expand Up @@ -337,7 +337,7 @@ where
Block,
<Block as sp_runtime::traits::Block>::Hash,
N,
>::new(&config.network);
>::new(&config.network, config.prometheus_registry().cloned());
let metrics = N::register_notification_metrics(config.prometheus_registry());
let peer_store_handle = net_config.peer_store_handle();
let (grandpa_protocol_config, grandpa_notification_service) =
Expand All @@ -363,12 +363,12 @@ where
spawn_handle: task_manager.spawn_handle(),
import_queue,
block_announce_validator_builder: None,
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
warp_sync_config: Some(WarpSyncConfig::WithProvider(warp_sync)),
block_relay: None,
metrics,
})?;

let role = config.role.clone();
let role = config.role;
let force_authoring = config.force_authoring;
let backoff_authoring_blocks: Option<()> = None;
let name = config.network.node_name.clone();
Expand Down Expand Up @@ -591,7 +591,7 @@ where
let rpc_setup = shared_voter_state.clone();

Box::new(
move |deny_unsafe, subscription_task_executor: SubscriptionTaskExecutor| {
move |subscription_task_executor: SubscriptionTaskExecutor| {
let grandpa_deps = crate::rpc::GrandpaDeps {
shared_voter_state: rpc_setup.clone(),
shared_authority_set: shared_authority_set.clone(),
Expand All @@ -604,7 +604,6 @@ where
client: client.clone(),
pool: pool.clone(),
select_chain: select_chain.clone(),
deny_unsafe,
babe: babe_deps.clone(),
grandpa: grandpa_deps,
command_sink_opt: command_sink_opt.clone(),
Expand Down
6 changes: 2 additions & 4 deletions pallets/authority-members/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ std = [
"sp-runtime/std",
"sp-staking/std",
"sp-state-machine/std",
"sp-std/std",
]
try-runtime = [
"frame-support/try-runtime",
Expand All @@ -59,8 +58,7 @@ serde = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-staking = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
sp-io = { workspace = true }
sp-state-machine = { workspace = true }
sp-io = { workspace = true, default-features = true }
sp-state-machine = { workspace = true, default-features = true }
11 changes: 5 additions & 6 deletions pallets/authority-members/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ pub use traits::*;
pub use types::*;
pub use weights::WeightInfo;

use codec::alloc::borrow::ToOwned;
use frame_support::traits::Get;
use sp_runtime::traits::Convert;
use sp_std::prelude::*;
use scale_info::prelude::{collections::BTreeMap, vec, vec::Vec};
use sp_runtime::traits::{Convert, IsMember};

#[frame_support::pallet]
pub mod pallet {
Expand All @@ -75,8 +76,6 @@ pub mod pallet {
traits::{StorageVersion, UnfilteredDispatchable, ValidatorRegistration},
};
use frame_system::pallet_prelude::*;
use sp_runtime::traits::{Convert, IsMember};
use sp_std::{collections::btree_map::BTreeMap, vec};

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
Expand Down Expand Up @@ -661,7 +660,7 @@ impl<T: Config> pallet_session::historical::SessionManager<T::ValidatorId, T::Fu
{
fn new_session(
new_index: SessionIndex,
) -> Option<sp_std::vec::Vec<(T::ValidatorId, T::FullIdentification)>> {
) -> Option<Vec<(T::ValidatorId, T::FullIdentification)>> {
<Self as pallet_session::SessionManager<_>>::new_session(new_index).map(|validators_ids| {
validators_ids
.into_iter()
Expand All @@ -672,7 +671,7 @@ impl<T: Config> pallet_session::historical::SessionManager<T::ValidatorId, T::Fu

fn new_session_genesis(
new_index: SessionIndex,
) -> Option<sp_std::vec::Vec<(T::ValidatorId, T::FullIdentification)>> {
) -> Option<Vec<(T::ValidatorId, T::FullIdentification)>> {
<Self as pallet_session::SessionManager<_>>::new_session_genesis(new_index).map(
|validators_ids| {
validators_ids
Expand Down
11 changes: 8 additions & 3 deletions pallets/authority-members/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ pub fn new_test_ext(initial_authorities_len: u64) -> sp_io::TestExternalities {
.map(|i| (i * 3, i * 3, UintAuthorityId(i * 3).into()))
.collect();

let non_authority_keys = Vec::default();

let mut t = frame_system::GenesisConfig::<Test>::default()
.build_storage()
.unwrap();
Expand All @@ -184,9 +186,12 @@ pub fn new_test_ext(initial_authorities_len: u64) -> sp_io::TestExternalities {
}
.assimilate_storage(&mut t)
.unwrap();
pallet_session::GenesisConfig::<Test> { keys }
.assimilate_storage(&mut t)
.unwrap();
pallet_session::GenesisConfig::<Test> {
keys,
non_authority_keys,
}
.assimilate_storage(&mut t)
.unwrap();
sp_io::TestExternalities::new(t)
}

Expand Down
8 changes: 3 additions & 5 deletions pallets/certification/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ std = [
"sp-io/std",
"sp-keystore/std",
"sp-runtime/std",
"sp-std/std",
]
try-runtime = [
"duniter-primitives/try-runtime",
Expand All @@ -49,9 +48,8 @@ frame-system = { workspace = true }
scale-info = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }

[dev-dependencies]
maplit = { workspace = true }
sp-io = { workspace = true }
sp-keystore = { workspace = true }
maplit = { workspace = true, default-features = true }
sp-io = { workspace = true, default-features = true }
sp-keystore = { workspace = true, default-features = true }
3 changes: 1 addition & 2 deletions pallets/certification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ use crate::traits::*;
use codec::Codec;
use duniter_primitives::Idty;
use frame_support::{pallet_prelude::*, traits::StorageVersion};
use scale_info::prelude::{collections::BTreeMap, fmt::Debug, vec::Vec};
use sp_runtime::traits::AtLeast32BitUnsigned;
use sp_std::{fmt::Debug, vec::Vec};

#[frame_support::pallet]
pub mod pallet {
use super::*;
use frame_system::pallet_prelude::*;
use sp_runtime::traits::Saturating;
use sp_std::collections::btree_map::BTreeMap;

/// The current storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
Expand Down
2 changes: 1 addition & 1 deletion pallets/certification/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use crate::{mock::*, Error, Event};
use frame_support::{assert_noop, assert_ok};
use maplit::btreemap;
use sp_std::collections::btree_map::BTreeMap;
use scale_info::prelude::{collections::BTreeMap, vec};

#[test]
fn test_must_receive_cert_before_can_issue() {
Expand Down
Loading

0 comments on commit 244ce1d

Please sign in to comment.