Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v6.7.0 #1599

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 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
Expand Up @@ -18,7 +18,7 @@ edition = "2021"
homepage = "https://darwinia.network"
license = "GPL-3.0"
repository = "https://github.com/darwinia-network/darwinia"
version = "6.6.5"
version = "6.7.0"

[workspace.dependencies]
# crates.io
Expand Down
2 changes: 1 addition & 1 deletion node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
///
/// The worker binaries associated to the node binary should ensure that they are using the same
/// version as the main node that started them.
pub const NODE_VERSION: &str = "6.6.5";
pub const NODE_VERSION: &str = "6.7.0";

/// Sub-commands supported by the collator.
#[derive(Debug, clap::Subcommand)]
Expand Down
2 changes: 1 addition & 1 deletion pallet/account-migration/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: sp_runtime::create_runtime_str!("Darwinia2"),
impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"),
authoring_version: 0,
spec_version: 6_6_5_0,
spec_version: 6_6_7_0,
impl_version: 0,
apis: sp_version::create_apis_vec!([]),
transaction_version: 0,
Expand Down
8 changes: 6 additions & 2 deletions pallet/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,10 @@ pub mod pallet {
// let cs_from_contract = Self::elect_from_contract(n1)?;
// let cs_from_pallet = Self::elect(n2)?;
let cs_from_contract = Self::elect_from_contract(n1).unwrap_or_default();
let cs_from_pallet = Self::elect(n2).unwrap_or_default();
let cs_from_pallet = Self::elect(n2).unwrap_or_default()
.into_iter()
.filter(|c| !cs_from_contract.contains(c))
.collect();

log::info!("collators from contract {cs_from_contract:?}");
log::info!("collators from pallet {cs_from_pallet:?}");
Expand Down Expand Up @@ -1356,7 +1359,8 @@ where
PalletId(*b"da/staki").into_account_truncating()
}

fn now<T>() -> Moment
/// The current time in milliseconds.
pub fn now<T>() -> Moment
where
T: Config,
{
Expand Down
10 changes: 6 additions & 4 deletions pallet/staking/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,15 @@ impl crate::Election<AccountId> for RingStaking {
.map(|i| {
let who = AccountId(i);

assert_ok!(Session::set_keys(
if Session::set_keys(
RuntimeOrigin::signed(who),
SessionKeys { uint: i.into() },
Vec::new()
));

who
).is_ok() {
who
} else {
AccountId(0)
}
})
.collect(),
)
Expand Down
18 changes: 18 additions & 0 deletions pallet/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,24 @@ fn hybrid_election_should_work() {
});
}

#[test]
fn dedup_election_should_work() {
ExtBuilder::default().collator_count(10).build().execute_with(|| {
let who = AccountId(100);
let _ = <pallet_balances::Pallet<Runtime>>::deposit_creating(&who, 100 as _);

assert_ok!(Staking::stake(RuntimeOrigin::signed(who), 100 as _, Vec::new()));
assert_ok!(Staking::collect(RuntimeOrigin::signed(who), Perbill::zero()));
assert_ok!(Staking::nominate(RuntimeOrigin::signed(who), who));

Timestamp::set_timestamp(30 * DAY_IN_MILLIS);
new_session();
new_session();

assert_eq!(vec![who], <pallet_session::Validators<Runtime>>::get());
});
}

#[test]
fn hybrid_payout_should_work() {
ExtBuilder::default().collator_count(10).inflation_type(1).build().execute_with(|| {
Expand Down
11 changes: 0 additions & 11 deletions precompile/deposit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,4 @@ where

Ok(true)
}

#[precompile::public("migrate(address)")]
fn migrate(handle: &mut impl PrecompileHandle, who: Address) -> EvmResult<bool> {
let origin: AccountIdOf<Runtime> = handle.context().caller.into();
RuntimeHelper::<Runtime>::try_dispatch(
handle,
Some(origin).into(),
darwinia_deposit::Call::<Runtime>::migrate { who: H160::from(who).into() },
)?;
Ok(true)
}
}
1 change: 0 additions & 1 deletion precompile/deposit/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ fn selectors() {
assert!(PCall::lock_selectors().contains(&0x998e4242));
assert!(PCall::claim_selectors().contains(&0x4e71d92d));
assert!(PCall::claim_with_penalty_selectors().contains(&0xfa04a9bf));
assert!(PCall::migrate_selectors().contains(&0xce5494bb));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion runtime/crab/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: sp_runtime::create_runtime_str!("Crab2"),
impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"),
authoring_version: 0,
spec_version: 6_6_5_0,
spec_version: 6_6_7_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
2 changes: 2 additions & 0 deletions runtime/crab/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ fn migrate() -> frame_support::weights::Weight {
<darwinia_staking::RingStakingContract<Runtime>>::put(who);
}

darwinia_staking::MigrationStartPoint::put(darwinia_staking::now());

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(7, 7)
}
2 changes: 1 addition & 1 deletion runtime/darwinia/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: sp_runtime::create_runtime_str!("Darwinia2"),
impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"),
authoring_version: 0,
spec_version: 6_6_5_0,
spec_version: 6_6_7_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
2 changes: 2 additions & 0 deletions runtime/darwinia/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ fn migrate() -> frame_support::weights::Weight {
<darwinia_staking::RingStakingContract<Runtime>>::put(who);
}

darwinia_staking::MigrationStartPoint::put(darwinia_staking::now());

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(7, 107)
}
2 changes: 1 addition & 1 deletion runtime/koi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub const VERSION: sp_version::RuntimeVersion = sp_version::RuntimeVersion {
spec_name: sp_runtime::create_runtime_str!("Darwinia Koi"),
impl_name: sp_runtime::create_runtime_str!("DarwiniaOfficialRust"),
authoring_version: 0,
spec_version: 6_6_6_2,
spec_version: 6_6_7_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
Loading