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

feat: add block rewards to altair and centrifuge runtimes #1342

Merged
merged 30 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
0328dd0
feat: add ED funding to rewards pallet
wischli May 10, 2023
aad3cd7
feat: apply reward genesis config to dev runtime
wischli May 10, 2023
793797e
tests: apply rewards ED to block rewards
wischli May 11, 2023
e320b01
tests: add sanity intgr block rewards check
wischli May 11, 2023
cd36e63
feat: add block rewards to altair runtime
wischli May 11, 2023
1c64212
feat: add block rewards to cfg runtime
wischli May 11, 2023
7a4b92f
docs: improve blk rw migraton com
wischli May 11, 2023
afc4d54
feat: reduce collator kick threshold to 2 hours
wischli May 10, 2023
0301952
Revert "feat: reduce collator kick threshold to 2 hours"
wischli May 11, 2023
9b4dc2a
fix: re-enable transfer keep alive
wischli May 11, 2023
d2aeaa2
fix: chain_spec
wischli May 12, 2023
d0aa485
refactor: move rewards migration
wischli May 12, 2023
315bb78
feat: add session key migration
wischli May 12, 2023
e913b6f
Merge branch 'main' into feat/block-rewards-to-prod
wischli May 12, 2023
87446db
fix: mixed up tokens in spec
wischli May 12, 2023
12f08c1
refactor: rm dev migrations
wischli May 12, 2023
b87cd00
bench: fix block rewards
wischli May 15, 2023
a995225
Merge remote-tracking branch 'origin/main' into feat/block-rewards-to…
wischli May 15, 2023
2b43d2b
refactor: move migrations to sep file
wischli May 15, 2023
310f2b5
refactor: block rewards pallet id
wischli May 15, 2023
635a6af
refactor: improve pallet genesis build err log
wischli May 15, 2023
e3047d2
refactor: remove rewards domain concept (#1344)
wischli May 16, 2023
24616cf
refactor: rename LiquidityRewardsBase
wischli May 16, 2023
7d322e4
tests: add block rewards RAPI int
wischli May 16, 2023
9957c73
clippy: remove unused
wischli May 16, 2023
238ddc9
fmt: taplo
wischli May 16, 2023
4be7404
fix: dev chainspec after renaming
wischli May 16, 2023
1fb344e
refactor: apply suggestion from code review
wischli May 16, 2023
7bf4a40
Update runtime/centrifuge/src/lib.rs
wischli May 16, 2023
0fcf91c
Merge branch 'main' into feat/block-rewards-to-prod
wischli May 16, 2023
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
feat: reduce collator kick threshold to 2 hours
  • Loading branch information
wischli committed May 11, 2023
commit afc4d54d57474f014807d49f2091bb2637e114ff
4 changes: 4 additions & 0 deletions libs/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ pub mod constants {

/// Unhashed 36-bytes prefix for currencies managed by Connectors.
pub const GENERAL_CURRENCY_INDEX_PREFIX: [u8; 36] = *b"CentrifugeGeneralCurrencyIndexPrefix";

/// The time period in which a collator needs to author a block in order to
/// stay in the set of collators.
pub const COLLATOR_KICK_THRESHOLD: BlockNumber = 2 * HOURS;
}

/// Listing of parachains we integrate with.
Expand Down
7 changes: 6 additions & 1 deletion runtime/altair/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,18 @@ parameter_types! {
pub const MaxVoters: u32 = 1000;
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
pub KickThreshold: BlockNumber = prod_or_fast!(
cfg_primitives::constants::COLLATOR_KICK_THRESHOLD,
1 * MINUTES,
"CFG_COLLATOR_KICK_THRESHOLD"
);
}

// Implement Collator Selection pallet configuration trait for the runtime
impl pallet_collator_selection::Config for Runtime {
type Currency = Balances;
// should be a multiple of session or things will get inconsistent
type KickThreshold = Period;
type KickThreshold = KickThreshold;
type MaxCandidates = MaxCandidates;
type MaxInvulnerables = MaxInvulnerables;
type MinCandidates = MinCandidates;
Expand Down
7 changes: 6 additions & 1 deletion runtime/centrifuge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1130,13 +1130,18 @@ parameter_types! {
pub const MaxVoters: u32 = 1000;
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
pub KickThreshold: BlockNumber = prod_or_fast!(
cfg_primitives::constants::COLLATOR_KICK_THRESHOLD,
1 * MINUTES,
"CFG_COLLATOR_KICK_THRESHOLD"
);
}

// Implement Collator Selection pallet configuration trait for the runtime
impl pallet_collator_selection::Config for Runtime {
type Currency = Balances;
// should be a multiple of session or things will get inconsistent
type KickThreshold = Period;
type KickThreshold = KickThreshold;
type MaxCandidates = MaxCandidates;
type MaxInvulnerables = MaxInvulnerables;
type MinCandidates = MinCandidates;
Expand Down
11 changes: 8 additions & 3 deletions runtime/development/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use pallet_restricted_tokens::{
pub use pallet_timestamp::Call as TimestampCall;
pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_transaction_payment_rpc_runtime_api::{FeeDetails, RuntimeDispatchInfo};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use polkadot_runtime_common::{prod_or_fast, BlockHashCount, SlowAdjustingFeeUpdate};
use runtime_common::fees::{DealWithFees, WeightToFee};
pub use runtime_common::*;
use scale_info::TypeInfo;
Expand Down Expand Up @@ -348,7 +348,7 @@ impl pallet_authorship::Config for Runtime {
}

parameter_types! {
pub Period: u32 = polkadot_runtime_common::prod_or_fast!(6 * HOURS, 1 * MINUTES, "DEV_SESSION_PERIOD");
pub Period: u32 = prod_or_fast!(6 * HOURS, 1 * MINUTES, "DEV_SESSION_PERIOD");
pub const Offset: u32 = 0;
}

Expand Down Expand Up @@ -1228,6 +1228,11 @@ parameter_types! {
pub const MaxVoters: u32 = 10 * 1000;
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
pub KickThreshold: BlockNumber = prod_or_fast!(
cfg_primitives::constants::COLLATOR_KICK_THRESHOLD,
1 * MINUTES,
"CFG_COLLATOR_KICK_THRESHOLD"
);
}

type CollatorSelectionUpdateOrigin = EitherOfDiverse<
Expand All @@ -1239,7 +1244,7 @@ type CollatorSelectionUpdateOrigin = EitherOfDiverse<
impl pallet_collator_selection::Config for Runtime {
type Currency = Tokens;
// should be a multiple of session or things will get inconsistent
type KickThreshold = Period;
type KickThreshold = KickThreshold;
type MaxCandidates = MaxCandidates;
type MaxInvulnerables = MaxInvulnerables;
type MinCandidates = MinCandidates;
Expand Down