Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Non-Interactive Staking #12610

Merged
merged 57 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d2a1c7b
Improve naming.
gavofyork Nov 2, 2022
a1748df
More improvements to naming
gavofyork Nov 2, 2022
8394666
Fungible counterpart
gavofyork Nov 2, 2022
c81e4a4
Shared pot instead of reserve
gavofyork Nov 2, 2022
9a78199
Transferable receipts
gavofyork Nov 2, 2022
556aee9
Better naming
gavofyork Nov 2, 2022
326bed5
Use u128 for counterpart
gavofyork Nov 3, 2022
fb9857f
Partial thawing
gavofyork Nov 3, 2022
b232a35
Docs
gavofyork Nov 3, 2022
66fa13b
Remove AdminOrigin
gavofyork Nov 3, 2022
3855ed0
Integrate into Kitchen Sink
gavofyork Nov 3, 2022
ed21e76
Thaw throttling
gavofyork Nov 3, 2022
c2fd94e
Remove todo
gavofyork Nov 3, 2022
ec6b594
Docs
gavofyork Nov 3, 2022
1442179
Fix benchmarks
gavofyork Nov 3, 2022
86ceb01
Building
gavofyork Nov 4, 2022
54609be
Tests work
gavofyork Nov 4, 2022
085996b
New benchmarks
gavofyork Nov 5, 2022
077afbe
Benchmarking tests
gavofyork Nov 5, 2022
3ca6918
Test new defensive_saturating_* functions
ggwpez Nov 5, 2022
25d80d3
fmt
ggwpez Nov 5, 2022
9ea6681
Formatting
gavofyork Nov 6, 2022
be66334
Update frame/nis/src/lib.rs
gavofyork Nov 6, 2022
471c83b
Apply suggestions from code review
gavofyork Nov 6, 2022
c668161
Merge branch 'gav-ref-nis' of github.com:paritytech/substrate into ga…
gavofyork Nov 6, 2022
a44dc75
Events added
gavofyork Nov 6, 2022
f89b093
Fix kitchensink
gavofyork Nov 6, 2022
f5a3e3d
Update frame/nis/src/lib.rs
gavofyork Nov 8, 2022
1474a75
Review niggles
gavofyork Nov 10, 2022
376132d
Merge branch 'gav-ref-nis' of github.com:paritytech/substrate into ga…
gavofyork Nov 11, 2022
bafbdff
Merge remote-tracking branch 'origin/master' into gav-ref-nis
gavofyork Nov 11, 2022
ef9a239
Remove genesis build requirements
gavofyork Nov 11, 2022
207a4b5
Grumbles
gavofyork Nov 14, 2022
e395e84
Merge remote-tracking branch 'origin/master' into gav-ref-nis
gavofyork Nov 14, 2022
6a85012
Fixes
gavofyork Nov 14, 2022
d11f04e
Fixes
gavofyork Nov 14, 2022
8b47006
Fixes
gavofyork Nov 14, 2022
2a59d93
Update frame/nis/src/lib.rs
gavofyork Nov 22, 2022
cd45d8a
Update primitives/runtime/src/traits.rs
gavofyork Nov 22, 2022
d201b05
Merge remote-tracking branch 'origin/master' into gav-ref-nis
gavofyork Nov 22, 2022
990f280
Formatting
gavofyork Nov 22, 2022
15bd0ac
Fixes
gavofyork Nov 23, 2022
9578bf0
Fix node genesis config
ggwpez Nov 23, 2022
ecf4bc1
Fix node chain specs
ggwpez Nov 23, 2022
0a57aed
Use free asset ID as counterpart
ggwpez Nov 23, 2022
6e13e91
Account for rounding errors in fund_deficit bench
ggwpez Nov 23, 2022
45c58b4
clippy
ggwpez Nov 23, 2022
e4499b4
fmt
ggwpez Nov 23, 2022
335ca07
Fix
gavofyork Nov 27, 2022
314728f
Rename
gavofyork Nov 27, 2022
ab31838
Merge branch 'gav-ref-nis' of github.com:paritytech/substrate into ga…
gavofyork Nov 27, 2022
57402c0
Merge remote-tracking branch 'origin/master' into gav-ref-nis
gavofyork Nov 27, 2022
52e6430
Fixes
gavofyork Nov 27, 2022
5817e46
Fixes
gavofyork Nov 27, 2022
fd2575a
Merge branch 'master' into gav-ref-nis
gavofyork Dec 1, 2022
14a4085
Merge remote-tracking branch 'origin/master' into gav-ref-nis
gavofyork Dec 2, 2022
2a18a46
Formatting
gavofyork Dec 2, 2022
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 @@ -99,7 +99,7 @@ members = [
"frame/examples/basic",
"frame/examples/offchain-worker",
"frame/executive",
"frame/gilt",
"frame/nis",
"frame/grandpa",
"frame/identity",
"frame/im-online",
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub fn testnet_genesis(
},
vesting: Default::default(),
assets: Default::default(),
gilt: Default::default(),
nis: Default::default(),
transaction_storage: Default::default(),
transaction_payment: Default::default(),
alliance: Default::default(),
Expand Down
8 changes: 4 additions & 4 deletions bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pallet-election-provider-multi-phase = { version = "4.0.0-dev", default-features
pallet-election-provider-support-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../../frame/election-provider-support/benchmarking", optional = true }
pallet-elections-phragmen = { version = "5.0.0-dev", default-features = false, path = "../../../frame/elections-phragmen" }
pallet-fast-unstake = { version = "4.0.0-dev", default-features = false, path = "../../../frame/fast-unstake" }
pallet-gilt = { version = "4.0.0-dev", default-features = false, path = "../../../frame/gilt" }
pallet-nis = { version = "4.0.0-dev", default-features = false, path = "../../../frame/nis" }
pallet-grandpa = { version = "4.0.0-dev", default-features = false, path = "../../../frame/grandpa" }
pallet-im-online = { version = "4.0.0-dev", default-features = false, path = "../../../frame/im-online" }
pallet-indices = { version = "4.0.0-dev", default-features = false, path = "../../../frame/indices" }
Expand Down Expand Up @@ -143,7 +143,7 @@ std = [
"pallet-elections-phragmen/std",
"pallet-fast-unstake/std",
"frame-executive/std",
"pallet-gilt/std",
"pallet-nis/std",
"pallet-grandpa/std",
"pallet-im-online/std",
"pallet-indices/std",
Expand Down Expand Up @@ -221,7 +221,7 @@ runtime-benchmarks = [
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-fast-unstake/runtime-benchmarks",
"pallet-gilt/runtime-benchmarks",
"pallet-nis/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
Expand Down Expand Up @@ -274,7 +274,7 @@ try-runtime = [
"pallet-election-provider-multi-phase/try-runtime",
"pallet-elections-phragmen/try-runtime",
"pallet-fast-unstake/try-runtime",
"pallet-gilt/try-runtime",
"pallet-nis/try-runtime",
"pallet-grandpa/try-runtime",
"pallet-im-online/try-runtime",
"pallet-indices/try-runtime",
Expand Down
37 changes: 24 additions & 13 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ use frame_support::{
pallet_prelude::Get,
parameter_types,
traits::{
AsEnsureOriginWithArg, ConstU128, ConstU16, ConstU32, Currency, EitherOfDiverse,
EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter, KeyOwnerProofSystem,
LockIdentifier, Nothing, OnUnbalanced, U128CurrencyToVote, WithdrawReasons,
fungible::ItemOf, AsEnsureOriginWithArg, ConstU128, ConstU16, ConstU32, Currency,
EitherOfDiverse, EqualPrivilegeOnly, Everything, Imbalance, InstanceFilter,
KeyOwnerProofSystem, LockIdentifier, Nothing, OnUnbalanced, U128CurrencyToVote,
WithdrawReasons,
},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
Expand All @@ -53,6 +54,7 @@ use pallet_grandpa::{
fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList,
};
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_nis::WithMaximumOf;
use pallet_session::historical::{self as pallet_session_historical};
pub use pallet_transaction_payment::{CurrencyAdapter, Multiplier, TargetedFeeAdjustment};
use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo};
Expand Down Expand Up @@ -1457,27 +1459,36 @@ parameter_types! {
pub const MaxQueueLen: u32 = 1000;
pub const FifoQueueLen: u32 = 500;
pub const Period: BlockNumber = 30 * DAYS;
pub const MinFreeze: Balance = 100 * DOLLARS;
pub const MinBid: Balance = 100 * DOLLARS;
pub const MinReceipt: Perquintill = Perquintill::from_percent(1);
pub const IntakePeriod: BlockNumber = 10;
pub const MaxIntakeBids: u32 = 10;
pub MaxIntakeWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 10;
pub const ThawThrottle: (Perquintill, BlockNumber) = (Perquintill::from_percent(25), 5);
pub Target: Perquintill = Perquintill::zero();
pub const NisPalletId: PalletId = PalletId(*b"py/nis ");
}

impl pallet_gilt::Config for Runtime {
impl pallet_nis::Config for Runtime {
type WeightInfo = pallet_nis::weights::SubstrateWeight<Runtime>;
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type CurrencyBalance = Balance;
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
type FundOrigin = frame_system::EnsureSigned<AccountId>;
type Counterpart = ItemOf<Assets, ConstU32<0u32>, AccountId>;
type CounterpartAmount = WithMaximumOf<ConstU128<21_000_000_000_000_000_000u128>>;
type Deficit = ();
type Surplus = ();
type IgnoredIssuance = IgnoredIssuance;
type Target = Target;
type PalletId = NisPalletId;
type QueueCount = QueueCount;
type MaxQueueLen = MaxQueueLen;
type FifoQueueLen = FifoQueueLen;
type Period = Period;
type MinFreeze = MinFreeze;
type MinBid = MinBid;
type MinReceipt = MinReceipt;
type IntakePeriod = IntakePeriod;
type MaxIntakeBids = MaxIntakeBids;
type WeightInfo = pallet_gilt::weights::SubstrateWeight<Runtime>;
type MaxIntakeWeight = MaxIntakeWeight;
type ThawThrottle = ThawThrottle;
}

parameter_types! {
Expand Down Expand Up @@ -1662,7 +1673,7 @@ construct_runtime!(
Assets: pallet_assets,
Mmr: pallet_mmr,
Lottery: pallet_lottery,
Gilt: pallet_gilt,
Nis: pallet_nis,
Uniques: pallet_uniques,
TransactionStorage: pallet_transaction_storage,
VoterList: pallet_bags_list::<Instance1>,
Expand Down Expand Up @@ -1765,7 +1776,7 @@ mod benches {
[pallet_election_provider_support_benchmarking, EPSBench::<Runtime>]
[pallet_elections_phragmen, Elections]
[pallet_fast_unstake, FastUnstake]
[pallet_gilt, Gilt]
[pallet_nis, Nis]
[pallet_grandpa, Grandpa]
[pallet_identity, Identity]
[pallet_im_online, ImOnline]
Expand Down
2 changes: 1 addition & 1 deletion bin/node/testing/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn config_endowed(code: Option<&[u8]>, extra_endowed: Vec<AccountId>) -> Gen
society: SocietyConfig { members: vec![alice(), bob()], pot: 0, max_members: 999 },
vesting: Default::default(),
assets: Default::default(),
gilt: Default::default(),
nis: Default::default(),
transaction_storage: Default::default(),
transaction_payment: Default::default(),
alliance: Default::default(),
Expand Down
131 changes: 0 additions & 131 deletions frame/gilt/src/benchmarking.rs

This file was deleted.

Loading