[GH-ISSUE #2392] [Feature] Solidity: inspect and compare compiler storage layouts without inferring live state #801

Open
opened 2026-10-15 18:28:35 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @matbrgz on GitHub (Oct 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2392

Type: Feature Domain: Blockchain RE Status: Proposed Ecosystem: REA

Analyst question and current gap

The current EVM interface profile does not expose Solidity storage layouts. An analyst comparing two builds needs typed slot/offset facts and specific layout changes without treating them as observed chain state or a proven safe upgrade.

Proposed outcome

  • Consume caller-selected compiler storageLayout and transientStorageLayout artifacts, retaining source/contract/build identity and unsupported schema versions.
  • Preserve arbitrary-width slots, packed byte offsets, type references, inherited declarations, struct fields, array/mapping structure and recursive references.
  • Compare explicitly paired layouts with explanations for moved, removed, added and type-changed fields; do not infer semantic upgrade safety from equal slot coordinates.
  • Keep persistent versus transient storage distinct. Report partial/unknown type coverage and unresolved build association.
  • Provide focused CLI/MCP inventory and comparison with bounded traversal and stable paging.

Acceptance and verification

  • Own compiler-pinned fixtures cover packing, inheritance, structs, mappings, dynamic arrays and admitted transient-layout output.
  • Malformed type graphs, cycles, oversized slot values and missing type references remain bounded and lossless.
  • A changed packed field, inheritance order and storage type produce specific deltas.
  • No RPC or storage-value acquisition occurs; same layout does not produce a claim of equivalent execution.
  • Record one feature specification, one implementation plan and incremental tasks under docs/specs/solidity/storage-layout/ before code.

Scope and relationships

Independently scoped follow-up to roadmap #972 and existing EVM interface PR #1051; parent TIOBE language tracker #2383. Initial analysis uses caller-selected local evidence and owned fixtures. New provider choices require the explicit CONTRIBUTING.md maintainer decision before substantial implementation for integration. Runtime acquisition, local execution and blockchain mutation are not implicit parts of this feature.

Primary references

Originally created by @matbrgz on GitHub (Oct 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2392 [![Type: Feature](https://img.shields.io/badge/type-feature-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Domain: Blockchain RE](https://img.shields.io/badge/domain-blockchain_RE-orange.svg?style=flat-square)](https://github.com/morluto/rea) [![Status: Proposed](https://img.shields.io/badge/status-proposed-blue.svg?style=flat-square)](https://github.com/morluto/rea) [![Ecosystem: REA](https://img.shields.io/badge/ecosystem-morluto%2Frea-8A2BE2.svg?style=flat-square)](https://github.com/morluto/rea) ## Analyst question and current gap The current EVM interface profile does not expose Solidity storage layouts. An analyst comparing two builds needs typed slot/offset facts and specific layout changes without treating them as observed chain state or a proven safe upgrade. ## Proposed outcome - Consume caller-selected compiler storageLayout and transientStorageLayout artifacts, retaining source/contract/build identity and unsupported schema versions. - Preserve arbitrary-width slots, packed byte offsets, type references, inherited declarations, struct fields, array/mapping structure and recursive references. - Compare explicitly paired layouts with explanations for moved, removed, added and type-changed fields; do not infer semantic upgrade safety from equal slot coordinates. - Keep persistent versus transient storage distinct. Report partial/unknown type coverage and unresolved build association. - Provide focused CLI/MCP inventory and comparison with bounded traversal and stable paging. ## Acceptance and verification - [ ] Own compiler-pinned fixtures cover packing, inheritance, structs, mappings, dynamic arrays and admitted transient-layout output. - [ ] Malformed type graphs, cycles, oversized slot values and missing type references remain bounded and lossless. - [ ] A changed packed field, inheritance order and storage type produce specific deltas. - [ ] No RPC or storage-value acquisition occurs; same layout does not produce a claim of equivalent execution. - [ ] Record one feature specification, one implementation plan and incremental tasks under docs/specs/solidity/storage-layout/ before code. ## Scope and relationships Independently scoped follow-up to roadmap #972 and existing EVM interface PR #1051; parent TIOBE language tracker #2383. Initial analysis uses caller-selected local evidence and owned fixtures. New provider choices require the explicit CONTRIBUTING.md maintainer decision before substantial implementation for integration. Runtime acquisition, local execution and blockchain mutation are not implicit parts of this feature. ## Primary references - [Solidity storage-layout semantics](https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html)
Author
Owner

@matbrgz commented on GitHub (Oct 12, 2026):

Triage & Architectural Review Notes

Objective (ELI5):
Parse and visualize EVM contract storage layouts (storageLayout from solc) without connecting to a live blockchain network or querying live RPC state.

Key Requirements:

  1. Packing & Offsets: Correctly model continuous 32-byte slot assignments and byte offsets (offset: 0..31) for packed elementary types (uint128, bool, address).
  2. Dynamic Structures: Represent mappings and dynamic arrays by their hashing derivations (keccak256(p . s)) as structural recipes rather than attempting runtime key enumeration.
<!-- gh-comment-id:6133845951 --> @matbrgz commented on GitHub (Oct 12, 2026): ### Triage & Architectural Review Notes **Objective (ELI5):** Parse and visualize EVM contract storage layouts (`storageLayout` from solc) without connecting to a live blockchain network or querying live RPC state. **Key Requirements:** 1. **Packing & Offsets:** Correctly model continuous 32-byte slot assignments and byte offsets (`offset: 0..31`) for packed elementary types (`uint128`, `bool`, `address`). 2. **Dynamic Structures:** Represent mappings and dynamic arrays by their hashing derivations (`keccak256(p . s)`) as structural recipes rather than attempting runtime key enumeration.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#801
No description provided.