thetatoken / theta-protocol-ledger

Reference implementation of the Theta Blockchain Ledger Protocol
https://docs.thetatoken.org/
GNU General Public License v3.0
362 stars 85 forks source link

BroadcastRawTransaction timeout on mainnet #169

Open jaydp17 opened 2 years ago

jaydp17 commented 2 years ago

Experiencing the same problem as #99 on mainnet.

There's one more issue about the same problem but on testnet #167

Most broadcasts take somewhere between 20 ~ 60s & about 50% of them timeout with the following error printed by the theta node

[2021-12-02 13:00:11] ERROR [rpc] HTTP request timed out: requestBody={"
{\\"jsonrpc\\":\\"2.0\\",\\"id\\":1,\\"method\\":\\"theta.BroadcastRawTransaction\\",\\"params\\":
[{\\"tx_bytes\\":\\"SOME_TX_BYTES\\"}]}"}

This happens on both v3.1.1 & v3.2.0

jieyilong commented 2 years ago

It could be because the node is sometimes out of sync with the network. Another option is to call theta.BroadcastRawTransactionAsync instead, and check if the tx is confirmed later:

https://docs.thetatoken.org/docs/rpc-api-reference#broadcastrawtransactionasync