In Conflux network, when sending a transaction via method
cfx_sendRawTransaction, if the transaction is not constructed correctly, the sending will fail. Some of the common errors are:
- using a nonce that has already been executed
- using a nonce that has already been sent to the transaction pool
There are also several other cases where sending fails:
- The chainId is under mismatch.
- epochHeight is too large
- gas exceeds 15 million (half of block gas limit)
- gas is less than 21000
- data is too large (exceeds 200K)
- gasPrice is set to 0
- Signature error
- Transaction pool is full
The following are the RPC errors returned by the
cfx_sendRawTransaction method when a transaction fails
In this case, the nonce needs to be changed to a currently available (unused) one
For both cases, the transaction has already been sent to the transaction pool. If you want to update or replace it, you can use the same nonce, modify the corresponding field, and resend it with a higher gasPrice value.
The nonce for sending a transaction cannot be too large for the user's current nonce. If it exceeds 2000, the following error will be found:
If the gas traded is too small (
<21000) or too large (
>15m) the following error is returned:
The gasPrice of the transaction cannot be set to 0:
The transaction has a size limit. The maximum is 200k.
If the epochHeight of a transaction is smaller than the epochNumber of the current network by more than 100k, the following error will be found.
In this case, you can wait for a while to resend the transaction and increase the gasPrice of the transaction to help improve the chances of sending
Wait for the node data to sync to the latest before sending