ain icon indicating copy to clipboard operation
ain copied to clipboard

Include block height in RPC responses

Open pawn-police opened this issue 3 years ago • 3 comments

What would you like to be added:

Specific requests where I would like to see the block height in the response:

  • listpoolpairs
  • listtokens
  • listauctions

Why is this needed:

It is currently impossible to determine at what block height a given response held true. If I request getblockcount before and after listpoolpair I still end up with cases where the true block height of the listpoolpair response can not be determined because the final call to getblockcount returned a higher block height.

Having the true block height in the response will be really helpful during analysis because there won't be any entries where the block height is undetermined.

pawn-police avatar Oct 06 '22 22:10 pawn-police

@pawn-police: Thanks for opening an issue, it is currently awaiting triage.

The triage/accepted label can be added by foundation members by writing /triage accepted in a comment.

Details

I am a bot created to help the DeFiCh developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the DeFiCh/oss-governance-bot repository.

defichain-bot avatar Oct 06 '22 22:10 defichain-bot

Thanks for this. This would actually be super useful to apply for all of the rpc responses, but requires breaking change. So, the current plan is to address this as a part of rpc v2, which is a planned full design with established conventions - the current rpcs will not however be taking on these changes, and there are many consumers of these APIs, and we'll likely just leave these APIs as it is.

prasannavl avatar Oct 13 '22 23:10 prasannavl

I understand that a change of contract would impact too many consumers. Perhaps the block height can be included in a response header as an intermediate solution?

pawn-police avatar Oct 14 '22 02:10 pawn-police