Skip to content

[CORE] Build Low-Level Assembly Batch Event EmitterΒ #723

Description

@mijinummi

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


🧠 Concept

Implement a low-level event logging utility in Yul assembly that emits batch execution summaries using raw log1, log2, or log3 opcodes.

⚠️ Problem

Emitting events in high-frequency loops using standard Solidity syntax allocates memory and executes repeated ABI encoding for each log item.

πŸ“ Implementation Scope

  • contracts/events/BatchLogEngine.sol
  • test/events/BatchLogEngine.test.ts

πŸ› οΈ Requirements

  1. Construct topic arrays and log payload buffers directly in scratch memory (0x00--0x40).
  2. Trigger event logging using the inline assembly opcode log2(memPtr, size, topic1, topic2).

🎯 Acceptance Criteria

  • Emits batched operational logs with significantly lower gas usage per event.
  • Emitted logs match expected topic structures in indexer simulations.

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