Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Show changes
Showing
with 526 additions and 459 deletions
...@@ -15,10 +15,11 @@ ...@@ -15,10 +15,11 @@
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
use crate::{Balance, BlockNumber}; use crate::{Balance, BlockNumber};
use frame_support::weights::constants::WEIGHT_PER_MICROS;
use frame_support::weights::Weight; use frame_support::weights::Weight;
use sp_runtime::Perbill; use sp_runtime::Perbill;
pub use crate::weights::paritydb_weights::constants::ParityDbWeight as DbWeight;
/// This determines the average expected block time that we are targeting. /// This determines the average expected block time that we are targeting.
/// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`. /// Blocks will be produced at a minimum duration defined by `SLOT_DURATION`.
/// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked /// `SLOT_DURATION` is picked up by `pallet_timestamp` which is in turn picked
...@@ -63,39 +64,24 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); ...@@ -63,39 +64,24 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
// WEIGHTS CONSTANTS // // WEIGHTS CONSTANTS //
// Read DB weights
pub const READ_WEIGHTS: Weight = 250 * WEIGHT_PER_MICROS; // ~250 µs
// Write DB weights
pub const WRITE_WEIGHTS: Weight = 1_000 * WEIGHT_PER_MICROS; // ~1000 µs
// Execution cost of everything outside of the call itself:
// signature verification, pre_dispatch and post_dispatch
pub const EXTRINSIC_BASE_WEIGHTS: Weight = READ_WEIGHTS + WRITE_WEIGHTS;
// DB weights
frame_support::parameter_types! {
pub const DbWeight: frame_support::weights::RuntimeDbWeight = frame_support::weights::RuntimeDbWeight {
read: READ_WEIGHTS,
write: WRITE_WEIGHTS,
};
}
// Block weights limits // Block weights limits
pub fn block_weights( pub fn block_weights(
expected_block_weight: Weight, expected_block_weight: Weight,
normal_ratio: sp_arithmetic::Perbill, normal_ratio: sp_arithmetic::Perbill,
) -> frame_system::limits::BlockWeights { ) -> frame_system::limits::BlockWeights {
let base_weight = DbWeight::get().reads(1) + DbWeight::get().writes(1);
let normal_weight = normal_ratio * expected_block_weight; let normal_weight = normal_ratio * expected_block_weight;
frame_system::limits::BlockWeights::builder() frame_system::limits::BlockWeights::builder()
.for_class(frame_support::weights::DispatchClass::Normal, |weights| { .base_block(crate::weights::block_weights::BlockExecutionWeight::get())
weights.base_extrinsic = EXTRINSIC_BASE_WEIGHTS; .for_class(frame_support::dispatch::DispatchClass::all(), |weights| {
weights.base_extrinsic = base_weight;
})
.for_class(frame_support::dispatch::DispatchClass::Normal, |weights| {
weights.max_total = normal_weight.into(); weights.max_total = normal_weight.into();
}) })
.for_class( .for_class(
frame_support::weights::DispatchClass::Operational, frame_support::dispatch::DispatchClass::Operational,
|weights| { |weights| {
weights.base_extrinsic = EXTRINSIC_BASE_WEIGHTS;
weights.max_total = expected_block_weight.into(); weights.max_total = expected_block_weight.into();
weights.reserved = (expected_block_weight - normal_weight).into(); weights.reserved = (expected_block_weight - normal_weight).into();
}, },
......
...@@ -26,8 +26,9 @@ where ...@@ -26,8 +26,9 @@ where
type Balance = T; type Balance = T;
// Force constant fees // Force constant fees
fn weight_to_fee(lenght_in_bytes: &Weight) -> Self::Balance { fn weight_to_fee(length_in_bytes: &Weight) -> Self::Balance {
(*lenght_in_bytes as u32 / 1_000_u32).into() ((length_in_bytes.ref_time() as u32 + length_in_bytes.proof_size() as u32) / 1_000_u32)
.into()
} }
} }
......
...@@ -31,7 +31,7 @@ where ...@@ -31,7 +31,7 @@ where
{ {
fn on_new_session(_index: sp_staking::SessionIndex) -> Weight { fn on_new_session(_index: sp_staking::SessionIndex) -> Weight {
pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch(); pallet_provide_randomness::Pallet::<Runtime>::on_new_epoch();
0 Weight::zero()
} }
} }
...@@ -69,7 +69,7 @@ where ...@@ -69,7 +69,7 @@ where
} }
IdtyEvent::Created { .. } | IdtyEvent::Confirmed | IdtyEvent::Removed { .. } => {} IdtyEvent::Created { .. } | IdtyEvent::Confirmed | IdtyEvent::Removed { .. } => {}
} }
0 Weight::zero()
} }
} }
...@@ -99,7 +99,7 @@ impl< ...@@ -99,7 +99,7 @@ impl<
Runtime::DbWeight::get().reads(1) Runtime::DbWeight::get().reads(1)
} }
} }
_ => 0, _ => Weight::zero(),
}) + Inner::on_event(membership_event) }) + Inner::on_event(membership_event)
} }
} }
...@@ -147,7 +147,7 @@ impl< ...@@ -147,7 +147,7 @@ impl<
println!("fail to set session keys: {:?}", e) println!("fail to set session keys: {:?}", e)
} }
} }
0 Weight::zero()
} }
sp_membership::Event::MembershipRevoked(idty_index) => { sp_membership::Event::MembershipRevoked(idty_index) => {
let call = pallet_authority_members::Call::<Runtime>::remove_member { let call = pallet_authority_members::Call::<Runtime>::remove_member {
...@@ -160,9 +160,9 @@ impl< ...@@ -160,9 +160,9 @@ impl<
println!("faid to remove member: {:?}", e) println!("faid to remove member: {:?}", e)
} }
} }
0 Weight::zero()
} }
_ => 0, _ => Weight::zero(),
}) + Inner::on_event(membership_event) }) + Inner::on_event(membership_event)
} }
} }
...@@ -182,7 +182,7 @@ where ...@@ -182,7 +182,7 @@ where
println!("fail to revoke membership: {:?}", e) println!("fail to revoke membership: {:?}", e)
} }
} }
0 Weight::zero()
} }
} }
...@@ -221,7 +221,7 @@ where ...@@ -221,7 +221,7 @@ where
); );
} }
0 Weight::zero()
} }
} }
......
...@@ -35,7 +35,7 @@ macro_rules! pallets_config { ...@@ -35,7 +35,7 @@ macro_rules! pallets_config {
/// The identifier used to distinguish between accounts. /// The identifier used to distinguish between accounts.
type AccountId = AccountId; type AccountId = AccountId;
/// The aggregated dispatch type that is available for extrinsics. /// The aggregated dispatch type that is available for extrinsics.
type Call = Call; type RuntimeCall = RuntimeCall;
/// The lookup mechanism to get account ID from whatever is passed in dispatchers. /// The lookup mechanism to get account ID from whatever is passed in dispatchers.
type Lookup = AccountIdLookup<AccountId, ()>; type Lookup = AccountIdLookup<AccountId, ()>;
/// The index type for storing how many extrinsics an account has signed. /// The index type for storing how many extrinsics an account has signed.
...@@ -49,9 +49,9 @@ macro_rules! pallets_config { ...@@ -49,9 +49,9 @@ macro_rules! pallets_config {
/// The header type. /// The header type.
type Header = generic::Header<BlockNumber, BlakeTwo256>; type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// The ubiquitous event type. /// The ubiquitous event type.
type Event = Event; type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type. /// The ubiquitous origin type.
type Origin = Origin; type RuntimeOrigin = RuntimeOrigin;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first). /// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount; type BlockHashCount = BlockHashCount;
/// The weight of database operations that the runtime can invoke. /// The weight of database operations that the runtime can invoke.
...@@ -86,26 +86,25 @@ macro_rules! pallets_config { ...@@ -86,26 +86,25 @@ macro_rules! pallets_config {
pub const NoPreimagePostponement: Option<u32> = Some(10); pub const NoPreimagePostponement: Option<u32> = Some(10);
} }
impl pallet_scheduler::Config for Runtime { impl pallet_scheduler::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Origin = Origin; type RuntimeOrigin = RuntimeOrigin;
type PalletsOrigin = OriginCaller; type PalletsOrigin = OriginCaller;
type Call = Call; type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight; type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = EnsureRoot<AccountId>; type ScheduleOrigin = EnsureRoot<AccountId>;
type OriginPrivilegeCmp = EqualPrivilegeOnly; type OriginPrivilegeCmp = EqualPrivilegeOnly;
type MaxScheduledPerBlock = MaxScheduledPerBlock; type MaxScheduledPerBlock = MaxScheduledPerBlock;
type WeightInfo = common_runtime::weights::pallet_scheduler::WeightInfo<Runtime>; type WeightInfo = common_runtime::weights::pallet_scheduler::WeightInfo<Runtime>;
type PreimageProvider = Preimage; type Preimages = Preimage;
type NoPreimagePostponement = ();
} }
// ACCOUNT // // ACCOUNT //
impl pallet_duniter_account::Config for Runtime { impl pallet_duniter_account::Config for Runtime {
type AccountIdToSalt = sp_runtime::traits::ConvertInto; type AccountIdToSalt = sp_runtime::traits::ConvertInto;
type Event = Event;
type MaxNewAccountsPerBlock = frame_support::pallet_prelude::ConstU32<1>; type MaxNewAccountsPerBlock = frame_support::pallet_prelude::ConstU32<1>;
type NewAccountPrice = frame_support::traits::ConstU64<300>; type NewAccountPrice = frame_support::traits::ConstU64<300>;
type RuntimeEvent = RuntimeEvent;
} }
// BLOCK CREATION // // BLOCK CREATION //
...@@ -154,11 +153,11 @@ macro_rules! pallets_config { ...@@ -154,11 +153,11 @@ macro_rules! pallets_config {
type ReserveIdentifier = [u8; 8]; type ReserveIdentifier = [u8; 8];
/// The type for recording an account's balance. /// The type for recording an account's balance.
type Balance = Balance; type Balance = Balance;
/// The ubiquitous event type.
type Event = Event;
type DustRemoval = Treasury; type DustRemoval = Treasury;
type ExistentialDeposit = ExistentialDeposit; type ExistentialDeposit = ExistentialDeposit;
type AccountStore = Account; type AccountStore = Account;
/// The ubiquitous event type.
type RuntimeEvent = RuntimeEvent;
type WeightInfo = common_runtime::weights::pallet_balances::WeightInfo<Runtime>; type WeightInfo = common_runtime::weights::pallet_balances::WeightInfo<Runtime>;
} }
...@@ -175,16 +174,16 @@ macro_rules! pallets_config { ...@@ -175,16 +174,16 @@ macro_rules! pallets_config {
} }
pub struct OnChargeTransaction; pub struct OnChargeTransaction;
impl pallet_transaction_payment::Config for Runtime { impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type OnChargeTransaction = OneshotAccount; type OnChargeTransaction = OneshotAccount;
type OperationalFeeMultiplier = frame_support::traits::ConstU8<5>; type OperationalFeeMultiplier = frame_support::traits::ConstU8<5>;
type WeightToFee = common_runtime::fees::WeightToFeeImpl<Balance>; type WeightToFee = common_runtime::fees::WeightToFeeImpl<Balance>;
type LengthToFee = common_runtime::fees::LengthToFeeImpl<Balance>; type LengthToFee = common_runtime::fees::LengthToFeeImpl<Balance>;
type FeeMultiplierUpdate = (); type FeeMultiplierUpdate = ();
type RuntimeEvent = RuntimeEvent;
} }
impl pallet_oneshot_account::Config for Runtime { impl pallet_oneshot_account::Config for Runtime {
type Currency = Balances; type Currency = Balances;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type InnerOnChargeTransaction = CurrencyAdapter<Balances, HandleFees>; type InnerOnChargeTransaction = CurrencyAdapter<Balances, HandleFees>;
} }
...@@ -194,7 +193,6 @@ macro_rules! pallets_config { ...@@ -194,7 +193,6 @@ macro_rules! pallets_config {
type MaxAuthorities = MaxAuthorities; type MaxAuthorities = MaxAuthorities;
} }
impl pallet_authority_members::Config for Runtime { impl pallet_authority_members::Config for Runtime {
type Event = Event;
type KeysWrapper = opaque::SessionKeysWrapper; type KeysWrapper = opaque::SessionKeysWrapper;
type IsMember = SmithsMembership; type IsMember = SmithsMembership;
type OnNewSession = OnNewSessionHandler<Runtime>; type OnNewSession = OnNewSessionHandler<Runtime>;
...@@ -205,6 +203,7 @@ macro_rules! pallets_config { ...@@ -205,6 +203,7 @@ macro_rules! pallets_config {
type MaxKeysLife = frame_support::pallet_prelude::ConstU32<1_500>; type MaxKeysLife = frame_support::pallet_prelude::ConstU32<1_500>;
type MaxOfflineSessions = frame_support::pallet_prelude::ConstU32<2_400>; type MaxOfflineSessions = frame_support::pallet_prelude::ConstU32<2_400>;
type RemoveMemberOrigin = EnsureRoot<Self::AccountId>; type RemoveMemberOrigin = EnsureRoot<Self::AccountId>;
type RuntimeEvent = RuntimeEvent;
} }
impl pallet_authorship::Config for Runtime { impl pallet_authorship::Config for Runtime {
type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>; type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Babe>;
...@@ -214,7 +213,7 @@ macro_rules! pallets_config { ...@@ -214,7 +213,7 @@ macro_rules! pallets_config {
} }
impl pallet_im_online::Config for Runtime { impl pallet_im_online::Config for Runtime {
type AuthorityId = ImOnlineId; type AuthorityId = ImOnlineId;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type ValidatorSet = Historical; type ValidatorSet = Historical;
type NextSessionRotation = Babe; type NextSessionRotation = Babe;
type ReportUnresponsiveness = Offences; type ReportUnresponsiveness = Offences;
...@@ -225,12 +224,12 @@ macro_rules! pallets_config { ...@@ -225,12 +224,12 @@ macro_rules! pallets_config {
type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize; type MaxPeerDataEncodingSize = MaxPeerDataEncodingSize;
} }
impl pallet_offences::Config for Runtime { impl pallet_offences::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>; type IdentificationTuple = pallet_session::historical::IdentificationTuple<Self>;
type OnOffenceHandler = (); type OnOffenceHandler = ();
} }
impl pallet_session::Config for Runtime { impl pallet_session::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type ValidatorId = AccountId; type ValidatorId = AccountId;
type ValidatorIdOf = sp_runtime::traits::ConvertInto; type ValidatorIdOf = sp_runtime::traits::ConvertInto;
type ShouldEndSession = Babe; type ShouldEndSession = Babe;
...@@ -245,8 +244,7 @@ macro_rules! pallets_config { ...@@ -245,8 +244,7 @@ macro_rules! pallets_config {
type FullIdentificationOf = FullIdentificationOfImpl; type FullIdentificationOf = FullIdentificationOfImpl;
} }
impl pallet_grandpa::Config for Runtime { impl pallet_grandpa::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call;
type KeyOwnerProofSystem = (); type KeyOwnerProofSystem = ();
...@@ -274,8 +272,8 @@ macro_rules! pallets_config { ...@@ -274,8 +272,8 @@ macro_rules! pallets_config {
} }
impl pallet_upgrade_origin::Config for Runtime { impl pallet_upgrade_origin::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call; type Call = RuntimeCall;
type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>; type UpgradableOrigin = pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>;
type WeightInfo = common_runtime::weights::pallet_upgrade_origin::WeightInfo<Runtime>; type WeightInfo = common_runtime::weights::pallet_upgrade_origin::WeightInfo<Runtime>;
#[cfg(feature = "runtime-benchmarks")] #[cfg(feature = "runtime-benchmarks")]
...@@ -292,10 +290,9 @@ macro_rules! pallets_config { ...@@ -292,10 +290,9 @@ macro_rules! pallets_config {
impl pallet_preimage::Config for Runtime { impl pallet_preimage::Config for Runtime {
type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>; type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Currency = Balances; type Currency = Balances;
type ManagerOrigin = EnsureRoot<AccountId>; type ManagerOrigin = EnsureRoot<AccountId>;
type MaxSize = PreimageMaxSize;
type BaseDeposit = PreimageBaseDeposit; type BaseDeposit = PreimageBaseDeposit;
type ByteDeposit = PreimageByteDeposit; type ByteDeposit = PreimageByteDeposit;
} }
...@@ -303,14 +300,13 @@ macro_rules! pallets_config { ...@@ -303,14 +300,13 @@ macro_rules! pallets_config {
// UTILITIES // // UTILITIES //
impl pallet_atomic_swap::Config for Runtime { impl pallet_atomic_swap::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type SwapAction = pallet_atomic_swap::BalanceSwapAction<AccountId, Balances>; type SwapAction = pallet_atomic_swap::BalanceSwapAction<AccountId, Balances>;
type ProofLimit = frame_support::traits::ConstU32<1_024>; type ProofLimit = frame_support::traits::ConstU32<1_024>;
} }
impl pallet_provide_randomness::Config for Runtime { impl pallet_provide_randomness::Config for Runtime {
type Currency = Balances; type Currency = Balances;
type Event = Event;
type GetCurrentEpochIndex = GetCurrentEpochIndex<Self>; type GetCurrentEpochIndex = GetCurrentEpochIndex<Self>;
type MaxRequests = frame_support::traits::ConstU32<100>; type MaxRequests = frame_support::traits::ConstU32<100>;
type RequestPrice = frame_support::traits::ConstU64<2_000>; type RequestPrice = frame_support::traits::ConstU64<2_000>;
...@@ -318,6 +314,7 @@ macro_rules! pallets_config { ...@@ -318,6 +314,7 @@ macro_rules! pallets_config {
type OnUnbalanced = Treasury; type OnUnbalanced = Treasury;
type ParentBlockRandomness = pallet_babe::ParentBlockRandomness<Self>; type ParentBlockRandomness = pallet_babe::ParentBlockRandomness<Self>;
type RandomnessFromOneEpochAgo = pallet_babe::RandomnessFromOneEpochAgo<Self>; type RandomnessFromOneEpochAgo = pallet_babe::RandomnessFromOneEpochAgo<Self>;
type RuntimeEvent = RuntimeEvent;
} }
parameter_types! { parameter_types! {
...@@ -329,8 +326,8 @@ macro_rules! pallets_config { ...@@ -329,8 +326,8 @@ macro_rules! pallets_config {
pub const AnnouncementDepositFactor: Balance = deposit(0, 66); pub const AnnouncementDepositFactor: Balance = deposit(0, 66);
} }
impl pallet_proxy::Config for Runtime { impl pallet_proxy::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call; type RuntimeCall = RuntimeCall;
type Currency = Balances; type Currency = Balances;
type ProxyType = ProxyType; type ProxyType = ProxyType;
type ProxyDepositBase = ProxyDepositBase; type ProxyDepositBase = ProxyDepositBase;
...@@ -348,8 +345,8 @@ macro_rules! pallets_config { ...@@ -348,8 +345,8 @@ macro_rules! pallets_config {
pub const DepositFactor: Balance = DEPOSIT_PER_BYTE * 32; pub const DepositFactor: Balance = DEPOSIT_PER_BYTE * 32;
} }
impl pallet_multisig::Config for Runtime { impl pallet_multisig::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call; type RuntimeCall = RuntimeCall;
type Currency = Balances; type Currency = Balances;
type DepositBase = DepositBase; type DepositBase = DepositBase;
type DepositFactor = DepositFactor; type DepositFactor = DepositFactor;
...@@ -358,8 +355,8 @@ macro_rules! pallets_config { ...@@ -358,8 +355,8 @@ macro_rules! pallets_config {
} }
impl pallet_utility::Config for Runtime { impl pallet_utility::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call; type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller; type PalletsOrigin = OriginCaller;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Self>; type WeightInfo = pallet_utility::weights::SubstrateWeight<Self>;
} }
...@@ -378,7 +375,7 @@ macro_rules! pallets_config { ...@@ -378,7 +375,7 @@ macro_rules! pallets_config {
type Burn = Burn; type Burn = Burn;
type BurnDestination = (); type BurnDestination = ();
type Currency = Balances; type Currency = Balances;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type OnSlash = Treasury; type OnSlash = Treasury;
type ProposalBond = ProposalBond; type ProposalBond = ProposalBond;
type ProposalBondMinimum = frame_support::traits::ConstU64<10_000>; type ProposalBondMinimum = frame_support::traits::ConstU64<10_000>;
...@@ -404,7 +401,7 @@ macro_rules! pallets_config { ...@@ -404,7 +401,7 @@ macro_rules! pallets_config {
impl pallet_universal_dividend::Config for Runtime { impl pallet_universal_dividend::Config for Runtime {
type BlockNumberIntoBalance = sp_runtime::traits::ConvertInto; type BlockNumberIntoBalance = sp_runtime::traits::ConvertInto;
type Currency = pallet_balances::Pallet<Runtime>; type Currency = pallet_balances::Pallet<Runtime>;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type MaxPastReeval = frame_support::traits::ConstU32<4>; type MaxPastReeval = frame_support::traits::ConstU32<4>;
type MembersCount = MembersCount; type MembersCount = MembersCount;
type MembersStorage = common_runtime::providers::UdMembersStorage<Runtime>; type MembersStorage = common_runtime::providers::UdMembersStorage<Runtime>;
...@@ -429,8 +426,7 @@ macro_rules! pallets_config { ...@@ -429,8 +426,7 @@ macro_rules! pallets_config {
impl pallet_identity::Config for Runtime { impl pallet_identity::Config for Runtime {
type ChangeOwnerKeyPeriod = ChangeOwnerKeyPeriod; type ChangeOwnerKeyPeriod = ChangeOwnerKeyPeriod;
type ConfirmPeriod = ConfirmPeriod; type ConfirmPeriod = ConfirmPeriod;
type Event = Event; type CheckIdtyCallAllowed = (Wot, SmithsSubWot);
type EnsureIdtyCallAllowed = (Wot, SmithsSubWot);
type IdtyCreationPeriod = IdtyCreationPeriod; type IdtyCreationPeriod = IdtyCreationPeriod;
type IdtyData = IdtyData; type IdtyData = IdtyData;
type IdtyIndex = IdtyIndex; type IdtyIndex = IdtyIndex;
...@@ -441,31 +437,30 @@ macro_rules! pallets_config { ...@@ -441,31 +437,30 @@ macro_rules! pallets_config {
type RemoveIdentityConsumers = RemoveIdentityConsumersImpl<Self>; type RemoveIdentityConsumers = RemoveIdentityConsumersImpl<Self>;
type RevocationSigner = <Signature as sp_runtime::traits::Verify>::Signer; type RevocationSigner = <Signature as sp_runtime::traits::Verify>::Signer;
type RevocationSignature = Signature; type RevocationSignature = Signature;
type RuntimeEvent = RuntimeEvent;
} }
impl pallet_membership::Config<frame_support::instances::Instance1> for Runtime { impl pallet_membership::Config<frame_support::instances::Instance1> for Runtime {
type IsIdtyAllowedToClaimMembership = Wot; type CheckCallAllowed = Wot;
type IsIdtyAllowedToRenewMembership = Wot;
type IsIdtyAllowedToRequestMembership = Wot;
type Event = Event;
type IdtyId = IdtyIndex; type IdtyId = IdtyIndex;
type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>; type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>;
type MembershipPeriod = MembershipPeriod; type MembershipPeriod = MembershipPeriod;
type MetaData = (); type MetaData = ();
type OnEvent = OnMembershipEventHandler<Wot, Runtime>; type OnEvent = OnMembershipEventHandler<Wot, Runtime>;
type PendingMembershipPeriod = PendingMembershipPeriod; type PendingMembershipPeriod = PendingMembershipPeriod;
type RuntimeEvent = RuntimeEvent;
} }
impl pallet_certification::Config<Instance1> for Runtime { impl pallet_certification::Config<Instance1> for Runtime {
type CertPeriod = CertPeriod; type CertPeriod = CertPeriod;
type Event = Event;
type IdtyIndex = IdtyIndex; type IdtyIndex = IdtyIndex;
type OwnerKeyOf = Identity; type OwnerKeyOf = Identity;
type IsCertAllowed = Wot; type CheckCertAllowed = Wot;
type MaxByIssuer = MaxByIssuer; type MaxByIssuer = MaxByIssuer;
type MinReceivedCertToBeAbleToIssueCert = MinReceivedCertToBeAbleToIssueCert; type MinReceivedCertToBeAbleToIssueCert = MinReceivedCertToBeAbleToIssueCert;
type OnNewcert = Wot; type OnNewcert = Wot;
type OnRemovedCert = Wot; type OnRemovedCert = Wot;
type RuntimeEvent = RuntimeEvent;
type ValidityPeriod = ValidityPeriod; type ValidityPeriod = ValidityPeriod;
} }
...@@ -480,28 +475,26 @@ macro_rules! pallets_config { ...@@ -480,28 +475,26 @@ macro_rules! pallets_config {
} }
impl pallet_membership::Config<Instance2> for Runtime { impl pallet_membership::Config<Instance2> for Runtime {
type IsIdtyAllowedToClaimMembership = SmithsSubWot; type CheckCallAllowed = SmithsSubWot;
type IsIdtyAllowedToRenewMembership = SmithsSubWot;
type IsIdtyAllowedToRequestMembership = SmithsSubWot;
type Event = Event;
type IdtyId = IdtyIndex; type IdtyId = IdtyIndex;
type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>; type IdtyIdOf = common_runtime::providers::IdentityIndexOf<Self>;
type MembershipPeriod = SmithMembershipPeriod; type MembershipPeriod = SmithMembershipPeriod;
type MetaData = SmithsMembershipMetaData<opaque::SessionKeysWrapper>; type MetaData = SmithsMembershipMetaData<opaque::SessionKeysWrapper>;
type OnEvent = OnSmithMembershipEventHandler<SmithsSubWot, Runtime>; type OnEvent = OnSmithMembershipEventHandler<SmithsSubWot, Runtime>;
type PendingMembershipPeriod = SmithPendingMembershipPeriod; type PendingMembershipPeriod = SmithPendingMembershipPeriod;
type RuntimeEvent = RuntimeEvent;
} }
impl pallet_certification::Config<Instance2> for Runtime { impl pallet_certification::Config<Instance2> for Runtime {
type CertPeriod = SmithCertPeriod; type CertPeriod = SmithCertPeriod;
type Event = Event;
type IdtyIndex = IdtyIndex; type IdtyIndex = IdtyIndex;
type OwnerKeyOf = Identity; type OwnerKeyOf = Identity;
type IsCertAllowed = SmithsSubWot; type CheckCertAllowed = SmithsSubWot;
type MaxByIssuer = SmithMaxByIssuer; type MaxByIssuer = SmithMaxByIssuer;
type MinReceivedCertToBeAbleToIssueCert = SmithMinReceivedCertToBeAbleToIssueCert; type MinReceivedCertToBeAbleToIssueCert = SmithMinReceivedCertToBeAbleToIssueCert;
type OnNewcert = SmithsSubWot; type OnNewcert = SmithsSubWot;
type OnRemovedCert = SmithsSubWot; type OnRemovedCert = SmithsSubWot;
type RuntimeEvent = RuntimeEvent;
type ValidityPeriod = SmithValidityPeriod; type ValidityPeriod = SmithValidityPeriod;
} }
...@@ -520,9 +513,9 @@ macro_rules! pallets_config { ...@@ -520,9 +513,9 @@ macro_rules! pallets_config {
pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * DAYS; pub const TechnicalCommitteeMotionDuration: BlockNumber = 7 * DAYS;
} }
impl pallet_collective::Config<Instance2> for Runtime { impl pallet_collective::Config<Instance2> for Runtime {
type Origin = Origin; type RuntimeOrigin = RuntimeOrigin;
type Proposal = Call; type Proposal = RuntimeCall;
type Event = Event; type RuntimeEvent = RuntimeEvent;
type MotionDuration = TechnicalCommitteeMotionDuration; type MotionDuration = TechnicalCommitteeMotionDuration;
type MaxProposals = frame_support::pallet_prelude::ConstU32<20>; type MaxProposals = frame_support::pallet_prelude::ConstU32<20>;
type MaxMembers = frame_support::pallet_prelude::ConstU32<100>; type MaxMembers = frame_support::pallet_prelude::ConstU32<100>;
......
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
// You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>. // along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(clippy::unnecessary_cast)]
pub mod block_weights;
pub mod frame_system; pub mod frame_system;
pub mod pallet_babe; pub mod pallet_babe;
pub mod pallet_balances; pub mod pallet_balances;
...@@ -24,3 +30,4 @@ pub mod pallet_scheduler; ...@@ -24,3 +30,4 @@ pub mod pallet_scheduler;
pub mod pallet_timestamp; pub mod pallet_timestamp;
pub mod pallet_universal_dividend; pub mod pallet_universal_dividend;
pub mod pallet_upgrade_origin; pub mod pallet_upgrade_origin;
pub mod paritydb_weights;
// Copyright 2021 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-18 (Y/M/D)
//! HOSTNAME: `raspberrypi`, CPU: `ARMv7 Processor rev 3 (v7l)`
//!
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Ğdev`
//! WARMUPS: `10`, REPEAT: `100`
//! WEIGHT-PATH: `.`
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1`, WEIGHT-ADD: `0`
// Executed Command:
// ./duniter
// benchmark
// overhead
// --chain=gdev
// --execution=wasm
// --wasm-execution=interpreted-i-know-what-i-do
// --weight-path=.
// --warmup=10
// --repeat=100
use frame_support::{
parameter_types,
weights::{constants::WEIGHT_PER_NANOS, Weight},
};
parameter_types! {
/// Time to execute an empty block.
/// Calculated by multiplying the *Average* with `1` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 23_866_638, 90_077_105
/// Average: 24_871_527
/// Median: 23_915_377
/// Std-Dev: 6645558.32
///
/// Percentiles nanoseconds:
/// 99th: 30_529_787
/// 95th: 27_134_555
/// 75th: 23_951_395
pub const BlockExecutionWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(24_871_527);
}
#[cfg(test)]
mod test_weights {
use frame_support::weights::constants;
/// Checks that the weight exists and is sane.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn sane() {
let w = super::BlockExecutionWeight::get();
// At least 100 µs.
assert!(
w.ref_time() >= 100u64 * constants::WEIGHT_PER_MICROS.ref_time(),
"Weight should be at least 100 µs."
);
// At most 50 ms.
assert!(
w.ref_time() <= 50u64 * constants::WEIGHT_PER_MILLIS.ref_time(),
"Weight should be at most 50 ms."
);
}
}
...@@ -45,41 +45,41 @@ use sp_std::marker::PhantomData; ...@@ -45,41 +45,41 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
fn remark(b: u32, ) -> Weight { fn remark(b: u32, ) -> Weight {
(56_698_000 as Weight) (Weight::from_ref_time(56_698_000))
// Standard Error: 0 // Standard Error: 0
.saturating_add((238_000 as Weight).saturating_mul(b as Weight)) .saturating_add((Weight::from_ref_time(238_000)).saturating_mul(b as u64))
} }
fn remark_with_event(b: u32, ) -> Weight { fn remark_with_event(b: u32, ) -> Weight {
(1_830_806_000 as Weight) (Weight::from_ref_time(1_830_806_000))
// Standard Error: 0 // Standard Error: 0
.saturating_add((254_000 as Weight).saturating_mul(b as Weight)) .saturating_add((Weight::from_ref_time(254_000)).saturating_mul(b as u64))
} }
// Storage: System Digest (r:1 w:1) // Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a686561707061676573] (r:0 w:1) // Storage: unknown [0x3a686561707061676573] (r:0 w:1)
fn set_heap_pages() -> Weight { fn set_heap_pages() -> Weight {
(74_351_000 as Weight) (Weight::from_ref_time(74_351_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Skipped Metadata (r:0 w:0) // Storage: Skipped Metadata (r:0 w:0)
fn set_storage(i: u32, ) -> Weight { fn set_storage(i: u32, ) -> Weight {
(0 as Weight) (Weight::from_ref_time(0))
// Standard Error: 26_000 // Standard Error: 26_000
.saturating_add((38_883_000 as Weight).saturating_mul(i as Weight)) .saturating_add((Weight::from_ref_time(38_883_000)).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes((1u64).saturating_mul(i as u64)))
} }
// Storage: Skipped Metadata (r:0 w:0) // Storage: Skipped Metadata (r:0 w:0)
fn kill_storage(i: u32, ) -> Weight { fn kill_storage(i: u32, ) -> Weight {
(14_386_000 as Weight) (Weight::from_ref_time(14_386_000))
// Standard Error: 16_000 // Standard Error: 16_000
.saturating_add((18_658_000 as Weight).saturating_mul(i as Weight)) .saturating_add((Weight::from_ref_time(18_658_000)).saturating_mul(i as u64))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight))) .saturating_add(T::DbWeight::get().writes((1u64).saturating_mul(i as u64)))
} }
// Storage: Skipped Metadata (r:0 w:0) // Storage: Skipped Metadata (r:0 w:0)
fn kill_prefix(p: u32, ) -> Weight { fn kill_prefix(p: u32, ) -> Weight {
(0 as Weight) (Weight::from_ref_time(0))
// Standard Error: 8_000 // Standard Error: 8_000
.saturating_add((6_532_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(6_532_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) .saturating_add(T::DbWeight::get().writes((1u64).saturating_mul(p as u64)))
} }
} }
...@@ -39,13 +39,13 @@ impl<T: frame_system::Config> pallet_babe::WeightInfo for WeightInfo<T> { ...@@ -39,13 +39,13 @@ impl<T: frame_system::Config> pallet_babe::WeightInfo for WeightInfo<T> {
let validator_count = validator_count.max(100) as u64; let validator_count = validator_count.max(100) as u64;
// checking membership proof // checking membership proof
(35 * WEIGHT_PER_MICROS) (WEIGHT_PER_MICROS * 35)
.saturating_add((175 * WEIGHT_PER_NANOS).saturating_mul(validator_count)) .saturating_add((WEIGHT_PER_NANOS * 175).saturating_mul(validator_count))
.saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads(5))
// check equivocation proof // check equivocation proof
.saturating_add(110 * WEIGHT_PER_MICROS) .saturating_add(WEIGHT_PER_MICROS * 110)
// report offence // report offence
.saturating_add(110 * WEIGHT_PER_MICROS) .saturating_add(WEIGHT_PER_MICROS * 110)
.saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes(3))
} }
} }
...@@ -47,47 +47,47 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> { ...@@ -47,47 +47,47 @@ impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn transfer() -> Weight { fn transfer() -> Weight {
(2_412_993_000 as Weight) (Weight::from_ref_time(2_412_993_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn transfer_keep_alive() -> Weight { fn transfer_keep_alive() -> Weight {
(1_414_318_000 as Weight) (Weight::from_ref_time(1_414_318_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight { fn set_balance_creating() -> Weight {
(594_104_000 as Weight) (Weight::from_ref_time(594_104_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight { fn set_balance_killing() -> Weight {
(704_715_000 as Weight) (Weight::from_ref_time(704_715_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: System Account (r:2 w:2) // Storage: System Account (r:2 w:2)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn force_transfer() -> Weight { fn force_transfer() -> Weight {
(2_427_122_000 as Weight) (Weight::from_ref_time(2_427_122_000))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3))
} }
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn transfer_all() -> Weight { fn transfer_all() -> Weight {
(1_769_185_000 as Weight) (Weight::from_ref_time(1_769_185_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn force_unreserve() -> Weight { fn force_unreserve() -> Weight {
(619_549_000 as Weight) (Weight::from_ref_time(619_549_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
} }
...@@ -35,19 +35,19 @@ impl<T: frame_system::Config> pallet_grandpa::WeightInfo for WeightInfo<T> { ...@@ -35,19 +35,19 @@ impl<T: frame_system::Config> pallet_grandpa::WeightInfo for WeightInfo<T> {
let validator_count = validator_count.max(100) as u64; let validator_count = validator_count.max(100) as u64;
// checking membership proof // checking membership proof
(35 * WEIGHT_PER_MICROS) (WEIGHT_PER_MICROS * 35)
.saturating_add((175 * WEIGHT_PER_NANOS).saturating_mul(validator_count)) .saturating_add((WEIGHT_PER_NANOS * 175).saturating_mul(validator_count))
.saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().reads(5))
// check equivocation proof // check equivocation proof
.saturating_add(95 * WEIGHT_PER_MICROS) .saturating_add(WEIGHT_PER_MICROS * 95)
// report offence // report offence
.saturating_add(110 * WEIGHT_PER_MICROS) .saturating_add(WEIGHT_PER_MICROS * 110)
.saturating_add(T::DbWeight::get().writes(3)) .saturating_add(T::DbWeight::get().writes(3))
// fetching set id -> session index mappings // fetching set id -> session index mappings
.saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().reads(2))
} }
fn note_stalled() -> Weight { fn note_stalled() -> Weight {
(3 * WEIGHT_PER_MICROS).saturating_add(T::DbWeight::get().writes(1)) (WEIGHT_PER_MICROS * 3).saturating_add(T::DbWeight::get().writes(1))
} }
} }
...@@ -46,101 +46,68 @@ use sp_std::marker::PhantomData; ...@@ -46,101 +46,68 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
fn as_multi_threshold_1(z: u32, ) -> Weight { fn as_multi_threshold_1(z: u32, ) -> Weight {
(694_175_000 as Weight) (Weight::from_ref_time(694_175_000))
// Standard Error: 0 // Standard Error: 0
.saturating_add((405_000 as Weight).saturating_mul(z as Weight)) .saturating_add((Weight::from_ref_time(405_000)).saturating_mul(z as u64))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create(s: u32, z: u32, ) -> Weight { fn as_multi_create(s: u32, z: u32, ) -> Weight {
(1_258_408_000 as Weight) (Weight::from_ref_time(1_258_408_000))
// Standard Error: 752_000 // Standard Error: 752_000
.saturating_add((34_672_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(34_672_000)).saturating_mul(s as u64))
// Standard Error: 0 // Standard Error: 0
.saturating_add((249_000 as Weight).saturating_mul(z as Weight)) .saturating_add((Weight::from_ref_time(249_000)).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
(1_397_026_000 as Weight)
// Standard Error: 754_000
.saturating_add((29_235_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((574_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
fn as_multi_approve(s: u32, z: u32, ) -> Weight { fn as_multi_approve(s: u32, z: u32, ) -> Weight {
(865_034_000 as Weight) (Weight::from_ref_time(865_034_000))
// Standard Error: 878_000 // Standard Error: 878_000
.saturating_add((36_962_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(36_962_000)).saturating_mul(s as u64))
// Standard Error: 0 // Standard Error: 0
.saturating_add((250_000 as Weight).saturating_mul(z as Weight)) .saturating_add((Weight::from_ref_time(250_000)).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
(1_470_691_000 as Weight)
// Standard Error: 1_012_000
.saturating_add((36_087_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((573_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1) // Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn as_multi_complete(s: u32, z: u32, ) -> Weight { fn as_multi_complete(s: u32, z: u32, ) -> Weight {
(1_884_292_000 as Weight) (Weight::from_ref_time(1_884_292_000))
// Standard Error: 1_339_000 // Standard Error: 1_339_000
.saturating_add((80_505_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(80_505_000)).saturating_mul(s as u64))
// Standard Error: 0 // Standard Error: 0
.saturating_add((980_000 as Weight).saturating_mul(z as Weight)) .saturating_add((Weight::from_ref_time(980_000)).saturating_mul(z as u64))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0) // Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn approve_as_multi_create(s: u32, ) -> Weight { fn approve_as_multi_create(s: u32, ) -> Weight {
(1_267_276_000 as Weight) (Weight::from_ref_time(1_267_276_000))
// Standard Error: 243_000 // Standard Error: 243_000
.saturating_add((33_108_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(33_108_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:0) // Storage: Multisig Calls (r:1 w:0)
fn approve_as_multi_approve(s: u32, ) -> Weight { fn approve_as_multi_approve(s: u32, ) -> Weight {
(865_683_000 as Weight) (Weight::from_ref_time(865_683_000))
// Standard Error: 403_000 // Standard Error: 403_000
.saturating_add((35_735_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(35_735_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn approve_as_multi_complete(s: u32, ) -> Weight {
(14_065_198_000 as Weight)
// Standard Error: 3_270_000
.saturating_add((72_838_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
// Storage: Multisig Multisigs (r:1 w:1) // Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1) // Storage: Multisig Calls (r:1 w:1)
fn cancel_as_multi(s: u32, ) -> Weight { fn cancel_as_multi(s: u32, ) -> Weight {
(6_654_037_000 as Weight) (Weight::from_ref_time(6_654_037_000))
// Standard Error: 300_000 // Standard Error: 300_000
.saturating_add((33_665_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(33_665_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
} }
...@@ -48,24 +48,24 @@ pub struct WeightInfo<T>(PhantomData<T>); ...@@ -48,24 +48,24 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_oneshot_account::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_oneshot_account::WeightInfo for WeightInfo<T> {
// Storage: OneshotAccount OneshotAccounts (r:1 w:1) // Storage: OneshotAccount OneshotAccounts (r:1 w:1)
fn create_oneshot_account() -> Weight { fn create_oneshot_account() -> Weight {
(941_602_000 as Weight) (Weight::from_ref_time(941_602_000))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: OneshotAccount OneshotAccounts (r:1 w:1) // Storage: OneshotAccount OneshotAccounts (r:1 w:1)
// Storage: System BlockHash (r:1 w:0) // Storage: System BlockHash (r:1 w:0)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn consume_oneshot_account() -> Weight { fn consume_oneshot_account() -> Weight {
(971_453_000 as Weight) (Weight::from_ref_time(971_453_000))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: OneshotAccount OneshotAccounts (r:1 w:1) // Storage: OneshotAccount OneshotAccounts (r:1 w:1)
// Storage: System BlockHash (r:1 w:0) // Storage: System BlockHash (r:1 w:0)
// Storage: System Account (r:2 w:2) // Storage: System Account (r:2 w:2)
fn consume_oneshot_account_with_remaining() -> Weight { fn consume_oneshot_account_with_remaining() -> Weight {
(1_500_781_000 as Weight) (Weight::from_ref_time(1_500_781_000))
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3))
} }
} }
...@@ -45,94 +45,81 @@ use sp_std::marker::PhantomData; ...@@ -45,94 +45,81 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_proxy`. /// Weight functions for `pallet_proxy`.
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_proxy::WeightInfo for WeightInfo<T> {
// dummy
fn create_pure(_s:u32)->Weight {Weight::zero()}
// dummy
fn kill_pure(_s:u32)->Weight {Weight::zero()}
// Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Proxies (r:1 w:0)
fn proxy(p: u32, ) -> Weight { fn proxy(p: u32, ) -> Weight {
(580_976_000 as Weight) (Weight::from_ref_time(580_976_000))
// Standard Error: 66_000 // Standard Error: 66_000
.saturating_add((43_246_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(43_246_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
} }
// Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1) // Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn proxy_announced(a: u32, p: u32, ) -> Weight { fn proxy_announced(a: u32, p: u32, ) -> Weight {
(1_543_060_000 as Weight) (Weight::from_ref_time(1_543_060_000))
// Standard Error: 372_000 // Standard Error: 372_000
.saturating_add((106_336_000 as Weight).saturating_mul(a as Weight)) .saturating_add((Weight::from_ref_time(106_336_000)).saturating_mul(a as u64))
// Standard Error: 387_000 // Standard Error: 387_000
.saturating_add((37_661_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(37_661_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Proxy Announcements (r:1 w:1) // Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn remove_announcement(a: u32, _p: u32, ) -> Weight { fn remove_announcement(a: u32, _p: u32, ) -> Weight {
(1_028_018_000 as Weight) (Weight::from_ref_time(1_028_018_000))
// Standard Error: 359_000 // Standard Error: 359_000
.saturating_add((105_964_000 as Weight).saturating_mul(a as Weight)) .saturating_add((Weight::from_ref_time(105_964_000)).saturating_mul(a as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Proxy Announcements (r:1 w:1) // Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn reject_announcement(a: u32, _p: u32, ) -> Weight { fn reject_announcement(a: u32, _p: u32, ) -> Weight {
(1_044_098_000 as Weight) (Weight::from_ref_time(1_044_098_000))
// Standard Error: 349_000 // Standard Error: 349_000
.saturating_add((106_076_000 as Weight).saturating_mul(a as Weight)) .saturating_add((Weight::from_ref_time(106_076_000)).saturating_mul(a as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Proxy Proxies (r:1 w:0) // Storage: Proxy Proxies (r:1 w:0)
// Storage: Proxy Announcements (r:1 w:1) // Storage: Proxy Announcements (r:1 w:1)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
fn announce(a: u32, p: u32, ) -> Weight { fn announce(a: u32, p: u32, ) -> Weight {
(1_262_407_000 as Weight) (Weight::from_ref_time(1_262_407_000))
// Standard Error: 350_000 // Standard Error: 350_000
.saturating_add((104_255_000 as Weight).saturating_mul(a as Weight)) .saturating_add((Weight::from_ref_time(104_255_000)).saturating_mul(a as u64))
// Standard Error: 364_000 // Standard Error: 364_000
.saturating_add((38_980_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(38_980_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Proxy Proxies (r:1 w:1) // Storage: Proxy Proxies (r:1 w:1)
fn add_proxy(p: u32, ) -> Weight { fn add_proxy(p: u32, ) -> Weight {
(964_226_000 as Weight) (Weight::from_ref_time(964_226_000))
// Standard Error: 288_000 // Standard Error: 288_000
.saturating_add((55_018_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(55_018_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: Proxy Proxies (r:1 w:1) // Storage: Proxy Proxies (r:1 w:1)
fn remove_proxy(p: u32, ) -> Weight { fn remove_proxy(p: u32, ) -> Weight {
(761_347_000 as Weight) (Weight::from_ref_time(761_347_000))
// Standard Error: 240_000 // Standard Error: 240_000
.saturating_add((58_595_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(58_595_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: Proxy Proxies (r:1 w:1) // Storage: Proxy Proxies (r:1 w:1)
fn remove_proxies(p: u32, ) -> Weight { fn remove_proxies(p: u32, ) -> Weight {
(706_599_000 as Weight) (Weight::from_ref_time(706_599_000))
// Standard Error: 55_000 // Standard Error: 55_000
.saturating_add((41_943_000 as Weight).saturating_mul(p as Weight)) .saturating_add((Weight::from_ref_time(41_943_000)).saturating_mul(p as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
}
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
// Storage: Proxy Proxies (r:1 w:1)
fn anonymous(p: u32, ) -> Weight {
(1_162_882_000 as Weight)
// Standard Error: 25_000
.saturating_add((105_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Proxy Proxies (r:1 w:1)
fn kill_anonymous(p: u32, ) -> Weight {
(952_412_000 as Weight)
// Standard Error: 58_000
.saturating_add((41_903_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
} }
} }
...@@ -45,150 +45,55 @@ use sp_std::marker::PhantomData; ...@@ -45,150 +45,55 @@ use sp_std::marker::PhantomData;
/// Weight functions for `pallet_scheduler`. /// Weight functions for `pallet_scheduler`.
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_scheduler::WeightInfo for WeightInfo<T> {
// Storage: Scheduler Agenda (r:2 w:2) // dummy
// Storage: Preimage PreimageFor (r:1 w:1) fn service_agendas_base()->Weight {Weight::zero()}
// Storage: Preimage StatusFor (r:1 w:1) // dummy
// Storage: Scheduler Lookup (r:0 w:1) fn service_agenda_base(_s:u32)->Weight {Weight::zero()}
fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { // dummy
(0 as Weight) fn service_task_base()->Weight {Weight::zero()}
// Standard Error: 4_241_000 // dummy
.saturating_add((1_897_662_000 as Weight).saturating_mul(s as Weight)) fn service_task_fetched(_s:u32)->Weight {Weight::zero()}
.saturating_add(T::DbWeight::get().reads(1 as Weight)) // dummy
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight))) fn service_task_named()->Weight {Weight::zero()}
.saturating_add(T::DbWeight::get().writes(1 as Weight)) // dummy
.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight))) fn service_task_periodic()->Weight {Weight::zero()}
} // dummy
// Storage: Scheduler Agenda (r:1 w:1) fn execute_dispatch_signed()->Weight {Weight::zero()}
// Storage: Preimage PreimageFor (r:1 w:1) // dummy
// Storage: Preimage StatusFor (r:1 w:1) fn execute_dispatch_unsigned()->Weight {Weight::zero()}
// Storage: Scheduler Lookup (r:0 w:1)
fn on_initialize_named_resolved(s: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 3_139_000
.saturating_add((1_581_261_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:2 w:2)
// Storage: Preimage PreimageFor (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
(332_908_000 as Weight)
// Standard Error: 2_905_000
.saturating_add((1_623_424_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: Preimage PreimageFor (r:1 w:1)
// Storage: Preimage StatusFor (r:1 w:1)
fn on_initialize_resolved(s: u32, ) -> Weight {
(327_285_000 as Weight)
// Standard Error: 4_837_000
.saturating_add((1_511_863_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: Preimage PreimageFor (r:1 w:0)
// Storage: Scheduler Lookup (r:0 w:1)
fn on_initialize_named_aborted(s: u32, ) -> Weight {
(576_015_000 as Weight)
// Standard Error: 3_247_000
.saturating_add((834_088_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: Preimage PreimageFor (r:1 w:0)
fn on_initialize_aborted(s: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 3_109_000
.saturating_add((794_152_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Scheduler Agenda (r:2 w:2)
// Storage: Scheduler Lookup (r:0 w:1)
fn on_initialize_periodic_named(s: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 4_608_000
.saturating_add((1_580_912_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:2 w:2)
fn on_initialize_periodic(s: u32, ) -> Weight {
(405_993_000 as Weight)
// Standard Error: 5_129_000
.saturating_add((1_400_748_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:1 w:1)
// Storage: Scheduler Lookup (r:0 w:1)
fn on_initialize_named(s: u32, ) -> Weight {
(149_824_000 as Weight)
// Standard Error: 2_930_000
.saturating_add((1_272_241_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
}
// Storage: Scheduler Agenda (r:1 w:1)
fn on_initialize(s: u32, ) -> Weight {
(103_696_000 as Weight)
// Standard Error: 2_588_000
.saturating_add((1_194_963_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1)
fn schedule(s: u32, ) -> Weight { fn schedule(s: u32, ) -> Weight {
(655_442_000 as Weight) (Weight::from_ref_time(655_442_000))
// Standard Error: 23_000 // Standard Error: 23_000
.saturating_add((1_352_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(1_352_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1)
// Storage: Scheduler Lookup (r:0 w:1) // Storage: Scheduler Lookup (r:0 w:1)
fn cancel(s: u32, ) -> Weight { fn cancel(s: u32, ) -> Weight {
(431_975_000 as Weight) (Weight::from_ref_time(431_975_000))
// Standard Error: 606_000 // Standard Error: 606_000
.saturating_add((422_692_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(422_692_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Lookup (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1)
fn schedule_named(s: u32, ) -> Weight { fn schedule_named(s: u32, ) -> Weight {
(820_828_000 as Weight) (Weight::from_ref_time(820_828_000))
// Standard Error: 12_000 // Standard Error: 12_000
.saturating_add((795_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(795_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Lookup (r:1 w:1)
// Storage: Scheduler Agenda (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1)
fn cancel_named(s: u32, ) -> Weight { fn cancel_named(s: u32, ) -> Weight {
(197_177_000 as Weight) (Weight::from_ref_time(197_177_000))
// Standard Error: 672_000 // Standard Error: 672_000
.saturating_add((425_783_000 as Weight).saturating_mul(s as Weight)) .saturating_add((Weight::from_ref_time(425_783_000)).saturating_mul(s as u64))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
} }
...@@ -48,11 +48,11 @@ impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> { ...@@ -48,11 +48,11 @@ impl<T: frame_system::Config> pallet_timestamp::WeightInfo for WeightInfo<T> {
// Storage: Timestamp Now (r:1 w:1) // Storage: Timestamp Now (r:1 w:1)
// Storage: Babe CurrentSlot (r:1 w:0) // Storage: Babe CurrentSlot (r:1 w:0)
fn set() -> Weight { fn set() -> Weight {
(126_036_000 as Weight) (Weight::from_ref_time(126_036_000))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
fn on_finalize() -> Weight { fn on_finalize() -> Weight {
(53_611_000 as Weight) (Weight::from_ref_time(53_611_000))
} }
} }
...@@ -46,7 +46,7 @@ use sp_std::marker::PhantomData; ...@@ -46,7 +46,7 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightInfo<T> {
fn on_initialize() -> Weight { fn on_initialize() -> Weight {
111_220_000 as Weight Weight::from_ref_time(111_220_000)
} }
// Storage: Membership CounterForMembership (r:1 w:0) // Storage: Membership CounterForMembership (r:1 w:0)
// Storage: UniversalDividend NextReeval (r:1 w:0) // Storage: UniversalDividend NextReeval (r:1 w:0)
...@@ -54,9 +54,9 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn ...@@ -54,9 +54,9 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn
// Storage: UniversalDividend MonetaryMass (r:1 w:1) // Storage: UniversalDividend MonetaryMass (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:1) // Storage: UniversalDividend CurrentUdIndex (r:1 w:1)
fn on_initialize_ud_created() -> Weight { fn on_initialize_ud_created() -> Weight {
(525_382_000 as Weight) Weight::from_ref_time(525_382_000)
.saturating_add(T::DbWeight::get().reads(5 as Weight)) .saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: Membership CounterForMembership (r:1 w:0) // Storage: Membership CounterForMembership (r:1 w:0)
// Storage: UniversalDividend NextReeval (r:1 w:1) // Storage: UniversalDividend NextReeval (r:1 w:1)
...@@ -65,35 +65,35 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn ...@@ -65,35 +65,35 @@ impl<T: frame_system::Config> pallet_universal_dividend::WeightInfo for WeightIn
// Storage: UniversalDividend PastReevals (r:1 w:1) // Storage: UniversalDividend PastReevals (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:1) // Storage: UniversalDividend CurrentUdIndex (r:1 w:1)
fn on_initialize_ud_reevalued() -> Weight { fn on_initialize_ud_reevalued() -> Weight {
(1_161_595_000 as Weight) Weight::from_ref_time(1_161_595_000)
.saturating_add(T::DbWeight::get().reads(6 as Weight)) .saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(5 as Weight)) .saturating_add(T::DbWeight::get().writes(5))
} }
// Storage: Identity IdentityIndexOf (r:1 w:0) // Storage: Identity IdentityIndexOf (r:1 w:0)
// Storage: Identity Identities (r:1 w:1) // Storage: Identity Identities (r:1 w:1)
// Storage: UniversalDividend CurrentUdIndex (r:1 w:0) // Storage: UniversalDividend CurrentUdIndex (r:1 w:0)
// Storage: UniversalDividend PastReevals (r:1 w:0) // Storage: UniversalDividend PastReevals (r:1 w:0)
fn claim_uds(n: u32) -> Weight { fn claim_uds(n: u32) -> Weight {
(1_228_876_000 as Weight) Weight::from_ref_time(1_228_876_000)
// Standard Error: 958_000 // Standard Error: 958_000
.saturating_add((7_551_000 as Weight).saturating_mul(n as Weight)) .saturating_add((Weight::from_ref_time(7_551_000)).saturating_mul(n as u64))
.saturating_add(T::DbWeight::get().reads(4 as Weight)) .saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(1 as Weight)) .saturating_add(T::DbWeight::get().writes(1))
} }
// Storage: UniversalDividend CurrentUd (r:1 w:0) // Storage: UniversalDividend CurrentUd (r:1 w:0)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn transfer_ud() -> Weight { fn transfer_ud() -> Weight {
(2_468_842_000 as Weight) (Weight::from_ref_time(2_468_842_000))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
// Storage: UniversalDividend CurrentUd (r:1 w:0) // Storage: UniversalDividend CurrentUd (r:1 w:0)
// Storage: System Account (r:1 w:1) // Storage: System Account (r:1 w:1)
// Storage: Account PendingNewAccounts (r:0 w:1) // Storage: Account PendingNewAccounts (r:0 w:1)
fn transfer_ud_keep_alive() -> Weight { fn transfer_ud_keep_alive() -> Weight {
(1_442_150_000 as Weight) (Weight::from_ref_time(1_442_150_000))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2))
} }
} }
...@@ -46,6 +46,6 @@ use sp_std::marker::PhantomData; ...@@ -46,6 +46,6 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_upgrade_origin::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_upgrade_origin::WeightInfo for WeightInfo<T> {
fn dispatch_as_root() -> Weight { fn dispatch_as_root() -> Weight {
(324_716_000 as Weight) (Weight::from_ref_time(324_716_000))
} }
} }
// Copyright 2021 Axiom-Team
//
// This file is part of Duniter-v2S.
//
// Duniter-v2S is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, version 3 of the License.
//
// Duniter-v2S is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Duniter-v2S. If not, see <https://www.gnu.org/licenses/>.
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-11-18 (Y/M/D)
//! HOSTNAME: `raspberrypi`, CPU: `ARMv7 Processor rev 3 (v7l)`
//!
//! DATABASE: `ParityDb`, RUNTIME: `Ğdev`
//! BLOCK-NUM: `BlockId::Number(85630)`
//! SKIP-WRITE: `false`, SKIP-READ: `false`, WARMUPS: `1`
//! STATE-VERSION: `V1`, STATE-CACHE-SIZE: `0`
//! WEIGHT-PATH: `.`
//! METRIC: `Average`, WEIGHT-MUL: `2`, WEIGHT-ADD: `0`
// Executed Command:
// ./duniter
// benchmark
// storage
// -d=/mnt/ssd1/duniter-v2s/t1
// --chain=gdev
// --mul=2
// --weight-path=.
// --state-version=1
/// Storage DB weights for the `Ğdev` runtime and `ParityDb`.
pub mod constants {
use frame_support::{
parameter_types,
weights::{constants, RuntimeDbWeight},
};
parameter_types! {
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
/// are available for brave runtime engineers who may want to try this out as default.
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
/// Time to read one storage item.
/// Calculated by multiplying the *Average* of all values with `2` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 62_017, 5_238_182
/// Average: 125_949
/// Median: 124_943
/// Std-Dev: 19659.02
///
/// Percentiles nanoseconds:
/// 99th: 151_424
/// 95th: 143_017
/// 75th: 133_498
read: 250_000 * constants::WEIGHT_PER_NANOS.ref_time(),
/// Time to write one storage item.
/// Calculated by multiplying the *Average* of all values with `2` and adding `0`.
///
/// Stats nanoseconds:
/// Min, Max: 88_054, 107_065_367
/// Average: 419_064
/// Median: 424_994
/// Std-Dev: 423253.1
///
/// Percentiles nanoseconds:
/// 99th: 611_825
/// 95th: 512_789
/// 75th: 457_938
write: 840_000 * constants::WEIGHT_PER_NANOS.ref_time(),
};
}
#[cfg(test)]
mod test_db_weights {
use super::constants::ParityDbWeight as W;
use frame_support::weights::constants;
/// Checks that all weights exist and have sane values.
// NOTE: If this test fails but you are sure that the generated values are fine,
// you can delete it.
#[test]
fn bound() {
// At least 1 µs.
assert!(
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Read weight should be at least 1 µs."
);
assert!(
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
"Write weight should be at least 1 µs."
);
// At most 1 ms.
assert!(
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Read weight should be at most 1 ms."
);
assert!(
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
"Write weight should be at most 1 ms."
);
}
}
}
[build-dependencies.substrate-wasm-builder] [build-dependencies.substrate-wasm-builder]
git = 'https://github.com/duniter/substrate' git = 'https://github.com/duniter/substrate'
branch = 'duniter-substrate-v0.9.26' branch = 'duniter-substrate-v0.9.32'
[package] [package]
authors = ['Axiom-Team Developers <https://axiom-team.fr>'] authors = ['Axiom-Team Developers <https://axiom-team.fr>']
...@@ -103,10 +103,10 @@ try-runtime = [ ...@@ -103,10 +103,10 @@ try-runtime = [
] ]
[dev-dependencies] [dev-dependencies]
sp-consensus-vrf = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' } sp-consensus-vrf = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
sp-finality-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' } sp-finality-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' } sp-io = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26' } sp-keyring = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32' }
[dependencies] [dependencies]
# local # local
...@@ -132,43 +132,43 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive" ...@@ -132,43 +132,43 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive"
serde = { version = "1.0.101", optional = true, features = ["derive"] } serde = { version = "1.0.101", optional = true, features = ["derive"] }
# substrate # substrate
frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', optional = true } frame-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', optional = true }
frame-try-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false, optional = true } frame-try-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false, optional = true }
frame-executive = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } frame-executive = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } frame-support = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
frame-system = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } frame-system = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', optional = true } frame-system-benchmarking = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', optional = true }
frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false} frame-system-rpc-runtime-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false}
pallet-atomic-swap = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-atomic-swap = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-authority-discovery = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-authority-discovery = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-authorship = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-authorship = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-babe = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-babe = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-balances = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-collective = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-collective = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-grandpa = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-im-online = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-im-online = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-offences = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-offences = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-multisig = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-multisig = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-preimage = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-preimage = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-proxy = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-proxy = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-scheduler = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-scheduler = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-session = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-session = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-sudo = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-sudo = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-timestamp = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-timestamp = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-transaction-payment = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-transaction-payment = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-treasury = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-treasury = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
pallet-utility = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } pallet-utility = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-api = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-arithmetic = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-arithmetic = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-authority-discovery = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-authority-discovery = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-block-builder = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-block-builder = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-consensus-babe = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-consensus-babe = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-inherents = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-inherents = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-offchain = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-offchain = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-session = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-session = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-std = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-std = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-transaction-pool = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-transaction-pool = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
sp-version = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.26', default-features = false } sp-version = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.32', default-features = false }
...@@ -103,7 +103,8 @@ pub fn native_version() -> NativeVersion { ...@@ -103,7 +103,8 @@ pub fn native_version() -> NativeVersion {
/// Block type as expected by this runtime. /// Block type as expected by this runtime.
pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>; pub type Block = sp_runtime::generic::Block<Header, UncheckedExtrinsic>;
/// Unchecked extrinsic type as expected by this runtime. /// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>; pub type UncheckedExtrinsic =
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
/// The SignedExtension to the basic transaction logic. /// The SignedExtension to the basic transaction logic.
pub type SignedExtra = ( pub type SignedExtra = (
frame_system::CheckNonZeroSender<Runtime>, frame_system::CheckNonZeroSender<Runtime>,
...@@ -126,17 +127,42 @@ pub type Executive = frame_executive::Executive< ...@@ -126,17 +127,42 @@ pub type Executive = frame_executive::Executive<
pub type TechnicalCommitteeInstance = Instance2; pub type TechnicalCommitteeInstance = Instance2;
#[cfg(feature = "runtime-benchmarks")]
mod benches {
define_benchmarks!(
// Duniter
// NOTE: Make sure to prefix these with `common_runtime::` so
// the that path resolves correctly in the generated file.
[common_runtime::oneshot_account, OneshotAccount]
[common_runtime::universal_dividend, UniversalDividend]
[common_runtime::upgrade_origin, UpgradeOrigin]
// Substrate
[pallet_balances, Balances]
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_collective, TechnicalCommittee]
[pallet_im_online, ImOnline]
[pallet_multisig, Multisig]
[pallet_preimage, Preimage]
[pallet_proxy, Proxy]
[pallet_scheduler, Scheduler]
[frame_system, SystemBench::<Runtime>]
[pallet_timestamp, Timestamp]
[pallet_treasury, Treasury]
[pallet_utility, Utility]
);
}
pub struct BaseCallFilter; pub struct BaseCallFilter;
impl Contains<Call> for BaseCallFilter { impl Contains<RuntimeCall> for BaseCallFilter {
fn contains(call: &Call) -> bool { fn contains(call: &RuntimeCall) -> bool {
!matches!( !matches!(
call, call,
Call::System( RuntimeCall::System(
frame_system::Call::remark { .. } | frame_system::Call::remark_with_event { .. } frame_system::Call::remark { .. } | frame_system::Call::remark_with_event { .. }
) | Call::Membership( ) | RuntimeCall::Membership(
pallet_membership::Call::claim_membership { .. } pallet_membership::Call::claim_membership { .. }
| pallet_membership::Call::revoke_membership { .. } | pallet_membership::Call::revoke_membership { .. }
) | Call::Session(_) ) | RuntimeCall::Session(_)
) )
} }
} }
...@@ -166,23 +192,26 @@ impl Default for ProxyType { ...@@ -166,23 +192,26 @@ impl Default for ProxyType {
Self::AlmostAny Self::AlmostAny
} }
} }
impl frame_support::traits::InstanceFilter<Call> for ProxyType { impl frame_support::traits::InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &Call) -> bool { fn filter(&self, c: &RuntimeCall) -> bool {
match self { match self {
ProxyType::AlmostAny => { ProxyType::AlmostAny => {
// Some calls are never authorized from a proxied account // Some calls are never authorized from a proxied account
!matches!( !matches!(
c, c,
Call::Cert(..) | Call::Identity(..) | Call::SmithsCert(..) RuntimeCall::Cert(..) | RuntimeCall::Identity(..) | RuntimeCall::SmithsCert(..)
) )
} }
ProxyType::TransferOnly => { ProxyType::TransferOnly => {
matches!(c, Call::Balances(..) | Call::UniversalDividend(..)) matches!(
c,
RuntimeCall::Balances(..) | RuntimeCall::UniversalDividend(..)
)
} }
ProxyType::CancelProxy => { ProxyType::CancelProxy => {
matches!( matches!(
c, c,
Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })
) )
} }
} }
...@@ -191,8 +220,8 @@ impl frame_support::traits::InstanceFilter<Call> for ProxyType { ...@@ -191,8 +220,8 @@ impl frame_support::traits::InstanceFilter<Call> for ProxyType {
common_runtime::pallets_config! { common_runtime::pallets_config! {
impl pallet_sudo::Config for Runtime { impl pallet_sudo::Config for Runtime {
type Event = Event; type RuntimeEvent = RuntimeEvent;
type Call = Call; type RuntimeCall = RuntimeCall;
} }
} }
...@@ -259,10 +288,10 @@ construct_runtime!( ...@@ -259,10 +288,10 @@ construct_runtime!(
impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where where
Call: From<C>, RuntimeCall: From<C>,
{ {
type Extrinsic = UncheckedExtrinsic; type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call; type OverarchingCall = RuntimeCall;
} }
// All of our runtimes share most of their Runtime API implementations. // All of our runtimes share most of their Runtime API implementations.
......