darwinia-docs icon indicating copy to clipboard operation
darwinia-docs copied to clipboard

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

Open WoeOm opened this issue 4 years ago • 5 comments

nominator: 5HE1gjo5cRP5Xzf42zrc3gExws6zqrtnMsHTi3jZ5KbLpKnd validator: 5HKSD4vd1GaM92Udj9NJ3rTSrrsjyFYvYBukAs2ZcuFtA5UX

image

WoeOm avatar Jun 15 '20 10:06 WoeOm

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 avatar Jun 16 '20 05:06 hackfisher

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

Screenshot 2020-06-16 at 1 24 05 PM

AurevoirXavier avatar Jun 16 '20 05:06 AurevoirXavier

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.

hackfisher avatar Jun 16 '20 05:06 hackfisher

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.

AurevoirXavier avatar Jun 16 '20 05:06 AurevoirXavier

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())
			});

hackfisher avatar Jun 16 '20 05:06 hackfisher