Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
346 changes: 173 additions & 173 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ pub struct RunCmd {
/// **Dangerous!** Do not touch unless explicitly adviced to.
#[clap(long)]
pub overseer_channel_capacity_override: Option<usize>,

#[allow(missing_docs)]
#[clap(long, hide = true)]
pub malus_finality_delay: Option<u32>,
}

#[allow(missing_docs)]
Expand Down
2 changes: 2 additions & 0 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ where
false,
overseer_gen,
cli.run.overseer_channel_capacity_override,
#[cfg(feature = "malus")]
cli.run.malus_finality_delay,
hwbench,
)
.map(|full| full.task_manager)
Expand Down
20 changes: 19 additions & 1 deletion node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ pub fn new_full<RuntimeApi, ExecutorDispatch, OverseerGenerator>(
overseer_enable_anyways: bool,
overseer_gen: OverseerGenerator,
overseer_message_channel_capacity_override: Option<usize>,
#[cfg(feature = "malus")] malus_finality_delay: Option<u32>,
hwbench: Option<sc_sysinfo::HwBench>,
) -> Result<NewFull<Arc<FullClient<RuntimeApi, ExecutorDispatch>>>, Error>
where
Expand Down Expand Up @@ -1221,7 +1222,15 @@ where
// add a custom voting rule to temporarily stop voting for new blocks
// after the given pause block is finalized and restarting after the
// given delay.
let builder = grandpa::VotingRulesBuilder::default();
let mut builder = grandpa::VotingRulesBuilder::default();

#[cfg(not(feature = "malus"))]
let malus_finality_delay = None;

if let Some(delay) = malus_finality_delay {
info!(?delay, "Enabling malus finality delay",);
builder = builder.add(grandpa::BeforeBestBlockBy(delay));
};

let voting_rule = match grandpa_pause {
Some((block, delay)) => {
Expand Down Expand Up @@ -1349,6 +1358,7 @@ pub fn build_full(
overseer_enable_anyways: bool,
overseer_gen: impl OverseerGen,
overseer_message_channel_override: Option<usize>,
#[cfg(feature = "malus")] malus_finality_delay: Option<u32>,
hwbench: Option<sc_sysinfo::HwBench>,
) -> Result<NewFull<Client>, Error> {
#[cfg(feature = "rococo-native")]
Expand All @@ -1367,6 +1377,8 @@ pub fn build_full(
overseer_enable_anyways,
overseer_gen,
overseer_message_channel_override,
#[cfg(feature = "malus")]
malus_finality_delay,
hwbench,
)
.map(|full| full.with_client(Client::Rococo))
Expand All @@ -1385,6 +1397,8 @@ pub fn build_full(
overseer_enable_anyways,
overseer_gen,
overseer_message_channel_override,
#[cfg(feature = "malus")]
malus_finality_delay,
hwbench,
)
.map(|full| full.with_client(Client::Kusama))
Expand All @@ -1403,6 +1417,8 @@ pub fn build_full(
overseer_enable_anyways,
overseer_gen,
overseer_message_channel_override,
#[cfg(feature = "malus")]
malus_finality_delay,
hwbench,
)
.map(|full| full.with_client(Client::Westend))
Expand All @@ -1424,6 +1440,8 @@ pub fn build_full(
gum::warn!("Channel capacity should _never_ be tampered with on polkadot!");
capacity
}),
#[cfg(feature = "malus")]
malus_finality_delay,
hwbench,
)
.map(|full| full.with_client(Client::Polkadot))
Expand Down
1 change: 1 addition & 0 deletions node/test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ pub fn new_full(
polkadot_service::RealOverseerGen,
None,
None,
None,
)
}

Expand Down
1 change: 1 addition & 0 deletions parachain/test-parachains/adder/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ fn main() -> Result<()> {
polkadot_service::RealOverseerGen,
None,
None,
None,
)
.map_err(|e| e.to_string())?;
let mut overseer_handle = full_node
Expand Down
1 change: 1 addition & 0 deletions parachain/test-parachains/undying/collator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ fn main() -> Result<()> {
polkadot_service::RealOverseerGen,
None,
None,
None,
)
.map_err(|e| e.to_string())?;
let mut overseer_handle = full_node
Expand Down