Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[moveos_std] Improve the event queue, trigger OffChainEvent sametime #2484

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

jolestar
Copy link
Contributor

Summary

follow #2476

  1. Only create the event queue when the first subscriber subscribes to it to reduce the number of EventQueue objects.
  2. Trigger an OffChainEvent when OnChainEvent emits; the developer can merge OnChain and OffChain events.

Leave a break change to #2402

Copy link

vercel bot commented Aug 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 21, 2024 3:14pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rooch ⬜️ Ignored (Inspect) Aug 21, 2024 3:14pm

Copy link

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

@@ -27,16 +29,31 @@ module moveos_std::event_queue {
emit_time: u64,
}

/// The off-chain event
/// Every on-chain event also trigger an off-chain event
struct OffChainEvent<E> has copy, drop, store {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the different between OnChainEvent and OffChainEvent?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OffChainEvent emit via event::emit, OnChainEvent store on chain.

@jolestar jolestar merged commit 542aea1 into main Aug 23, 2024
8 checks passed
@jolestar jolestar deleted the refactor_event_queue branch August 23, 2024 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants