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

Store events, add a read_event method. #2309

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

afck
Copy link
Contributor

@afck afck commented Jul 25, 2024

Motivation

Event streams will soon replace broadcast channels, and also enable other blockchains to more easily interpret Linera data, e.g. to facilitate bridges.

Proposal

Introduce a new type:

struct EventId { 
  chain_id: ChainId,
  stream_id: StreamId, // (<applicationId>, <streamName>) tuple
  key: Vec<u8> // index of the event in the particular stream
}

Add Event(EventId, Vec<u8>) variant to OracleResponse.

Collect events from the executed block and store them in storage.

Add a read_event(event_id) method to the contract and service runtimes.

Test Plan

TBD

Release Plan

  • Need to bump the major/minor version number in the next release of the crates.
  • Need to update the developer manual.

Links

@deuszx deuszx marked this pull request as ready for review October 10, 2024 10:52
@ma2bd ma2bd marked this pull request as draft October 27, 2024 23:42
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