raiden-network / raiden-contracts

Raiden Network Smart Contracts
MIT License
53 stars 45 forks source link

'invalid sender' from `python -m raiden_contracts.deploy raiden ` #398

Closed offerm closed 5 years ago

offerm commented 5 years ago

Running python -m raiden_contracts.deploy raiden against a local geth instance (private network) generated this error invalid sender

Any idea what can be the problem?

full command: python -m raiden_contracts.deploy raiden --rpc-provider http://127.0.0.1:8545 --private-key /home/offerm/xud-eth/blkchain1/keystore/UTC--2019-01 -05T16-07-39.952784480Z--c04bb5e9e17ba5391105730360413089fe88181d --gas-price 10 --gas-limit 6000000

full response

Web3 provider is RPC connection http://127.0.0.1:8545
Enter the private key password: 
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 643, in <module>
    main()
  File "/usr/lib/python3/dist-packages/click/core.py", line 759, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 714, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1158, in invoke
    rv.append(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 951, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 552, in invoke
    return callback(*args, **kwargs)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 154, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 221, in raiden
    deployed_contracts_info = deploy_raiden_contracts(deployer)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 368, in deploy_raiden_contracts
    endpoint_registry_receipt = deployer.deploy(CONTRACT_ENDPOINT_REGISTRY)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 95, in deploy
    txhash = self.send_deployment_transaction(contract, args)
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 121, in send_deployment_transaction
    raise ex
  File "/home/offerm/raiden-contracts/raiden_contracts/deploy/__main__.py", line 115, in send_deployment_transaction
    private_key=self.private_key,
  File "/usr/local/lib/python3.6/dist-packages/raiden_libs/private_contract.py", line 34, in transact
    return self._call.web3.eth.sendRawTransaction(data.rawTransaction)
  File "/usr/local/lib/python3.6/dist-packages/web3/eth.py", line 274, in sendRawTransaction
    [raw_transaction],
  File "/usr/local/lib/python3.6/dist-packages/web3/manager.py", line 112, in request_blocking
    raise ValueError(response["error"])
ValueError: {'code': -32000, 'message': 'invalid sender'}
offerm commented 5 years ago

running geth in with --verbosity 5 I can see this:

DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=219.925µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=100.875µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=95.319µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=81.828µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=81.851µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=74.486µs
DEBUG[01-05|22:05:56.048] Executing EVM call finished              runtime=72.652µs
DEBUG[01-05|22:05:56.049] VM returned with error                   err="contract creation code storage out of gas"
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=85.692µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=77.831µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=88.524µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=74.809µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=81.794µs
DEBUG[01-05|22:05:56.049] VM returned with error                   err="contract creation code storage out of gas"
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=85.729µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=85.061µs
DEBUG[01-05|22:05:56.049] VM returned with error                   err="contract creation code storage out of gas"
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=91.185µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=65.854µs
DEBUG[01-05|22:05:56.049] VM returned with error                   err="contract creation code storage out of gas"
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=75.99µs
DEBUG[01-05|22:05:56.049] Executing EVM call finished              runtime=99.117µs
DEBUG[01-05|22:05:56.050] VM returned with error                   err="contract creation code storage out of gas"
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=75.312µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=76.179µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=78.773µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=75.186µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=72.978µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=90.076µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=101.368µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=78.223µs
DEBUG[01-05|22:05:56.050] Executing EVM call finished              runtime=75.029µs
TRACE[01-05|22:05:56.064] Discarding invalid transaction           hash=01340c…a59de0 err="invalid sender"

Any idea?

offerm commented 5 years ago

Found the reason for the problem here - https://github.com/ethereum/web3.js/issues/1040#issuecomment-332049470

the problem is with EIP155 and matching ChainID and NetworkID.
If you set the two values above to the same value it will work
loredanacirstea commented 5 years ago

@offerm , yes, thank you for reporting this. So you need to start geth with --networkid <chainID_from_genesis.json> and it will deploy correctly. I will add this in the dev section of the Readme file.

loredanacirstea commented 5 years ago

This issue can be closed after https://github.com/raiden-network/raiden-contracts/pull/406. Let me know if you think otherwise.