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

comet RPC for /tx doesn't seem to be working #4354

Open
tzemanovic opened this issue Feb 7, 2025 · 6 comments
Open

comet RPC for /tx doesn't seem to be working #4354

tzemanovic opened this issue Feb 7, 2025 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@tzemanovic
Copy link
Member

This requires Comet config to have tx indexer enabled (e.g. set to "kv"), but even with that it doesn't seem to work. We need to figure out why and add a test coverage for it

@tzemanovic tzemanovic added the bug Something isn't working label Feb 7, 2025
@tzemanovic tzemanovic self-assigned this Feb 7, 2025
@yito88
Copy link
Member

yito88 commented Feb 7, 2025

Note: Indexing was disabled #1278 because the disk space was occupied by the index.

@brentstone
Copy link
Collaborator

Ah! So can a node still simply re-enable indexing with the --tx-index arg to namadan ledger run in addition to the kv arg in the config?

@yito88
Copy link
Member

yito88 commented Feb 7, 2025

The option --tx-index has been removed in 4ccb9cf

@tzemanovic
Copy link
Member Author

Yup, the indexer is now controlled directly via comet section of the config. By default it's disabled and then the /tx endpoint returns an error message saying it has to be enabled. When you enable it and then submit another tx, it returns an error that it's not able to find it

@tzemanovic
Copy link
Member Author

The issue is that our tx hash no longer matches CometBFT tx hash

@tzemanovic
Copy link
Member Author

The /tx endpoint doesn't contain any useful information even when you use the CometBFT tx hash to find it (besides block height), because this information is being filled in with default in our ABCI++ shim layer. That means that this cannot be improved until we upgrade CometBFT (#4156) at which point it would be beneficial to ensure that Namada tx hash matches CometBFT hash and to return txs' events in the FinalizeBlock response. Additionally, we should attach the inner tx hash attribute to the events (at protocol level) to disambiguate tx association in batched txs.

To query tx and its events in the meantime one can either:

  1. Use namadac tx-result to find the tx result (or namada_sdk::rpc::query_tx_status in code). These events are stored in Namada state and are not persisted on e.g. node restart. This also only finds the tx/applied events, but not other events that may be emitted by a tx
  2. Use CometBFT /block_results?height={tx_applied_height} to find all the events emitted in this block. The events emitted by the tx in question can be found in the end_block_events field, following the tx application order. The relevant event has "type": "tx/applied" and { "key": "hash", "value": "{tx_hash}"} with the matching tx_hash. IF there are other relevant events they will be directly preceding this event, following any previous "tx/applied" event (if any)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants