Skip to content

kvindexer: Remove event type from block event #571

Closed

Description

@jmalicevic

Feature Request

By introducing FinalizeBlock in v0.38.x, all block events will be returned in ResponseFinalizeBlock. Previously,
the events were returned from both BeginBlock and EndBlock. The indexer would then store the type of the function the event belongs to. With FinalizeBlock replacing them, the current events are indexed with one type of function, thus storing this information is redundant and useless, while taking storage space.

We propose removing the finalize_block value from the event key.

Summary

The information about the event function type should be removed from the event keys in the block indexer.

Problem Definition

Implementing this, removes extra bytes from the event key. THis might prove to have a significant impact as the indexer is anyways taking up a lot of storage.

The only possible disadvantage is supporting events indexed with older version (pre v0.38.x). Those events will contain event function type in their keys. But this can dealt with by accounting for that extra information on traversal. Potentially, we could offer the users the option to re-index the data and set a flag that the data is re-indexed. This would avoid checking for the parameter on every record.

Proposal

Indexing: Remove the typ parameter from the composite key in the Index method in state/indexer/block/kv/kv.go.

Querying: In all the functions that read the events from the database, implement a check whether the typ value exists or not. Ignore it if it does.

Potential improvement: Enable users t oconfigure a flag saying that the data indexed does not have typ stored so we can avoid the check described above.

DoD

  • Even function type removed
  • Queries work with data indexed with older version and data indexed with new versions

Activity

  1. added
    enhancement
    needs-triage
    on Mar 23, 2023
  2. added this to the 2023-Q1 milestone on Mar 23, 2023
  3. self-assigned this
    on Mar 23, 2023
  4. removed
    needs-triage
    on Apr 3, 2023
  5. modified the milestones: 2023-Q1, 2023-Q2 on Apr 13, 2023
  6. moved this from Todo to Ready for Review in CometBFT 2023on Apr 19, 2023
  7. moved this from Ready for Review to Done in CometBFT 2023on Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementindexerstorage

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions