sounder25/foundational-agent-skills/22-state-overlay-consistency

Claude Code and agent skill by sounder25/foundational-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Detect and prevent state-visibility violations across execution contexts within a single transaction.

Install

npx vskill@latest install sounder25/foundational-agent-skills/22-state-overlay-consistency

SKILL.md

SKILL-022 — State Overlay Consistency Checker

Status

PROPOSED → VERIFIED (after EELS reproduction)

Purpose

Detect and prevent state-visibility violations across execution contexts within a single transaction.

This skill ensures that state mutations (code deployment, storage writes, warm slots, balances) performed in one execution frame (e.g., CREATE, CREATE2) are visible and inherited by all subsequent execution contexts (CALL, DELEGATECALL, STATICCALL) during the same transaction.

This skill exists to stop silent gas under-charging and consensus-breaking execution paths.

Problem Class

Silent Overlay Forking

A transaction performs:

  1. CREATE / CREATE2
  2. Writes code to state
  3. Immediately performs CALL to the created address

But:

  • Child execution context does not see the deployed code.
  • Call executes as if target is empty.
  • Gas accounting under-charges.
  • Final balances diverge from expected EELS state.

This failure is invisible to standard unit tests unless gas and state continuity are explicitly validated.

Trigger

  • Manual: verify state continuity
  • Automatic (any single transaction):
  • CREATE → CALL
  • CREATE2 → CALL
  • CREATE → DELEGATECALL
  • TSTORE → CALL
  • SSTORE → CALL

Preconditions

  • Transaction-scoped execution
  • Nested execution contexts / overlays
  • Ability to inspect:
  • Code
  • Storage
  • Gas accounting
  • Frame hierarchy

Core Invariants

1. Code Visibility Invariant

If code is written at address A at time T, then: GetCode(A) MUST return non-empty for all execution frames at time > T within the same transaction.

Violation ⇒ FAIL

2. Overlay Inheritance Invariant

Every child execution frame must:

  • Inherit parent overlay state
  • Not fork from base/global snapshot
  • Preserve:
  • Code hashes
  • Storage roots
  • Warm slot sets

Unexpected divergence ⇒ FAIL

3. Gas Propagation Sanity Check

For any CALL:

  • If target address has non-empty code: Child execution must consume gas.
  • If total gas charged equals base cost only (e.g., 2600): Flag as probable invisible execution.

This check is heuristic but high-confidence.

4. Write-Then-Read Consistency

Detect patterns:

  • SetCode → GetCode
  • SSTORE → SLOAD
  • TSTORE → TLOAD

If a read does not observe a prior write within the same transaction, fail immediately.

Output

PASS
json
{
"status": "PASS",
"frames_checked": 7,
"mutations_verified": 14
}
FAIL
json
{
"status": "FAIL",
"failure_type": "state_overlay_inconsistency",
"address": "0x05d4acfafec9c8ac000000000000000000000000",
"symptoms": [
"CALL charged base gas only",
"child execution gas == 0",
"deployed code invisible"
],
"root_cause_hint": "Subcall created fresh overlay without inheriting parent state"
}

Severity

  • Critical
  • Silent gas mis-accounting
  • Invalid execution semantics
  • Potential consensus divergence
  • Auto-block recommended

Integration

SkillRole
SKILL-007Requires invariants
SKILL-017Detects stuck execution
SKILL-018Hard pre-execution gate
SKILL-019Red-team scenario gen
SKILL-020Postmortem logging

Design Principle

State changes are meaningless unless they are observable.

Origin

Derived from: CS-001 — State Overlay Visibility Failure during CREATE2 → CALL execution.

This skill exists to prevent gas-math patches that mask state-propagation bugs.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sounder25/foundational-agent-skills/22-state-overlay-consistency/badge)](https://verified-skill.com/skills/sounder25/foundational-agent-skills/22-state-overlay-consistency)

Something wrong with this skill or its page? Tell us.