Skip to content

Implement Event Emission Optimizations #1488

Description

@Shredder401k

Difficulty: Medium
Type: Optimization

Summary

Optimize event emissions to reduce gas costs while maintaining necessary information for indexers.

Current Behaviour

Events include all data, may be verbose.

Expected Behaviour

Events include only essential data. Use topics efficiently. Minimize event size.

Suggested Implementation

  • Use symbol_short for topics (max 9 chars)
  • Include only essential data in event body
  • Reference stream_id instead of full stream data
  • Use compact data types where possible
  • Consider off-chain indexing for detailed data

Files or Areas Likely Affected

  • contracts/Contract-V1/src/lib.rs (optimize event emissions)

Acceptance Criteria

  • Audit all event emissions
  • Identify optimization opportunities
  • Minimize event data size
  • Use short topics (<= 9 chars)
  • Remove redundant data
  • Essential data still available for indexers
  • Measure gas savings
  • At least 5% reduction in event emission costs
  • Indexers can still function properly
  • Rustdoc explains event structure

Additional Notes

Events are for off-chain indexing. Include minimum necessary data. Large events waste gas.


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions