Skip to content
This repository has been archived by the owner on Jun 13, 2019. It is now read-only.

Testnet deploy @ 2018.09.16

boolafish edited this page Sep 16, 2018 · 16 revisions

Note

This is a doc served as our testnet deployment and also our QA process on testnet.

Setup

Run

  • One process for parity node:
parity --chain kovan
  • Another process running operator child chain server:
python -m plasma_cash.child_chain

(there was port conflict on 8546 on my mac for some reason. As a result, changed the port to 8547. Need to change hardcoded port in plasma_cash/child_chain/main.py and plasma_cash/dependency_config.py). However, seems like ubuntu environment won't have same problem.

  • use python ide to run commands directly (like the style in README)

Config change

Mainly changes for contract address, also turn on level db instead of default memory db.

see final change here: config.py

plasma_config = dict(
    ROOT_CHAIN_CONTRACT_ADDRESS='0x50e4e9dd51F071D63437c1908e93F2Db58b28785',
    AUTHORITY=b';\x08\x84\xf4\xe5\x0e\x9b\xc2\xce\x9b"J\xb7/\xea\x89\xa8\x1c\xdf|',
    AUTHORITY_KEY=b'\xa1\x89i\x81|,\xef\xad\xf5+\x93\xeb \xf9\x17\xdc\xe7`\xce\x13\xb2\xac\x90%\xe06\x1a\xd1\xe7\xa1\xd4H',
)

db_config = {
    'type': 'leveldb'
}

QA

Did a manual QA on testnet. However, we did not test finalize exit as that need to wait 2 weeks. Tested all 3 types of challenge. Could check in the contract event.

The contract deployed to testnet is altered to emit event for all functions (see code here). In explorer, by default, it is showing hex in event log, need to change the last one to Text to show human readable event log. (see following image)

show readable event log

users

  • operator: 0x3B0884f4E50e9BC2CE9b224aB72feA89a81CDF7c (for convenience, same as userA)
  • userA: 0x3B0884f4E50e9BC2CE9b224aB72feA89a81CDF7c
  • userB: 0xb83e232458A092696bE9717045d9A605FB0FEc2b
  • userC: 0x08d92dcA9038eA9433254996a2D4F08D43BE8227

flow

plasma test net QA flow

All three kinds of challenge is tested within the above flow.

Challenge Already spent

After userA transfer to userB, and userB transfer to userC. UserB try to exit and userC challenge it.

challenge already spent

Challenge Double spent

Continue with the previous flow, user C transfer back to userA. And then userA try to send to userB and userC, where userB's transaction is earlier then userC's one. UserC try to exit with its transaction. And userB challenged double spent since its tx comes earlier.

challenge double spending

Challenge History

So from the flow above, userB is the final eligible owner of the coin. After userB start exit with its final transaction, userC tries to do a challenge. Since userB should be able to exit with the coin, userB can successfully respond the challenge.

challenge history

Clone this wiki locally