Skip to content

Commit fc64f40

Browse files
committed
Recovery runtime without AuraApi
1 parent 95c593d commit fc64f40

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ homepage.workspace = true
1212
repository.workspace = true
1313

1414
[workspace.package]
15-
version = "4.0.2"
15+
version = "4.0.3"
1616
edition = "2021"
1717
authors = ["Airalab <research@robonomics.network>"]
1818
license = "Apache-2.0"

runtime/robonomics/src/lib.rs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
8484
spec_name: alloc::borrow::Cow::Borrowed("robonomics"),
8585
impl_name: alloc::borrow::Cow::Borrowed("robonomics-airalab"),
8686
authoring_version: 1,
87-
spec_version: 42,
87+
spec_version: 43,
8888
impl_version: 1,
8989
apis: RUNTIME_API_VERSIONS,
9090
transaction_version: 2,
@@ -204,7 +204,7 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
204204

205205
impl pallet_timestamp::Config for Runtime {
206206
type Moment = u64;
207-
type OnTimestampSet = Aura;
207+
type OnTimestampSet = ();
208208
type MinimumPeriod = ConstU64<0>;
209209
type WeightInfo = ();
210210
}
@@ -751,25 +751,6 @@ impl_runtime_apis! {
751751
}
752752
}
753753

754-
impl cumulus_primitives_aura::AuraUnincludedSegmentApi<Block> for Runtime {
755-
fn can_build_upon(
756-
included_hash: <Block as BlockT>::Hash,
757-
slot: cumulus_primitives_aura::Slot,
758-
) -> bool {
759-
ConsensusHook::can_build_upon(included_hash, slot)
760-
}
761-
}
762-
763-
impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {
764-
fn slot_duration() -> sp_consensus_aura::SlotDuration {
765-
sp_consensus_aura::SlotDuration::from_millis(MILLISECS_PER_BLOCK)
766-
}
767-
768-
fn authorities() -> Vec<AuraId> {
769-
pallet_aura::Authorities::<Runtime>::get().into_inner()
770-
}
771-
}
772-
773754
impl sp_api::Metadata<Block> for Runtime {
774755
fn metadata() -> OpaqueMetadata {
775756
OpaqueMetadata::new(Runtime::metadata().into())
@@ -944,9 +925,30 @@ impl_runtime_apis! {
944925
}
945926
}
946927

928+
struct CheckInherents;
929+
impl cumulus_pallet_parachain_system::CheckInherents<Block> for CheckInherents {
930+
fn check_inherents(
931+
block: &Block,
932+
relay_state_proof: &cumulus_pallet_parachain_system::RelayChainStateProof,
933+
) -> sp_inherents::CheckInherentsResult {
934+
let relay_chain_slot = relay_state_proof
935+
.read_slot()
936+
.expect("Could not read the relay chain slot from the proof");
937+
let inherent_data =
938+
cumulus_primitives_timestamp::InherentDataProvider::from_relay_chain_slot_and_duration(
939+
relay_chain_slot,
940+
sp_std::time::Duration::from_secs(6),
941+
)
942+
.create_inherent_data()
943+
.expect("Could not create the timestamp inherent data");
944+
inherent_data.check_extrinsics(block)
945+
}
946+
}
947+
947948
cumulus_pallet_parachain_system::register_validate_block! {
948949
Runtime = Runtime,
949-
BlockExecutor = cumulus_pallet_aura_ext::BlockExecutor<Runtime, Executive>,
950+
BlockExecutor = Executive,
951+
CheckInherents = CheckInherents
950952
}
951953

952954
parameter_types! {

0 commit comments

Comments
 (0)