Skip to content

Commit

Permalink
Merge pull request #451 from Cerebellum-Network/fix/runtime-version
Browse files Browse the repository at this point in the history
build: Devnet runtime version is aligned with Qanet
  • Loading branch information
yahortsaryk authored Oct 17, 2024
2 parents 1cbc9fe + 4223a99 commit 8f25ae2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 67 deletions.
38 changes: 19 additions & 19 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 Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "5.5.0"
version = "6.0.0"
authors = ["Cerebellum-Network"]
edition = "2021"
homepage = "https://cere.network/"
Expand Down
43 changes: 1 addition & 42 deletions runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 55000,
spec_version: 60000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 19,
Expand Down Expand Up @@ -503,15 +503,6 @@ impl pallet_authorship::Config for Runtime {
type EventHandler = (Staking, ImOnline);
}

impl_opaque_keys! {
pub struct OldSessionKeys {
pub grandpa: Grandpa,
pub babe: Babe,
pub im_online: ImOnline,
pub authority_discovery: AuthorityDiscovery,
}
}

impl_opaque_keys! {
pub struct SessionKeys {
pub grandpa: Grandpa,
Expand All @@ -522,22 +513,6 @@ impl_opaque_keys! {
}
}

fn transform_session_keys(v: AccountId, old: OldSessionKeys) -> SessionKeys {
SessionKeys {
grandpa: old.grandpa,
babe: old.babe,
im_online: old.im_online,
authority_discovery: old.authority_discovery,
ddc_verification: {
let mut id: ddc_primitives::sr25519::AuthorityId =
sp_core::sr25519::Public::from_raw([0u8; 32]).into();
let id_raw: &mut [u8] = id.as_mut();
id_raw[0..32].copy_from_slice(v.as_ref());
id_raw[0..4].copy_from_slice(b"cer!");
id
},
}
}
impl pallet_session::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type ValidatorId = <Self as frame_system::Config>::AccountId;
Expand Down Expand Up @@ -1437,22 +1412,6 @@ pub type Executive = frame_executive::Executive<
Migrations,
>;

pub mod migrations {
use super::*;

/// When this is removed, should also remove `OldSessionKeys`.
pub struct UpgradeSessionKeys;
impl frame_support::traits::OnRuntimeUpgrade for UpgradeSessionKeys {
fn on_runtime_upgrade() -> Weight {
Session::upgrade_keys::<OldSessionKeys, _>(transform_session_keys);
Perbill::from_percent(50) * RuntimeBlockWeights::get().max_block
}
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (UpgradeSessionKeys,);
}

type EventRecord = frame_system::EventRecord<
<Runtime as frame_system::Config>::RuntimeEvent,
<Runtime as frame_system::Config>::Hash,
Expand Down
6 changes: 1 addition & 5 deletions runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,7 @@ impl pallet_contracts::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type Debug = ();
type Environment = ();
type Migrations = (
pallet_contracts::migration::v13::Migration<Runtime>,
pallet_contracts::migration::v14::Migration<Runtime, Balances>,
pallet_contracts::migration::v15::Migration<Runtime>,
);
type Migrations = ();
}

impl pallet_sudo::Config for Runtime {
Expand Down

0 comments on commit 8f25ae2

Please sign in to comment.