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

zetacore : Discussion for emitting and indexing events #3464

Open
kingpinXD opened this issue Feb 4, 2025 · 0 comments
Open

zetacore : Discussion for emitting and indexing events #3464

kingpinXD opened this issue Feb 4, 2025 · 0 comments
Assignees
Labels
zetacore Issues related to ZetaCore

Comments

@kingpinXD
Copy link
Contributor

kingpinXD commented Feb 4, 2025

Key Points

  • The zeta core emits several events both from default cosmos modules and custom zetachain modules

  • The events are part of the blockchain state, and a separate index is maintained by comet-bft to query the events

    • Every app instance (Node) can choose which events to index; This can be set in app.toml
# IndexEvents defines the set of events in the form {eventType}.{attributeKey},
# which informs Tendermint what to index. If empty, all events will be indexed.
#
# Example:
# ["message.sender", "message.recipient"]
index-events = []
  • The event indexing uses a KV backend by default , but this can be changed to a PostgreSQL backend. Which might be beneficial for querying the events.This can be set in config.toml
[tx_index]

# What indexer to use for transactions
#
# The application will set which txs to index. In some cases a node operator will be able
# to decide which txs to index based on configuration set in the application.
#
# Options:
#   1) "null"
#   2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
# 		- When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
#   3) "psql" - the indexer services backed by PostgreSQL.
# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed.
indexer = "kv"

Recommendations

  • Index only events which are querying so that tx_index.db can be optimised.
  • Explore plsql backend for some nodes , it might improve query performance also make it easier to query the events.
  • Remove events which are unnecessary to help reduce the growth of the application state.
@kingpinXD kingpinXD added the zetacore Issues related to ZetaCore label Feb 4, 2025
@kingpinXD kingpinXD self-assigned this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zetacore Issues related to ZetaCore
Projects
None yet
Development

No branches or pull requests

1 participant