-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Robust transaction history implementation #1362
Comments
Confirmations are there to protect the wallet from funds getting reorged out primarily. Thats why they are handled differently than confirmed completed ones. So the block confirmation is a user-set config option, that can be set to 0 for the universe wallet. That means you get all the confirmed as confirmed right from get go. BUT this will lead to some lost funds as coinbase transactions are the only transactions that cannot be reoerged. They are locked to a block. This is a problem for us as we have many 1 block reorgs. Sp TLDR, think carefully about just displaying rewards as gotten as soon as a block is mined. That block might be reorged out and the user will "loose" funds. That might lead to some false reports of wallets losing funds. |
FYI:
|
I completely agree. At present, we utilize |
But note in the code, I checked, |
I'll try to win some blocks and let you know about |
Looks like you're right 👍
|
Just a note on the view only wallet used in universe, this wallet most interacts with the block chain and never with another wallet. So you only time you will see not yet mined transactions are when they are reorge out. But if the mined in block and mined timestamp are null, or 0, the tx is completed but not yet mined, aka not in the block chain |
What's wrong with the current implementation?
minotari_console_wallet
's grpc service only exposes theget_completed_transactions
request, which streams all transactions in an unordered manner. This poses a challenge, especially for users with a large number of transactions (for instance, Mike currently has around 1500). We need to fetch them all and sort on our side. When we want to refresh the tx history, we have to to refetch all transactions and sort them again.2. As the name implies,(Edit: turned out we receive status 12, not sure why we had an issue with this then)get_completed_transactions
returns only confirmed transactions. When a user mines a block, they almost immediately see a winning animation and a balance update; however, the transaction history is only updated after three confirmations. To face this issue, we can only usestream_transaction_events
to handle unconfirmed transactions on our own. This adds a lot of complexity. We would need to store unconfirmed transactions separately, wait for confirmations and refetch them as confirmed ones. It's possible, but seems unreasonable to do, since it's exact copy of whatminotari_console_wallet
does.What we want to achieve?
What we can do?
We can use
stream_transaction_events
to refetch tx historyThe text was updated successfully, but these errors were encountered: