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 throws "Invalid Sender" #1040
Comments
@lukehedger does not seem to be related. signTransaction is working fine, and im even able to retrieve the signer address using web3.eth.accounts.recoverTransaction(tx.rawTransaction). decoded tx.rawTransaction using ethereumjs-tx, and it seems to match the transaction RLP spec. |
Switched to "testrpc" and got same error as #932. Worked around it by using "ethereumjs-tx" for signing transaction and then sending it using sendSignedTransaction. sample code that works with testrpc: var ethNodeUrl = 'http://localhost:8545';
var provider = new Web3.providers.HttpProvider(ethNodeUrl);
var web3 = new Web3(provider);
var accountString = '{............encrypted account.........}';
var account = web3.eth.accounts.decrypt(JSON.parse(accountString), 'password');
web3.eth.getTransactionCount(account.address).then((nonce) => {
var tx = new Tx({
nonce: nonce,
from: account.address,
to: '<some target>',
value: 8704500000000000,
gasLimit: 200000
});
tx.sign(new Buffer(account.privateKey.substr(2), 'hex'));
web3.eth.sendSignedTransaction('0x'+tx.serialize().toString('hex')).then((response) => {
console.log(response);
});
}); not sure why it is not working only with geth. you can close this if you feel it is not a problem with web3. |
I get the same error in the browser while the tests with node work fine. In order to debug, I tried using |
the problem is with EIP155 and matching ChainID and NetworkID. |
Tried with geth again and it works fine with ChainID and NetworkID set to 10. With ChainID 1337, i get #932. I will close this for now. |
solved by change the ChainID. 0: Olympic, Ethereum public pre-release testnet |
I ran into this issue. Make sure if you supply networkid when starting geth that it is the same in all places (ABIs, Provider, Genesis, Geth) Eg. I was using 6660001 everywhere And i got the |
Change Source: #2915 |
still facing this issues {"jsonrpc":"2.0","id":0,"error":{"code":-32000,"message":"invalid sender"} |
@drgorb @robert-zaremba @lukehedger still facing this issue |
Change the below
to the below
Reference: #3305 |
Thanks , Its completely working |
sample code:
throws "Unhandled rejection Error: Returned error: invalid sender".
genesis.json has non-zero chainId. FROM account has sufficient balance. Works fine if i "unlock the account" in geth and then use sendTransaction(). dont want to do that as that has security issues (even if unlock timeout is very small).
The text was updated successfully, but these errors were encountered: