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

Staking rate targeting and specific rewards. #2882

Merged
merged 43 commits into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
987ae8a
PNPoS implementation
gui1117 Jun 5, 2019
eaf08c9
wip: change staking api
gui1117 Jun 7, 2019
1adc045
code readibility
gui1117 Jun 18, 2019
b47a60e
fix overflow
gui1117 Jun 18, 2019
a441bcc
comment
gui1117 Jun 18, 2019
0b854e7
license
gui1117 Jun 18, 2019
156deff
doc
gui1117 Jun 19, 2019
6cbb21d
reorganize a bit
gui1117 Jun 19, 2019
bf65044
rename to proper english + doc
gui1117 Jun 19, 2019
9cbae9d
address comments
gui1117 Jun 27, 2019
242aa96
refactor unused mock
gui1117 Jun 28, 2019
9663a1c
fix add_point
gui1117 Jun 28, 2019
5186a59
update tests
gui1117 Jun 28, 2019
2ffcb85
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 1, 2019
1c61c25
add not equalize to ci
gui1117 Jul 1, 2019
6e1d525
Revert "add not equalize to ci"
gui1117 Jul 1, 2019
7c750e5
bring test back
gui1117 Jul 1, 2019
22ed0d2
update locks
gui1117 Jul 1, 2019
a8162c0
fix genesis config
gui1117 Jul 1, 2019
9b24d2f
add authorship event handler + test
gui1117 Jul 1, 2019
0fe56c9
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 2, 2019
5559966
uncouple timestamp from staking
gui1117 Jul 2, 2019
b5796ed
use on finalize instead
gui1117 Jul 2, 2019
04803aa
remove todo
gui1117 Jul 2, 2019
720c69f
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 2, 2019
e87eb25
simplify mock
gui1117 Jul 3, 2019
a979385
address comment
gui1117 Jul 3, 2019
0d2dfa9
doc
gui1117 Jul 7, 2019
4d18ab0
Merge remote-tracking branch 'origin/master' into HEAD
gui1117 Jul 8, 2019
1b2c9b6
merge test
gui1117 Jul 8, 2019
a9474de
fmt
gui1117 Jul 8, 2019
cfbab16
remove todo todo
gui1117 Jul 9, 2019
936ab12
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 17, 2019
2454458
move add_reward_point to regular function
gui1117 Jul 17, 2019
ced4a07
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 19, 2019
e9505cd
doc
gui1117 Jul 19, 2019
1c350eb
doc
gui1117 Jul 19, 2019
0f2a52b
Merge remote-tracking branch 'origin/master' into gui-reward-inflation
gui1117 Jul 20, 2019
9026a7d
increase version
gui1117 Jul 20, 2019
3d416c7
Merge branch 'master' into gui-reward-inflation
gui1117 Jul 23, 2019
8431c44
doc and fmt
gui1117 Jul 24, 2019
a711a1b
Update srml/staking/src/inflation.rs
gui1117 Jul 24, 2019
6d3754b
Fix some doc typos
Jul 24, 2019
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
1 change: 1 addition & 0 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ fn staging_testnet_config_genesis() -> GenesisConfig {
staking: Some(StakingConfig {
current_era: 0,
offline_slash: Perbill::from_parts(1_000_000),
session_reward: Perbill::from_parts(2_065),
current_session_reward: 0,
validator_count: 7,
offline_slash_grace: 4,
minimum_validator_count: 4,
Expand Down Expand Up @@ -259,8 +257,6 @@ pub fn testnet_genesis(
minimum_validator_count: 1,
validator_count: 2,
offline_slash: Perbill::zero(),
session_reward: Perbill::zero(),
current_session_reward: 0,
offline_slash_grace: 0,
stakers: initial_authorities.iter().map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator)).collect(),
invulnerables: initial_authorities.iter().map(|x| x.0.clone()).collect(),
Expand Down
2 changes: 0 additions & 2 deletions node/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ mod tests {
validator_count: 3,
minimum_validator_count: 0,
offline_slash: Perbill::zero(),
session_reward: Perbill::zero(),
current_session_reward: 0,
offline_slash_grace: 0,
invulnerables: vec![alice(), bob(), charlie()],
}),
Expand Down
5 changes: 3 additions & 2 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 117,
impl_version: 117,
spec_version: 118,
impl_version: 118,
apis: RUNTIME_API_VERSIONS,
};

Expand Down Expand Up @@ -236,6 +236,7 @@ parameter_types! {

impl staking::Trait for Runtime {
type Currency = Balances;
type Time = Timestamp;
type CurrencyToVote = CurrencyToVoteHandler;
type OnRewardMinted = Treasury;
type Event = Event;
Expand Down
4 changes: 3 additions & 1 deletion srml/staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ primitives = { package = "sr-primitives", path = "../../core/sr-primitives", def
srml-support = { path = "../support", default-features = false }
system = { package = "srml-system", path = "../system", default-features = false }
session = { package = "srml-session", path = "../session", default-features = false, features = ["historical"] }
authorship = { package = "srml-authorship", path = "../authorship", default-features = false }

[dev-dependencies]
substrate-primitives = { path = "../../core/primitives" }
timestamp = { package = "srml-timestamp", path = "../timestamp" }
balances = { package = "srml-balances", path = "../balances" }
timestamp = { package = "srml-timestamp", path = "../timestamp" }
rand = "0.6.5"

[features]
Expand All @@ -37,4 +38,5 @@ std = [
"primitives/std",
"session/std",
"system/std",
"authorship/std",
]
Loading