Skip to content

Commit

Permalink
Deploy manual-seal binaries (#766)
Browse files Browse the repository at this point in the history
* update types to 0.5.9

* fix testnet build

* create instant seal

* wip

* allow instnat and manual seal

* update sealing

* update sealing

* update clippy

---------

Co-authored-by: drewstone <drewstone329@gmail.com>
  • Loading branch information
1xstj and drewstone authored Oct 1, 2024
1 parent 0de43e2 commit 1c60a02
Show file tree
Hide file tree
Showing 7 changed files with 352 additions and 427 deletions.
6 changes: 6 additions & 0 deletions Cargo.lock

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

8 changes: 6 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ sp-inherents = { workspace = true, features = ["std"] }
sp-keystore = { workspace = true, features = ["std"] }
sp-runtime = { workspace = true, features = ["std"] }
sp-timestamp = { workspace = true, features = ["std"] }

pallet-services-rpc = { workspace = true }

sp-consensus-grandpa = { workspace = true }
sp-offchain = { workspace = true }
pallet-airdrop-claims = { workspace = true }
sc-chain-spec = { workspace = true }
sc-rpc = { workspace = true }
Expand All @@ -72,12 +72,16 @@ sp-block-builder = { workspace = true }
sp-blockchain = { workspace = true }
substrate-frame-rpc-system = { workspace = true }
substrate-prometheus-endpoint = { workspace = true }
sp-session = { workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
sp-io = { workspace = true }

# RPC related dependencies
jsonrpsee = { workspace = true }
pallet-im-online = { workspace = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
sc-transaction-pool-api = { workspace = true }

# Frontier
Expand Down
2 changes: 1 addition & 1 deletion node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Cli {
/// Choose sealing method.
#[cfg(feature = "manual-seal")]
#[arg(long, value_enum, ignore_case = true)]
pub sealing: Option<Sealing>,
pub sealing: Sealing,
}

#[derive(Debug, clap::Subcommand)]
Expand Down
61 changes: 61 additions & 0 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub fn run() -> sc_cli::Result<()> {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::CheckBlock(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
Expand All @@ -124,6 +125,16 @@ pub fn run() -> sc_cli::Result<()> {
Ok((cmd.run(client, import_queue), task_manager))
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::CheckBlock(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
let (client, _, import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, import_queue), task_manager))
})
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::ExportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
Expand All @@ -132,6 +143,16 @@ pub fn run() -> sc_cli::Result<()> {
Ok((cmd.run(client, config.database), task_manager))
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::ExportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
let (client, _, import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, config.database), task_manager))
})
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::ExportState(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
Expand All @@ -140,6 +161,16 @@ pub fn run() -> sc_cli::Result<()> {
Ok((cmd.run(client, config.chain_spec), task_manager))
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::ExportState(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
let (client, _, import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, config.chain_spec), task_manager))
})
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::ImportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
Expand All @@ -148,10 +179,20 @@ pub fn run() -> sc_cli::Result<()> {
Ok((cmd.run(client, import_queue), task_manager))
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::ImportBlocks(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
let (client, _, import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
Ok((cmd.run(client, import_queue), task_manager))
})
},
Some(Subcommand::PurgeChain(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|config| cmd.run(config.database))
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::Revert(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|config| {
Expand All @@ -164,6 +205,20 @@ pub fn run() -> sc_cli::Result<()> {
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::Revert(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.async_run(|mut config| {
let (client, backend, import_queue, task_manager, _) =
service::new_chain_ops(&mut config, &cli.eth)?;
let aux_revert = Box::new(|client, _, blocks| {
sc_consensus_grandpa::revert(client, blocks)?;
Ok(())
});
Ok((cmd.run(client, backend, Some(aux_revert)), task_manager))
})
},
#[cfg(not(feature = "manual-seal"))]
Some(Subcommand::Benchmark(cmd)) => {
let runner = cli.create_runner(cmd)?;

Expand Down Expand Up @@ -212,6 +267,10 @@ pub fn run() -> sc_cli::Result<()> {
}
})
},
#[cfg(feature = "manual-seal")]
Some(Subcommand::Benchmark(cmd)) => {
unimplemented!()
},
Some(Subcommand::FrontierDb(cmd)) => {
let runner = cli.create_runner(cmd)?;
runner.sync_run(|mut config| {
Expand Down Expand Up @@ -268,6 +327,8 @@ pub fn run() -> sc_cli::Result<()> {
eth_config: cli.eth,
debug_output: cli.output_path,
auto_insert_keys: cli.auto_insert_keys,
#[cfg(feature = "manual-seal")]
sealing: cli.sealing,
})
.map_err(Into::into)
.await
Expand Down
Loading

0 comments on commit 1c60a02

Please sign in to comment.