Skip to content

Commit

Permalink
Compounding rewards (Astar) & Nomination transfer (Shiden) (#639)
Browse files Browse the repository at this point in the history
* Compounding rewards for Astar

* Weights update

* Bigger init balance for Alice

* Endow Alice and Bob

* Nomination transfer for Shiden

* Remove deprecated hook

* Fix
  • Loading branch information
Dinonard authored May 16, 2022
1 parent 4ee9162 commit e36b361
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 177 deletions.
111 changes: 18 additions & 93 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 = "3.26.1"
version = "3.27.0"
authors = ["Stake Technologies <devops@stake.co.jp>"]
description = "Astar collator implementation in Rust."
build = "build.rs"
Expand Down
53 changes: 5 additions & 48 deletions bin/collator/src/parachain/chain_spec/astar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use astar_runtime::{
};
use cumulus_primitives_core::ParaId;
use sc_service::ChainType;
use sp_core::{crypto::Ss58Codec, sr25519, Pair, Public};
use sp_core::{sr25519, Pair, Public};
use sp_runtime::{
traits::{IdentifyAccount, Verify},
Perbill,
Expand All @@ -22,56 +22,13 @@ pub fn get_chain_spec(para_id: u32) -> AstarChainSpec {
// Alice as default
let sudo_key = get_account_id_from_seed::<sr25519::Public>("Alice");
let endowned = vec![
(sudo_key.clone(), 100 * ASTR),
(
// Lockdrop
AccountId::from_ss58check("5HEEAH8enKBb62mERpWY6cymE5pXjqp9vgptTTgj4wcMCunk").unwrap(),
2_100_000_000 * ASTR,
),
(
// Parachain Auction
AccountId::from_ss58check("5GEXA7G1idwiEDDNJMdpP27Vz3BRw82gziZB1GrPttaxXTGW").unwrap(),
1_050_000_000 * ASTR,
),
(
// Parachain Auction Bonus
AccountId::from_ss58check("5DveWyztFMF2bgqT8ZXNfALhuw6k3gqvA4eoUunQwm2Z2RmE").unwrap(),
350_000_000 * ASTR,
),
(
// Parachain Reserve
AccountId::from_ss58check("5C5CDyRQzCVvFjWx1FYzN1HY25CvoKH6CbzyBLVuUDzi8ESX").unwrap(),
350_000_000 * ASTR,
),
(
// Protocol Development
AccountId::from_ss58check("5F48VxQChQmMpCchszYHyhtARpBXXZ2y1zC4mNYsefMkc1fw").unwrap(),
700_000_000 * ASTR,
),
(
// On Chain DAO
AccountId::from_ss58check("5DyanbfmERU3X5EAEtVq9H12XDsbXLupPn47e4y2LjhDdwjL").unwrap(),
350_000_000 * ASTR,
),
(
// Marketing
AccountId::from_ss58check("5EL7GdB9Woz8oBL6NP4AvVWguDgi923UjLMGcdPusnNXFA7r").unwrap(),
350_000_000 * ASTR,
),
(
// Institutional Investors
AccountId::from_ss58check("5HdeVKsojzVAEaAaCscu7NiWG4X4aG88dVn67VgA5LG7macZ").unwrap(),
700_000_000 * ASTR,
),
(
// Team
AccountId::from_ss58check("5G3wWrPihXTbrk7pDDjeoqZz2Hoy823WB4dd4vLzZqmL5F3x").unwrap(),
350_000_000 * ASTR,
get_account_id_from_seed::<sr25519::Public>("Alice"),
10_000 * ASTR,
),
(
// Foundation
AccountId::from_ss58check("5EfMfGRp6vr8JLknyvx77nmyRfZSrFTBzyJQ856Gn2iuoFZc").unwrap(),
700_000_000 * ASTR,
get_account_id_from_seed::<sr25519::Public>("Bob"),
10_000 * ASTR,
),
];

Expand Down
6 changes: 3 additions & 3 deletions runtime/astar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "astar-runtime"
version = "3.26.0"
version = "3.27.0"
authors = ["Stake Technologies <devops@stake.co.jp>"]
edition = "2021"
build = "build.rs"
Expand Down Expand Up @@ -91,8 +91,8 @@ pallet-block-reward = { git = "https://github.com/AstarNetwork/astar-frame", bra
pallet-collator-selection = { git = "https://github.com/AstarNetwork/astar-frame", branch = "pallet-collator-selection-3.0.0/polkadot-v0.9.19", default-features = false }
pallet-custom-signatures = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.19", default-features = false }
pallet-vesting = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.19", default-features = false }
pallet-dapps-staking = { git = "https://github.com/AstarNetwork/astar-frame", branch = "pallet-dapps-staking-3.2.3/polkadot-v0.9.19", default-features = false }
pallet-precompile-dapps-staking = { git = "https://github.com/AstarNetwork/astar-frame", branch = "pallet-dapps-staking-3.2.3/polkadot-v0.9.19", default-features = false }
pallet-dapps-staking = { git = "https://github.com/AstarNetwork/astar-frame", tag = "pallet-dapps-staking-3.3.5/polkadot-v0.9.19", default-features = false }
pallet-precompile-dapps-staking = { git = "https://github.com/AstarNetwork/astar-frame", tag = "pallet-dapps-staking-3.3.5/polkadot-v0.9.19", default-features = false }
pallet-evm-precompile-sr25519 = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.19", default-features = false }
pallet-evm-precompile-assets-erc20 = { git = "https://github.com/AstarNetwork/astar-frame", branch = "polkadot-v0.9.19", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion runtime/astar/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("astar"),
impl_name: create_runtime_str!("astar"),
authoring_version: 1,
spec_version: 15,
spec_version: 16,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 2,
Expand Down
30 changes: 26 additions & 4 deletions runtime/astar/src/weights/pallet_dapps_staking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,29 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking StakersInfo (r:1 w:1)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:1)
// Storage: DappsStaking GeneralEraInfo (r:2 w:1)
// Storage: DappsStaking Ledger (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn claim_staker_with_restake() -> Weight {
(91_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(10 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking GeneralStakerInfo (r:1 w:1)
// Storage: DappsStaking RegisteredDapps (r:1 w:0)
// Storage: DappsStaking CurrentEra (r:1 w:0)
// Storage: DappsStaking ContractEraStake (r:1 w:0)
// Storage: DappsStaking GeneralEraInfo (r:1 w:0)
fn claim_staker() -> Weight {
(36_748_000 as Weight)
.saturating_add(T::DbWeight::get().reads(6 as Weight))
// Storage: DappsStaking Ledger (r:1 w:0)
fn claim_staker_without_restake() -> Weight {
(56_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
Expand All @@ -151,4 +166,11 @@ impl<T: frame_system::Config> pallet_dapps_staking::WeightInfo for WeightInfo<T>
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: DappsStaking PalletDisabled (r:1 w:0)
// Storage: DappsStaking Ledger (r:1 w:1)
fn set_reward_destination() -> Weight {
(24_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
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 = "3.26.0"
version = "3.27.0"
authors = ["Stake Technologies <devops@stake.co.jp>"]
edition = "2021"
build = "build.rs"
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 = "3.26.0"
version = "3.27.0"
authors = ["Stake Technologies <devops@stake.co.jp>"]
edition = "2021"
build = "build.rs"
Expand Down
Loading

0 comments on commit e36b361

Please sign in to comment.