ability-analysis
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
L1 trigger - audits state sync, snapshot integrity, checkpoint trust, pruning race conditions, and state growth attacks.
$ npx -y skills add PlamenTSV/plamen --skill state-sync-pruning --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/state-sync-pruningContext preview
The summary Claude sees to decide when to auto-load this skill.
L1 trigger - audits state sync, snapshot integrity, checkpoint trust, pruning race conditions, and state growth attacks.
name: "state-sync-pruning" description: "L1 trigger - audits state sync, snapshot integrity, checkpoint trust, pruning race conditions, and state growth attacks."
> **L1 trigger**: `L1_PATTERN=true` AND (`sync/` OR `snap_sync` OR `fast_sync` OR `statesync` OR `pruning` OR `snapshot/` detected in recon subsystem map) > **Inject Into**: `depth-state-trace` or `depth-edge-case` > **Language**: Go and Rust > **Finding prefix**: `[SS-N]` > **Status**: v0.1 draft, Round 4 exemplars pending
Recon identifies state sync or pruning code. State sync is the mechanism by which a new node catches up without replaying the entire history; pruning is how an existing node garbage-collects old state. Both are subtle: a bug in either can corrupt the node's state silently, leading to later divergence.
Identify the sync mode(s) supported:
| Mode | Description | Trust model | |---|---|---| | **Full sync** | Replay every block from genesis | Trustless (modulo consensus rules) | | **Fast sync** | Download headers + recent state trie | Trusts weak subjectivity checkpoint | | **Snap sync** (Ethereum) | Download flat account snapshots in ranges | Healing phase verifies root | | **Warp sync** (Parity) | Download a snapshot of state at a past block | Trusts snapshot root | | **State sync** (Cosmos) | Download state at a trusted height from peers | Trusts a configured height/hash | | **Checkpoint sync** (Beacon) | Trusts a recent finalized checkpoint root | Weak subjectivity | | **Portal Network** | Content-addressed historical storage | Trustless per item |
Write the mode(s) into the finding header.
Every non-full sync mode depends on a root or checkpoint. Verify the trust chain:
1. **Where does the checkpoint come from?** Hardcoded? CLI flag? RPC? Config file? 2. **What signs it?** Nothing (pure trust)? A hardcoded key? The current validator set? 3. **Validity period**: is the checkpoint rejected if older than X? Stale checkpoints permit long-range attacks. 4. **Rollback**: if a checkpoint turns out to be invalid mid-sync, does the node recover cleanly?
Tag: `[SYNC-TRUST:{source}:{validation}]`
**Historical exemplar class**: unsigned-checkpoint sync in early Cosmos clients; trust-anchor bypass in early beacon chain clients.
For any sync mode that downloads bulk state (snap, warp, state sync):
Tag: `[SNAPSHOT:{integrity-class}]`
Pruning removes old state to save disk. Bugs here corrupt the active state.
A persistence unit is any tuple of writes that must commit or abort together for higher-level state to stay consistent (block body + receipts + state root; header + total-difficulty + canonical-hash mapping; snapshot chunk + chunk manifest). A node crash BETWEEN the writes of a logical unit leaves partially-applied state that the restart path may silently accept.
Methodology — enumerate as a table, one row per logical unit:
| Logical Unit | Writes In Order | Fence (txn commit / fsync / batch) | Restart Recovery | Torn-Write Risk |
For each row: 1. Read the write sequence from the code. Do all writes happen under the SAME DB transaction / batch that commits atomically, or are they split across multiple commits? 2. If split, what happens if the process dies between commits? Does the next start detect and roll back, complete the remaining writes, or silently accept the partial state? 3. OS-level torn writes: for any write that bypasses the DB's own atomicity (direct `write` + `fsync` to a file), verify that either the write is ≤ 4 KiB (page-atomic on most filesystems) or the file uses a write-then-rename pattern with `fsync` on the parent directory. 4. Windows-specific: `rename` is NOT atomic over an existing file on pre-Windows-10 / some network filesystems; `MoveFileEx` with
Autonomous Web3 security auditor for Claude Code and OpenAI Codex CLI. Orchestrates 18-100 AI agents across 40+ phases to produce audit reports with verified PoC exploits — for smart contracts and L1 node-client infrastructure.
Repo: PlamenTSV/plamen
Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth…
Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into…
Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) -…
Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by…
Trigger Pattern MONETARY_PARAMETER flag (required) - Inject Into Breadth agents (merged via…