Skip to content

Commit

Permalink
sdk update - v1.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smohan-dw committed Jan 3, 2025
1 parent c3cf6f3 commit 33c81a0
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 36 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.

6 changes: 3 additions & 3 deletions node/cli/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ fn braid_sign_call(
use cord_braid_runtime as runtime;
use sp_core::Pair;

let extra: runtime::SignedExtra = (
let extra: runtime::TxExtension = (
pallet_network_membership::CheckNetworkMembership::<runtime::Runtime>::new(),
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
Expand Down Expand Up @@ -263,7 +263,7 @@ fn loom_sign_call(
use cord_loom_runtime as runtime;
use sp_core::Pair;

let extra: runtime::SignedExtra = (
let extra: runtime::TxExtension = (
pallet_network_membership::CheckNetworkMembership::<runtime::Runtime>::new(),
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
Expand Down Expand Up @@ -319,7 +319,7 @@ fn weave_sign_call(
use cord_weave_runtime as runtime;
use sp_core::Pair;

let extra: runtime::SignedExtra = (
let extra: runtime::TxExtension = (
//pallet_network_membership::CheckNetworkMembership::<runtime::Runtime>::new(),
frame_system::CheckNonZeroSender::<runtime::Runtime>::new(),
frame_system::CheckSpecVersion::<runtime::Runtime>::new(),
Expand Down
13 changes: 8 additions & 5 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ impl SubstrateCli for Cli {
_ => Box::new(chain_spec::weave_development_config()?),
},
#[cfg(not(feature = "braid-native"))]
name if name.starts_with("braid-") && !name.ends_with(".json") =>
Err(format!("`{}` only supported with `braid-native` feature enabled.", name))?,
name if name.starts_with("braid-") && !name.ends_with(".json") => {
Err(format!("`{}` only supported with `braid-native` feature enabled.", name))?
},
#[cfg(not(feature = "loom-native"))]
name if name.starts_with("loom-") && !name.ends_with(".json") =>
Err(format!("`{}` only supported with `loom-native` feature enabled.", name))?,
name if name.starts_with("loom-") && !name.ends_with(".json") => {
Err(format!("`{}` only supported with `loom-native` feature enabled.", name))?
},
// "weave" => Box::new(chain_spec::weave_config()?),
path => {
let path = std::path::PathBuf::from(path);
Expand Down Expand Up @@ -296,11 +298,12 @@ pub fn run() -> Result<()> {
let ext_builder = RemarkBuilder::new(partial.client.clone(),config.chain_spec.identify_chain());

cmd.run(
config,
config.chain_spec.name().into(),
partial.client,
inherent_benchmark_data()?,
Vec::new(),
&ext_builder,
false
)
},
BenchmarkCmd::Extrinsic(cmd) => {
Expand Down
57 changes: 32 additions & 25 deletions node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use crate::cli::Cli;
use {
sc_client_api::BlockBackend,
sc_consensus_grandpa::{self},
sc_transaction_pool_api::OffchainTransactionPoolFactory,
};

#[cfg(feature = "full-node")]
Expand Down Expand Up @@ -74,7 +73,10 @@ use sc_consensus_babe::{self, SlotProportion};
use sc_network::{
event::Event, service::traits::NetworkService, NetworkBackend, NetworkEventStream,
};
use sc_network_sync::{SyncingService, WarpSyncConfig};
use sc_network_sync::{strategy::warp::WarpSyncConfig, SyncingService};
use sc_transaction_pool::TransactionPoolHandle;
use sc_transaction_pool_api::OffchainTransactionPoolFactory;

pub use sp_runtime::{OpaqueExtrinsic, SaturatedConversion};

#[cfg(feature = "braid-native")]
Expand Down Expand Up @@ -276,7 +278,7 @@ type FullBeefyBlockImport<InnerBlockImport> = sc_consensus_beefy::import::BeefyB
AuthorityId,
>;
/// The transaction pool type defintion.
pub type TransactionPool = sc_transaction_pool::FullPool<Block, FullClient>;
pub type TransactionPool = sc_transaction_pool::TransactionPoolHandle<Block, FullClient>;

/// Creates PartialComponents for a node.
/// Enables chain operations for cases when full node is unnecessary.
Expand All @@ -289,7 +291,7 @@ pub fn new_partial(
FullBackend,
FullSelectChain,
sc_consensus::DefaultImportQueue<Block>,
sc_transaction_pool::FullPool<Block, FullClient>,
sc_transaction_pool::TransactionPoolHandle<Block, FullClient>,
(
impl Fn(
sc_rpc::SubscriptionTaskExecutor,
Expand Down Expand Up @@ -356,12 +358,15 @@ pub fn new_partial(

let select_chain = sc_consensus::LongestChain::new(backend.clone());

let transaction_pool = sc_transaction_pool::BasicPool::new_full(
config.transaction_pool.clone(),
config.role.is_authority().into(),
config.prometheus_registry(),
task_manager.spawn_essential_handle(),
client.clone(),
let transaction_pool = Arc::from(
sc_transaction_pool::Builder::new(
task_manager.spawn_essential_handle(),
client.clone(),
config.role.is_authority().into(),
)
.with_options(config.transaction_pool.clone())
.with_prometheus(config.prometheus_registry())
.build(),
);

// #[allow(clippy::redundant_clone)]
Expand Down Expand Up @@ -507,7 +512,7 @@ pub struct NewFullBase {
/// The syncing service of the node.
pub sync: Arc<SyncingService<Block>>,
/// The transaction pool of the node.
pub transaction_pool: Arc<TransactionPool>,
pub transaction_pool: Arc<TransactionPoolHandle<Block, FullClient>>,
/// The rpc handlers of the node.
pub rpc_handlers: RpcHandlers,
}
Expand All @@ -527,11 +532,11 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
),
) -> Result<NewFullBase, ServiceError> {
let is_offchain_indexing_enabled = config.offchain_worker.indexing_enabled;
let role = config.role.clone();
let role = config.role;
let force_authoring = config.force_authoring;
let backoff_authoring_blocks = if config.chain_spec.is_braid() ||
config.chain_spec.is_loom() ||
config.chain_spec.is_weave()
let backoff_authoring_blocks = if config.chain_spec.is_braid()
|| config.chain_spec.is_loom()
|| config.chain_spec.is_weave()
{
// the block authoring backoff is disabled on production networks
None
Expand All @@ -548,10 +553,12 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
let enable_offchain_worker = config.offchain_worker.enabled;

let hwbench = (!disable_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(&database_path);
sc_sysinfo::gather_hwbench(Some(database_path), &SUBSTRATE_REFERENCE_HARDWARE)
}))
.then(|| {
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(&database_path);
sc_sysinfo::gather_hwbench(Some(database_path), &SUBSTRATE_REFERENCE_HARDWARE)
})
})
.flatten();

let sc_service::PartialComponents {
Expand Down Expand Up @@ -878,9 +885,7 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
);

if enable_offchain_worker {
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work",
let offchain_workers =
sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions {
runtime_api_provider: client.clone(),
keystore: Some(keystore_container.keystore()),
Expand All @@ -894,9 +899,11 @@ pub fn new_full_base<N: NetworkBackend<Block, <Block as BlockT>::Hash>>(
custom_extensions: move |_| {
vec![Box::new(statement_store.clone().as_statement_store_ext()) as Box<_>]
},
})
.run(client.clone(), task_manager.spawn_handle())
.boxed(),
})?;
task_manager.spawn_handle().spawn(
"offchain-workers-runner",
"offchain-work",
offchain_workers.run(client.clone(), task_manager.spawn_handle()).boxed(),
);
}

Expand Down
2 changes: 0 additions & 2 deletions node/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ sc-consensus-beefy-rpc = { workspace = true, default-features = true }
sc-consensus-grandpa = { workspace = true, default-features = true }
sc-consensus-grandpa-rpc = { workspace = true, default-features = true }
sc-rpc = { workspace = true, default-features = true }
# sc-rpc-api = { workspace = true, default-features = true }
sc-rpc-spec-v2 = { workspace = true, default-features = true }
sc-sync-state-rpc = { workspace = true, default-features = true }
sc-transaction-pool-api = { workspace = true, default-features = true }
sp-api = { workspace = true, default-features = true }
Expand Down
1 change: 1 addition & 0 deletions node/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// along with CORD. If not, see <https://www.gnu.org/licenses/>.

//! A collection of CORD specific RPC methods.
#![warn(unused_crate_dependencies)]

use std::sync::Arc;

Expand Down

0 comments on commit 33c81a0

Please sign in to comment.