agents/skills/injectable/l1/validator-lifecycle-and-slashing/SKILL.md
L1 trigger - audits validator entry/exit transitions, slashing correctness, leader-duplicate handling, and lifecycle state invariants for PoS / DPoS / BFT consensus clients.
npx skillsauth add plamentsv/plamen validator-lifecycle-and-slashingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
L1 trigger:
L1_PATTERN=trueAND (slashing/ORvalidator/ORstaking/ORx/slashingORx/stakingORunbondingORdelegatordetected in recon subsystem map) Inject Into:depth-state-traceordepth-consensus-invariantLanguage: Go and Rust Finding prefix:[VL-N]Status: v0.1 draft (added from Round 4 gap analysis)
Recon identifies a PoS / DPoS / BFT staking subsystem. This skill is ADJACENT to but distinct from fork-choice-audit and consensus-safety-invariants: those cover "which chain is head" and "does the state machine stay consistent," while this one covers "who counts as a validator right now, and when must they be punished."
Round 4 gap analysis identified this as a pattern with ≥3 public exemplars not well-covered by the existing skill pack.
Every staking system has a finite state machine for validator status. Common states:
| State | Meaning | Typical transitions | |---|---|---| | Pending / Deposited | Funds deposited, not yet active | → Active (on epoch boundary) | | Active | Currently producing blocks / signing attestations | → Exiting (voluntary), → Slashed (on misbehavior), → Jailed (on downtime) | | Exiting | Requested to leave, funds locked | → Unbonding | | Unbonding | Exit period elapsing; still slashable | → Withdrawable | | Withdrawable | Funds claimable | → (removed) | | Jailed / Tombstoned | Temporarily removed for downtime | → Active (on unjail) | | Slashed | Permanently penalized | → Unbonding (with reduced stake) |
Tag: [VL-STATE:{transition}:{missing-update}]
Slashing is the enforcement mechanism for validator misbehavior. Bugs here let malicious validators escape penalty or let honest validators be wrongly punished.
Enumerate every offense the protocol defines:
For each, find the detection code and verify:
Attacker wants to escape slashing by transitioning to a non-slashable state before detection fires. Key check:
Can a validator exit / re-delegate / unbond between committing an offense and being detected?
If yes, the evidence window is too short — the protocol has a slashing evasion bug. Examples:
Tag: [VL-EVASION:{offense}:{window-gap}]
Conversely: a validator should not be slashed twice for the same evidence. Check: is there a slashed-offenses set / bitmap? Is it consulted before slashing?
Slashing burns stake. Verify:
Tag: [VL-MATH:{op}:{issue}]
Related to fork-choice-audit Section 3, but focused on validator-level accountability:
same_leader + same_slot + different_payload leading to 5+ hour network halt. Helius history.Tag: [VL-DUPLICATE:{handling}]
Epoch transitions are a critical moment when pending validators become active, exiting validators leave, and the total stake changes. Bugs at epoch boundaries:
Tag: [VL-EPOCH:{boundary}:{gap}]
| State | Test | Expected | |---|---|---| | Empty validator set | no validators active | handled per spec (no block produced, chain stalls gracefully?) | | Single validator | only one active | no double-sign detection needed, but still must work | | Slashing at genesis | evidence applies to pre-genesis state | rejected | | Slashing on already-slashed | double-slash attempt | rejected (double-slash protection) | | Exit during slashing window | attempt to exit mid-evidence-period | blocked until exit window ≥ evidence window | | Stake = 1 wei | minimum stake validator | handled without divide-by-zero (see consensus-safety-invariants) | | Stake = u64::MAX | overflow boundary | handled | | Unbonding across upgrade | unbonding validator during hard fork | state preserved correctly |
Tag: [BOUNDARY:validator:{state}:{result}]
[CONFORMANCE-PASS] (against slashing spec) > [LSP-TRACE] > [CODE-TRACE]Solana hot-spare duplicate-block network halt (September 30, 2022) — fork choice lacked handling for same_leader + same_slot + different_payload. Chain halted 5+ hours. Helius outage history. Skill catch point: Section 3 duplicate handling.
Cosmos SDK x/staking re-delegation-window slashing evasion (historical, various advisories) — re-delegation of stake during the evidence window could sidestep slashing. Class has been patched multiple times. Reference: Cosmos SDK security advisories archive. Skill catch point: Section 2b — slashing evasion.
Polygon PoS validator-exit consensus disruption (July 2025) — validator lifecycle transition triggered a Bor/Erigon finality issue. Cointelegraph report. Skill catch point: Section 4 — epoch boundary with lifecycle transition.
Ethereum beacon chain early slashing edge cases — Aumasson et al. review found multiple subtle slashing-condition bugs in early Eth2 clients. Security Review of Ethereum Beacon Clients. Skill catch point: Section 2a — slashable offense enumeration + 2b — evasion window.
slash(, Slash(, jail(, unbond(, undelegate(fork-choice-audit (leader duplicates), consensus-safety-invariants (panic in slashing path + integer math), bls-aggregation-audit (attestation signing)depth-state-trace, depth-consensus-invariantdocs/l1-mode/severity-matrix.mddevelopment
Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project documentation checks. Generates a scored Audit Readiness Report and optionally runs static analysis. Trigger on: "prepare for audit", "audit readiness", "pre-audit check", "audit prep", "NatSpec check", or any request to review a Solidity codebase before a security review.
development
Launch the Plamen deterministic Web3 security audit pipeline
development
Run the Plamen smart-contract audit wizard in Codex
testing
Launch the Plamen deterministic L1 infrastructure audit pipeline