omgnetwork / plasma-mvp

OmiseGO's research implementation of Minimal Viable Plasma
MIT License
561 stars 158 forks source link

web3.exceptions.InvalidAddress, When running make child-chain #150

Closed devonwesley closed 6 years ago

devonwesley commented 6 years ago
screen shot 2018-07-11 at 3 38 00 pm

Issue Type

[x] bug report
[ ] feature request

Current Behavior

Expected Behavior

I was following the readme, so I expected the child-chain server to start up.

Steps to Reproduce

  1. Follow readme steps
  2. Then run make child-chain

Motivation for Change

I would just like help so I can continue.

System Specs

smartcontracts commented 6 years ago

Thanks for the report! I've submitted a patch here: #151

The root of this issue was here: https://github.com/omisego/plasma-mvp/blob/595b7e85c8050ba02365df14fdce552ff5dc38f1/plasma/config.py#L2

Web3py is strict about address checksums (for good reason) as of v4. I updated the address to a correctly formatted address.

devonwesley commented 6 years ago

Nice Thank you so much. @kfichter

I'll give it a shot and see how it works.

devonwesley commented 6 years ago

Nice, it worked! Thanks

devonwesley commented 6 years ago

I tried to submit a PR, but permission was denied. I started getting the same error with the deposit CLI command. I went ahead and fixed it. But maybe you can take a look at it. @kfichter

bh2smith commented 6 years ago

Please notice that the demo/example commands also contain BAD-dresses! For example;

omg deposit 100 0xfd02ecee62797e75d86bcff1642eb0844afb28c7

Also yields, web3.exceptions.InvalidAddress

devonwesley commented 6 years ago

Yeah you can fix it by using the checksum: Web3.toChecksumAddress(ADDRESS)

Inside of the client.py file. @bh2smith

smartcontracts commented 6 years ago

Will try to update the patch today

smartcontracts commented 6 years ago

Fixed, sorry for the delay.

hernandp commented 6 years ago

@kfichter I dont want to reopen this, but deposit command with latest code throws the same error...

smartcontracts commented 6 years ago

@hernandp What command are you using and what's the error?

hernandp commented 6 years ago

@kfichter

:plasma-mvp ck$ omg deposit 0xfd02EcEE62797e75D86BCff1642EB0844afB28c7
Traceback (most recent call last):
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/bin/omg", line 11, in <module>
    load_entry_point('plasma==0.0.0', 'console_scripts', 'omg')()
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/click-6.7-py3.6.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/plasma-0.0.0-py3.6.egg/plasma/cli/cli.py", line 18, in cli
    ctx.obj = Client()
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/plasma-0.0.0-py3.6.egg/plasma/client/client.py", line 16, in __init__
    self.root_chain = deployer.get_contract_at_address("RootChain", plasma_config['ROOT_CHAIN_CONTRACT_ADDRESS'], concise=True)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/plasma-0.0.0-py3.6.egg/plasma/root_chain/deployer.py", line 150, in get_contract_at_address
    contract_instance = self.w3.eth.contract(abi=abi, address=address)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/web3/eth.py", line 369, in contract
    return ContractFactory(address)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/web3/contract.py", line 240, in __init__
    self.address = normalize_address(self.web3.ens, address)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/web3/utils/normalizers.py", line 160, in normalize_address
    validate_address(address)
  File "/Users/coinfabrik/.pyenv/versions/3.6.6rc1/lib/python3.6/site-packages/web3/utils/validation.py", line 157, in validate_address
    value,
web3.exceptions.InvalidAddress: ('Web3.py only accepts checksum addresses. The software that gave you this non-checksum address should be considered unsafe, please file it as a bug on their platform. Try using an ENS name instead. Or, if you must accept lower safety, use Web3.toChecksumAddress(lower_case_address).', '0xa3b2a1804203b75b494028966c0f62e677447a39')