Skip to content

[CORE] Implement Zero-Allocation Precompile Multi-Call Processor in Yul #693

Description

@mijinummi

Labels: high-difficulty, yul, cryptography, gasguard
Difficulty: High
Module: contracts/crypto/


🧠 Concept

Build an assembly batch engine that executes multiple signature verification operations (ecrecover) or modular exponentiations (modexp) sequentially within a single Yul execution loop.

⚠️ Problem

Executing multiple cryptographic checks sequentially using high-level Solidity wrappers repeatedly allocates and frees memory, accumulating significant memory expansion gas.

📁 Implementation Scope

  • contracts/crypto/BatchPrecompileProcessor.sol
  • test/crypto/BatchPrecompileProcessor.test.ts

🛠️ Requirements

  1. Maintain fixed-size input/output buffers in memory without invoking free memory updates.
  2. Call EVM precompiles (0x01 or 0x05) repeatedly within a Yul loop using staticcall.
  3. Aggregate results and return execution status flags atomically.

🎯 Acceptance Criteria

  • Batch cryptographic verification gas scales linearly without memory expansion penalties.
  • Accurately identifies failed validations in batch payloads.

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