Skip to content

[CORE] Implement EIP-1153 Transient Memory State Rollback Guard #694

Description

@mijinummi

Labels: high-difficulty, solidity, eip1153, gasguard
Difficulty: High
Module: contracts/security/


🧠 Concept

Construct a lightweight transactional state rollback system that tracks modified storage slots using EIP-1153 transient storage (TSTORE/TLOAD) to restore original states if sub-calls fail.

⚠️ Problem

Manual state restoration in complex workflows requires writing original values back to persistent storage (SSTORE), incurring high gas costs if state changes must be reverted.

📁 Implementation Scope

  • contracts/security/TransientStateSnapshot.sol
  • test/security/TransientStateSnapshot.test.ts

🛠️ Requirements

  1. Record original storage values to transient storage slots using tstore before state mutations.
  2. On execution failure, restore state values from transient storage back to persistent storage slots.
  3. Automatically clear transient tracking state upon transaction completion.

🎯 Acceptance Criteria

  • Provides efficient, low-gas state snapshotting and rollback functionality for multi-step operations.
  • Gas costs are significantly lower than persistent storage snapshot approaches.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions