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

cometindex: make transactions available in event batches #5097

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

cronokirby
Copy link
Contributor

The raw ABCI event database already has all the transaction data, and this PR amends our processing pipeline in cometindex to present blocks containing both a list of events, each of which may directly have all of this transaction data (along with a transaction hash), and a list of all the transactions themselves.

This also refactors things to be a bit more opaque, giving us more control over the internal representation of the batch of events.

The ContextualizedEvent struct is probably a little over-engineered, but avoids needlessly copying the transaction data around. Ultimately the performance of indexing is tied to data throughput, so we should be mindful of needless copying in the architecture.

This should help with the draft in #5081, avoiding the need for creating a bespoke event.

I tested this by setting up a little indexer just parsing out the tx data and serializing the JSON, and

Checklist before requesting a review

  • I have added guiding text to explain how a reviewer should test these changes.

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Indexing code changes only

This also refactors things to be a bit more opaque, giving us more control
over the internal representation of the batch of events.

The ContextualizedEvent struct is probably a little over-engineered,
but avoids needlessly copying the transaction data around. Ultimately
the performance of indexing is tied to data throughput, so we should be mindful
of needless copying in the architecture.
Copy link
Member

@erwanor erwanor left a comment

Choose a reason for hiding this comment

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

Nice

@cronokirby cronokirby merged commit fbb124d into main Feb 18, 2025
9 checks passed
@cronokirby cronokirby deleted the cronokirby/cometindex-transactions branch February 18, 2025 16:54
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