mx-api-service icon indicating copy to clipboard operation
mx-api-service copied to clipboard

[Bug]: transactions filter

Open bogdanIuga opened this issue 3 years ago • 4 comments

Contact Details

[email protected]

Description

status filter not working

Steps to reproduce

Status filter does not work. I set it to get only success transactions, but I also get pending transactions

  1. go to api.elrond.com
  2. go to GET /transactions
  3. set status filter to success
  4. execute
  5. look in the response until a pending transaction is returned

Please check if the same issue happens to GET transactions/count

image

On which network is the bug manifesting itself?

Mainnet

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

bogdanIuga avatar Jul 31 '22 18:07 bogdanIuga

Hello!

Indeed, this is confusing.

The reasoning behind this is that actually pending transactions are actually transactions with status success, but are still awaiting results from cross-shard smart contracts.

If you quickly look up the transaction on index.elrond.com or on gateway.elrond.com, you will see it actually has the status success. We are actually setting the status on pending artificially on api.elrond.com level, so that we know that the given transaction still has something to execute.

Will open some discussions internally so that we might get the cross-shard-scr-pending status directly in the indexer, then we can filter by success as expected.

tanghel avatar Aug 09 '22 07:08 tanghel

the pending status from the API turns into a failed status... just caught this case.

So the status filter is useless for the APIs

Any updates?

bogdanIuga avatar Aug 17 '22 08:08 bogdanIuga

a transaction has status pending while it is being processed, then the status changes to "success", "failed", etc.

the indexer team is already working on providing the real transaction status in the elasticsearch, thus solving the "success as pending" transaction issue.

we would really appreciate to receive constructive criticism and focus on the issues at hand.

tanghel avatar Aug 17 '22 16:08 tanghel

I'm sorry for that, it was a long and very frustrating day...

We'll refactor to get the transactions with a delay of ~1 minute using the timestamp filter and see how it goes.

bogdanIuga avatar Aug 23 '22 07:08 bogdanIuga