This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- unstake when balance too low - unstake after N slashes according to val prefs - don't early-terminate session/era unless unstaked - offline grace period before punishment
gavofyork
added
the
A3-in_progress
Pull request is in progress. No review needed at this stage.
label
Aug 12, 2018
gavofyork
commented
Aug 13, 2018
fn note_round_end(&mut self, was_online: bool) { | ||
let now = Instant::now(); | ||
|
||
fn note_round_end(&mut self, now: Instant, was_online: Option<bool>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we provide now
in order to ensure that all rounds in the same block are considered contemporaneous, which lets us group which validators were offline for the previous block specifically.
gavofyork
commented
Aug 13, 2018
.or_insert_with(Observed::new) | ||
.note_round_end(was_online); | ||
self.observed.entry(validator).or_insert_with(Observed::new); | ||
for (val, obs) in self.observed.iter_mut() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all validators are updated with the current time so that we can see which of them were inactive in specifially the previous block.
gavofyork
added
A0-please_review
Pull request needs code review.
and removed
A3-in_progress
Pull request is in progress. No review needed at this stage.
labels
Aug 14, 2018
rphmeier
added
A5-grumble
and removed
A0-please_review
Pull request needs code review.
labels
Aug 14, 2018
(Waiting for tests) |
I think, the auto-unnominate after N slashes according to nominator's preferences, is also necessary. |
@jiangfuyao yeah, but that'll be another PR |
gavofyork
added
A0-please_review
Pull request needs code review.
and removed
A5-grumble
labels
Aug 15, 2018
rphmeier
approved these changes
Aug 15, 2018
rphmeier
added
A8-looksgood
and removed
A0-please_review
Pull request needs code review.
labels
Aug 15, 2018
Closed
gavofyork
added a commit
that referenced
this pull request
Aug 15, 2018
* Slashing improvements - unstake when balance too low - unstake after N slashes according to val prefs - don't early-terminate session/era unless unstaked - offline grace period before punishment * Fix warning * Cleanups and ensure slash_count decays * Bump authoring version and introduce needed authoring stub * Rename * Fix offline tracker * Fix offline tracker * Renames * Add test * Tests * Tests.
gavofyork
added a commit
that referenced
this pull request
Aug 27, 2018
* New slashing mechanism (#554) * Slashing improvements - unstake when balance too low - unstake after N slashes according to val prefs - don't early-terminate session/era unless unstaked - offline grace period before punishment * Fix warning * Cleanups and ensure slash_count decays * Bump authoring version and introduce needed authoring stub * Rename * Fix offline tracker * Fix offline tracker * Renames * Add test * Tests * Tests. * Remove accidental merge files. * Version bump, fixes (#572) * Bump version, don't propose invalid blocks * Fix build. * Fixes. * More fixes. * Fix tests. * Fix more tests * More tests fixed * Fix merge * Fix accidental merge bug * Fixes. * Staking failsafes - Don't slash/unstake/change session when too few staking participants - Introduce set_balance PrivCall * Make minimum validator count dynamic. * test fixes * Fix tests. * Fix tests * Fix tests, update readme. * Test with release. * Use safe math when dealing with total stake * Fix test again. * Fix grumbles.
gavofyork
added a commit
that referenced
this pull request
Aug 27, 2018
New slashing mechanism (#554) … * Slashing improvements - unstake when balance too low - unstake after N slashes according to val prefs - don't early-terminate session/era unless unstaked - offline grace period before punishment * Fix warning * Cleanups and ensure slash_count decays * Bump authoring version and introduce needed authoring stub * Rename * Fix offline tracker * Fix offline tracker * Renames * Add test * Tests * Tests. Remove accidental merge files. Merge remote-tracking branch 'origin/master' into gav-new-pos Version bump, fixes (#572) … * Bump version, don't propose invalid blocks * Fix build. * Fixes. * More fixes. * Fix tests. * Fix more tests * More tests fixed Fix merge Fix accidental merge bug Fixes. Staking failsafes … - Don't slash/unstake/change session when too few staking participants - Introduce set_balance PrivCall Make minimum validator count dynamic. test fixes Fix tests. Fix tests Fix tests, update readme. Merge remote-tracking branch 'origin/master' into gav-new-pos Test with release. Use safe math when dealing with total stake Fix test again. Introduce events into runtime. Fix tests Add events for account new/reap Integration-style tests for events.
gavofyork
added a commit
that referenced
this pull request
Aug 28, 2018
* Squashed commit. New slashing mechanism (#554) … * Slashing improvements - unstake when balance too low - unstake after N slashes according to val prefs - don't early-terminate session/era unless unstaked - offline grace period before punishment * Fix warning * Cleanups and ensure slash_count decays * Bump authoring version and introduce needed authoring stub * Rename * Fix offline tracker * Fix offline tracker * Renames * Add test * Tests * Tests. Remove accidental merge files. Merge remote-tracking branch 'origin/master' into gav-new-pos Version bump, fixes (#572) … * Bump version, don't propose invalid blocks * Fix build. * Fixes. * More fixes. * Fix tests. * Fix more tests * More tests fixed Fix merge Fix accidental merge bug Fixes. Staking failsafes … - Don't slash/unstake/change session when too few staking participants - Introduce set_balance PrivCall Make minimum validator count dynamic. test fixes Fix tests. Fix tests Fix tests, update readme. Merge remote-tracking branch 'origin/master' into gav-new-pos Test with release. Use safe math when dealing with total stake Fix test again. Introduce events into runtime. Fix tests Add events for account new/reap Integration-style tests for events. * Remove old code
liuchengxu
pushed a commit
to chainx-org/substrate
that referenced
this pull request
Aug 23, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Redesigns the slashing subsystem to make incremental slashing more sensible, offers a way out for validators that want a fail-safe and provides more scope for fail-overs (especially when done in combination with a weighted leader-selection algorithm).
Still to do:
validator_offline
test.