prysm-pulse/beacon-chain/state/state-native/spec_parameters.go

31 lines
1.1 KiB
Go
Raw Normal View History

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