tendermint/abci

Clarify use of "index" in Query response

mdyring opened this issue · 3 comments

Hi guys,

Can you clarify what the intended usage of "index" in ResponseQuery is?

I noticed it is set to -1 in the kvstore example if proof is requested, otherwise not set.

I am primarily concerned if this will be required for IBC down the line.

BR,
Martin

See https://github.com/tendermint/abci/blob/master/specification.rst#query:

Index (int64): The index of the key in the tree.

This is simply the index of the key in the tree (ie. assuming keys are ordered and you can iterate through them, this is the index in that iteration). I don't think we need it for IBC.

Please re-open if you need more clarity

@mdyring I found the source of your frustration, it was throwing me off too because it was not in the tutorial. Line 107 in kvstore.go says resQuery.Index = -1 // TODO make Proof return index

If it is not used (and no plans to do so), I'd suggest removing it for now and then adding it later on if the need arises.