Skip to content

FEAT] Implement EIP-1153 TSTORE/TLOAD Temporary Context Cache #634

Description

@mijinummi

Labels: medium-difficulty, solidity, eip1153, gasguard
Difficulty: Medium
Module: contracts/cache/


🧠 Concept

Utilize EVM transient storage opcodes (TSTORE / TLOAD) to maintain intra-transaction calculation caches without writing to persistent storage slots.

⚠️ Problem

Writing intermediate execution calculations to persistent storage (SSTORE) and clearing them later costs far more gas than using transient storage.

📁 Implementation Scope

  • contracts/cache/TransientCache.sol
  • test/cache/TransientCache.test.ts

🛠️ Requirements

  1. Implement Yul wrappers for tstore(slot, val) and tload(slot).
  2. Cache intermediate exchange rates and fee benchmarks during complex execution pipelines.
  3. Ensure values flush automatically at transaction completion without residual gas overhead.

🎯 Acceptance Criteria

  • Replaces expensive storage writes with $100\text{ gas}$ transient operations.
  • Transient cache values persist across internal function calls within the same transaction.

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