raiden-network / raiden-contracts

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

Deploy Raiden contracts on Görli testnet #488

Closed LefterisJP closed 5 years ago

LefterisJP commented 5 years ago

Motivation

Yesterday the new cross-client PoA network Görli was launched in Berlin: https://twitter.com/ETHBerlin/status/1090991452954521600. Technical info shown below taken from here

Please see goerli.genesis for a genesis file compatible with Pantheon or Geth.

Please see goerli.json for a chain specification compatible with Nethermind or Parity Ethereum.

Please see bootnodes.txt if you fail connecting to the network.

For raiden development and testing this is ideal. Ropsten is highly unstable and the only cross-client testnet until now. With Görli we can finally use a single testnet for both major clients.

Task description

Raiden Client side

Things to consider

I suppose we should wait until the next contracts release when the latest contracts development version will be deployed in all testnets to do this as it makes no sense to do it without a new release.

@pirapira Did I forget anything?

pirapira commented 5 years ago
LefterisJP commented 5 years ago

launch Görli nodes

Good point. Will add it to the initial post. But the good thing with Goerli, at least in the first months is that it's so small that running it locally should be no problem to sync in seconds/minutes.

pirapira commented 5 years ago

faucet

pirapira commented 5 years ago
pirapira commented 5 years ago

I'm trying to create a twitter account for https://faucet.goerli.mudit.blog/

pirapira commented 5 years ago

Interestingly, the same deployment script works on Ropsten but not on Goerli.

pirapira commented 5 years ago
(venv) parupunte% python -m raiden_contracts.deploy raiden --rpc-provider $GOERLI --private-key $GOPRIV --gas-price 4 --gas-limit 6000000                                         (git)-[goerli]  ~/src/raiden-contracts 

Web3 provider is RPC connection http://localhost:8545                                                                                                                                                                    
Enter the private key password:                                                                                                                                                                                          
DEBUG:__main__:Deploying EndpointRegistry txHash=0xe6e346ee09a1ddfdd6dd287004216b07e2710bd910f522ad6cd2e56a7ab87269, contracts version 0.7.0                                                                             
INFO:__main__:EndpointRegistry address: 0x3E9ab960bc70b409Daa4E10D0b166A2B772ca1e7. Gas used: 555302                                                                                                                     
DEBUG:__main__:Deploying SecretRegistry txHash=0xbf9e274ac524f331ca65fd24bd417cc27b982eebd546c3f2bdbf0fffdf5c14eb, contracts version 0.7.0                                                                               
INFO:__main__:SecretRegistry address: 0xF209Aa18FA52321c45B1fA6b4df962a3BAb43121. Gas used: 313274                                                                                                                       
DEBUG:__main__:Deploying TokenNetworkRegistry txHash=0xb2fcae61ea66de196cc5d9c96bf97f05d5deadf5c4988cf50179e5f48aba5de1, contracts version 0.7.0                                                                         
INFO:__main__:TokenNetworkRegistry address: 0x6262B8F79E7085B203dDCd613FE57b1C29F5F1E2. Gas used: 4708296                                                                                                                
Deployment information for chain id = 5  has been updated at /home/yoichi/src/raiden-contracts/raiden_contracts/data/deployment_private_net.json.                                                                        
EndpointRegistry at 0x3E9ab960bc70b409Daa4E10D0b166A2B772ca1e7 matches the compiled data from contracts.json                                                                                                             
checking the contract version                                                                                                                                                                                            
calling EndpointRegistry at address 0x3E9ab960bc70b409Daa4E10D0b166A2B772ca1e7                                                                                                                                           
Traceback (most recent call last):                                                                                                                                                                                       
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/web3/contract.py", line 1372, in call_contract_function                                                                                       
    output_data = decode_abi(output_types, return_data)                                                                                                                                                                  
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/abi.py", line 96, in decode_abi                                                                                                       
    return decoder(stream)                                                                                                                                                                                               
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 118, in __call__                                                                                                   
    return self.decode(stream)                                                                                                                                                                                           
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_utils/functional.py", line 46, in inner                                                                                                   
    return callback(fn(*args, **kwargs))                                                                                                                                                                                 
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 164, in decode                                                                                                     
    yield decoder(stream)                                                                                                                                                                                                
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 118, in __call__                                                                                                   
    return self.decode(stream)                                                                                                                                                                                           
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 133, in decode                                                                                                     
    start_pos = decode_uint_256(stream)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 118, in __call__
    return self.decode(stream)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 186, in decode
    raw_data = self.read_data_from_stream(stream)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/eth_abi/decoding.py", line 296, in read_data_from_stream
    len(data),
eth_abi.exceptions.InsufficientDataBytes: Tried to read 32 bytes.  Only got 0 bytes
pirapira commented 5 years ago

That was with geth --goerli --rpc. I should try Parity and see what happens now.

pirapira commented 5 years ago

For the Parity Goerli I wait for https://github.com/paritytech/parity-ethereum/pull/9981

