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

R4R: Censorship Slash #1080

Merged
merged 5 commits into from
Jan 17, 2019
Merged

R4R: Censorship Slash #1080

merged 5 commits into from
Jan 17, 2019

Conversation

MrXJC
Copy link
Contributor

@MrXJC MrXJC commented Jan 16, 2019

Target Issue: #1052

@MrXJC MrXJC changed the title WIP: Censorship Slash R4R: Censorship Slash Jan 16, 2019
@@ -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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

handleProposalCensorship => handleProposerCensorship

@@ -40,3 +40,20 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, sk Keeper) (tags

return
}

// slashing begin block functionality
Copy link
Contributor

Choose a reason for hiding this comment

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

slashing end block functionality

@wukongcheng
Copy link
Contributor

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%.

// 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))
Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

wukongcheng
wukongcheng previously approved these changes Jan 17, 2019
chengwenxi
chengwenxi previously approved these changes Jan 17, 2019
@MrXJC MrXJC dismissed stale reviews from chengwenxi and wukongcheng via c689419 January 17, 2019 09:07
@wukongcheng wukongcheng merged commit 11c5756 into irisnet:develop Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants