Open ish3lan opened 5 years ago
Thanks for reporting, @ish3lan. What version of Ganache are you using?
It looks like the nonce in the signed transaction may be too large; that is: greater than 9007199254740991 (Number.MAX_SAFE_INTEGER
). Is it possible that the nonce in your signed transaction is incorrect?
That is right I mistakenly put the sending address in the nonce field
however the problem still exists with private keys of first and second account swapped .
On Tue, 15 Jan 2019 at 7:08 PM David Murdoch notifications@github.com wrote:
It looks like the nonce in the signed transaction may be too large; that is: greater than 9007199254740991 (Number.MAX_SAFE_INTEGER). Is it possible that the nonce in your signed transaction is incorrect?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/trufflesuite/ganache/issues/1079#issuecomment-454448386, or mute the thread https://github.com/notifications/unsubscribe-auth/AHE5fDw2EeXtDRKRRyjJRdS7eDGZvl9Wks5vDfzrgaJpZM4aBMG4
Can you paste the private key length error here?
@ish3lan Did you make any progress on this issue? If not, please provide the error message.
Related to https://github.com/trufflesuite/ganache/issues/847
@davidmurdoch @ccowell
This is a bit late, I am not able to regenerate the claimed scenario (swapping private keys thing), however I can confirm when I paste the full private key of the sending address I get from ganache-cli e.g. 0xc5c7e13cfd7a269be287aa6f9f1f70d225ef60dedde297068c8748d8e8f06981
I get this error:
/Udacity/Block Chain/Project 5/node_modules/ethereumjs-util/dist/index.js:369
var sig = secp256k1.sign(msgHash, privateKey);
^
RangeError: private key length is invalid
at Object.exports.ecsign (/Udacity/Block Chain/Project 5/node_modules/ethereumjs-util/dist/index.js:369:23)
at Transaction.sign (/Udacity/Block Chain/Project 5/node_modules/ethereumjs-tx/es5/index.js:252:23)
at Object.<anonymous> (/Udacity/Block Chain/Project 5/index.js:42:13)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:775:12)
at startup (internal/bootstrap/node.js:300:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:826:3)
I was able to avoid this by deleting the 0x
at the beginning of private key
@ish3lan Just so I understand, this last error you gave us isn't coming from Ganache, is it? Are you just saying that the format Ganache gives you for the private key (JSON-RPC UNFORMATTTED DATA; hex encoded with leading 0x
) isn't what you expected?
In many blogs I've found it was a Truffle version problem. Truffle v5 would make problems of this type. They suggest to downgrade to truffle@4.1.15.
This has not been so for me. I have continue to use truffle v5. I've resolved by checking my gas limit when I sent a transaction. gasLimit: web3.utils.toHex( gas_limit ),//The maximum gas provided for this transaction (gas limit)
I tried to sign a transaction using the sender private key, I got private key length error. I tried to sign it using the receiver private key it worked. The I signed another transaction using another receiving and sending addresses and it worked as expected (signing transaction using the sender private key).
Then I went again to send a transaction from the the first account to the second and I got this error.