Sending TX Common Error
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
#
Nonce Usage Error#
using a nonce that has already been executedIn this case, the nonce needs to be changed to a currently available (unused) one
#
using a nonce that has already been sent to the transaction poolor
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.
#
using a too large nonceThe 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:
#
GasIf the gas traded is too small (<21000
) or too large (>15m
) the following error is returned:
#
gasPriceThe gasPrice of the transaction cannot be set to 0:
#
DataThe transaction has a size limit. The maximum is 200k.
#
epochHeightIf the epochHeight of a transaction is smaller than the epochNumber of the current network by more than 100k, the following error will be found.
#
chainId Usage Error#
Encoding or Signature Error#
Full Transaction Poolor
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
#
Others#
the node is in catch-up modeWait for the node data to sync to the latest before sending