You can programatically cancel or accelerate a "stuck" EVM transaction.
Background: EVM Nonce Handling
Every transaction over the Ethereum and account-based networks has a specific nonce. The first transaction sent from a particular address and vault has nonce 0, the second nonce 1, and so forth. For a given address and chain, each outgoing transaction’s nonce is unique, and must be exactly one more than the previous one (no gaps are allowed).
Note that because ERC-20 tokens are implemented as smart contracts over the EVM networks, they, too use the same nonce mechanism and the same addresses as native token transactions.
Fordefi increments the nonce whenever a transaction is pushed to the blockchain so that the transaction that will be signed next will have the following nonce. This will prevent nonce collisions and takes the burden of handling the nonce from the users.
Stuck Transaction
If a previously submitted transaction was submitted with low fees, it may be stuck in the mempool. Moreover, due to the sequential nature of nonces in EVM chains, any subsequent transactions from the same vault on the same chain will be "queued" in the mempool—each transaction waiting for all the transactions with smaller nonces to complete.
Fordefi enables you to cancel or accelerate stuck transactions. This is achieved by sending a new transaction on chain with the same nonce as the stuck transaction and a fee that should be adjusted to the current network congestion, but no less than 12% above the original transaction.
- Learn more about canceling and accelerating transactions using the Fordefi web console.
Cancel a transaction
To cancel a transaction using the API, call this endpoint with this payload example. Effectively, you send 0 ETH (or the base asset on any other chain) to yourself, with a higher fee:
{
"type": "evm_transaction",
"release_type": "cancel",
"signer_type": "api_signer"
}
Accelerate a transaction
Provide the following example payload to the same endpoint, as above. It creates exactly the same transaction as the original only just with higher fees:
{
"type": "evm_transaction",
"release_type": "accelerate",
"signer_type": "api_signer"
}
Transaction Info
Once cancelled or accelerated, the original transaction includes a child_transaction_id
field, which contains the id of the newly created replacement transaction. The replacement transactions points back to the original transaction in its parent_transaction_id
field and also has its is_cancelation
or is_acceleration
fields set. You can obtain the transaction objects that contain these data using the Get Transaction endpoint.