Skip to content

Store events, add a read_event method.#2309

Closed
afck wants to merge 5 commits intolinera-io:mainfrom
afck:event-storage
Closed

Store events, add a read_event method.#2309
afck wants to merge 5 commits intolinera-io:mainfrom
afck:event-storage

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
@afck afck mentioned this pull request Feb 12, 2025
afck added a commit that referenced this pull request Feb 12, 2025
## Motivation

We want to use event streams for committee changes to address the admin
chain's scalability issues. Ultimately we want to replace pub-sub
channels with event streams entirely. (#365)

## Proposal

Write committed blocks' events to storage.

## Test Plan

This doesn't use them yet, and just ports parts of
#2309 to `main`, so we
don't have to rebase them again in the future. CI should catch any
regressions, and the event functionality itself will be tested in
upcoming PRs, when events are actually used.

## Release Plan

- Nothing to do / These changes follow the usual release cycle.

## Links

- Porting parts of #2309.
- Related to #365.
- [reviewer
checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
@afck afck closed this Mar 17, 2025
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