-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodeError("replacement transaction underpriced") #42
Comments
@cctanfujun what you can do is to supply the parameter Sent with GitHawk |
but i saw the source code,onBlock default value is pending? |
Hm, in this case I suggest a to use a workflow that I’ve posted in a previous question from you. Looks like the node (do you use Infura?) does not include the transaction in a mempool instantly and still provides you with the same Sent with GitHawk |
yes i used infura |
could you please give an example? this is my code?
i call this twicce in a short time, and got the error? |
Im getting this error as well and cannot resolve. I've tried several times to adjust nonce and gas/// whats going on here? |
hello,this is because nonce should be set sequence,when you send a nonce is 1 transcation ,and then you send a same nonce transcation will cause this error, because of when use infura transcation maybe not include in memory ,you will get this error.so you can set nonce manual,use |
What should help is setting a higher gas price. You can supply a gas price in options or manually. For beginning try setting it 20-30% higher than the price you get from “getGasPrice()” call
…________________________________
From: 谈釜君 <notifications@github.com>
Sent: Sunday, September 30, 2018 6:30:16 AM
To: matterinc/web3swift
Cc: Alexander; Comment
Subject: Re: [matterinc/web3swift] nodeError("replacement transaction underpriced") (#42)
Im getting this error as well and cannot resolve.
When I increase the gas to force a success, the transaction never gets mined. It also weirdly shows up on etherscan as a "Secondary Node" tx. Which fails after an hour or 2.
I've tried several times to adjust nonce and gas/// whats going on here?
hello,this is because nonce should be set sequence,when you send a nonce is 1 transcation ,and then you send a same nonce transcation will cause this error, because of when use infura transcation maybe not include in memory ,you will get this error.so you can set nonce manual,use
assemble
―
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#42 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv91VfOSvtG4S5MQ8DD9pnA6kZHjT-ks5ugDrIgaJpZM4WxREY>.
|
Just to clarify: do you want to kick the transaction with the old nonce out of the pool or submit a new one? Also, you don’t need to “assemble” separately and “send” after. Assembling gives you a transaction with all parameters encoded and you can manually set a nonce, gas limit, gas price for it, and then use web3.eth.sendTransaction. When you call “send” all the nonce, gas limit and price are done automatically, so you indeed get the old nonce with onBlock: “latest”
…________________________________
From: Franky <notifications@github.com>
Sent: Sunday, September 30, 2018 5:50:36 PM
To: matterinc/web3swift
Cc: Alexander; Comment
Subject: Re: [matterinc/web3swift] nodeError("replacement transaction underpriced") (#42)
Here is the entire method, with assemble added.
[screen shot 2018-09-30 at 7 49 50 am]<https://user-images.githubusercontent.com/1709272/46258844-7bb5b300-c485-11e8-8d3d-26cf20b31758.png>
Note this worked Last week, until I updated my pods.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#42 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv92jePoz50EEIdC3m5S31h01_EsgLks5ugNo8gaJpZM4WxREY>.
|
Gotcha, I'll try again tomorrow. Ideally, I just want any transaction to Mine. I must have old ones that are stuck, I cant figure it out. Old transactions can fail thats fine, if Kicking them from the Mem Pool is the only way to get a new transaction to mine, then yes. I need to kick the pending Nonce. From your note is the pattern to... |
Ok, let’s assume that you don’t yet have a stuck transaction:
1) make a transactionIntermediate and just use .send(onBlock:”latest”). Under the hood you automatically get a transaction with some nonce N, gas limit GL and gas price GP
2) now this transaction is stuck in the memory pool. The only way to kick it off is to make another transaction with the same nonce and higher gas limit. You may also want to increase the gas price to be above the market. To do it you have to make a transactionIntermediate and do .assemble(onBlock:”pending”) (actually it does not matter, you set a nonce manually later). This will get you an EthereumTransaction object, let’s call it “to”. On this object you can do
tx.nonce = N
tx.gasLimit = GL+1 (just something more that gas limit of the stuck transaction)
tx.gasPrice = some price above the market
3) now do a web3.eth.sendTransaction(tx, ...) and it will be signed under the hood if necessary sent to the node
Sincerely, Alex
…________________________________
From: Franky <notifications@github.com>
Sent: Monday, October 1, 2018 8:09:37 AM
To: matterinc/web3swift
Cc: Alexander; Comment
Subject: Re: [matterinc/web3swift] nodeError("replacement transaction underpriced") (#42)
Gotcha, I'll try again tomorrow.
Ideally, I just want any transaction to Mine. I must have old ones that are stuck, I cant figure it out.
Old transactions can fail thats fine, if Kicking them from the Mem Pool is the only way to get a new transaction to mine, then yes. I need to kick the pending Nonce.
From your note is the pattern to...
Send with Fail due to old transaction
then
Assemble and Remove
then
Send New Transaction
?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#42 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AGKv96rTysgSAPWXumBiAKV0on8Ed7EZks5ugaORgaJpZM4WxREY>.
|
@cctanfujun @FrankyAguilar |
This still doesn't work. Same issue, still happening. |
@FrankyAguilar Am I right understand, that you want to have the transactions queue locally to be able send\push\pop transactions from this queue and want to be sure, that all of them will be posted in infura with confliction each other? |
@FrankyAguilar, @cctanfujun hi, I've finally got this bug in live. Also got node error "nonce too low".
guard let pendingNonce = try self.web3Instance?.eth.getTransactionCount(address: EthereumAddress(self.address)!, onBlock: "pending") else {
throw Errors.NetworkErrors.cantCreateRequest
}
guard let latestNonce = try self.web3Instance?.eth.getTransactionCount(address: EthereumAddress(self.address)!, onBlock: "latest") else {
throw Errors.NetworkErrors.cantCreateRequest
}
let selectedNonce = max(pendingNonce, latestNonce)
Hope it will help you |
Closed due to inactivity |
i call a contract method twice in a short time,and create this error,i know this is beacuse of the same nonce,but i don't know how to solve it, i need call the method twice,make two transcation.Anyone can help?
The text was updated successfully, but these errors were encountered: