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

dApp Staking v3 - Shibuya integration #1109

Merged
merged 35 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
68e4153
dApp staking v3 - Shibuya integration
Dinonard Dec 18, 2023
539e700
Init
Dinonard Dec 18, 2023
f8923e5
Fix build
Dinonard Dec 18, 2023
1a0954d
Fix find/replace doc mess
Dinonard Dec 18, 2023
3954524
Migration & disable
Dinonard Dec 18, 2023
efba128
More integration
Dinonard Dec 18, 2023
801e272
Progress
Dinonard Dec 19, 2023
acc9bcf
Adjusted integration
Dinonard Dec 19, 2023
7a6b875
Finished integration
Dinonard Dec 19, 2023
df1f936
Additional modifications & cleanup
Dinonard Dec 19, 2023
5574e0a
Move comment
Dinonard Dec 19, 2023
69d2f4d
Fixes
Dinonard Dec 19, 2023
779ee1f
Shibuya integration tests fix & proxy
Dinonard Dec 19, 2023
43d6421
Renaming
Dinonard Dec 19, 2023
b4895b2
Integration test fixes & legacy support
Dinonard Dec 19, 2023
c73e49d
Adjust for benchmarks
Dinonard Dec 19, 2023
b105db0
Merge remote-tracking branch 'origin/feat/dapp-staking-v3' into feat/…
Dinonard Dec 19, 2023
157d20a
Remove chain-extension, small updates
Dinonard Dec 19, 2023
0868b3d
fixes
Dinonard Dec 19, 2023
a3d51a7
Partial weights
Dinonard Dec 19, 2023
dce2a31
Minor changes
Dinonard Dec 19, 2023
d380ff6
Benchmark fixes
Dinonard Dec 19, 2023
c6cef61
dApp staking weights
Dinonard Dec 20, 2023
0bd6338
Weights, deps
Dinonard Dec 20, 2023
b853cc9
Remove redundant storage item
Dinonard Dec 20, 2023
1992221
Inflation params, resolve TODOs
Dinonard Dec 20, 2023
72f549b
Optimize lengthy benchmark
Dinonard Dec 20, 2023
76e681f
Integration test
Dinonard Dec 20, 2023
9b3b03d
Sort out more TODOs
Dinonard Dec 20, 2023
447e19f
Benchmark optimization
Dinonard Dec 20, 2023
367535c
Fix seed
Dinonard Dec 20, 2023
55c2dd5
Remove spec version bump
Dinonard Dec 20, 2023
a45e52d
Fix integration test
Dinonard Dec 20, 2023
62254ef
Merge remote-tracking branch 'origin/feat/dapp-staking-v3' into feat/…
Dinonard Dec 20, 2023
81fb86d
Weights update
Dinonard Dec 20, 2023
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
42 changes: 8 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ members = [

"primitives",

"chain-extensions/dapps-staking",
"chain-extensions/pallet-assets",
"chain-extensions/xvm",
"chain-extensions/unified-accounts",
Expand Down Expand Up @@ -298,12 +297,10 @@ pallet-evm-precompile-dapps-staking = { path = "./precompiles/dapps-staking", de
pallet-evm-precompile-dapp-staking-v3 = { path = "./precompiles/dapp-staking-v3", default-features = false }
pallet-evm-precompile-unified-accounts = { path = "./precompiles/unified-accounts", default-features = false }

pallet-chain-extension-dapps-staking = { path = "./chain-extensions/dapps-staking", default-features = false }
pallet-chain-extension-xvm = { path = "./chain-extensions/xvm", default-features = false }
pallet-chain-extension-assets = { path = "./chain-extensions/pallet-assets", default-features = false }
pallet-chain-extension-unified-accounts = { path = "./chain-extensions/unified-accounts", default-features = false }

dapps-staking-chain-extension-types = { path = "./chain-extensions/types/dapps-staking", default-features = false }
xvm-chain-extension-types = { path = "./chain-extensions/types/xvm", default-features = false }
assets-chain-extension-types = { path = "./chain-extensions/types/assets", default-features = false }
unified-accounts-chain-extension-types = { path = "./chain-extensions/types/unified-accounts", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion bin/collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ shiden-runtime = { workspace = true, features = ["std"] }

# astar pallets dependencies
astar-primitives = { workspace = true }
pallet-dapp-staking-v3 = { workspace = true }

# frame dependencies
frame-system = { workspace = true, features = ["std"] }
Expand Down
6 changes: 2 additions & 4 deletions bin/collator/src/local/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use local_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, BalancesConfig, BlockRewardConfig,
CouncilConfig, DappStakingConfig, DemocracyConfig, EVMConfig, GenesisConfig, GrandpaConfig,
GrandpaId, InflationConfig, InflationParameters, Precompiles, RewardDistributionConfig,
Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig, VestingConfig,
AST,
Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TierThreshold, TreasuryConfig,
VestingConfig, AST,
};
use sc_service::ChainType;
use sp_core::{crypto::Ss58Codec, sr25519, Pair, Public};
Expand All @@ -32,8 +32,6 @@ use sp_runtime::{
Perbill, Permill,
};

use pallet_dapp_staking_v3::TierThreshold;

type AccountPublic = <Signature as Verify>::Signer;

/// Specialized `ChainSpec` for Shiden Network.
Expand Down
58 changes: 41 additions & 17 deletions bin/collator/src/parachain/chain_spec/shibuya.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
use cumulus_primitives_core::ParaId;
use sc_service::ChainType;
use shibuya_runtime::{
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, Balance, BalancesConfig, BlockRewardConfig,
CollatorSelectionConfig, CouncilConfig, DemocracyConfig, EVMChainIdConfig, EVMConfig,
GenesisConfig, ParachainInfoConfig, Precompiles, RewardDistributionConfig, SessionConfig,
SessionKeys, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TreasuryConfig,
VestingConfig, SBY,
wasm_binary_unwrap, AccountId, AuraConfig, AuraId, Balance, BalancesConfig,
CollatorSelectionConfig, CouncilConfig, DappStakingConfig, DemocracyConfig, EVMChainIdConfig,
EVMConfig, GenesisConfig, InflationConfig, InflationParameters, ParachainInfoConfig,
Precompiles, SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig,
TechnicalCommitteeConfig, TierThreshold, TreasuryConfig, VestingConfig, SBY,
};
use sp_core::{sr25519, Pair, Public};

use sp_runtime::{
traits::{IdentifyAccount, Verify},
Perbill,
Permill,
};

use super::{get_from_seed, Extensions};
Expand Down Expand Up @@ -114,17 +114,6 @@ fn make_genesis(
},
parachain_info: ParachainInfoConfig { parachain_id },
balances: BalancesConfig { balances },
block_reward: BlockRewardConfig {
// Make sure sum is 100
reward_config: RewardDistributionConfig {
treasury_percent: Perbill::from_percent(10),
base_staker_percent: Perbill::from_percent(20),
dapps_percent: Perbill::from_percent(20),
collators_percent: Perbill::from_percent(5),
adjustable_percent: Perbill::from_percent(45),
ideal_dapps_staking_tvl: Perbill::from_percent(40),
},
},
vesting: VestingConfig { vesting: vec![] },
session: SessionConfig {
keys: authorities
Expand Down Expand Up @@ -174,6 +163,41 @@ fn make_genesis(
},
democracy: DemocracyConfig::default(),
treasury: TreasuryConfig::default(),
dapp_staking: DappStakingConfig {
reward_portion: vec![
Permill::from_percent(40),
Permill::from_percent(30),
Permill::from_percent(20),
Permill::from_percent(10),
],
slot_distribution: vec![
Permill::from_percent(10),
Permill::from_percent(20),
Permill::from_percent(30),
Permill::from_percent(40),
],
// TODO: adjust this if needed
tier_thresholds: vec![
TierThreshold::DynamicTvlAmount {
amount: 100 * SBY,
minimum_amount: 80 * SBY,
},
TierThreshold::DynamicTvlAmount {
amount: 50 * SBY,
minimum_amount: 40 * SBY,
},
TierThreshold::DynamicTvlAmount {
amount: 20 * SBY,
minimum_amount: 20 * SBY,
},
TierThreshold::FixedTvlAmount { amount: 10 * SBY },
],
slots_per_tier: vec![10, 20, 30, 40],
},
// TODO: adjust this if needed
inflation: InflationConfig {
params: InflationParameters::default(),
},
}
}

Expand Down
43 changes: 0 additions & 43 deletions chain-extensions/dapps-staking/Cargo.toml

This file was deleted.

Loading
Loading