pirapira commented 5 years ago

@LefterisJP where did you see Chain ID = 5?

Chain ID: 5

I'm seeing in EIP-155, the chain ID for Goerli is 6284.

LefterisJP commented 5 years ago

@pirapira As per the issue's descriptions I took the technical details from the respective github repo here

pirapira commented 5 years ago

I see. Now I bet that the EIP will change and the existing Goerli chain stays.

pirapira commented 5 years ago

On parity-goerli I get


python -m raiden_contracts.deploy raiden --rpc-provider $GOERLI --private-key $GOPRIV --gas-price 12 --gas-limit 6000000

Web3 provider is RPC connection http://localhost:8545
Enter the private key password: 
DEBUG:__main__:Deploying EndpointRegistry txHash=0xb1a93dac5113ce366b53123e56f8e616f67a11006108546b527c1dfd7d706beb, contracts version 0.7.0
INFO:__main__:EndpointRegistry address: 0x43171252fDda1DC8b2738fd84a33164F957D0873. Gas used: 555302
DEBUG:__main__:Deploying SecretRegistry txHash=0x92a097a2ec4a2839f8f7a2e37cb6adecaf111a96a1b05f50ebe53254086fee69, contracts version 0.7.0
INFO:__main__:SecretRegistry address: 0xf556018a060Ed21a5674cc4A985de757Db4d6691. Gas used: 313274
DEBUG:__main__:Deploying TokenNetworkRegistry txHash=0x33e908e42c20f06ea9f9d206c6e03f3deae870188230178f9776dfece42b775d, contracts version 0.7.0
INFO:__main__:TokenNetworkRegistry address: 0xb96fD3C1Bb5de5E175cAF360602C5E66cE970931. Gas used: 4708296
Deployment information for chain id = 5  has been updated at /home/yoichi/src/raiden-contracts/raiden_contracts/data/deployment_goerli.json.
EndpointRegistry at 0x43171252fDda1DC8b2738fd84a33164F957D0873 matches the compiled data from contracts.json
checking the contract version
calling EndpointRegistry at address 0x43171252fDda1DC8b2738fd84a33164F957D0873
prepared a transaction with data 0xb32c65c8
got 32 bytes for expected 32
got 32 bytes for expected 32
called
SecretRegistry at 0xf556018a060Ed21a5674cc4A985de757Db4d6691 matches the compiled data from contracts.json
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/yoichi/src/raiden-contracts/raiden_contracts/deploy/__main__.py", line 848, in <module>
    main()
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/core.py", line 1163, in invoke
    rv.append(sub_ctx.command.invoke(sub_ctx))
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/yoichi/src/raiden-contracts/raiden_contracts/deploy/__main__.py", line 189, in wrapper
    return func(*args, **kwargs)
  File "/home/yoichi/src/raiden-contracts/venv/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/yoichi/src/raiden-contracts/raiden_contracts/deploy/__main__.py", line 267, in raiden
    verify_deployed_contracts(deployer.web3, deployer.contract_manager)
  File "/home/yoichi/src/raiden-contracts/raiden_contracts/deploy/__main__.py", line 651, in verify_deployed_contracts
    CONTRACT_SECRET_REGISTRY,
  File "/home/yoichi/src/raiden-contracts/raiden_contracts/deploy/__main__.py", line 809, in verify_deployed_contract
    f"We have block_number {contracts[contract_name]['block_number']} "
AssertionError: We have block_number 101652 instead of 101653
(venv) parupunte%                                                        
pirapira commented 5 years ago

Geth doesn't return contract_version() string on Goerli. Parity reports a different block number on Goerli.

@LefterisJP do you need Goerli or is it just a nice idea?

LefterisJP commented 5 years ago

It's not a must have. But it will solve all our multiple testnet trouble and it will finally be a PoA testnet where both clients can be tested at the same time. If we manage to get Goerli going, then we can stop testing on all other testnets.

czepluch commented 5 years ago

Are we going to prioritize this? I think it would be great to have this for testing purposes. Especially for the scenario player.

LefterisJP commented 5 years ago

I would love to have this done. I don't know why I am assigned though. I suppose the deployment is part of the contracts repo scripts. @pirapira I can help of course but please tell me how can I help :)

pirapira commented 5 years ago

I can try again though I don't expect success. Görli is very empty, so I'm assigning a higher mental probability that the problems I saw still persist.

czepluch commented 5 years ago

Another good reason to move this forward: https://www.parity.io/announcing-the-end-of-parity-support-for-kovan/

pirapira commented 5 years ago

When https://github.com/raiden-network/raiden/pull/3808 is merged, raiden:master can be tried with the Goerli deployment.

pirapira commented 5 years ago

But I forgot to deploy the RedEyes version (0.4.0) on Goerli.

pirapira commented 5 years ago

863 deploys the RedEyes version on Goerli.

pirapira commented 5 years ago

We can close this now. When a problem happens, we open new issues.