2022-05-20 15:30:30 +00:00
|
|
|
package state_native
|
|
|
|
|
|
|
|
import (
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/config/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/v3/runtime/version"
|
2022-05-20 15:30:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) {
|
|
|
|
switch b.version {
|
2022-10-12 16:39:19 +00:00
|
|
|
case version.Bellatrix, version.Capella:
|
2022-05-20 15:30:30 +00:00
|
|
|
return params.BeaconConfig().ProportionalSlashingMultiplierBellatrix, nil
|
|
|
|
case version.Altair:
|
|
|
|
return params.BeaconConfig().ProportionalSlashingMultiplierAltair, nil
|
|
|
|
case version.Phase0:
|
|
|
|
return params.BeaconConfig().ProportionalSlashingMultiplier, nil
|
|
|
|
}
|
|
|
|
return 0, errNotSupported("ProportionalSlashingMultiplier()", b.version)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BeaconState) InactivityPenaltyQuotient() (uint64, error) {
|
|
|
|
switch b.version {
|
2022-10-12 16:39:19 +00:00
|
|
|
case version.Bellatrix, version.Capella:
|
2022-05-20 15:30:30 +00:00
|
|
|
return params.BeaconConfig().InactivityPenaltyQuotientBellatrix, nil
|
|
|
|
case version.Altair:
|
|
|
|
return params.BeaconConfig().InactivityPenaltyQuotientAltair, nil
|
|
|
|
case version.Phase0:
|
|
|
|
return params.BeaconConfig().InactivityPenaltyQuotient, nil
|
|
|
|
}
|
|
|
|
return 0, errNotSupported("InactivityPenaltyQuotient()", b.version)
|
|
|
|
}
|