Add slashing protection strict mode for external signers - #11182
Add slashing protection strict mode for external signers#11182ayaanoncrypto wants to merge 1 commit into
Conversation
|
I have read the CLA Document and I hereby sign the CLA ayaanoncrypto seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 75767ed. Configure here.
| records.computeIfAbsent(validator, __ -> addRecord(validator, genesisValidatorsRoot)); | ||
| if (slashingProtectionStrictModeEnabled && record.isNew()) { | ||
| return Optional.empty(); | ||
| } |
There was a problem hiding this comment.
Strict mode caches missing records permanently
Medium Severity
When strict mode is enabled, getSigningRecordForSigning inserts a record via computeIfAbsent before checking isNew. Because isNew is immutable, a first miss is remembered for the process lifetime, so later slashing-protection files are ignored and signing stays refused until restart.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 75767ed. Configure here.


PR Description
Fixed Issue(s)
Documentation
doc-change-requiredlabel to this PR if updates are required.Changelog
Note
Medium Risk
Changes when signing is allowed in the slashing-protection path; misconfiguration could block duties or weaken protection, though default remains the prior auto-create behavior.
Overview
Adds an opt-in
--slashing-protection-strict-mode-enabledflag (default off) so Teku refuses block and attestation signing when there is no existing slashing protection file for a validator, instead of auto-creating an empty record on first sign.Both
LocalSlashingProtectorandLocalSlashingProtectorConcurrentAccesstake the setting viaValidatorConfigandValidatorClientService. The concurrent path tracks whether a record was newly synthesized withLocalSlashingProtectionRecord.isNew()and treats that like a missing file when strict mode is on. Tests cover strict vs non-strict behavior for blocks and attestations.Reviewed by Cursor Bugbot for commit 75767ed. Bugbot is set up for automated code reviews on this repo. Configure here.