Skip to content

Commit

Permalink
Merge branch 'master' into improve-storage-monitor-api
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr authored Jan 10, 2024
2 parents efb0de2 + ccd5555 commit 540f91d
Show file tree
Hide file tree
Showing 44 changed files with 4,069 additions and 1,000 deletions.
8 changes: 8 additions & 0 deletions .gitlab/pipeline/zombienet/polkadot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ zombienet-polkadot-functional-0009-approval-voting-coalescing:
--local-dir="${LOCAL_DIR}/functional"
--test="0009-approval-voting-coalescing.zndsl"

zombienet-polkadot-functional-0010-validator-disabling:
extends:
- .zombienet-polkadot-common
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-local-env-manager.sh
--local-dir="${LOCAL_DIR}/functional"
--test="0010-validator-disabling.zndsl"

zombienet-polkadot-smoke-0001-parachains-smoke-test:
extends:
- .zombienet-polkadot-common
Expand Down
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 29 additions & 3 deletions cumulus/parachains/runtimes/people/people-rococo/src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ use frame_support::{
RuntimeDebugNoBound,
};
use pallet_identity::{Data, IdentityInformationProvider};
use parachains_common::impls::ToParentTreasury;
use parachains_common::{impls::ToParentTreasury, DAYS};
use scale_info::TypeInfo;
use sp_runtime::{traits::AccountIdConversion, RuntimeDebug};
use sp_runtime::{
traits::{AccountIdConversion, Verify},
RuntimeDebug,
};
use sp_std::prelude::*;

