Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
84 changes: 69 additions & 15 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ sc-cli = { default-features = false, git = "https://github.com/paritytech/polkad
sc-client-api = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-consensus = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-consensus-manual-seal = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-consensus-aura = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-consensus-grandpa = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-executor = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-keystore = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
sc-network = { default-features = false, git = "https://github.com/paritytech/polkadot-sdk.git", tag = "polkadot-stable2506-2" }
Expand Down
3 changes: 1 addition & 2 deletions griffin-core/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,7 @@ where
// performing pool validations and other off-chain runtime calls.
sp_io::storage::set(HEIGHT_KEY, &header.number().encode());

if let Some(mut data) = ExtendedHeader::get_pcdata_storage() {
data.count += 1;
if let Some(data) = ExtendedHeader::get_pcdata_storage() {
sp_io::storage::set(DATA_KEY, &(data).encode());
}

Expand Down
4 changes: 4 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ sc-cli = { workspace = true }
sc-client-api = { workspace = true }
sc-consensus = { workspace = true }
sc-consensus-manual-seal = { workspace = true }
sc-consensus-aura = { workspace = true }
sc-consensus-grandpa = { workspace = true }
sc-executor = { workspace = true }
sc-network = { workspace = true }
sc-service = { workspace = true }
Expand All @@ -39,6 +41,8 @@ serde_json = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-consensus-grandpa = { workspace = true }
sp-genesis-builder = { workspace = true }
sp-io = { workspace = true }
sp-timestamp = { workspace = true }
Expand Down
26 changes: 0 additions & 26 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@ use griffin_partner_chains_runtime::opaque::SessionKeys;
use partner_chains_cli::{KeyDefinition, AURA, GRANDPA};
use partner_chains_node_commands::{PartnerChainRuntime, PartnerChainsSubcommand};

#[derive(Debug, Clone)]
pub enum Consensus {
ManualSeal(u64),
InstantSeal,
None,
}

#[derive(Debug, Clone)]
pub struct WizardBindings;

Expand Down Expand Up @@ -72,30 +65,11 @@ impl PartnerChainRuntime for WizardBindings {
}
}

impl std::str::FromStr for Consensus {
type Err = String;

fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(if s == "instant-seal" {
Consensus::InstantSeal
} else if let Some(block_time) = s.strip_prefix("manual-seal-") {
Consensus::ManualSeal(block_time.parse().map_err(|_| "invalid block time")?)
} else if s.to_lowercase() == "none" {
Consensus::None
} else {
return Err("incorrect consensus identifier".into());
})
}
}

#[derive(Debug, clap::Parser)]
pub struct Cli {
#[command(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(long, default_value = "manual-seal-3000")]
pub consensus: Consensus,

#[clap(flatten)]
pub run: sc_cli::RunCmd,
}
Expand Down
14 changes: 5 additions & 9 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,12 @@ pub fn run() -> sc_cli::Result<()> {
griffin_core::types::OpaqueBlock,
<griffin_core::types::OpaqueBlock as sp_runtime::traits::Block>::Hash,
>,
>(
config, cli.consensus
)
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => service::new_full::<
sc_network::Litep2pNetworkBackend,
>(
config, cli.consensus
)
>(config)
.map_err(sc_cli::Error::Service),
sc_network::config::NetworkBackendType::Litep2p => {
service::new_full::<sc_network::Litep2pNetworkBackend>(config)
.map_err(sc_cli::Error::Service)
}
}
})
}
Expand Down
Loading