Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Show collided transactions in Explorer #817

Closed
telezhnaya opened this issue Dec 14, 2021 · 15 comments
Closed

Show collided transactions in Explorer #817

telezhnaya opened this issue Dec 14, 2021 · 15 comments
Assignees
Labels
bug Something isn't working Priority_3

Comments

@telezhnaya
Copy link
Contributor

telezhnaya commented Dec 14, 2021

We have a sad story with transaction hash collisions both on mainnet and testnet near/near-indexer-for-explorer#84

We created the fix on Indexer side, now we are collecting collided transactions. One of the new transaction hashes is in the mainnet DB, its hash:

AUh97Kbbg962AfqnQTnmM7tSSy5rnczZ99xXNjAxkctL_issue84_35056813

But it's not possible to look at it on Explorer: https://explorer.near.org/transactions/AUh97Kbbg962AfqnQTnmM7tSSy5rnczZ99xXNjAxkctL_issue84_35056813 It is stored at block 35056813, it's not shown in the block info either.

All the collided hashes will have such format. We need to support these transactions.

@telezhnaya telezhnaya added the bug Something isn't working label Dec 14, 2021
@frol
Copy link
Collaborator

frol commented Dec 14, 2021

@shelegdmitriy well, there is no way to query the collided transaction via RPC yet, so there is no way to have a proper Transaction Details page before we actually expose the API to query it from nearcore (not any time soon, I believe), but let's at least see if we can do anything on the Block Details page since I would expect to see the transaction there: https://explorer.near.org/blocks/6Z5iLBjHzXZUsuC6iDTthXw2AYe32AmnbowKNgPtRJK9

@frol
Copy link
Collaborator

frol commented Dec 14, 2021

Account Details page does not show the transaction either: https://explorer.near.org/accounts/9807f85f65c59573d247ba3ef9a3fb3a7ff1cd5c33a851237c337127b486ecfb.

@shelegdmitriy Before you fix the issue, please, write your findings as to why Explorer does not get the transaction listed (maybe we will decide not to fix it right now and instead wait for Activities list that will change the way we query the data in the first place)

@shelegdmitriy
Copy link
Contributor

@frol ok, I'll take a look

@shelegdmitriy
Copy link
Contributor

Well, we still can show some transaction details. For now we collect all the data about transaction from two queries:

  1. from indexer (we receive signerId, receiverId, blockHash, blockTimestamp) (and those data also awailable for collided transaction);
  2. from rpc (we receive transaction_outcome, receipt, receipt_outcome and collect all receipts) (and this query actually fails for collided transaction);

So my first steps which I try:

  1. query for transactionInfo from indexer (success);
  2. check if thansaction is colleted (if query form indexer proceed I find substring "issue84" in transactionHash);
  3. if transaction is collided then I skip query to rpc and return transactionInfo as is

And here is what we actually could see:
Снимок экрана 2021-12-15 в 12 18 18

Next step is to clarify how we can display this transaction on the BlockDetails page in fact that we need a list of actions for it

@frol @telezhnaya

@shelegdmitriy
Copy link
Contributor

shelegdmitriy commented Dec 15, 2021

About transactionActions we can query for them from indexer transaction_actions table but for this transaction it returns nothing. So for now I don't know how we can display it on BlockDetails page. @frol @telezhnaya any thoughts?

@telezhnaya
Copy link
Contributor Author

I haven't read the implementation, maybe my idea is hard to achieve.
Is it possible to get the information and, in case of success, just show it?
The reasons of failure can be different. In any case, it's better to try to collect the info from the different sources and show everything that we can.
I don't like the idea with "if hash contains issue84". We have the hash containing issue
https://explorer.near.org/transactions/2LissueAY6kkb2Fjk5i1MmCw5dC4ZqbaDKNQwXBox681
It's a matter of time when we meet issue84
And the code with such ifs is hard to read and maintain

@telezhnaya
Copy link
Contributor Author

I suggest not to use transaction_actions table, we have an issue about removing it
near/near-indexer-for-explorer#176

@shelegdmitriy
Copy link
Contributor

I haven't read the implementation, maybe my idea is hard to achieve.

Is it possible to get the information and, in case of success, just show it?

The reasons of failure can be different. In any case, it's better to try to collect the info from the different sources and show everything that we can.

I don't like the idea with "if hash contains issue84". We have the hash containing issue

https://explorer.near.org/transactions/2LissueAY6kkb2Fjk5i1MmCw5dC4ZqbaDKNQwXBox681

It's a matter of time when we meet issue84

And the code with such ifs is hard to read and maintain

Ok, so "issue84" is not required for those transactions. Let me think about it ones again

@shelegdmitriy
Copy link
Contributor

I suggest not to use transaction_actions table, we have an issue about removing it

near/near-indexer-for-explorer#176

I just suggested that we can use it but it doesn't make any sense

@shelegdmitriy
Copy link
Contributor

@telezhnaya we can do as you said. I just need to make some fix. But still I can't get how we'll show this transaction on the BlockDetails page.

@telezhnaya
Copy link
Contributor Author

@shelegdmitriy
We use transaction_actions table for BlockDetails page, right? Is that an only problem?
Can you check whether it's possible to get rid of this usage? We anyway need to do that for near/near-indexer-for-explorer#176 in one day

@shelegdmitriy
Copy link
Contributor

@shelegdmitriy

We use transaction_actions table for BlockDetails page, right? Is that an only problem?

Can you check whether it's possible to get rid of this usage? We anyway need to do that for near/near-indexer-for-explorer#176 in one day

No, we don't use transaction_actions at all. We query for transactionStatus and transactionActions from rpc. So if there is no transactionActions we can't display it on BlockDetails page

@telezhnaya
Copy link
Contributor Author

Oh, I see. It's better to hear @frol opinion here.

Created the issue about missing entries in transaction_actions: near/near-indexer-for-explorer#214.

@shelegdmitriy
Copy link
Contributor

I discussed this with @frol and we decided to leave it as is because of several points:

  1. we can't resolve this issue fully because a lot of stuff we collect from rpc and there is no way to get it in another way;
  2. It's still a rare case so there will be very small amount of such transactions;
  3. the interpretation of transactions will change with new design.
    So there is no actions here
    @telezhnaya

@shelegdmitriy
Copy link
Contributor

I guess we can close this issue as we have the new interpretation of account details page

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

No branches or pull requests

3 participants