Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the slashingRate for prepDisqualification penalty to 100% on transiting to RevIISS4R0 #197

Conversation

goldworm-icon
Copy link
Member

No description provided.

…siting to RevIISS4R0

* Slash bonds only if the rate > 0 in DisqualifyPRep()
@@ -596,8 +596,10 @@ func (es *ExtensionStateImpl) DisqualifyPRep(cc icmodule.CallContext, address mo
ps := es.State.GetPRepStatusByOwner(address, false)
// Record PenaltyImposed eventlog
EmitPenaltyImposedEvent(cc, ps, pt)
rate, _ := es.State.GetSlashingRate(cc.Revision().Value(), pt)
return es.slash(cc, address, rate)
if rate, _ := es.State.GetSlashingRate(cc.Revision().Value(), pt); rate > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slash() check 0 rate already

Copy link
Member

@mksong76 mksong76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about to assume it 100%, if there is no configured value for slash-rate for disqualification ?

So, getSlashingRate() returns 100% on PenaltyPRepDisqualification if there is no value set.

@goldworm-icon goldworm-icon deleted the goldworm-bugfix-prep-disqualification-slashing-rate2 branch December 12, 2023 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants