-
Notifications
You must be signed in to change notification settings - Fork 127
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
R4R: Censorship Slash #1080
R4R: Censorship Slash #1080
Conversation
61b1e96
to
32fefec
Compare
modules/slashing/keeper.go
Outdated
@@ -174,6 +174,50 @@ func (k Keeper) handleValidatorSignature(ctx sdk.Context, addr crypto.Address, p | |||
return | |||
} | |||
|
|||
// Punish proposer censorship by slashing malefactor's stake | |||
func (k Keeper) handleProposalCensorship(ctx sdk.Context, addr crypto.Address, infractionHeight int64) (tags sdk.Tags) { |
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.
handleProposalCensorship => handleProposerCensorship
modules/slashing/tick.go
Outdated
@@ -40,3 +40,20 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags | |||
|
|||
return | |||
} | |||
|
|||
// slashing begin block functionality |
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.
slashing end block functionality
If a Validator is slash twice at the same block height(double-sign & invalid tx), each time slash 20%, then the total slash is 36% instead of 40%. |
modules/slashing/keeper.go
Outdated
// ABCI, and now received as evidence. | ||
// The revisedFraction (which is the new fraction to be slashed) is passed | ||
// in separately to separately slash unbonding and rebonding delegations. | ||
tags = k.validatorSet.Slash(ctx, consAddr,infractionHeight, validator.GetPower().RoundInt64(), sdk.NewDecWithPrec(5,2)) |
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.
The hardcode sdk.NewDecWithPrec(5,2)
should be defined as a gov param.
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.
Any new param or param change needs to be added to the params spec. @MrXJC @wukongcheng
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.
OK we also need a ProposerCensorshipUnbondDuration like DoubleSignUnbondDuration
Target Issue: #1052