Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix runtime
  • Loading branch information
Michal Swietek committed Nov 22, 2022
commit 0b3ea604ff5d81fbfe80add6b0f07af232a9f5de
66 changes: 34 additions & 32 deletions bin/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("aleph-node"),
impl_name: create_runtime_str!("aleph-node"),
authoring_version: 1,
spec_version: 40,
spec_version: 38,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 13,
Expand Down Expand Up @@ -164,7 +164,7 @@ impl frame_system::Config for Runtime {
/// The identifier used to distinguish between accounts.
type AccountId = AccountId;
/// 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.
type Lookup = AccountIdLookup<AccountId, ()>;
/// The index type for storing how many extrinsics an account has signed.
Expand All @@ -178,9 +178,9 @@ impl frame_system::Config for Runtime {
/// The header type.
type Header = generic::Header<BlockNumber, BlakeTwo256>;
/// The ubiquitous event type.
type Event = Event;
type RuntimeEvent = RuntimeEvent;
/// The ubiquitous origin type.
type Origin = Origin;
type RuntimeOrigin = RuntimeOrigin;
/// Maximum number of block number to block hash mappings to keep (oldest pruned first).
type BlockHashCount = BlockHashCount;
/// The weight of database operations that the runtime can invoke.
Expand Down Expand Up @@ -239,7 +239,7 @@ impl pallet_balances::Config for Runtime {
/// The type for recording an account's balance.
type Balance = Balance;
/// The ubiquitous event type.
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DustRemoval = ();
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = System;
Expand Down Expand Up @@ -277,7 +277,7 @@ parameter_types! {
}

impl pallet_transaction_payment::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction = CurrencyAdapter<Balances, EverythingToTheTreasury>;
type LengthToFee = IdentityFee<Balance>;
type WeightToFee = IdentityFee<Balance>;
Expand All @@ -292,10 +292,10 @@ parameter_types! {
}

impl pallet_scheduler::Config for Runtime {
type Event = Event;
type Origin = Origin;
type RuntimeEvent = RuntimeEvent;
type RuntimeOrigin = RuntimeOrigin;
type PalletsOrigin = OriginCaller;
type Call = Call;
type RuntimeCall = RuntimeCall;
type MaximumWeight = MaximumSchedulerWeight;
type ScheduleOrigin = frame_system::EnsureRoot<AccountId>;
type MaxScheduledPerBlock = MaxScheduledPerBlock;
Expand All @@ -306,13 +306,13 @@ impl pallet_scheduler::Config for Runtime {
}

impl pallet_sudo::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
}

impl pallet_aleph::Config for Runtime {
type AuthorityId = AlephId;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type SessionInfoProvider = Session;
type SessionManager = Elections;
}
Expand All @@ -331,7 +331,7 @@ parameter_types! {

impl pallet_elections::Config for Runtime {
type EraInfoProvider = Staking;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type DataProvider = Staking;
type SessionInfoProvider = Session;
type SessionPeriod = SessionPeriod;
Expand All @@ -347,7 +347,7 @@ parameter_types! {
}

impl pallet_session::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type ValidatorId = <Self as frame_system::Config>::AccountId;
type ValidatorIdOf = pallet_staking::StashOf<Self>;
type ShouldEndSession = pallet_session::PeriodicSessions<SessionPeriod, Offset>;
Expand Down Expand Up @@ -385,7 +385,7 @@ impl Convert<sp_core::U256, Balance> for U256ToBalance {

impl pallet_nomination_pools::Config for Runtime {
type WeightInfo = ();
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type CurrencyBalance = Balance;
type RewardCounter = FixedU128;
Expand All @@ -407,6 +407,7 @@ parameter_types! {
pub const MaxNominatorRewardedPerValidator: u32 = MAX_NOMINATORS_REWARDED_PER_VALIDATOR;
pub const OffendingValidatorsThreshold: Perbill = Perbill::from_percent(33);
pub const SessionsPerEra: EraIndex = DEFAULT_SESSIONS_PER_ERA;
pub HistoryDepth: u32 = 84;
}

pub struct UniformEraPayout;
Expand Down Expand Up @@ -462,7 +463,6 @@ impl pallet_staking::WeightInfo for PayoutStakersDecreasedWeightInfo {
Weight
),
(rebond(l: u32), SubstrateStakingWeights, Weight),
(set_history_depth(e: u32), SubstrateStakingWeights, Weight),
(reap_stash(s: u32), SubstrateStakingWeights, Weight),
(new_era(v: u32, n: u32), SubstrateStakingWeights, Weight),
(
Expand Down Expand Up @@ -505,7 +505,7 @@ impl pallet_staking::Config for Runtime {
type GenesisElectionProvider = Elections;
type MaxNominations = ConstU32<1>;
type RewardRemainder = Treasury;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Slash = Treasury;
type Reward = ();
type SessionsPerEra = SessionsPerEra;
Expand All @@ -523,6 +523,8 @@ impl pallet_staking::Config for Runtime {
type WeightInfo = PayoutStakersDecreasedWeightInfo;
type CurrencyBalance = Balance;
type OnStakerSlash = NominationPools;
type HistoryDepth = HistoryDepth;
type TargetList = pallet_staking::UseValidatorsMap<Self>;
}

parameter_types! {
Expand All @@ -539,18 +541,18 @@ impl pallet_timestamp::Config for Runtime {

impl<C> frame_system::offchain::SendTransactionTypes<C> for Runtime
where
Call: From<C>,
RuntimeCall: From<C>,
{
type Extrinsic = UncheckedExtrinsic;
type OverarchingCall = Call;
type OverarchingCall = RuntimeCall;
}

parameter_types! {
pub const MinVestedTransfer: Balance = MICRO_AZERO;
}

impl pallet_vesting::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BlockNumberToBalance = ConvertInto;
type MinVestedTransfer = MinVestedTransfer;
Expand All @@ -569,8 +571,8 @@ parameter_types! {
}

impl pallet_multisig::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type Currency = Balances;
type DepositBase = DepositBase;
type DepositFactor = DepositFactor;
Expand Down Expand Up @@ -614,7 +616,7 @@ impl pallet_treasury::Config for Runtime {
type Burn = Burn;
type BurnDestination = ();
type Currency = Balances;
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type MaxApprovals = MaxApprovals;
type OnSlash = ();
type PalletId = TreasuryPalletId;
Expand All @@ -629,8 +631,8 @@ impl pallet_treasury::Config for Runtime {
}

impl pallet_utility::Config for Runtime {
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_utility::weights::SubstrateWeight<Runtime>;
type PalletsOrigin = OriginCaller;
}
Expand All @@ -648,7 +650,7 @@ parameter_types! {
// Maximum size of the lazy deletion queue of terminated contracts.
// The weight needed for decoding the queue should be less or equal than a tenth
// of the overall weight dedicated to the lazy deletion.
pub DeletionQueueDepth: u32 = (DeletionWeightLimit::get().saturating_div((
pub DeletionQueueDepth: u32 = DeletionWeightLimit::get().saturating_div((
<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -
<Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)
).ref_time()) * 10).ref_time() as u32; // 2228
Expand All @@ -659,8 +661,8 @@ impl pallet_contracts::Config for Runtime {
type Time = Timestamp;
type Randomness = RandomnessCollectiveFlip;
type Currency = Balances;
type Event = Event;
type Call = Call;
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
// The safest default is to allow no calls at all. This is unsafe experimental feature with no support in ink!
type CallFilter = Nothing;
type DepositPerItem = DepositPerItem;
Expand All @@ -675,7 +677,6 @@ impl pallet_contracts::Config for Runtime {
type AddressGenerator = pallet_contracts::DefaultAddressGenerator;
type ContractAccessWeight = pallet_contracts::DefaultContractAccessWeight<BlockWeights>;
type MaxCodeLen = ConstU32<{ 128 * 1024 }>;
type RelaxedMaxCodeLen = ConstU32<{ 256 * 1024 }>;
type MaxStorageKeyLen = ConstU32<128>;
}

Expand All @@ -691,7 +692,7 @@ parameter_types! {
}

impl pallet_identity::Config for Runtime {
type Event = Event;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type BasicDeposit = BasicDeposit;
type FieldDeposit = FieldDeposit;
Expand Down Expand Up @@ -757,9 +758,10 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment<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>;
/// Extrinsic type that has already been checked.
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Runtime,
Expand Down