Found a bug for get_actions rpc api?
Hi, I am doing stress testing on Jungle testnet for the exchange wallet product. Here is what I did:
- run a script which continuously (every second) deposits 100 times to the exchange hot wallet
- at the same time, the exchange wallet system keeps running and use get_actions rpc api to fetch new actions and save them to database if there is any.
From my observation, there are always some actions that were missed to be saved in the database. Then I found out it is because the second my system fetching new actions, some of them have the same transaction hash as the previous actions and my code does not save the actions with the duplicate hash into the database. However, if I wait approximately one minute and use the get_actions rpc api to fetch the 100 actions, those actions that have the duplicate hash were corrected to another unique hash which exactly match the tx hash as the script sign and broadcast the tx. To sum up, The account actions may have the wrong trx_id when the tx were just broadcasted.
The tx hash of the action my coding is looking at is: "action" -> "action_trace" -> "trx_id"
I figured this might be a bug for get_actions rpc api. If it is not, How could I avoid this problem?
If you send action with exactly same parameters at an almost similar time, your transaction id is very likely to the same since they share the same params, ref block, expiration time, etc. You might try to force your transactions to be unique by putting a different value each time on your action params (e.g. memo field). Or if you don't have any param in your action that can be variable, you can embed an eosio nonce action with a different value each time in your transaction.
We haven't received any update for this. If you still have the problem and wish to discuss further, please post it in https://eosio.stackexchange.com.