This is a private network
A transaction was sent to create a contract using the eth_sendTransaction
RPC call.
The transaction is "removed" marked "will be removed" because it ran out of gas but remains in the pending
state and miners keep trying to process it.
1- Is there a way to cancel a pending transaction ?
According to the sendTransaction
documentation resending a transaction with the same nonce allows to "overwrite your own pending transaction".
Using eth_getTransactionByHash
it is possible to recover the nonce of a transaction.
However when sending a new transaction with the same nonce (and more gas), the new transaction fails with "TX (d37f7a1b) failed, will be removed: Transaction w/ invalid nonce"
2- How do we "overwrite" a pending transaction ?
Many Thanks
edit1: result of eth.pendingTransactions
The input is the same (same contract), and so is the the nonce.
The first 2 fail with TX (49dcf54d/7e591a92) failed, will be removed: Out of gas
, the third one with TX (d37f7a1b) failed, will be removed: Transaction w/ invalid nonce. tx=8 state=9)
[{
blockHash: null,
blockNumber: null,
from: "0x766b8dc3ee1a98dd53444ce3cc5a185305570861",
gas: 90000,
gasPrice: 20000000000,
hash: "0x49dcf54d52ddad2cfb57d9805b1a94bbc6b60ad44eaac9c117399530424d1300",
input: "0x60606...5056",
nonce: 8,
to: null,
transactionIndex: null,
value: 0
}, {
blockHash: null,
blockNumber: null,
from: "0x766b8dc3ee1a98dd53444ce3cc5a185305570861",
gas: 150000,
gasPrice: 20000000000,
hash: "0x7e591a92683453ea0ec6a7024d54198140ec2c23936b3662c4f3e0d9978fc828",
input: "0x60606...5056",
nonce: 8,
to: null,
transactionIndex: null,
value: 0
}, {
blockHash: null,
blockNumber: null,
from: "0x766b8dc3ee1a98dd53444ce3cc5a185305570861",
gas: 500000,
gasPrice: 20000000000,
hash: "0xd37f7a1bcedef089723f31bbf155b6c4c66f77fd0b5a5f6c3168a0b8ff3af299",
input: "0x60606...5056",
nonce: 8,
to: null,
transactionIndex: null,
value: 0
}]
edit2: change after the node that created the transactions started mining
The situation only changed when the node that created the transactions started mining
- The first transaction was removed
- The second transaction, although it was rejected with an OOG on storage allocation, completed and a contract address generated
- The third transaction was removed
Is this the expected behaviour that the node that created the pending transaction must mine so that a transaction running OOG on another miner is actually removed ?
The original question still remains: how do we remove/cancel/overwrite a pending transaction ?