Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable async backing moonbase #2623

Merged
merged 147 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
e784e24
use relay block as clocktime in parachain staking
Agusrodri Nov 24, 2023
9150b67
add RelayChainBlockNumberProvider trait
Agusrodri Nov 27, 2023
157affb
adapt benchmarks
Agusrodri Nov 27, 2023
2ed4b82
fix benchmarks
Agusrodri Nov 27, 2023
c39583c
fix warning in benchmarks
Agusrodri Nov 28, 2023
a15c4f4
fix staking TS tests
Agusrodri Nov 29, 2023
db34402
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Nov 29, 2023
e2a33b5
upgrade to polkadot v1.3.0
ahmadkaouk Nov 30, 2023
cd071d3
Temporarily disable kusama and polkadot runtime dependencies
ahmadkaouk Nov 30, 2023
03eb85c
Remove support for Kusama Native Runtime
ahmadkaouk Nov 30, 2023
7f8115a
fix delegation tests
Agusrodri Dec 1, 2023
87bde92
Update evm pin
ahmadkaouk Dec 4, 2023
e4e9eed
update deposit_asset function signature
ahmadkaouk Dec 4, 2023
43ab234
change clocktime to a diff of 2
Agusrodri Dec 4, 2023
172d086
fix integration tests
Agusrodri Dec 6, 2023
1420710
add last_relay_block to can_author runtime api
Agusrodri Dec 7, 2023
36f50a7
fmt and fix some TS tests
Agusrodri Dec 7, 2023
e49871c
remove default impl for RelayChainBlockNumberProvider and add test co…
Agusrodri Dec 7, 2023
182cd43
Add Hasher generic parameter to Bounded
ahmadkaouk Dec 7, 2023
65b0b56
Rename InvalidEvmTransactionError to TransactionValidationError
ahmadkaouk Dec 7, 2023
c2dd2a2
Use transfer_allow_death instead of deprecated transfer
ahmadkaouk Dec 7, 2023
a1b3954
fix build issue
ahmadkaouk Dec 7, 2023
01a7a8d
Use pallet_xcm::RuntimeCall
ahmadkaouk Dec 8, 2023
da4826c
BackendReader renamed to Backend in Frontier
ahmadkaouk Dec 8, 2023
f4ca2d1
Update frontier pin
ahmadkaouk Dec 8, 2023
289018e
Temporarily update new missing weight functions
ahmadkaouk Dec 8, 2023
9cbfa27
Adapt to new return type of ValidatedTransaction::apply
ahmadkaouk Dec 8, 2023
af917fe
IdentityInfo in pallet_identity is now generic
ahmadkaouk Dec 8, 2023
8b2d4c4
Associated type Hasher for QueryPreimage, StorePreimage and Bounded
ahmadkaouk Dec 8, 2023
27da143
Update Frontier Pin
ahmadkaouk Dec 8, 2023
fd2d328
fix runtime compilation errors
librelois Dec 8, 2023
4ace443
Rename BackendReader to Backend
ahmadkaouk Dec 8, 2023
6318533
Remove Send and Sync Trait Bounds for Frontier Backend
ahmadkaouk Dec 8, 2023
fb59e55
Implement closest_merkle_tree and child_closest_merkle_tree for Stora…
ahmadkaouk Dec 8, 2023
26fc6ee
Set block_relay to none
ahmadkaouk Dec 8, 2023
d0e8e2b
Use polkadot_primitives v6
ahmadkaouk Dec 9, 2023
4e5d5a1
Annotate EC for Eth::new
ahmadkaouk Dec 9, 2023
cfe9167
Update polkadot-sdk pin
ahmadkaouk Dec 9, 2023
262a880
Use transferAllowDeath instead of transfer in tests
ahmadkaouk Dec 11, 2023
134682e
start migration
Agusrodri Dec 11, 2023
0f78bbb
Update polkadot-sdk pin
ahmadkaouk Dec 11, 2023
7659190
Use transferAllowDeath instead of transfer
ahmadkaouk Dec 11, 2023
1a5640d
add pre and post checks
Agusrodri Dec 11, 2023
5d1c280
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Dec 11, 2023
b4fae21
fix typescript test
ahmadkaouk Dec 11, 2023
15a9f6a
add logs for testing
Agusrodri Dec 11, 2023
77eb23d
fix typescript tests
ahmadkaouk Dec 12, 2023
d255ba3
Merge remote-tracking branch 'origin/master' into ahmad-upgrade-to-po…
ahmadkaouk Dec 12, 2023
d49f461
Fix zombie tests
ahmadkaouk Dec 12, 2023
2495c2e
finish migration
Agusrodri Dec 12, 2023
8450409
clippy
Agusrodri Dec 12, 2023
53a225b
Fix test balance Transferable
ahmadkaouk Dec 13, 2023
14a8fca
Temporarily disabled relay-encoder rust tests
ahmadkaouk Dec 13, 2023
4bbc605
Fix Rust Tests build
ahmadkaouk Dec 13, 2023
6f66dd5
Fix build with runtime-benchmarks
ahmadkaouk Dec 14, 2023
21a5618
fmt
ahmadkaouk Dec 14, 2023
faa9b6b
Typescript Fmt
ahmadkaouk Dec 14, 2023
c6443ba
Set MaxHolds to 1
ahmadkaouk Dec 14, 2023
dd7a8f0
comply editorconfig
librelois Dec 14, 2023
9aa1857
fix democracy TS tests
Agusrodri Dec 14, 2023
bda525f
fix Eslint warning
Agusrodri Dec 14, 2023
cf2452f
Fix typescript test
ahmadkaouk Dec 14, 2023
c464778
fix txpool TS test
Agusrodri Dec 14, 2023
805aaf6
fix precompile identity test
Agusrodri Dec 14, 2023
94f912c
remove unused import
Agusrodri Dec 14, 2023
678da02
Fix rust tests
ahmadkaouk Dec 15, 2023
48c7567
Fix rust tests (no reserve anymore with preimage)
ahmadkaouk Dec 15, 2023
301f048
Fix xcm rust tests
ahmadkaouk Dec 15, 2023
17ccd0f
Fix build error
ahmadkaouk Dec 15, 2023
d33e92c
Update polkadot-sdk pin
ahmadkaouk Dec 18, 2023
e46bd0f
fix collective test
Agusrodri Dec 18, 2023
d3084e5
Add Evm Fix
ahmadkaouk Dec 18, 2023
09fa5a5
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Dec 18, 2023
d646310
Merge remote-tracking branch 'origin/master' into ahmad-upgrade-to-po…
Agusrodri Dec 18, 2023
2471548
Merge remote-tracking branch 'origin/ahmad-upgrade-to-polkadot-v1.3.0…
Agusrodri Dec 18, 2023
59bb955
use relay slot instead of relay block number
Agusrodri Dec 19, 2023
e4f622a
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Dec 19, 2023
79e09b0
add TODO in migration
Agusrodri Dec 19, 2023
251f373
fix warning
Agusrodri Dec 19, 2023
7c96d19
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Dec 27, 2023
c90f139
clippy
Agusrodri Dec 27, 2023
db05ffe
use proper RelayChainSlot type
Agusrodri Dec 28, 2023
a5ee82e
fix compilation
Agusrodri Dec 28, 2023
f3edd0c
fix types in benchmarks
Agusrodri Dec 28, 2023
f49efa4
new migration logic
Agusrodri Dec 28, 2023
fbb209b
remove parachain_system bound
Agusrodri Jan 8, 2024
d3b769b
Merge remote-tracking branch 'origin/master' into agustin-relay-clock…
Agusrodri Jan 8, 2024
ed2ea31
add ConsensusHookWrapperForMigration
Agusrodri Jan 8, 2024
70b4466
remove ConsensusHookWrapper and restore previous migration
Agusrodri Jan 9, 2024
4ab1114
work with the previous round length value
Agusrodri Jan 17, 2024
471e470
fix staking TS test
Agusrodri Jan 17, 2024
3d77fe4
Fully enable async-backing on moonbase
librelois Jan 18, 2024
c3efa38
adapt GasLimitStorageGrowthRatio to new block gas limit
librelois Jan 18, 2024
2e1bf96
make SlotProvider more generic
Agusrodri Jan 18, 2024
348950b
minor fixes
Agusrodri Jan 18, 2024
e9581c7
cleanup
Agusrodri Jan 18, 2024
3dac427
remove unnecessary dependencies
Agusrodri Jan 18, 2024
e7529f0
Merge remote-tracking branch 'origin/agustin-relay-clocktime' into en…
librelois Jan 19, 2024
31fca1f
Merge branch 'master' into enable-async-backing-moonbase
librelois Jan 30, 2024
9e9410e
fix rust compilation
librelois Jan 30, 2024
a86f8ac
moonbase rounds are 120 parablocks now
librelois Jan 19, 2024
bca701f
recompute gas limit pov ratio
librelois Jan 30, 2024
11f7eea
Revert "recompute gas limit pov ratio"
librelois Jan 30, 2024
9545c8e
Revert "adapt GasLimitStorageGrowthRatio to new block gas limit"
librelois Jan 30, 2024
db3a18f
revert block size changes and min period changes
librelois Jan 30, 2024
cde6dbd
revert unneeded tests changes from Agustin's PR
librelois Jan 30, 2024
1e1b005
opengov periods are double in parablocks now
librelois Jan 30, 2024
3b0c003
comment gov v1 tests
librelois Jan 30, 2024
162623b
palelt staking should support several "slot times"
librelois Jan 30, 2024
bca6f9d
compile rust tests
librelois Jan 30, 2024
b621b12
remove gov v1 tests
librelois Jan 30, 2024
cb12c5d
compile rust tests
librelois Jan 30, 2024
7519158
missing import
librelois Jan 30, 2024
7b410cb
try to enable async backing on zombi tests
librelois Jan 30, 2024
45c260f
inflation info per round are half now
librelois Jan 30, 2024
06350b8
enable async backing in rpc zombi tests
librelois Jan 30, 2024
a14787a
force moonbase collators to use async backing
librelois Jan 30, 2024
694b4c2
adapt rust staking tests
librelois Jan 30, 2024
c647779
async backing is not optional
librelois Jan 30, 2024
2b827ca
Update pallets/parachain-staking/src/lib.rs
librelois Jan 31, 2024
ef5088e
remove constants no longer used
librelois Jan 31, 2024
19fa9d4
fix client compilation
librelois Jan 31, 2024
6a60c76
fmt
librelois Jan 31, 2024
9547aa5
increase capacity and velocity
librelois Jan 31, 2024
6166939
use fixed ports for zombi relay
librelois Feb 1, 2024
7b779ef
enable async backing on zombi relay
librelois Feb 1, 2024
34ae560
add json fields instead of replace
librelois Feb 1, 2024
b42df4b
use a ts script to modify rococo plain specs
librelois Feb 1, 2024
0fc59f7
add json fields instead of modify
librelois Feb 1, 2024
3e282bc
use snake case
librelois Feb 1, 2024
eba6d2f
use a custom polkadot binary for zombi tests
librelois Feb 1, 2024
f825459
update moonkit pin (improve async backing logs)
librelois Feb 2, 2024
cb74450
not use raw chain spec for rococo
librelois Feb 4, 2024
a1dfc4d
not call author inherent on_finalize
librelois Feb 5, 2024
5547f0b
Revert "use a custom polkadot binary for zombi tests"
librelois Feb 5, 2024
c9a8bdd
zombinet require plain spec for the relay
librelois Feb 5, 2024
466208c
not call AuthorInherent::on_finalize
librelois Feb 5, 2024
33b8995
Merge branch 'master' into fullly-enable-async-backing-moonbase
librelois Feb 13, 2024
b43e5f7
no modify rococo specs
librelois Feb 13, 2024
9cf99aa
use forked polkadot bins
librelois Feb 13, 2024
00c833f
properly use forked polkadot bins
librelois Feb 13, 2024
4376e5c
explicitly list all polkadot bins
librelois Feb 13, 2024
8e2a60a
fix path location on CI
librelois Feb 13, 2024
3f65564
Fix zombienet timeouts for async branch (#2644)
timbrinded Feb 13, 2024
d99ad7b
Merge branch 'master' into fullly-enable-async-backing-moonbase
librelois Feb 14, 2024
f416db3
rm broken rust toolchain
librelois Feb 14, 2024
0dd0326
force addition of wasm32 target
librelois Feb 14, 2024
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
14 changes: 13 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ jobs:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
fi
rustup show
rustup target add wasm32-unknown-unknown
# Checks are run after uploading artifacts since they are modified by the tests
- name: Unit tests
run: |
Expand Down Expand Up @@ -613,7 +614,18 @@ jobs:
docker create --name moonbeam_container $DOCKER_TAG bash
docker cp moonbeam_container:moonbeam/moonbeam test/tmp/moonbeam_rt
docker rm -f moonbeam_container
- name: Setup chainspecs
- name: "TEMPORARY: Download forked polkadot-bins"
run: |
# When we remove this step, re-add "runScripts": ["download-polkadot.sh"]," to moonwall config
cd test/tmp
wget https://opslayer-dev-artifacts.s3.us-east-2.amazonaws.com/bins/moonbeam/polkadot/1.3.0/polkadot
wget https://opslayer-dev-artifacts.s3.us-east-2.amazonaws.com/bins/moonbeam/polkadot/1.3.0/polkadot-execute-worker
wget https://opslayer-dev-artifacts.s3.us-east-2.amazonaws.com/bins/moonbeam/polkadot/1.3.0/polkadot-prepare-worker

chmod +x polkadot
chmod +x polkadot-execute-worker
chmod +x polkadot-prepare-worker
- name: Prepare Chainspecs
run: |
cd test
pnpm install
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/subxt-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
uses: pnpm/action-setup@v2
with:
version: 8.6.12
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.74.0
override: true
- name: Install Subxt-cli
run: |
cargo install subxt-cli
Expand Down
24 changes: 12 additions & 12 deletions Cargo.lock

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

5 changes: 0 additions & 5 deletions node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ pub struct RunCmd {
/// Removes moonbeam prefix from Prometheus metrics
#[clap(long)]
pub no_prometheus_prefix: bool,

/// Enable asynchronous backing (for collators only)
/// This feature is still experimental, please don't use it in production.
#[clap(hide = true, long = "experimental-async-backing")]
pub async_backing: bool,
}

impl RunCmd {
Expand Down
6 changes: 3 additions & 3 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ pub fn run() -> Result<()> {
collator_options,
id,
rpc_config,
cli.run.async_backing,
false,
hwbench,
)
.await
Expand All @@ -807,7 +807,7 @@ pub fn run() -> Result<()> {
collator_options,
id,
rpc_config,
cli.run.async_backing,
false,
hwbench,
)
.await
Expand All @@ -823,7 +823,7 @@ pub fn run() -> Result<()> {
collator_options,
id,
rpc_config,
cli.run.async_backing,
true,
hwbench,
)
.await
Expand Down
5 changes: 2 additions & 3 deletions node/service/src/chain_spec/moonbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,11 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20);
const PARACHAIN_BOND_RESERVE_PERCENT: Percent = Percent::from_percent(30);
const BLOCKS_PER_ROUND: u32 = 2 * HOURS;
const BLOCKS_PER_YEAR: u32 = 31_557_600 / 6;
const NUM_SELECTED_CANDIDATES: u32 = 8;
pub fn moonbase_inflation_config() -> InflationInfo<Balance> {
fn to_round_inflation(annual: Range<Perbill>) -> Range<Perbill> {
use pallet_parachain_staking::inflation::{
perbill_annual_to_perbill_round, BLOCKS_PER_YEAR,
};
use pallet_parachain_staking::inflation::perbill_annual_to_perbill_round;
perbill_annual_to_perbill_round(
annual,
// rounds per year
Expand Down
5 changes: 2 additions & 3 deletions node/service/src/chain_spec/moonbeam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20);
const PARACHAIN_BOND_RESERVE_PERCENT: Percent = Percent::from_percent(30);
const BLOCKS_PER_ROUND: u32 = 6 * HOURS;
const BLOCKS_PER_YEAR: u32 = 31_557_600 / 12;
const NUM_SELECTED_CANDIDATES: u32 = 8;
pub fn moonbeam_inflation_config() -> InflationInfo<Balance> {
fn to_round_inflation(annual: Range<Perbill>) -> Range<Perbill> {
use pallet_parachain_staking::inflation::{
perbill_annual_to_perbill_round, BLOCKS_PER_YEAR,
};
use pallet_parachain_staking::inflation::perbill_annual_to_perbill_round;
perbill_annual_to_perbill_round(
annual,
// rounds per year
Expand Down
5 changes: 2 additions & 3 deletions node/service/src/chain_spec/moonriver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ pub fn get_chain_spec(para_id: ParaId) -> ChainSpec {
const COLLATOR_COMMISSION: Perbill = Perbill::from_percent(20);
const PARACHAIN_BOND_RESERVE_PERCENT: Percent = Percent::from_percent(30);
const BLOCKS_PER_ROUND: u32 = 2 * HOURS;
const BLOCKS_PER_YEAR: u32 = 31_557_600 / 12;
const NUM_SELECTED_CANDIDATES: u32 = 8;
pub fn moonriver_inflation_config() -> InflationInfo<Balance> {
fn to_round_inflation(annual: Range<Perbill>) -> Range<Perbill> {
use pallet_parachain_staking::inflation::{
perbill_annual_to_perbill_round, BLOCKS_PER_YEAR,
};
use pallet_parachain_staking::inflation::perbill_annual_to_perbill_round;
perbill_annual_to_perbill_round(
annual,
// rounds per year
Expand Down
2 changes: 2 additions & 0 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ where
};

if async_backing {
log::info!("Collator started with asynchronous backing.");
let client_clone = client.clone();
let code_hash_provider = move |block_hash| {
client_clone
Expand Down Expand Up @@ -1093,6 +1094,7 @@ where
}),
);
} else {
log::info!("Collator started without asynchronous backing.");
task_manager.spawn_essential_handle().spawn(
"nimbus",
None,
Expand Down
12 changes: 4 additions & 8 deletions pallets/parachain-staking/src/inflation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! Helper methods for computing issuance based on inflation
use crate::pallet::{BalanceOf, Config, Pallet};
use frame_support::traits::Currency;
use frame_support::traits::{Currency, Get};
use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
Expand All @@ -25,13 +25,9 @@ use sp_runtime::{Perbill, RuntimeDebug};
use substrate_fixed::transcendental::pow as floatpow;
use substrate_fixed::types::I64F64;

const SECONDS_PER_YEAR: u32 = 31557600;
const SECONDS_PER_BLOCK: u32 = 12;
pub const BLOCKS_PER_YEAR: u32 = SECONDS_PER_YEAR / SECONDS_PER_BLOCK;

fn rounds_per_year<T: Config>() -> u32 {
let blocks_per_round = <Pallet<T>>::round().length;
BLOCKS_PER_YEAR / blocks_per_round
T::SlotsPerYear::get() / blocks_per_round
}

#[derive(
Expand Down Expand Up @@ -136,8 +132,8 @@ impl<Balance> InflationInfo<Balance> {
self.round = annual_to_round::<T>(new);
}
/// Reset round inflation rate based on changes to round length
pub fn reset_round(&mut self, new_length: u32) {
let periods = BLOCKS_PER_YEAR / new_length;
pub fn reset_round<T: Config>(&mut self, new_length: u32) {
let periods = T::SlotsPerYear::get() / new_length;
self.round = perbill_annual_to_perbill_round(self.annual, periods);
}
/// Set staking expectations
Expand Down
5 changes: 4 additions & 1 deletion pallets/parachain-staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ pub mod pallet {
/// Maximum candidates
#[pallet::constant]
type MaxCandidates: Get<u32>;
/// Average number of slots per year
/// A slot here is the unit of time for staking rounds (provided by SlotProvider)
type SlotsPerYear: Get<u32>;
}

#[pallet::error]
Expand Down Expand Up @@ -973,7 +976,7 @@ pub mod pallet {
round.length = new;
// update per-round inflation given new rounds per year
let mut inflation_config = <InflationConfig<T>>::get();
inflation_config.reset_round(new);
inflation_config.reset_round::<T>(new);
<Round<T>>::put(round);
Self::deposit_event(Event::BlocksPerRoundSet {
current_round: now,
Expand Down
1 change: 1 addition & 0 deletions pallets/parachain-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ impl Config for Test {
type SlotProvider = StakingRoundSlotProvider;
type WeightInfo = ();
type MaxCandidates = MaxCandidates;
type SlotsPerYear = frame_support::traits::ConstU32<{ 31_557_600 / 6 }>;
}

pub(crate) struct ExtBuilder {
Expand Down
18 changes: 9 additions & 9 deletions pallets/parachain-staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ fn set_blocks_per_round_event_emits_correctly() {
first_block: 0,
old: 5,
new: 6,
new_per_round_inflation_min: Perbill::from_parts(926),
new_per_round_inflation_ideal: Perbill::from_parts(926),
new_per_round_inflation_max: Perbill::from_parts(926),
new_per_round_inflation_min: Perbill::from_parts(463),
new_per_round_inflation_ideal: Perbill::from_parts(463),
new_per_round_inflation_max: Perbill::from_parts(463),
});
});
}
Expand Down Expand Up @@ -518,9 +518,9 @@ fn set_inflation_event_emits_correctly() {
annual_min: min,
annual_ideal: ideal,
annual_max: max,
round_min: Perbill::from_parts(57),
round_ideal: Perbill::from_parts(75),
round_max: Perbill::from_parts(93),
round_min: Perbill::from_parts(29),
round_ideal: Perbill::from_parts(38),
round_max: Perbill::from_parts(47),
Agusrodri marked this conversation as resolved.
Show resolved Hide resolved
});
});
}
Expand Down Expand Up @@ -560,9 +560,9 @@ fn set_inflation_storage_updates_correctly() {
assert_eq!(
ParachainStaking::inflation_config().round,
Range {
min: Perbill::from_parts(57),
ideal: Perbill::from_parts(75),
max: Perbill::from_parts(93)
min: Perbill::from_parts(29),
ideal: Perbill::from_parts(38),
max: Perbill::from_parts(47)
}
);
});
Expand Down
1 change: 1 addition & 0 deletions precompiles/parachain-staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ impl pallet_parachain_staking::Config for Runtime {
type SlotProvider = StakingRoundSlotProvider;
type WeightInfo = ();
type MaxCandidates = MaxCandidates;
type SlotsPerYear = frame_support::traits::ConstU32<{ 31_557_600 / 6 }>;
}

pub(crate) struct ExtBuilder {
Expand Down
12 changes: 8 additions & 4 deletions runtime/moonbase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_
.saturating_div(2)
Agusrodri marked this conversation as resolved.
Show resolved Hide resolved
.set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64);

// TODO: Set MILLISECS_PER_BLOCK to 6000 when async backing will be definitly enabled
pub const MILLISECS_PER_BLOCK: u64 = 12000;
pub const MILLISECS_PER_BLOCK: u64 = 6_000;
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
pub const HOURS: BlockNumber = MINUTES * 60;
pub const DAYS: BlockNumber = HOURS * 24;
Expand Down Expand Up @@ -709,8 +708,12 @@ parameter_types! {
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4);
}

pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
/// into the relay chain.
const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
/// How many parachain blocks are processed by the relay chain per parent. Limits the
/// number of blocks authored per slot.
const BLOCK_PROCESSING_VELOCITY: u32 = 2;

type ConsensusHook = pallet_async_backing::consensus_hook::FixedVelocityConsensusHook<
Runtime,
Expand Down Expand Up @@ -830,6 +833,7 @@ impl pallet_parachain_staking::Config for Runtime {
type SlotProvider = RelayChainSlotProvider;
type WeightInfo = moonbeam_weights::pallet_parachain_staking::WeightInfo<Runtime>;
type MaxCandidates = ConstU32<200>;
type SlotsPerYear = ConstU32<{ 31_557_600 / 6 }>;
}

impl pallet_author_inherent::Config for Runtime {
Expand Down
Loading
Loading