hirosystems / explorer

Explore transactions and accounts on the Stacks blockchain. Clone any contract and experiment in your browser with the Explorer sandbox.
https://explorer.hiro.so/
MIT License
136 stars 102 forks source link

Display and label transactions with dropped_stale_garbage_collect as "expired" #578

Open GinaAbrams opened 2 years ago

GinaAbrams commented 2 years ago

I clicked this link and initially it showed me the transaction history, but then I clicked again and it's showing a blank page: https://explorer.stacks.co/txid/0x839e9ef7f6ca2858e3d9e31bb057bee72b11f413e26f001b28287b91133079bc?chain=mainnet

Any ideas why that might happen?

fbwoolf commented 2 years ago

Any ideas why that might happen?

Did you by chance do a replace by fee?

GinaAbrams commented 2 years ago

I was just trying to see the tx history, but I did ask the user if they could provide additional context.

beguene commented 2 years ago

I think this is because it was not included in the main chain (the longest chain) which can happen sometimes. This transaction has therefore been 'dropped' https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/0x839e9ef7f6ca2858e3d9e31bb057bee72b11f413e26f001b28287b91133079bc

GinaAbrams commented 2 years ago

What is our advice to users experiencing this?

GinaAbrams commented 2 years ago

Another one: https://explorer.stacks.co/txid/d602a022ede49ebe4ba8830dff0249e615a7ecd3f59a59649f422c84a0aa705a?chain=mainnet

fbwoolf commented 2 years ago

I feel like we should address this by providing better feedback in the UI on this page? We handle a few tx_status states but don't currently catch tx_status: dropped_stale_garbage_collect. Tbh, I don't know a lot about what this means to make a suggestion. @zone117x what feedback can we provide the user in the explorer on these dropped transactions?

diwakergupta commented 2 years ago

I think this is because it was not included in the main chain (the longest chain) which can happen sometimes. This transaction has therefore been 'dropped' https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/0x839e9ef7f6ca2858e3d9e31bb057bee72b11f413e26f001b28287b91133079bc

I think we're conflating pending transactions that get dropped from the mempool after 256 blocks, with transactions that are confirmed but are not on the canonical fork. These are distinct issues.

All transactions in this issue are in the former category.

I clicked this link and initially it showed me the transaction history, but then I clicked again and it's showing a blank page: https://explorer.stacks.co/txid/0x839e9ef7f6ca2858e3d9e31bb057bee72b11f413e26f001b28287b91133079bc?chain=mainnet

Any ideas why that might happen?

This transaction had a bad nonce nonce of tx 839e9ef7f6ca2858e3d9e31bb057bee72b11f413e26f001b28287b91133079bc is 19 (expected 14) and was eventually dropped. User could have corrected the nonce gap.

Another one: https://explorer.stacks.co/txid/d602a022ede49ebe4ba8830dff0249e615a7ecd3f59a59649f422c84a0aa705a?chain=mainnet

This transaction just wasn't picked up due to other, more expensive contract calls in the mempool. User could have attempted RBF with higher fee.

beguene commented 2 years ago

Thanks for the explanation, this makes sense! Since we have the info from the api that the tx is 'dropped_stale_garbage_collect' we could very well display a better message than 'not found'. This should be an improvement , @andresgalante @markmhx I am adding this to the backlog.

zone117x commented 2 years ago

To give some more context around tx_status: dropped_stale_garbage_collect, see: https://github.com/blockstack/stacks-blockchain/blob/master/docs/event-dispatcher.md#post-drop_mempool_tx

StaleGarbageCollect - transaction was dropped because it became stale

As @diwakergupta said, this happens after a tx has been in the mempool for over 256 blocks.

I agree a better UI could be shown for this condition.

markmhendrickson commented 2 years ago

Related: https://github.com/hirosystems/explorer/issues/572

markmhendrickson commented 2 years ago

@eugeniadigon mentioned it could make sense to update the wallets with a transaction state that reflects expiration / dropped_stale_garbage_collect as well

ginny-d commented 2 years ago

Is there anything pending to do here? Or is this issue covered in #1899?

Do we need the 'blank' (transaction expired) page for the Explorer?

ginny-d commented 2 years ago

Went ahead and designed it: https://www.figma.com/file/31q1g27k69z1yXb6r6vrRD/Explorer?node-id=3485%3A18858

Please advise for the correcting wording... :)

markmhendrickson commented 2 years ago

I've tweaked the copy a bit here. Should we add a "Learn more" as well for documentation about expirations?

Screen Shot 2021-11-22 at 11 59 16
gregorycoppola commented 2 years ago

Can the API just remember the transactions that got dropped?

That way, the user gets more information about what happened, and the whole system looks more robust, because we know we can remember things and things are not just getting dropped.

Seems like there are not going to be too many of these to store.

zone117x commented 2 years ago

Can the API just remember the transactions that got dropped?

It does store them. The only time they get lost is if the stacks-node event data changes and we do a full re-sync, dropped mempool txs don't exist anywhere after that.

BLuEScioN commented 1 month ago

@andresgalante Should we close this? I think the ask here is to show more detailed information and better explainers for txs, similar to #1408. In that case, we can reference this in the task we have for the redesign?