blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
373 stars 96 forks source link

when the network is down #61

Closed scottywm closed 2 years ago

scottywm commented 2 years ago

Hey thanks for answering all my questions.

In my last question I asked you what would happen to all the existing transactions that are in the process of getting executed and then suddenly the network goes down?

HERE IS MY QUESTION

These transactions were already being processed before the network crashed so would these pending transactions get rolled back or would they partially execute, leaving the transmitter 5%, 10%, 15% or 50% out of pocket? Or would these transactions stay in pending status until the network is up again ?

I already know that if the network is down new transactions won't happen, but that was not what i was asking. I'm wanting to know about what would happen to existing transactions that are in the process of being executed.

I'm building a platform that enables people to buy items using tether (USDT) on the Solana blockchain and its absolutely paramount that I understand what will happen to pending transactions when the network goes down because I don't want my users to be out of pocket when the network goes down and then get sued by my users and be liable for thousands of dollars or even go to jail.

The Solana network has gone down like seven times in the last 12 months so I really need to know what will happen to the current pending transactions if this event would occur again. It's very important and I really need an answer to this question otherwise I'm going to have to just use another blockchain network, which i don't want to have to do.

Thanks

yihau commented 2 years ago

Solana doesn't have a txpool like Ethereum. If your tx gets dropped unless someone resends it or it's never processed again.

scottywm commented 2 years ago

I don't understand what you are talking about.

All I'm asking is if the network goes down while transactions are being processed, what happens to those transactions?

Will they partially execute like 5% of the tokens get sent, will the transactions fail or will they stay in pending mode until the network is up again?

yihau commented 2 years ago

All I'm asking is if the network goes down while transactions are being processed, what happens to those transactions?

It is hard to answer it cuz there are lots of steps for a transaction to be processed. you can take a look at here

Will they partially execute like 5% of the tokens get sent

no. the result is either success or fail

scottywm commented 2 years ago

That is very good to know that the transaction will either fail or succeed, I'm relieved to learn this. thanks heaps :)

Also i implemented your advice on ACID transactions and it worked brilliantly so thanks again for that :)