Skip to content

Commit

Permalink
Remove dac_url and ddc_validation params
Browse files Browse the repository at this point in the history
  • Loading branch information
rakanalh committed Jan 5, 2024
1 parent 8069641 commit 5afaab9
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 43 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate.git",
sc-cli = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" }
sc-service = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate.git", optional = true, branch = "polkadot-v0.9.30" }
url = "2.4.1"

# Local
cere-client = { path = "../node/client", optional = true }
Expand Down
9 changes: 0 additions & 9 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ pub struct RunCmd {
#[clap(flatten)]
pub base: sc_cli::RunCmd,

/// Enable DDC validation (disabled by default). Works only on validator nodes with enabled
/// offchain workers.
#[clap(long, requires = "dac-url")]
pub enable_ddc_validation: bool,

/// DAC DataModel HTTP endpoint to retrieve DDC activity data for validation.
#[clap(long, requires = "enable-ddc-validation", validator = url::Url::parse)]
pub dac_url: Option<String>,

/// Force using Cere Dev runtime.
#[clap(long = "force-cere-dev")]
pub force_cere_dev: bool,
Expand Down
11 changes: 3 additions & 8 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,9 @@ pub fn run() -> sc_cli::Result<()> {
None => {
let runner = cli.create_runner(&cli.run.base)?;
runner.run_node_until_exit(|config| async move {
cere_service::build_full(
config,
cli.run.no_hardware_benchmarks,
cli.run.enable_ddc_validation,
cli.run.dac_url,
)
.map(|full| full.task_manager)
.map_err(Error::Service)
cere_service::build_full(config, cli.run.no_hardware_benchmarks)
.map(|full| full.task_manager)
.map_err(Error::Service)
})
},
}
Expand Down
24 changes: 1 addition & 23 deletions node/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub use cere_dev_runtime;
pub use cere_runtime;

use futures::prelude::*;
use sc_client_api::{Backend, BlockBackend};
use sc_client_api::BlockBackend;
use sc_consensus_babe::{self, SlotProportion};
use sc_network::Event;
use sc_service::{
Expand Down Expand Up @@ -271,16 +271,12 @@ where
pub fn build_full(
config: Configuration,
disable_hardware_benchmarks: bool,
enable_ddc_validation: bool,
dac_url: Option<String>,
) -> Result<NewFull<Client>, ServiceError> {
#[cfg(feature = "cere-dev-native")]
if config.chain_spec.is_cere_dev() {
return new_full::<cere_dev_runtime::RuntimeApi, CereDevExecutorDispatch>(
config,
disable_hardware_benchmarks,
enable_ddc_validation,
dac_url,
|_, _| (),
)
.map(|full| full.with_client(Client::CereDev))
Expand All @@ -291,8 +287,6 @@ pub fn build_full(
new_full::<cere_runtime::RuntimeApi, CereExecutorDispatch>(
config,
disable_hardware_benchmarks,
enable_ddc_validation,
dac_url,
|_, _| (),
)
.map(|full| full.with_client(Client::Cere))
Expand Down Expand Up @@ -326,8 +320,6 @@ impl<C> NewFull<C> {
pub fn new_full<RuntimeApi, ExecutorDispatch>(
mut config: Configuration,
disable_hardware_benchmarks: bool,
enable_ddc_validation: bool,
dac_url: Option<String>,
with_startup_data: impl FnOnce(
&sc_consensus_babe::BabeBlockImport<
Block,
Expand Down Expand Up @@ -357,20 +349,6 @@ where

let basics = new_partial_basics::<RuntimeApi, ExecutorDispatch>(&config)?;

let mut offchain_storage = basics
.backend
.offchain_storage()
.expect("no off-chain storage, DDC validation is not possible");

offchain_storage.set(
sp_core::offchain::STORAGE_PREFIX,
b"enable-ddc-validation",
if enable_ddc_validation { &[1] } else { &[0] },
);
if let Some(dac_url) = dac_url {
offchain_storage.set(sp_core::offchain::STORAGE_PREFIX, b"dac-url", dac_url.as_bytes());
};

let sc_service::PartialComponents {
client,
backend,
Expand Down
1 change: 0 additions & 1 deletion pallets/ddc-staking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ The DDC Staking module is the means by which an account can voluntarily place fu
- Controller account: The account that controls an owner's funds for staking.
- Storage: Storage network participant.
- Era: A time period of DDC participants activity data capture and accumulation which will further be used to calculate pay outs.
>>>>>>> deployment-0.9.30

0 comments on commit 5afaab9

Please sign in to comment.