parameter_types! {
Expand All @@ -51,6 +54,12 @@ impl pallet_identity::Config for Runtime {
type Slashed = ToParentTreasury<RelayTreasuryAccount, LocationToAccountId, Runtime>;
type ForceOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = EnsureRoot<Self::AccountId>;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -84,7 +93,6 @@ pub enum IdentityField {
TypeInfo,
)]
#[codec(mel_bound())]
#[cfg_attr(test, derive(frame_support::DefaultNoBound))]
pub struct IdentityInfo {
/// A reasonable display name for the controller of the account. This should be whatever the
/// account is typically known as and should not be confusable with other entities, given
Expand Down Expand Up @@ -202,3 +210,21 @@ impl IdentityInfo {
res
}
}

/// A `Default` identity. This is given to users who get a username but have not set an identity.
impl Default for IdentityInfo {
fn default() -> Self {
IdentityInfo {
display: Data::None,
legal: Data::None,
web: Data::None,
matrix: Data::None,
email: Data::None,
pgp_fingerprint: None,
image: Data::None,
twitter: Data::None,
github: Data::None,
discord: Data::None,
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,98 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Identity::UsernameAuthorities` (r:0 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn add_username_authority() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_873_000 picoseconds.
Weight::from_parts(13_873_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::UsernameAuthorities` (r:0 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn remove_username_authority() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 10_653_000 picoseconds.
Weight::from_parts(10_653_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::UsernameAuthorities` (r:1 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `Identity::AccountOfUsername` (r:1 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn set_username_for() -> Weight {
// Proof Size summary in bytes:
// Measured: `80`
// Estimated: `11037`
// Minimum execution time: 75_928_000 picoseconds.
Weight::from_parts(75_928_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Identity::PendingUsernames` (r:1 w:1)
/// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
/// Storage: `Identity::AccountOfUsername` (r:0 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn accept_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `11037`
// Minimum execution time: 38_157_000 picoseconds.
Weight::from_parts(38_157_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Identity::PendingUsernames` (r:1 w:1)
/// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
fn remove_expired_approval() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3542`
// Minimum execution time: 46_821_000 picoseconds.
Weight::from_parts(46_821_000, 0)
.saturating_add(Weight::from_parts(0, 3542))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::AccountOfUsername` (r:1 w:0)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn set_primary_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `247`
// Estimated: `11037`
// Minimum execution time: 22_515_000 picoseconds.
Weight::from_parts(22_515_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::AccountOfUsername` (r:1 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:0)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn remove_dangling_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `126`
// Estimated: `11037`
// Minimum execution time: 15_997_000 picoseconds.
Weight::from_parts(15_997_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
32 changes: 29 additions & 3 deletions cumulus/parachains/runtimes/people/people-westend/src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ use frame_support::{
RuntimeDebugNoBound,
};
use pallet_identity::{Data, IdentityInformationProvider};
use parachains_common::impls::ToParentTreasury;
use parachains_common::{impls::ToParentTreasury, DAYS};
use scale_info::TypeInfo;
use sp_runtime::{traits::AccountIdConversion, RuntimeDebug};
use sp_runtime::{
traits::{AccountIdConversion, Verify},
RuntimeDebug,
};
use sp_std::prelude::*;

parameter_types! {
Expand All @@ -51,6 +54,12 @@ impl pallet_identity::Config for Runtime {
type Slashed = ToParentTreasury<RelayTreasuryAccount, LocationToAccountId, Runtime>;
type ForceOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = EnsureRoot<Self::AccountId>;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -84,7 +93,6 @@ pub enum IdentityField {
TypeInfo,
)]
#[codec(mel_bound())]
#[cfg_attr(test, derive(frame_support::DefaultNoBound))]
pub struct IdentityInfo {
/// A reasonable display name for the controller of the account. This should be whatever it is
/// that it is typically known as and should not be confusable with other entities, given
Expand Down Expand Up @@ -202,3 +210,21 @@ impl IdentityInfo {
res
}
}

/// A `Default` identity. This is given to users who get a username but have not set an identity.
impl Default for IdentityInfo {
fn default() -> Self {
IdentityInfo {
display: Data::None,
legal: Data::None,
web: Data::None,
matrix: Data::None,
email: Data::None,
pgp_fingerprint: None,
image: Data::None,
twitter: Data::None,
github: Data::None,
discord: Data::None,
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,98 @@ impl<T: frame_system::Config> pallet_identity::WeightInfo for WeightInfo<T> {
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2))
}
/// Storage: `Identity::UsernameAuthorities` (r:0 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn add_username_authority() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 13_873_000 picoseconds.
Weight::from_parts(13_873_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::UsernameAuthorities` (r:0 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
fn remove_username_authority() -> Weight {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
// Minimum execution time: 10_653_000 picoseconds.
Weight::from_parts(10_653_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::UsernameAuthorities` (r:1 w:1)
/// Proof: `Identity::UsernameAuthorities` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`)
/// Storage: `Identity::AccountOfUsername` (r:1 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn set_username_for() -> Weight {
// Proof Size summary in bytes:
// Measured: `80`
// Estimated: `11037`
// Minimum execution time: 75_928_000 picoseconds.
Weight::from_parts(75_928_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Identity::PendingUsernames` (r:1 w:1)
/// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
/// Storage: `Identity::AccountOfUsername` (r:0 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
fn accept_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `11037`
// Minimum execution time: 38_157_000 picoseconds.
Weight::from_parts(38_157_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3))
}
/// Storage: `Identity::PendingUsernames` (r:1 w:1)
/// Proof: `Identity::PendingUsernames` (`max_values`: None, `max_size`: Some(77), added: 2552, mode: `MaxEncodedLen`)
fn remove_expired_approval() -> Weight {
// Proof Size summary in bytes:
// Measured: `106`
// Estimated: `3542`
// Minimum execution time: 46_821_000 picoseconds.
Weight::from_parts(46_821_000, 0)
.saturating_add(Weight::from_parts(0, 3542))
.saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::AccountOfUsername` (r:1 w:0)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:1)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn set_primary_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `247`
// Estimated: `11037`
// Minimum execution time: 22_515_000 picoseconds.
Weight::from_parts(22_515_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
/// Storage: `Identity::AccountOfUsername` (r:1 w:1)
/// Proof: `Identity::AccountOfUsername` (`max_values`: None, `max_size`: Some(73), added: 2548, mode: `MaxEncodedLen`)
/// Storage: `Identity::IdentityOf` (r:1 w:0)
/// Proof: `Identity::IdentityOf` (`max_values`: None, `max_size`: Some(7572), added: 10047, mode: `MaxEncodedLen`)
fn remove_dangling_username() -> Weight {
// Proof Size summary in bytes:
// Measured: `126`
// Estimated: `11037`
// Minimum execution time: 15_997_000 picoseconds.
Weight::from_parts(15_997_000, 0)
.saturating_add(Weight::from_parts(0, 11037))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}
}
2 changes: 1 addition & 1 deletion polkadot/node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rand = "0.8.5"

[dev-dependencies]
async-trait = "0.1.74"
parking_lot = "0.12.0"
parking_lot = "0.12.1"
sp-keyring = { path = "../../../../substrate/primitives/keyring" }
sp-keystore = { path = "../../../../substrate/primitives/keystore" }
sp-core = { path = "../../../../substrate/primitives/core" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/av-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ sp-core = { path = "../../../../substrate/primitives/core" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-keyring = { path = "../../../../substrate/primitives/keyring" }
parking_lot = "0.12.0"
parking_lot = "0.12.1"
test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" }
2 changes: 1 addition & 1 deletion polkadot/node/core/chain-selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ parity-scale-codec = "3.6.1"
[dev-dependencies]
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-core = { path = "../../../../substrate/primitives/core" }
parking_lot = "0.12.0"
parking_lot = "0.12.1"
assert_matches = "1"
kvdb-memorydb = "0.13.0"
2 changes: 1 addition & 1 deletion polkadot/node/jaeger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
[dependencies]
mick-jaeger = "0.1.8"
lazy_static = "1.4"
parking_lot = "0.12.0"
parking_lot = "0.12.1"
polkadot-primitives = { path = "../../primitives" }
polkadot-node-primitives = { path = "../primitives" }
sc-network = { path = "../../../substrate/client/network" }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ polkadot-node-metrics = { path = "../../metrics" }
polkadot-node-network-protocol = { path = "../protocol" }
polkadot-node-subsystem = { path = "../../subsystem" }
polkadot-overseer = { path = "../../overseer" }
parking_lot = "0.12.0"
parking_lot = "0.12.1"
bytes = "1"
fatality = "0.0.6"
thiserror = "1"
Expand Down
Loading

0 comments on commit 540f91d

Please sign in to comment.