LF-Decentralized-Trust-labs / paladin

Programmable privacy for EVM
https://lf-decentralized-trust-labs.github.io/paladin
Apache License 2.0
17 stars 6 forks source link

Allow events to be grouped by blockchain transaction #194

Open awrichar opened 2 months ago

awrichar commented 2 months ago

The behavior of the block indexer currently builds a stream of all events coming from all blockchain transactions, and then streams those events in batches to any matched listeners. For a blockchain transaction that emits multiple events, there is no guarantee about how a batch will break - during high throughput when batches are being completely filled, it's possible that a batch could break up events from a single transaction into two different batches.

There are some cases where it may be useful or necessary for an event stream listener (either internal or external) to combine information from two events in the same transaction. The easiest way to enable this type of processing would be to guarantee that batches will never break up events from a transaction.

Some detail questions are also implied:

  1. Should this be an always-on behavior, or configurable?
  2. What happens if a single transaction emits more events than the configured batch size? Which behavior takes precedence?
  3. Should event streams continue to deliver a flat stream of events, or should the events be organized into transaction groupings?
  4. If a transaction emits multiple events, but only 1 matches a given event stream, should that stream deliver only the matched event, or should it automatically include the other events from the same transaction as well?
github-actions[bot] commented 22 hours ago

This issue is stale because it has been open 30 days with no activity.