pactus-project / pactus

Pactus blockchain
https://pactus.org
MIT License
125 stars 137 forks source link

Transaction not going through/stuck #1379

Open aboka2k opened 1 week ago

aboka2k commented 1 week ago

I encountered a bug today when trying to Transfer some coins. I attempted to transfer from one of my Account to another Account on another node. The transaction initially appeared to go through, but after a long wait, nothing happened. Upon trying again, I received an "insufficient funds" error.

I checked pacviewer and found no record of the transaction. My node was synced at the time. After restarting the node, I try to send again, and I was able to successfully transfer the coins this time.

My suspicion is on: 1) Insufficient funds(not 100% sure as i didnt check exactly the decimals): I didn't have enough funds to cover the transaction fee, but the transaction still appeared to go through. This could indicate that transactions are not properly validated when the sender has insufficient funds. But somehoe it go through but not accepted by the chain, that is why it is stucked.

2) Rate limitation: The default rate limit for broadcasting transactions is 5 per second. If exceeded, messages might be consumed but not delivered. This could explain why the transaction was not registered on the chain.

Windows 10 Home 64bit GUI v1.2.0

Thank you,

b00f commented 4 days ago

We have implemented a rate limitation on broadcasting transactions. By default, it is set to 5 transactions per second. This means that if I receive more than 5 transactions per second, I will consume the messages myself but won't deliver them to others.

Here, you probably have more than 5 transactions per second: one is yours, and the other 4 are from others, like sortition, etc. Simply say in very random occasion transaction won't commit or commit too long.

One way to fix this issue is to check if we have sent the transaction; then we don't apply the rate limit. This approach is challenging, since we have no information at that level to identify the original sender of the transaction.

aboka2k commented 3 days ago

We have implemented a rate limitation on broadcasting transactions. By default, it is set to 5 transactions per second. This means that if I receive more than 5 transactions per second, I will consume the messages myself but won't deliver them to others.

Here, you probably have more than 5 transactions per second: one is yours, and the other 4 are from others, like sortition, etc. Simply say in very random occasion transaction won't commit or commit too long.

One way to fix this issue is to check if we have sent the transaction; then we don't apply the rate limit. This approach is challenging, since we have no information at that level to identify the original sender of the transaction.

Ok i think frist we need to try find out the real cause for this. And if its really bcoz of what you suggest here, will it be possible to check if the transaction is from myself or external, or maybe it will wait for awhile and check if my trsaction has gone through, if not re-send? im not sure, since im not a dev or really understand how it works under the hood. Thanks.

b00f commented 1 day ago

One simple solution for this issue is to check the sender of the message. If it comes from self-ID, we can always propagate the message even if the rate limit is exceeded.

aboka2k commented 1 day ago

One simple solution for this issue is to check the sender of the message. If it comes from self-ID, we can always propagate the message even if the rate limit is exceeded.

Is this the more probable reason for this? Any chances it be due to insufficient fees?

b00f commented 4 hours ago

I don't think so because the fee is checked at the time of sending the transaction. This issue appears when it seems like you've sent the transaction but it wasn't broadcasted.

aboka2k commented 4 hours ago

I don't think so because the fee is checked at the time of sending the transaction. This issue appears when it seems like you've sent the transaction but it wasn't broadcasted.

Okay, cool. Hope it will be implemented soon. I'll update here if I find out anything new. Thank you.