se3000/ruby-eth

Invalid Sender

juanfer opened this issue · 1 comments

Hi, I'm getting "invalid sender" error when trying to send signed transactions using ruby-eth in a local node. Can't figure out which is the problem. Here's the code, which calls transfer method in a contract.

key = Eth::Key.new priv: "xxxxx"
contract = Ethereum::Contract.create(client: eth_ipc_client, file: route_to_contract, address: contract_address)
contract.key = key
contract.transact.transfer(to, qty)

Of course private key is correct, variables to instantiate contract are correct, params "to" and "qty" are variables with a correct ETH address and a quantity lower than sender's total balance of token. Also, sender has enough ETH to send transaction. I also tried playing with gas_limit and gas_price values with no luck (as expected, because I'm working in a local node).

Every time I run the code, I get the "Invalid Sender" error. Not sure if this is an error in ruby-eth or if it is an error in ethereum.rb, but calling methods that don't require to be signed, run without problem.

ruby-eth version : 0.4.6
ethereum.rb version: 2.1.8

Any ideas?. Thanks!

Ok, seems that it has nothing to do with ethereum.rb, nor ruby-eth, but with geth. In the end, the error was not showing only on the situation described above, but in every single ETH signed transaction, so I started to look further and discovered a "problem" in my geth node.

There's a fix here: trufflesuite/truffle#595.

Basicly you have to use the same networkid param as the chainid used to start the node. Must be something related to new geth versions.