indexer icon indicating copy to clipboard operation
indexer copied to clipboard

Getting blocks from the indexer (and not algod), not possible to determine asset destruction

Open algorandthm opened this issue 4 years ago • 1 comments

Subject of the issue

When getting blocks from algod, if "apar" is missing that means destruction. Great! However, when getting blocks from indexer, "params" is always present, and it's not possible to distinguish modification/destruction.

Please see conversation here: https://forum.algorand.org/t/indexer-block-query-asset-destruction/5313/3

Fabrice from the Algorand Foundation agrees this is most probably an issue.

Your environment

irrelevant, you can see this using algoexplorer.io indexer (block) vs algod (block).

Steps to reproduce

  1. Find an asset that was destroyed, see that algod for that block has empty "apar", indexer has populated "params".
  2. Modify an asset to remove all values (clawback, reserve, manager, etc...) and see that getting blocks from the indexer this is indistinguishable from destruction.

Expected behaviour

Any way to distinguish destruction. Either deleted=false, or the "params" section missing (like "apar" for algod) or changing the indexer so modifications report actual quantity (and not zero) and turn that to zero do signal destruction. So, any way would do. I suppose if many are de-referencing the "params" removing it might cause issues and maybe the latter suggestion might help there .

Actual behaviour

Modification removing all modifiable parameters is undistinguishable from destruction, that is getting block from the index (not asset, the block, and looking at asset configuration tx).

Acceptance Criteria

  • Review the current behavior, and the API specification.
  • Propose a solution and how it would effect the spec, Indexer and the SDKs.
  • Create a followup issue to implement the proposal.

algorandthm avatar Dec 06 '21 16:12 algorandthm

This suggestion makes sense to me. In the meantime, you can also use the closed_at field to identify whether the asset has been deleted.

winder avatar Jan 10 '22 16:01 winder