agents/skills/injectable/l1/hardfork-activation-and-protocol-upgrade/SKILL.md
L1 trigger - audits bugs that surface only at fork boundaries / protocol upgrade points: activation logic, dormant code paths, upgrade epoch correctness, version gating.
npx skillsauth add plamentsv/plamen hardfork-activation-and-protocol-upgradeInstall 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 (fork_rulesORchain_configORhardforkORupgrade_handlerORx/upgradeORActivationHeightORActivationEpochdetected in recon subsystem map) Inject Into:depth-state-traceordepth-consensus-invariantLanguage: Go and Rust Finding prefix:[HF-N]Status: v0.1 draft (added from Round 4 gap analysis)
Recon identifies fork-activation, chain-config, or upgrade-handler code. This skill addresses a distinct bug class surfaced by Round 4: bugs that are invisible until an upgrade epoch arrives. The Prysm Fusaka bug (Dec 2025) is the canonical example — perfectly working code in v7.0.0, Critical-severity bug the moment Fusaka activated.
The defining feature: these bugs cannot be found by analyzing "current behavior" alone. They live in code paths that are dormant until a specific block height, epoch, or version condition fires.
Every hardfork has an activation condition: a block height, timestamp, epoch, or version number. Verify:
If a hardfork activates multiple rule changes (new opcode, new gas cost, new pricing), ALL must activate at the same height. Partial activation = consensus split.
Check: the code gated by if block.Number >= ForkBlock actually runs. Dead code that was meant to activate but never does is a finding (late activation = missed hardfork).
Testnet activation heights are different from mainnet. Verify: the code does not have a hardcoded mainnet block number that breaks on testnet, or vice versa. Every activation condition should be config-driven.
Tag: [HF-ACTIVATE:{fork}:{issue}]
The hardest class: code that exists for a future fork but has never run in production. Prysm Fusaka is the exemplar — v7.0.0 shipped with the Fusaka code path, but that path was dormant until the upgrade epoch. When it activated, bugs surfaced that no amount of testing on the pre-Fusaka chain would have caught.
if chainConfig.IsXxx(blockNumber) gate in the codebaseTag: [HF-DORMANT:{fork}:{gated-code}]
Critical methodology nuance: dormant code is under-tested by definition. Any finding in dormant code should be flagged High or Critical because the production blast radius is the entire upgrade.
For protocols with multiple client implementations, version gating must agree:
Check:
Tag: [HF-VERSION:{client}:{divergence}]
At the upgrade epoch itself, two rule sets coexist: pre-upgrade rules apply to blocks at epoch N-1, post-upgrade rules apply to N. At the boundary:
Tag: [HF-BOUNDARY:{issue}]
If an upgrade fails post-deployment, the protocol may need to be rolled back.
Tag: [HF-ROLLBACK:{state}]
| State | Test | Expected | |---|---|---| | Genesis = fork block | chain starts at upgrade | handled | | Reorg across fork | reorg to block before fork activation | state rolled back to pre-fork rules | | Fork block + 1 | first post-fork block | uses post-fork rules cleanly | | Missing client update | some nodes still on pre-fork version | they split off (this is the POINT of a hardfork) | | Upgrade during chain halt | activation height reached while chain is halted | activation applies when chain resumes |
[CONFORMANCE-PASS] (against spec + other clients) > [DIFF-PASS] (differential vs alternative implementation) > [LSP-TRACE]Prysm Fusaka mainnet bug (December 4, 2025) — v7.0.0 was shipped with the Fusaka code path. At Fusaka activation epoch 411392, Prysm's handling of outdated attestations triggered thousands of historical state replays, dropping participation to 75% and costing 382 ETH in validator rewards. Rated High (not Critical) because 9 other clients kept validating. Crypto.news analysis; postmortem. Skill catch point: Section 2 — dormant code path that only activated at the upgrade epoch. Differential test against Lighthouse / Teku / Nimbus would have caught it.
Nimbus Deneb consensus violation (v24.2.2 hotfix) — Nimbus deviation from spec at the Deneb hardfork boundary. Hotfix released to address the violation. Skill catch point: Section 1b — activation atomicity; Section 3 — version gating against spec.
Polygon Heimdall V2 upgrade triggered Bor/Erigon finality delay (September 2025) — hardfork on Heimdall side caused downstream clients (Bor, Erigon) to experience finality delays. Cross-client upgrade coordination failure. Cointelegraph. Skill catch point: Section 3 — cross-client version coordination.
Ethereum EIP-2929 activation (Berlin hardfork, 2021) — introduced warm/cold storage access, changing gas costs for state-touching opcodes. Multiple client-specific implementation bugs were caught pre-activation via testnets. Demonstrates the "dormant code" class — the bugs only surfaced once the code path was exercised by real traffic at the activation height.
ForkBlock, IsXxx(, ActivationEpoch, upgrade_handler, UpgradeHandler, PlanUpgradeconsensus-safety-invariants (activation code must preserve safety invariants), execution-client-hardening (opcode repricing / new opcode support), cross-environment-semantic-drift (forks of upstream clients may have drifted activation logic)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