Nethereum: Private node. Invalid sender eth_sendRawTransaction

Expected Behavior

When using SendRequestAndWaitForReceiptAsync or any other method to generate a transaction, the transaction should be created on the target private node

Current Behavior

Any transaction attempt fails with Invalid Sender. On the private node, a warning is generated “Served eth_sendRawTransation err=“invalid sender””

Steps to Reproduce

The following code is being used. On the very last line, we receive the error.

var sourceaccount = Account.LoadFromKeyStore( File.ReadAllText( "account1.json" ), "test1", 15 );
var target = Account.LoadFromKeyStore( File.ReadAllText( "account2.json" ), "test2", 15 );

var targetnode = new Web3( sourceaccount, "http://<external IP>:8085" );

var balance = targetnode.Eth.GetBalance.SendRequestAsync( sourceaccount.Address ).Result;
Console.WriteLine( "BALANCE >> " + balance.Value );

balance = targetnode.Eth.GetBalance.SendRequestAsync( target.Address ).Result;
Console.WriteLine( "BALANCE (TARGET) >> " + balance.Value );
			
var wei = Web3.Convert.ToWei(1);

var transactionReceipt = targetnode.TransactionManager.TransactionReceiptService.SendRequestAndWaitForReceiptAsync(
								  new TransactionInput() {
									From = sourceaccount.Address,
									To = target.Address,
									Value = new HexBigInteger(wei),
								}, null).Result;

Context (Environment)

Just testing a very basic example for two wallets and a transaction between them.

Detailed Description

The geth node is setup with a ChainId value of 15, confirmed by the admin.nodeInfo command. The account balance commands return the correct balance for both accounts and the source account has more than enough funds. The account json data has been downloaded directly from the server keystore. We have tried multiple approaches based on the different samples we’ve found but all them ultimately fail with an Invalid Sender error. Creating the very same transaction on geth console, on the server, is successful and the transfer is made after mining is completed.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (14 by maintainers)

Most upvoted comments

Thanks for the hint “web3.TransactionManager.UseLegacyAsDefault = true;”. This solved my problem “invalid remainder: eth_sendRawTransaction”.