Skip to content

Commit

Permalink
v6.6.5 prerelease (#1556)
Browse files Browse the repository at this point in the history
* Release `v6.6.5`

* Migrate

* Add addresses

* Set storage

* Correct reward address

* Fix

* Fix test
  • Loading branch information
AurevoirXavier authored Aug 9, 2024
1 parent e619d26 commit 5d8f799
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/note-template/runtime.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## {{ .Env.CHAIN | strings.Title }}
<h3 align="right">Upgrade Priority HIGH :red_circle:</h3>
<h4 align="center">!!All nodes need to be updated to this(`v6.6.4`) version prior to the upcoming `v6.6.5` release because of the new asynchronous backing feature!!</h4>
<h4 align="center">!!All nodes must be upgraded to a minimum of `v6.6.4` version because of the new asynchronous backing feature!!</h4>

#### Whitelist Hash
```
Expand Down
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.4"
version = "6.6.5"

[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.4";
pub const NODE_VERSION: &str = "6.6.5";

/// 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 @@ -54,7 +54,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_4_0,
spec_version: 6_6_5_0,
impl_version: 0,
apis: sp_version::create_apis_vec!([]),
transaction_version: 0,
Expand Down
6 changes: 5 additions & 1 deletion pallet/staking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,11 @@ pub mod pallet {
};

reward(account_id(), actual_reward_to_ring);
reward(<KtonRewardDistributionContract<T>>::get(), reward_to_kton);
reward(
[109, 111, 100, 108, 100, 97, 47, 116, 114, 115, 114, 121, 0, 0, 0, 0, 0, 0, 0, 0]
.into(),
reward_to_kton,
);

T::KtonStakerNotifier::notify(reward_to_kton);
}
Expand Down
3 changes: 0 additions & 3 deletions pallet/staking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ fn payout_should_work() {
vec![
// Pay to staking failed.
Event::Unpaid { who: account_id(), amount: 5000000000000000000000 },
// Pay to distribution contract failed.
// The contract address is the same as staking pallet account in unit test.
Event::Unpaid { who: account_id(), amount: 5000000000000000000000 },
// Pay to collator failed.
Event::Unpaid { who: account_id_of(6), amount: 3749999998500000000000 },
// Pay to nominator failed.
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_4_0,
spec_version: 6_6_5_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
14 changes: 12 additions & 2 deletions runtime/crab/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ impl frame_support::traits::OnRuntimeUpgrade for CustomOnRuntimeUpgrade {
}

fn migrate() -> frame_support::weights::Weight {
frame_support::weights::Weight::zero()
// <Runtime as frame_system::Config>::DbWeight::get().reads_writes(0, 0)
const KTON_DAO_VAULT_ADDR: &str = "0xf1b4f3D438eE2B363C5ba1641A498709ff5780bA";

#[cfg(feature = "try-runtime")]
assert!(array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR).is_ok());

if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) {
<darwinia_staking::KtonRewardDistributionContract<Runtime>>::put(w);
darwinia_staking::migration::migrate_staking_reward_distribution_contract::<Runtime>(w);
}

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(10, 10)
}
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_4_0,
spec_version: 6_6_5_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down
12 changes: 11 additions & 1 deletion runtime/darwinia/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ fn migrate() -> frame_support::weights::Weight {
}
.remove_storage_values();

const KTON_DAO_VAULT_ADDR: &str = "0xf1b4f3D438eE2B363C5ba1641A498709ff5780bA";

#[cfg(feature = "try-runtime")]
assert!(array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR).is_ok());

if let Ok(w) = array_bytes::hex_n_into::<_, _, 20>(KTON_DAO_VAULT_ADDR) {
<darwinia_staking::KtonRewardDistributionContract<Runtime>>::put(w);
darwinia_staking::migration::migrate_staking_reward_distribution_contract::<Runtime>(w);
}

// frame_support::weights::Weight::zero()
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(0, n)
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(10, n + 10)
}
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_4_1,
spec_version: 6_6_5_0,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 0,
Expand Down

0 comments on commit 5d8f799

Please sign in to comment.