Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Doc: The nomination which are before the validator's recent slashing will be ignored. #69

Open
WoeOm opened this issue Jun 15, 2020 · 5 comments

Comments

@WoeOm
Copy link
Contributor

WoeOm commented Jun 15, 2020

nominator: 5HE1gjo5cRP5Xzf42zrc3gExws6zqrtnMsHTi3jZ5KbLpKnd
validator: 5HKSD4vd1GaM92Udj9NJ3rTSrrsjyFYvYBukAs2ZcuFtA5UX

image

@hackfisher
Copy link
Contributor

hackfisher commented Jun 16, 2020

The nomination which are before the validator's latest slashing will be ignored:

			// Filter out nomination targets which were nominated before the most recent
			// slashing span.
			targets.retain(|stash| {
				<Self as Store>::SlashingSpans::get(&stash)
					.map_or(true, |spans| submitted_in >= spans.last_nonzero_slash())
			});

WechatIMG2646

staking.nominators: Option<Nominations>
{
  targets: [
    5HKSD4vd1GaM92Udj9NJ3rTSrrsjyFYvYBukAs2ZcuFtA5UX
  ],
  submittedIn: 148,
  suppressed: false
}

@hackfisher hackfisher transferred this issue from darwinia-network/darwinia Jun 16, 2020
@hackfisher hackfisher changed the title The number of stakers in the validator is incorrect Doc: The nomination which are before the validator's recent slashing will be ignored. Jun 16, 2020
@aurexav
Copy link
Member

aurexav commented Jun 16, 2020

I just nominate that validator(node). And I think this works well.

Screenshot 2020-06-16 at 1 24 05 PM

@hackfisher
Copy link
Contributor

hackfisher commented Jun 16, 2020

I just nominate that validator(node). And I think this works well.

Screenshot 2020-06-16 at 1 24 05 PM

Key point is that the nomination from 5HE1gjo5cRP5Xzf42zrc3gExws6zqrtnMsHTi3jZ5KbLpKnd was before the slashing. In other words, slashing will disable the validator be elected by those nominations happen before the slashing, it make sense.

Should add docs to tell this.

@aurexav
Copy link
Member

aurexav commented Jun 16, 2020

I just nominate that validator(node). And I think this works well.
Screenshot 2020-06-16 at 1 24 05 PM

Key points is that the nomination from 5HE1gjo5cRP5Xzf42zrc3gExws6zqrtnMsHTi3jZ5KbLpKnd was before the slashing. In other words, slashing will disable the validator be elected by those nominations happen before the slashing, make sense.

Should add docs to tell this.

But there's one more thing I need to check. What would happen if that validator(node) re-validate? Seems slash won't clean the Nominations storage.

@hackfisher
Copy link
Contributor

hackfisher commented Jun 16, 2020

I just nominate that validator(node). And I think this works well.
Screenshot 2020-06-16 at 1 24 05 PM

Key points is that the nomination from 5HE1gjo5cRP5Xzf42zrc3gExws6zqrtnMsHTi3jZ5KbLpKnd was before the slashing. In other words, slashing will disable the validator be elected by those nominations happen before the slashing, make sense.
Should add docs to tell this.

But there's one more thing I need to check. What would happen if that validator(node) re-validate? Seems slash won't clean the Nominations storage.

Check following code, Nomination storage currently are not cleaned when slash happens, but still will be ignored even if the validator re-validator, because the nomination records the submitted_in Era

			// Filter out nomination targets which were nominated before the most recent
			// slashing span.
			targets.retain(|stash| {
				<Self as Store>::SlashingSpans::get(&stash)
					.map_or(true, |spans| submitted_in >= spans.last_nonzero_slash())
			});

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants