2022-05-20 15:30:30 +00:00
|
|
|
package state_native
|
|
|
|
|
|
|
|
import (
|
2023-03-17 18:52:56 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/config/params"
|
|
|
|
"github.com/prysmaticlabs/prysm/v4/runtime/version"
|
2022-05-20 15:30:30 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (b *BeaconState) ProportionalSlashingMultiplier() (uint64, error) {
|
|
|
|
switch b.version {
|
2023-05-09 21:38:13 +00:00
|
|
|
case version.Bellatrix, version.Capella, version.Deneb:
|
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 {
|
2023-05-09 21:38:13 +00:00
|
|
|
case version.Bellatrix, version.Capella, version.Deneb:
|
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)
|
|
|
|
}
|