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

Downtime slash acknowledgements never sent to consumer if validator tombstoned #237

Closed
danwt opened this issue Jul 15, 2022 · 5 comments
Closed
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Issues that need priority attention -- something isn't working

Comments

@danwt
Copy link
Contributor

danwt commented Jul 15, 2022

In the code if the validator is tombstoned the downtime slash acknowledgement is never sent. The question, is what is intended by the acknowledgement? If the ack is supposed to mean that the slash happened then the code is correct. If the ack is supposed to mean that the slash request was received then the code is wrong. Either way there is a divergence from the spec but this is already covered by these issues

if k.slashingKeeper.IsTombstoned(ctx, consAddr) {
return false, nil
}
// slash and jail validator according to their infraction type
// and using the provider chain parameters
var (
jailTime time.Time
slashFraction sdk.Dec
)
switch data.Infraction {
case stakingtypes.Downtime:
// set the downtime slash fraction and duration
// then append the validator address to the slash ack for its chain id
slashFraction = k.slashingKeeper.SlashFractionDowntime(ctx)
jailTime = ctx.BlockTime().Add(k.slashingKeeper.DowntimeJailDuration(ctx))
k.AppendSlashAck(ctx, chainID, consAddr.String())

@danwt danwt added type: bug Issues that need priority attention -- something isn't working help wanted Open for all. You do not need permission to work on these. spec labels Jul 15, 2022
@danwt danwt moved this to Todo in Replicated Security Jul 15, 2022
@danwt
Copy link
Contributor Author

danwt commented Jul 15, 2022

Do you have any thoughts on this @sainoe?

@sainoe
Copy link
Contributor

sainoe commented Jul 15, 2022

The consumer module keeps track of the SlashPackets sent for downtime infraction in OutstandingDowntime which is a mapping from validator addressees to boolean value.

The SlashAcks field in VSCPacketData entails consumer chains to update this mapping and avoid them to send SlashPacket multiple times for the same downtime infraction.

Therefore the acknowledgement is meant to inform a consumer chain that it has successfully slashed a validator for downtime on the provider chain.

@danwt
Copy link
Contributor Author

danwt commented Jul 15, 2022

I understand the outstanding downtime part, but do we definitely want this to mean that the validator was not slashed, or simply that the slash packet was not received?

Because if the validator is tombstoned, the ack will never arrive, even though the slash request did arrive. Maybe this is OK.

@sainoe
Copy link
Contributor

sainoe commented Jul 15, 2022

I understand the outstanding downtime part, but do we definitely want this to mean that the validator was not slashed, or simply that the slash packet was not received?

It means not slashed yet.

Because if the validator is tombstoned, the ack will never arrive, even though the slash request did arrive. Maybe this is OK.

For the tombstoning there isn't the issue of sending the same infraction twice and anyway validators can't be slashed for double-sign multiple time. AFAIU if the slash packet is never received the ordered channel will
time-out on the next VSCMaturePacket.

@danwt
Copy link
Contributor Author

danwt commented Jul 15, 2022

Ok it sounds good. Thanks.

@danwt danwt closed this as completed Jul 15, 2022
Repository owner moved this from Todo to Done in Replicated Security Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. type: bug Issues that need priority attention -- something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants