MCPcopy Create free account
hub / github.com/akash-network/node / validateProviderSlashingHistory

Method validateProviderSlashingHistory

x/verification/keeper/msg.go:1353–1366  ·  view source on GitHub ↗
(ctx sdk.Context, tier vtypes.VerificationTier, params vtypes.Params, bond vtypes.ProviderBondRecord)

Source from the content-addressed store, hash-verified

1351}
1352
1353func (k *keeper) validateProviderSlashingHistory(ctx sdk.Context, tier vtypes.VerificationTier, params vtypes.Params, bond vtypes.ProviderBondRecord) error {
1354 if !vtypes.TierAtLeast(tier, vtypes.TierEstablished) || bond.LastSlashTime == nil {
1355 return nil
1356 }
1357
1358 window := cleanHistoryWindowForTier(params, tier)
1359 if window == 0 {
1360 return nil
1361 }
1362 if bond.LastSlashTime.After(ctx.BlockTime().Add(-window)) {
1363 return moduletypes.ErrSlashingHistoryViolation
1364 }
1365 return nil
1366}
1367
1368type attestationInterval struct {
1369 start time.Time

Callers 1

Calls 2

AfterMethod · 0.80

Tested by

no test coverage detected