Skip to content

Commit

Permalink
block bad block (#1650)
Browse files Browse the repository at this point in the history
* block bad block

* fix
  • Loading branch information
xlc authored Nov 29, 2021
1 parent a2e2e25 commit 15da2db
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ impl SubstrateCli for RelayChainCli {
}

fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
println!("Loading chain spec {}", id);
if id == "rococo-mandala" {
let spec = sc_service::GenericChainSpec::<(), polkadot_service::chain_spec::Extensions>::from_json_bytes(
&include_bytes!("../../../resources/rococo-mandala.json")[..],
Expand Down
2 changes: 2 additions & 0 deletions node/service/src/chain_spec/acala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ pub fn latest_acala_config() -> Result<ChainSpec, String> {
Extensions {
relay_chain: "polkadot".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down Expand Up @@ -207,6 +208,7 @@ pub fn acala_dev_config() -> Result<ChainSpec, String> {
Extensions {
relay_chain: "rococo-local".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down
1 change: 1 addition & 0 deletions node/service/src/chain_spec/karura.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ pub fn karura_dev_config() -> Result<ChainSpec, String> {
Extensions {
relay_chain: "rococo-local".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down
3 changes: 3 additions & 0 deletions node/service/src/chain_spec/mandala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ fn dev_testnet_config_from_chain_id(chain_id: &str) -> Result<ChainSpec, String>
Extensions {
relay_chain: "rococo-local".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down Expand Up @@ -141,6 +142,7 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
Extensions {
relay_chain: "rococo-local".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down Expand Up @@ -221,6 +223,7 @@ pub fn latest_mandala_testnet_config() -> Result<ChainSpec, String> {
Extensions {
relay_chain: "dev".into(),
para_id: PARA_ID,
bad_blocks: None,
},
))
}
Expand Down
3 changes: 3 additions & 0 deletions node/service/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ pub struct Extensions {
pub relay_chain: String,
/// The id of the Parachain.
pub para_id: u32,
/// Known bad block hashes.
#[serde(default)]
pub bad_blocks: sc_client_api::BadBlocks<polkadot_primitives::v1::Block>,
}

impl Extensions {
Expand Down
3 changes: 3 additions & 0 deletions resources/acala-dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
"paraId": 2000,
"consensusEngine": null,
"codeSubstitutes": {},
"badBlocks": [
"0xa820d0e6b3babb3a7023a229cfe61c32ceb68602f5339e2d416d7fbca5e82aa7"
],
"genesis": {
"raw": {
"top": {
Expand Down

0 comments on commit 15da2db

Please sign in to comment.