-
Notifications
You must be signed in to change notification settings - Fork 5k
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
sendSignedTransaction function is not returning a receipt (after Istanbul) #3104
Comments
Same identical problem, i have already opened a issue on Infura Github page: |
@umurb-hydrogen Have not been able to reproduce this. Could you look at the example below and identify any differences between what you've been doing and a tx which executed successfully? NB: Signing with const Transaction = require('ethereumjs-tx').Transaction;
const account1 = "0xAcb3e9205229D212Db914a92C77856b228B0a4E4";
const account2 = "0x458B8Adf2248709cf739149fE4BAb0B20101c4A1";
const txCount = await web3.eth.getTransactionCount(account1)
// Transaction
const txObject = {
nonce: web3.utils.toHex(txCount),
to: account2,
value: web3.utils.toHex(web3.utils.toWei('0.1', 'ether')),
gasLimit: web3.utils.toHex(21000),
gasPrice: web3.utils.toHex(web3.utils.toWei('10', 'gwei'))
}
// Sign the transaction
const tx = new Transaction(txObject, { chain: 'ropsten', hardfork: 'istanbul' })
const pk = Buffer.from(PRIVATE_KEY_ACCOUNT_1, 'hex')
tx.sign(pk)
const serializedTx = tx.serialize()
const raw = '0x' + serializedTx.toString('hex')
// Broadcast the transaction
const receipt = await web3.eth.sendSignedTransaction(raw) Receipt {
"blockHash": "0xdbb365914fd57cfc08657eed1a843a619d51651b233d3b45648ca5658e54f14f",
"blockNumber": 6527760,
"contractAddress": null,
"cumulativeGasUsed": 7643463,
"from": "0xacb3e9205229d212db914a92c77856b228b0a4e4",
"gasUsed": 21000,
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"status": true,
"to": "0x458b8adf2248709cf739149fe4bab0b20101c4a1",
"transactionHash": "0xb909b8f4074f45f067125348eb1cf71a197149dc03a37446dacd4a925963ff47",
"transactionIndex": 70
} Ropsten Etherscan [EDIT - Apologies, looked more carefully at your initial report - you're using accounts.sign? Will investigate this but suspect it will require a fix currently pending as part of #3070. Signing with ethereumjs-tx as above is a work-around.) |
I have solved my problem substituting Thanks |
Thanks for sharing the solution! Adding the Another thing to note is that my original code (without the I think we can close this issue. |
Ah interesting! Perhaps the network was having some problems... This is also being tracked in #3070 (under "transaction signing"). Closing. |
Looks like it has been resolved now. One additional thing to notice: if you are using web3 sendSignedTransaction function with infura nodes, promise is actually never resolved if nonce is too high. |
Stil can't call sendSignedTransaction on main net, no answer no timeout, nothing in response... |
Description
My code, which has been working fine on Ropsten Test Network is not working after the Istanbul hardfork.
Expected behavior
Calling
await web3.eth.sendSignedTransaction(signedTx.rawTransaction)
to return a receipt.Actual behavior
Calling
await web3.eth.sendSignedTransaction(signedTx.rawTransaction)
does send out the transaction, but does not return the receipt nor resolve the promise.Steps to reproduce the behavior
Try sending a signed transaction on Ropsten Test Network, and I think you'll be able to reproduce the issue.
Versions
The text was updated successfully, but these errors were encountered: