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

[WIP] malus-collator: implement initial version of malicious collator submitting same collation to all backing groups #6924

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions polkadot/parachain/test-parachains/undying/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ codec = { features = ["derive"], workspace = true }
dlmalloc = { features = ["global"], workspace = true }
log = { workspace = true }
polkadot-parachain-primitives = { features = ["wasm-api"], workspace = true }
polkadot-primitives = { workspace = true, default-features = false }
tiny-keccak = { features = ["keccak"], workspace = true }

# We need to make sure the global allocator is disabled until we have support of full substrate externalities
Expand All @@ -30,5 +31,6 @@ std = [
"codec/std",
"log/std",
"polkadot-parachain-primitives/std",
"polkadot-primitives/std",
"sp-io/std",
]
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ futures-timer = { workspace = true }
log = { workspace = true, default-features = true }

polkadot-cli = { workspace = true, default-features = true }
polkadot-erasure-coding = { workspace = true, default-features = true }
polkadot-node-primitives = { workspace = true, default-features = true }
polkadot-node-subsystem = { workspace = true, default-features = true }
polkadot-primitives = { workspace = true, default-features = true }
Expand Down
13 changes: 13 additions & 0 deletions polkadot/parachain/test-parachains/undying/collator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ pub struct ExportGenesisWasmCommand {
pub output: Option<PathBuf>,
}

/// Enum representing different types of malicious behaviors for collators.
#[derive(Debug, Parser, Clone, PartialEq, clap::ValueEnum)]
pub enum MalusType {
/// No malicious behavior.
None,
/// Submit the same collations to all assigned cores.
DuplicateCollations,
}

#[allow(missing_docs)]
#[derive(Debug, Parser)]
#[group(skip)]
Expand All @@ -81,6 +90,10 @@ pub struct RunCmd {
/// we compute per block.
#[arg(long, default_value_t = 1)]
pub pvf_complexity: u32,

/// Specifies the malicious behavior of the collator.
#[arg(long, value_enum, default_value_t = MalusType::None)]
pub malus_type: MalusType,
}

#[allow(missing_docs)]
Expand Down
Loading
Loading