mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-31 15:31:20 +00:00
Enable slashing protection in validator by default (#5278)
* Invert slashing protection validator flags for issue #5267 * remove from e2e flags * Make error level * Merge refs/heads/master into flip-propose
This commit is contained in:
parent
02b238bda2
commit
8376fb36ca
@ -204,13 +204,15 @@ func ConfigureValidator(ctx *cli.Context) {
|
||||
complainOnDeprecatedFlags(ctx)
|
||||
cfg := &Flags{}
|
||||
cfg = configureConfig(ctx, cfg)
|
||||
if ctx.Bool(protectProposerFlag.Name) {
|
||||
log.Warn("Enabled validator proposal slashing protection.")
|
||||
cfg.ProtectProposer = true
|
||||
cfg.ProtectProposer = true
|
||||
if ctx.Bool(disableProtectProposerFlag.Name) {
|
||||
log.Warn("Disabled validator proposal slashing protection.")
|
||||
cfg.ProtectProposer = false
|
||||
}
|
||||
if ctx.Bool(protectAttesterFlag.Name) {
|
||||
log.Warn("Enabled validator attestation slashing protection.")
|
||||
cfg.ProtectAttester = true
|
||||
cfg.ProtectAttester = true
|
||||
if ctx.Bool(disableProtectAttesterFlag.Name) {
|
||||
log.Warn("Disabled validator attestation slashing protection.")
|
||||
cfg.ProtectAttester = false
|
||||
}
|
||||
if ctx.Bool(enableDomainDataCacheFlag.Name) {
|
||||
log.Warn("Enabled domain data cache.")
|
||||
|
@ -80,15 +80,15 @@ var (
|
||||
Usage: "Cache filtered block tree by maintaining it rather than continually recalculating on the fly, " +
|
||||
"this is used for fork choice.",
|
||||
}
|
||||
protectProposerFlag = &cli.BoolFlag{
|
||||
Name: "protect-proposer",
|
||||
Usage: "Prevent the validator client from signing and broadcasting 2 different block " +
|
||||
"proposals in the same epoch. Protects from slashing.",
|
||||
disableProtectProposerFlag = &cli.BoolFlag{
|
||||
Name: "disable-protect-proposer",
|
||||
Usage: "Disables functionality to prevent the validator client from signing and " +
|
||||
"broadcasting 2 different block proposals in the same epoch. Protects from slashing.",
|
||||
}
|
||||
protectAttesterFlag = &cli.BoolFlag{
|
||||
Name: "protect-attester",
|
||||
Usage: "Prevent the validator client from signing and broadcasting 2 any slashable attestations. " +
|
||||
"Protects from slashing.",
|
||||
disableProtectAttesterFlag = &cli.BoolFlag{
|
||||
Name: "disable-protect-attester",
|
||||
Usage: "Disables functionality to prevent the validator client from signing and " +
|
||||
"broadcasting 2 any slashable attestations.",
|
||||
}
|
||||
disableStrictAttestationPubsubVerificationFlag = &cli.BoolFlag{
|
||||
Name: "disable-strict-attestation-pubsub-verification",
|
||||
@ -258,6 +258,16 @@ var (
|
||||
Usage: deprecatedUsage,
|
||||
Hidden: true,
|
||||
}
|
||||
deprecatedProtectProposerFlag = &cli.BoolFlag{
|
||||
Name: "protect-proposer",
|
||||
Usage: deprecatedUsage,
|
||||
Hidden: true,
|
||||
}
|
||||
deprecatedProtectAttesterFlag = &cli.BoolFlag{
|
||||
Name: "protect-attester",
|
||||
Usage: deprecatedUsage,
|
||||
Hidden: true,
|
||||
}
|
||||
)
|
||||
|
||||
var deprecatedFlags = []cli.Flag{
|
||||
@ -282,20 +292,20 @@ var deprecatedFlags = []cli.Flag{
|
||||
deprecatedForkchoiceAggregateAttestations,
|
||||
deprecatedEnableAttestationCacheFlag,
|
||||
deprecatedInitSyncCacheStateFlag,
|
||||
deprecatedProtectAttesterFlag,
|
||||
deprecatedProtectProposerFlag,
|
||||
}
|
||||
|
||||
// ValidatorFlags contains a list of all the feature flags that apply to the validator client.
|
||||
var ValidatorFlags = append(deprecatedFlags, []cli.Flag{
|
||||
minimalConfigFlag,
|
||||
protectAttesterFlag,
|
||||
protectProposerFlag,
|
||||
disableProtectAttesterFlag,
|
||||
disableProtectProposerFlag,
|
||||
enableDomainDataCacheFlag,
|
||||
}...)
|
||||
|
||||
// E2EValidatorFlags contains a list of the validator feature flags to be tested in E2E.
|
||||
var E2EValidatorFlags = []string{
|
||||
"--protect-attester",
|
||||
"--protect-proposer",
|
||||
"--enable-domain-data-cache",
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot uint64, pubKey [48]by
|
||||
}
|
||||
|
||||
if HasProposedForEpoch(history, epoch) {
|
||||
log.WithField("epoch", epoch).Warn("Tried to sign a double proposal, rejected")
|
||||
log.WithField("epoch", epoch).Error("Tried to sign a double proposal, rejected")
|
||||
if v.emitAccountMetrics {
|
||||
validatorProposeFailVec.WithLabelValues(fmtKey).Inc()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user