Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AstarNetwork/Astar into feat/asyn…
Browse files Browse the repository at this point in the history
…c-backing
  • Loading branch information
ermalkaleci committed Jul 30, 2024
2 parents 6ac7234 + d243148 commit c0c2d49
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 59 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-collator"
version = "5.42.0"
version = "5.42.2"
description = "Astar collator implementation in Rust."
build = "build.rs"
default-run = "astar-collator"
Expand Down
83 changes: 39 additions & 44 deletions bin/collator/src/parachain/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ where
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
) -> sc_consensus::DefaultImportQueue<Block>,
{
let telemetry = config
.telemetry_endpoints
Expand Down Expand Up @@ -254,7 +254,7 @@ where
config,
telemetry.as_ref().map(|telemetry| telemetry.handle()),
&task_manager,
)?;
);

let params = PartialComponents {
backend,
Expand Down Expand Up @@ -351,7 +351,7 @@ where
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
) -> sc_consensus::DefaultImportQueue<Block>,
SC: FnOnce(
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
Arc<TFullBackend<Block>>,
Expand Down Expand Up @@ -656,7 +656,7 @@ where
&Configuration,
Option<TelemetryHandle>,
&TaskManager,
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>,
) -> sc_consensus::DefaultImportQueue<Block>,
SC: FnOnce(
Arc<TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>,
Arc<TFullBackend<Block>>,
Expand Down Expand Up @@ -939,7 +939,7 @@ pub fn build_import_queue_fallback<RuntimeApi, Executor>(
config: &Configuration,
telemetry_handle: Option<TelemetryHandle>,
task_manager: &TaskManager,
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>
) -> sc_consensus::DefaultImportQueue<Block>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
+ Send
Expand All @@ -965,30 +965,30 @@ where
_,
_,
_,
>(
cumulus_client_consensus_aura::BuildVerifierParams {
client: verifier_client.clone(),
create_inherent_data_providers: move |parent_hash, _| {
let cidp_client = verifier_client.clone();
async move {
let slot_duration = cumulus_client_consensus_aura::slot_duration_at(
&*cidp_client,
parent_hash,
)?;
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
>(sc_consensus_aura::BuildVerifierParams {
client: verifier_client.clone(),
create_inherent_data_providers: move |parent_hash, _| {
let cidp_client = verifier_client.clone();
async move {
let slot_duration = cumulus_client_consensus_aura::slot_duration_at(
&*cidp_client,
parent_hash,
)?;
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration(
*timestamp,
slot_duration,
);

Ok((slot, timestamp))
}
},
telemetry: telemetry_handle,
Ok((slot, timestamp))
}
},
)) as Box<_>
telemetry: telemetry_handle,
check_for_equivocation: sc_consensus_aura::CheckForEquivocation::Yes,
compatibility_mode: sc_consensus_aura::CompatibilityMode::None,
})) as Box<_>
};

let relay_chain_verifier = Box::new(RelayChainVerifier::new(client.clone(), |_, _| async {
Expand All @@ -1004,13 +1004,7 @@ where
let registry = config.prometheus_registry();
let spawner = task_manager.spawn_essential_handle();

Ok(BasicQueue::new(
verifier,
Box::new(block_import),
None,
&spawner,
registry,
))
BasicQueue::new(verifier, Box::new(block_import), None, &spawner, registry)
}

/// Build aura only import queue.
Expand All @@ -1028,7 +1022,7 @@ pub fn build_import_queue<RuntimeApi, Executor>(
config: &Configuration,
telemetry_handle: Option<TelemetryHandle>,
task_manager: &TaskManager,
) -> Result<sc_consensus::DefaultImportQueue<Block>, sc_service::Error>
) -> sc_consensus::DefaultImportQueue<Block>
where
RuntimeApi: ConstructRuntimeApi<Block, TFullClient<Block, RuntimeApi, NativeElseWasmExecutor<Executor>>>
+ Send
Expand All @@ -1047,23 +1041,23 @@ where
Executor: sc_executor::NativeExecutionDispatch + 'static,
{
let cidp_client = client.clone();
cumulus_client_consensus_aura::import_queue::<
let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)
.expect("AuraApi slot_duration failed!");

cumulus_client_consensus_aura::equivocation_import_queue::fully_verifying_import_queue::<
AuraPair,
_,
_,
_,
_,
_,
>(cumulus_client_consensus_aura::ImportQueueParams {
block_import,
>(
client,
create_inherent_data_providers: move |parent_hash, _| {
block_import,
move |parent_hash, _| {
let cidp_client = cidp_client.clone();
async move {
let slot_duration = sc_consensus_aura::standalone::slot_duration_at(
&*cidp_client,
parent_hash,
)?;
let slot_duration =
sc_consensus_aura::standalone::slot_duration_at(&*cidp_client, parent_hash)?;
let timestamp = sp_timestamp::InherentDataProvider::from_system_time();

let slot =
Expand All @@ -1075,10 +1069,11 @@ where
Ok((slot, timestamp))
}
},
registry: config.prometheus_registry(),
spawner: &task_manager.spawn_essential_handle(),
telemetry: telemetry_handle,
}).map_err(Into::into)
slot_duration,
&task_manager.spawn_essential_handle(),
config.prometheus_registry(),
telemetry_handle,
)
}

/// Start collating with the `shell` runtime while waiting for an upgrade to an Aura compatible runtime.
Expand Down
2 changes: 1 addition & 1 deletion runtime/astar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-runtime"
version = "5.42.0"
version = "5.42.2"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/local/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "local-runtime"
version = "5.42.0"
version = "5.42.2"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/shibuya/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shibuya-runtime"
version = "5.42.0"
version = "5.42.2"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion runtime/shiden/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shiden-runtime"
version = "5.42.0"
version = "5.42.2"
build = "build.rs"
authors.workspace = true
edition.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions vendor/rpc/debug/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| internal_err(format!("Runtime api access error: {:?}", e)))?;

#[allow(deprecated)]
Expand Down Expand Up @@ -529,13 +530,13 @@ where
} else {
// Old "trace_transaction" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_transaction".
api.initialize_block(parent_block_hash, &header)
#[allow(deprecated)]
api.initialize_block_before_version_5(parent_block_hash, &header)
.map_err(|e| {
internal_err(format!("Runtime api access error: {:?}", e))
})?;

if trace_api_version == 4 {
// Pre pallet-message-queue
#[allow(deprecated)]
api.trace_transaction_before_version_5(
parent_block_hash,
Expand Down
5 changes: 3 additions & 2 deletions vendor/rpc/trace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ where
// Trace the block.
let f = || -> Result<_, String> {
let result = if trace_api_version >= 5 {
// The block is initialized inside "trace_transaction"
// The block is initialized inside "trace_block"
api.trace_block(
substrate_parent_hash,
extrinsics,
Expand All @@ -869,7 +869,8 @@ where
} else {
// Old "trace_block" api did not initialize block before applying transactions,
// so we need to do it here before calling "trace_block".
api.initialize_block(substrate_parent_hash, &block_header)
#[allow(deprecated)]
api.initialize_block_before_version_5(substrate_parent_hash, &block_header)
.map_err(|e| format!("Runtime api access error: {:?}", e))?;

#[allow(deprecated)]
Expand Down

0 comments on commit c0c2d49

Please sign in to comment.