Git Product home page Git Product logo

plasma-evm's Introduction

Plasma EVM Implementation

CircleCI Discord

Implementation of Plasma EVM. You can check smart contracts here. For more information, see documentations.

Development Status

  • Make enter / exit requests
  • Submit NRBs / ORBs
  • Finalize block and requests
  • Challenge on Null Address Transaction in NRBs
  • Continuous Rebase
  • Integration Computation Challenge using solevm.

Ethereum client

For the simple start of both clients(ethereum, plasma-evm), you can run run.rootchain.sh in Onther-Tech/go-ethereum and run.pls.sh in Onther-Tech/plasma-evm (this is recommended way to setup develop and test environment).

Public Testnet

Faraday testnet is running based on Rinkeby network as root chain.

See Onther-Tech/plasma-evm-networks

Build

$ make geth

Run

Before running plasma-evm client, you MUST run another geth client as root chain client.

$ git clone https://github.com/Onther-Tech/go-ethereum.git root-chain-geth && cd root-chain-geth
$ bash run.rootchain.sh

Then you can run or test plasma-evm client.

$ git clone https://github.com/Onther-Tech/plasma-evm.git && cd plasma-evm
$ bash run.pls.sh

Test

Some original go-ethereum tests may fail.

To test plasam-evm related features,

$ go test github.com/Onther-Tech/plasma-evm/pls
$ go test github.com/Onther-Tech/plasma-evm/tx

Command-line Options

build/bin/geth help returns available flags. Belows are plasma-evm-specific flags.

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev                               Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
  --dev.period value                  Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)
  --dev.key value                     Comma seperated developer account key as hex(for dev)

PLASMA EVM - OPERATOR OPTIONS:
  --operator value                    Plasma operator address as hex.
  --operator.key value                Plasma operator key as hex(for dev)
  --operator.password value           Operator password file to use for non-interactive password input
  --operator.minether value           Plasma operator minimum balance (default = 0.5 ether) (default: "0.5")
  --miner.recommit value              Time interval to recreate the block being mined (default: 3s)

PLASMA EVM - ROOTCHAIN TRANSACTION MANAGER OPTIONS:
  --tx.gasprice value                 Gas price for transaction (default = 10 Gwei) (default: 0)
  --tx.mingasprice value              Minimum gas price for submitting a block (default = 1 Gwei) (default: 1000000000)
  --tx.maxgasprice value              Maximum gas price for submitting a block (default = 100 Gwei) (default: 100000000000)
  --tx.interval value                 Pending interval time after submitting a block (default = 10s). If block submit transaction is not mined in 2 intervals, gas price will be adjusted. See https://golang.org/pkg/time/#ParseDuration (default: 10s)

PLASMA EVM - STAMINA OPTIONS:
  --stamina.operatoramount value      Operator stamina amount at genesis block in ETH (default: 1)
  --stamina.mindeposit value          Minimum deposit amount in ETH (default: 0.5)
  --stamina.recoverepochlength value  The length of recovery epoch in block (default: 120960)
  --stamina.withdrawaldelay value     Withdrawal delay in block (default: 362880)

PLASMA EVM - CHALLENGER OPTIONS:
  --rootchain.challenger value        Address of challenger account
  --challenger.password value         Challenger password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.
  --rootchain.contract value          Address of the RootChain contract
  --rootchain.deploygasprice value    Transaction gas price to deploy rootchain in GWei (default: 10000000000). This flag applies only to deploy command.

PLASMA EVM - STAKING OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.registry value          Address of RootChainRegistry contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.powerton value          Address of PowerTON contract
  
PLASMA EVM - CHILDCHAIN OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
  --childchain.sender value           Sender address of child chain transaction
  --childchain.gasprice value         Gas price for child chain transaction in GWei (default: 0)

Additional Commands

For more information, run below command (and sub-command) with --help flag.

account

$ geth account import-key <privateKey>    # Import a private key from hex key into a new account

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")
  --keystore value                    Directory for the keystore (default = inside the datadir)
  --lightkdf                          Reduce key-derivation RAM & CPU usage at some expense of KDF strength

ACCOUNT OPTIONS:
  --password value                    Password file to use for non-interactive password input
$ geth account import-hdwallet <mnemonic> <path>    # Import a mnemonic into a new account

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")
  --keystore value                    Directory for the keystore (default = inside the datadir)
  --lightkdf                          Reduce key-derivation RAM & CPU usage at some expense of KDF strength

ACCOUNT OPTIONS:
  --password value                    Password file to use for non-interactive password input

deploy

$ geth deploy <genesisPath> <chainId> <withPETH> <NRELength>    # Deploy RootChain contract and make genesis file

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev.key value                     Comma seperated developer account key as hex(for dev)

PLASMA EVM - STAMINA OPTIONS:
  --stamina.operatoramount value      Operator stamina amount at genesis block in ETH (default: 1)
  --stamina.mindeposit value          Minimum deposit amount in ETH (default: 0.5)
  --stamina.recoverepochlength value  The length of recovery epoch in block (default: 120960)
  --stamina.withdrawaldelay value     Withdrawal delay in block (default: 362880)

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.
  --rootchain.deploygasprice value    Transaction gas price to deploy rootchain in GWei (default: 10000000000). This flag applies only to deploy command.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)

stamina

$ geth stamina get-delegatee <address>    # Get delegatee of account

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina get-stamina <address>    # Get stamina of account

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina get-totaldeposit <address>    # Get total deposit of account

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina get-deposit <depositor> <delegatee>    # Get deposit of account from the depositor

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina get-lastrecoveryblock <delegatee>    # Get last recovery block of the delegatee

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina get-withdrawal <depositor>    # Get withdrawal requests

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
$ geth stamina set-delegator <delegator>    # Set delegator

ETHEREUM OPTIONS:
--datadir value                       Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
  --childchain.sender value           Sender address of child chain transaction
  --childchain.gasprice value         Gas price for child chain transaction in GWei (default: 0)
$ geth stamina deposit <delegatee> <value>    # Deposit PETH to gain stamina

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
  --childchain.sender value           Sender address of child chain transaction
  --childchain.gasprice value         Gas price for child chain transaction in GWei (default: 0)
$ geth stamina request-withdrawal <delegatee> <value>    # Request withdraw

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
  --childchain.sender value           Sender address of child chain transaction
  --childchain.gasprice value         Gas price for child chain transaction in GWei (default: 0)
$ geth stamina withdraw    # Process withdraw

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - CHILDCHAIN OPTIONS OPTIONS:
  --childchain.url value              JSONRPC endpoint of child chain provider.
  --childchain.sender value           Sender address of child chain transaction
  --childchain.gasprice value         Gas price for child chain transaction in GWei (default: 0)                              

manage-staking

$ geth manage-staking deploy-managers <withdrawalDelay> <seigPerBlock>    # Deploy staking manager contracts (except PowerTON)

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev.key value                     Comma separated developer account key as hex(for dev)

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth manage-staking deploy-powerton <roundDuration>    # Deploy PowerTON contract

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
  --rootchain.wton value              Address of WTON token contract
  --rootchain.seigmanager value       Address of SeigManager contract
$ geth manage-staking start-powerton    # Start PowerTON first round

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev.key value                     Comma seperated developer account key as hex(for dev)

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.powerton value          Address of PowerTON contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth manage-staking register    # Register RootChain contract

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev.key value                     Comma seperated developer account key as hex(for dev)

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth manage-staking set-commission-rate <rate> <isCommissionRateNegative>    # Set commission rate

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev.key value                     Comma seperated developer account key as hex(for dev)

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth manage-staking get-managers <path>    # Get staking managers addresses in database

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")
$ geth manage-staking set-managers <uri>    # Set staking managers addresses in database

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.registry value          Address of RootChainRegistry contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.powerton value          Address of PowerTON contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth manage-staking mint-ton <to> <amount>    # Mint TON to account (for dev)

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)

staking

$ geth staking balances <address>    # Print balances of token and stake

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
$ geth staking swap-from-ton <tonAmount>    # Swap TON to WTON

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking swap-to-ton <wtonAmount>    # Swap WTON to TON

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking stake-ton <amount>    # Stake TON

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking stake-wton <amount>    # Stake WTON

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking restake <amount>    # Restake pending withdrawal request

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.seigmanager value       Address of SeigManager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking request-withdrawal <amount>    # Make a withdrawal request

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)
$ geth staking process-withdrawal <numRequests>    # Process pending withdrawals

ETHEREUM OPTIONS:
  --datadir value                     Data directory for the databases and keystore (default: "/Users/thomashin/Library/Ethereum")

ACCOUNT OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input

PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.

PLASMA EVM - STAKING OPTIONS OPTIONS:
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.depositmanager value    Address of Deposit Manager contract
  --rootchain.gasprice value          Transaction gas price to root chain in GWei (default: 10000000000)

plasma-evm's People

Contributors

4000d avatar acud avatar arachnid avatar cd4761 avatar cjentzsch avatar cubedro avatar dcanyon avatar debris avatar fjl avatar frncmx avatar gavofyork avatar gballet avatar gluk256 avatar holiman avatar holisticode avatar janos avatar jpeletier avatar jsvisa avatar karalabe avatar kielbarry avatar matthalp-zz avatar nolash avatar nonsense avatar obscuren avatar rjl493456442 avatar shingonu avatar tgerring avatar vbuterin avatar zelig avatar zsfelfoldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plasma-evm's Issues

Request Block invalid at User node

Plasma-evm Operator Node does not matter generate ORB and insert into Chain, itself.
But, User node could not accept The ORB block from Operator node.

System information

Geth version: geth.1.8.20-plasma-evm
OS & Version: OSX/Ubuntu
Commit hash : develop commit 94d013d

Expected behaviour

User Node Accept *RB blocks as like NRB

INFO [06-26|23:37:25.466] Watching epoch prepared event            start block number=0
INFO [06-26|23:37:25.466] Watching block finalized event           start block number=0
INFO [06-26|23:37:25.467] IPC endpoint opened                      url=/Users/jins/plasma-rbg/newgeth/geth.ipc
INFO [06-26|23:37:25.468] HTTP endpoint opened                     url=http://0.0.0.0:8547                     cors=* vhosts=172.30.1.20,172.30.1.39,localhost
INFO [06-26|23:37:45.358] Block synchronisation started
INFO [06-26|23:37:45.396] Imported new chain segment               blocks=2 txs=2 mgas=1.469 elapsed=2.374ms    mgasps=618.589 number=2 hash=39cdeb…2d5465 age=1d7h35m  cache=8.11kB
INFO [06-26|23:37:45.463] Imported new chain segment               blocks=46 txs=63 mgas=37.869 elapsed=59.359ms   mgasps=637.953 number=48 hash=4de322…8f3f85 age=1d4h28m  cache=244.67kB

Actual behaviour

User node block synchronisation failed

Steps to reproduce the behaviour

  1. Setup Operator Node, User Node then Check Peer connection each other.
  2. Use startEnter method at rootchain contract to make ORB on Operator Node.
  3. Send some dummy transaction to make starting Mining ORB in Plasma-evm
  4. Operator Node Generated ORB, User Node is going to sync These blocks.

Backtrace

[backtrace]
INFO [06-25|11:51:37.681] Stats daemon started
INFO [06-25|11:51:37.687] IPC endpoint opened                      url=/root/.ethereum/geth.ipc
WARN [06-25|11:51:37.687] Stats server unreachable                 err="websocket.Dial ws://172.30.1.11/api: bad status"
INFO [06-25|11:51:37.688] HTTP endpoint opened                     url=http://0.0.0.0:8547      cors=* vhosts=172.30.1.11,172.30.1.39,localhost
INFO [06-25|11:51:47.547] Block synchronisation started
ERROR[06-25|11:51:47.571]
########## BAD BLOCK #########
Chain config: {ChainID: 16 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: <nil> Engine: ethash}

Number: 49
Hash: 0x938796b8895d266d98e5c8eda602c29369f42690b8d6fd5095abf03a25f6d634
	 0: cumulative: 50150 gas: 50150 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0x3556576fca4b70c699c457e2dda1f5a711df954f80ebe9d8209a6cca6a8e3d8e logs: [0xc0030f11e0] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000040000000000040000000000000000 state:
	 1: cumulative: 85364 gas: 35214 contract: 0x0000000000000000000000000000000000000000 status: 1 tx: 0x454a9d5b28bc9585907e78d6115a98cc6f5cb414128b2dce56ea14f6256f8140 logs: [0xc0030f1290] bloom: 00000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000040000000000040000000000000000 state:


Error: invalid merkle root (remote: a7aab665128eccde77e9233c4cb3aa2c8d22751a8aa717455d9b6ba5cd072b04 local: ffe96e69a22e68c5aad96192407b83f5230805d7694fab62b6a29ced3f9dddc9)
##############################

puppeth: deploy RootChain contract

In puppeth, insert geth deploy feature into puppeth in order to facilitate setting genesis.

Moreover, staking and PowerTON contract would be deployed at the same time.

1 tx in 1 block question

Why always single tx is included in 1 block?

It could be more? And if yes, how to adjust that value?

NRB#2 is mined just after NRB#1 is mined.

Abstract

When just after Plasma service is started and 1 TX are added, NRB#1 is mined as expected. But the next NRB#2 is unexpectedly and occasionally mined.

Expected behaviour

No NRB#2 is mined unless 2nd TX are added to tx pool

Actual behaviour

Unexpectedly NRB#2 is generated

Steps to reproduce the behaviour

run TestScenario3 in rootchain_manager_test.go. It crashes on below assertion

https://github.com/Onther-Tech/plasma-evm/blob/d57cae1e882a19d85f1fc9acf0f20f33cce0b860/pls/rootchain_manager_test.go#L404

(Error when tried to commit)panic: runtime error: invalid memory address or nil pointer dereference

epoch : 2

made a 2 dummy tx via console.

ubuntu@ip-172-31-19-165:~/plasma-evm$ build/bin/geth attach --datadir ./operaror
Welcome to the Geth JavaScript console!

instance: Geth/v1.9.10-stable-aed5ae2f/linux-amd64/go1.13.4
coinbase: 0x340c44089bc45f86060922d2d89efee9e0cdf5c7
at block: 0 (Thu, 01 Jan 1970 00:00:00 UTC)
 datadir: /home/ubuntu/plasma-evm/operator
 modules: admin:1.0 debug:1.0 eth:1.0 ethash:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0


> eth.sendTransaction({from: eth.accounts[0], to:eth.accounts[0], value: 0})   
"0x7c579204b53d3b9cccd2bb990b87baf8b048bb1777a256a848bb3bb64178c8a5"
> eth.sendTransaction({from: eth.accounts[0], to:eth.accounts[0], value: 0})   
"0xba24dd1eaf44ed3a294e8f7c07bc14c68867c35021c01eacc3054a4a15561359"

Error log

ubuntu@ip-172-31-19-165:~/plasma-evm$ nohup build/bin/geth --nousb         --datadir ./operator                      --rootchain.url wss://mainnet.infura.io/ws/v3/d738213eecc341feb0bf0021390c75e4                      --operator 0x340c44089bc45f86060922d2d89efee9e0cdf5c7                      --operator.password pwd.pass &
[1] 17033
ubuntu@ip-172-31-19-165:~/plasma-evm$ nohup: ignoring input and appending output to 'nohup.out'

ubuntu@ip-172-31-19-165:~/plasma-evm$ tail -f nohup.out 
INFO [05-14|15:49:46.048] Initialising Plasma protocol             versions="[64 63]" network=16 dbversion=<nil>
WARN [05-14|15:49:46.048] Upgrade blockchain database version      from=<nil> to=7
INFO [05-14|15:49:46.048] Loaded most recent local header          number=0 hash=154e22…69ceaa td=1 age=51y1mo6d
INFO [05-14|15:49:46.048] Loaded most recent local full block      number=0 hash=154e22…69ceaa td=1 age=51y1mo6d
INFO [05-14|15:49:46.048] Loaded most recent local fast block      number=0 hash=154e22…69ceaa td=1 age=51y1mo6d
INFO [05-14|15:49:46.049] Regenerated local transaction journal    transactions=0 accounts=0
INFO [05-14|15:49:46.061] Allocated fast sync bloom                size=654.00MiB
INFO [05-14|15:49:46.093] Initialized fast sync bloom              items=21 errorrate=0.000 elapsed=29.972ms
INFO [05-14|15:49:46.834] Rootchain provider connected             url=wss://mainnet.infura.io/ws/v3/d738213eecc341feb0bf0021390c75e4
INFO [05-14|15:49:47.053] Transaction manager loaded               numAccounts=0
INFO [05-14|15:49:50.058] New local node record                    seq=1 id=ede8d6b106a31c6a ip=127.0.0.1 udp=30305 tcp=30305
INFO [05-14|15:49:50.058] Started P2P networking                   self=enode://61997c06504f56e4b4d77b613de0c6845e3589561ed4a6044af05ae416f707cc8005ffc1cbc4c5d5e3aa619adeb5a8c6e6ce906d844a8c1cde76684d2947a00f@127.0.0.1:30305
INFO [05-14|15:49:50.491] Iterating epoch prepared event 
INFO [05-14|15:49:50.491] RootChain epoch prepared                 epochNumber=1 startBlockNumber=1 endBlockNumber=2 epochLength=2 isRequest=false userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [05-14|15:49:50.491] RootChain epoch prepared                 epochNumber=2 startBlockNumber=2 endBlockNumber=2 epochLength=1 isRequest=true  userActivated=false isEmpty=true  ForkNumber=0 isRebase=false
INFO [05-14|15:49:50.491] epoch is empty, jump to next epoch
INFO [05-14|15:49:50.491] RootChain epoch prepared                 epochNumber=3 startBlockNumber=3 endBlockNumber=4 epochLength=2 isRequest=false userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [05-14|15:49:50.492] NRB epoch is prepared, NRB epoch is started epochLength=2
INFO [05-14|15:49:50.492] NRB epoch is prepared, NRB epoch is started epochLength=2
INFO [05-14|15:49:50.704] Iterating block finalized event 
INFO [05-14|15:49:50.704] RootChain block finalized                forkNumber=0 blockNubmer=0
ERROR[05-14|15:49:50.704] Failed to get challenger account         err="unknown account"
INFO [05-14|15:49:51.012] Watching epoch prepared event            startBlockNumber=0
INFO [05-14|15:49:51.257] Watching block finalized event           startBlockNumber=0
INFO [05-14|15:49:51.449] Updated mining threads                   threads=2
INFO [05-14|15:49:51.450] current epoch is resumed
INFO [05-14|15:49:51.451] IPC endpoint opened                      url=/home/ubuntu/plasma-evm/operator/geth.ipc
INFO [05-14|15:50:11.548] New root chain block mined               number=10065211 numTxs=201 gasUsed=9949468 gasLimit=9980018
INFO [05-14|15:50:18.597] New root chain block mined               number=10065212 numTxs=102 gasUsed=9967958 gasLimit=9984847
ERROR[05-14|15:50:43.841] Failed to read root chain block          err="not found"
INFO [05-14|15:51:00.917] New root chain block mined               number=10065214 numTxs=191 gasUsed=9980526 gasLimit=9999456
ERROR[05-14|15:51:01.130] Failed to read root chain block          err="not found"
INFO [05-14|15:51:06.597] Etherbase automatically configured       address=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:51:19.061] New root chain block mined               number=10065216 numTxs=175 gasUsed=9983078 gasLimit=9990236
INFO [05-14|15:51:30.936] Setting new local account                address=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:51:30.937] Submitted transaction                    fullhash=0x094325666e9f9d31d2ed73251c8e3452fc02732657c6e6b2829c07cb8f4d41fe recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:51:33.457] Commit new mining work                   number=1    
    sealhash=12d0d8…edd6c1 uncles=0 txs=1 gas=21000 fees=2.1e-05 elapsed=729.399µs
INFO [05-14|15:51:33.458] Successfully sealed new block            number=1    
    sealhash=12d0d8…edd6c1 hash=cae735…5c7701 elapsed=436.755µs
INFO [05-14|15:51:33.458] �🔨 mined potential block                  number=1 
     hash=cae735…5c7701
INFO [05-14|15:51:33.458] New block is mined                       number=1    
INFO [05-14|15:51:33.530] New root chain block mined               number=10065217 numTxs=130 gasUsed=9985882 gasLimit=9999991
INFO [05-14|15:51:33.669] Submitted transaction                    fullhash=0x6e8087c1faa26b4fbf90a3e20efecdeaa652fc70ef4f06c4478920cba37bce88 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
WARN [05-14|15:51:33.671] Operator account balance on rootchain is too low     
INFO [05-14|15:51:33.671] Non-request epoch is not completed yet   epochNumber=3
INFO [05-14|15:51:36.459] Commit new mining work                   number=2    
    sealhash=c6c6da…f49fa5 uncles=0 txs=1 gas=21000 fees=2.1e-05 elapsed=586.694µs
INFO [05-14|15:51:36.459] Successfully sealed new block            number=2    
    sealhash=c6c6da…f49fa5 hash=faad8a…e5464d elapsed=411.323µs
INFO [05-14|15:51:36.459] �🔨 mined potential block                  number=2 
     hash=faad8a…e5464d
INFO [05-14|15:51:36.459] New block is mined                       number=2    
WARN [05-14|15:51:36.693] Operator account balance on rootchain is too low 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xd8a463]

goroutine 118 [running]:
github.com/Onther-Tech/plasma-evm/core/types.(*Block).Number(...)
        /home/ubuntu/plasma-evm/core/types/block.go:312
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).addEpochSubmitTransaction(0xc00001d860, 0xc0005054d0, 0x2, 0x2, 0xc000541e38, 0x6)
        /home/ubuntu/plasma-evm/pls/rootchain_manager.go:351 +0x1e3
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runSubmitter.func1(0xc00133b5f0, 0x0, 0x0)
        /home/ubuntu/plasma-evm/pls/rootchain_manager.go:451 +0x726
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runSubmitter(0xc00001d860)
        /home/ubuntu/plasma-evm/pls/rootchain_manager.go:474 +0x201
created by github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).run       
        /home/ubuntu/plasma-evm/pls/rootchain_manager.go:175 +0x65

After this, can't commit anymore.

ubuntu@ip-172-31-19-165:~/plasma-evm$ nohup build/bin/geth --nousb
         --datadir ./operator                      --rootchain.url wss://mainnet.infura.io/ws/v3/d738213eecc341feb0bf0021390c75e4                      --operator 0x340c44089bc45f86060922d2d89efee9e0cdf5c7                      --operator.password pwd.pass &
[1] 17060
ubuntu@ip-172-31-19-165:~/plasma-evm$ nohup: ignoring input and appending output to 'nohup.out'
ubuntu@ip-172-31-19-165:~/plasma-evm$ tail -f nohup.out 
INFO [05-14|15:55:30.057] Iterating block finalized event 
INFO [05-14|15:55:30.058] RootChain block finalized                forkNumber=0 blockNubmer=0
ERROR[05-14|15:55:30.058] Failed to get challenger account         err="unknown account"
INFO [05-14|15:55:30.326] Watching epoch prepared event            startBlockNumber=0
INFO [05-14|15:55:30.580] Watching block finalized event           startBlockNumber=0
INFO [05-14|15:55:30.772] Updated mining threads                   threads=2   
INFO [05-14|15:55:30.772] Transaction pool price threshold updated price=1000000000
INFO [05-14|15:55:30.772] Etherbase automatically configured       address=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:55:30.772] current epoch is already completed. stop miner       
INFO [05-14|15:55:30.774] IPC endpoint opened                      url=/home/ubuntu/plasma-evm/operator/geth.ipc
INFO [05-14|15:55:36.387] New root chain block mined               number=10065240 numTxs=117 gasUsed=9969687 gasLimit=9985005
INFO [05-14|15:56:01.601] New root chain block mined               number=10065241 numTxs=113 gasUsed=9977296 gasLimit=9989860
INFO [05-14|15:56:03.768] New root chain block mined               number=10065242 numTxs=135 gasUsed=9802284 gasLimit=9994721
INFO [05-14|15:56:07.198] New root chain block mined               number=10065243 numTxs=106 gasUsed=9806484 gasLimit=9999320
INFO [05-14|15:56:07.253] Submitted transaction                    fullhash=0xe68b542da818db76195ff056fb8f753b98c06ebc77e9f58d030cfd1fe5576380 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:56:08.152] New root chain block mined               number=10065244 numTxs=73  gasUsed=9998240 gasLimit=10000000
INFO [05-14|15:56:10.108] Submitted transaction                    fullhash=0x763d5703629fcef939a8c29a654e4e1c2fc93d58956cb30dbf6fee1d8c8f8a7e recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:56:14.693] New root chain block mined               number=10065245 numTxs=19  gasUsed=5502679 gasLimit=9990259
INFO [05-14|15:56:17.415] New root chain block mined               number=10065246 numTxs=89  gasUsed=9948352 gasLimit=9988564
INFO [05-14|15:56:30.539] Submitted transaction                    fullhash=0xba74590667480ec62604833173f340e08090228e8eb5b622528b1b2b53af6b9e recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:56:31.131] Submitted transaction                    fullhash=0x9cb5d1eda5d49196c514d04ed0e84fe81cdde41e6c4233b27cb3565de2489a26 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:56:31.578] Submitted transaction                    fullhash=0xd4bde8d8e74c8ff104431c3965f70d8f5bb50245e3014ff395762007ba331970 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:56:34.896] New root chain block mined               number=10065247 numTxs=125 gasUsed=9952313 gasLimit=9993383
INFO [05-14|15:56:40.697] New root chain block mined               number=10065248 numTxs=115 gasUsed=9969017 gasLimit=9983625
INFO [05-14|15:56:44.663] New root chain block mined               number=10065249 numTxs=0   gasUsed=0       gasLimit=9993373
INFO [05-14|15:56:51.062] New root chain block mined               number=10065250 numTxs=132 gasUsed=9989817 gasLimit=10000000
INFO [05-14|15:56:53.643] New root chain block mined               number=10065251 numTxs=45  gasUsed=9972531 gasLimit=9990236
INFO [05-14|15:56:56.265] New root chain block mined               number=10065252 numTxs=57  gasUsed=9984401 gasLimit=9995089
INFO [05-14|15:57:04.458] Submitted transaction                    fullhash=0x2730f18fa193fa94f42f9ac73ac88a4d14fe10250f7c4b3303a53856ac81270e recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:57:04.883] New root chain block mined               number=10065253 numTxs=91  gasUsed=9990084 gasLimit=10000000
INFO [05-14|15:57:13.893] New root chain block mined               number=10065254 numTxs=63  gasUsed=9982702 gasLimit=9990236
INFO [05-14|15:57:17.446] New root chain block mined               number=10065255 numTxs=46  gasUsed=9985706 gasLimit=9999991
INFO [05-14|15:57:18.802] Submitted transaction                    fullhash=0xa5b88b601b5f296a7096c9630e55c9f2f78d0c5f6fcee486467ad0dba829e158 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:57:20.312] Submitted transaction                    fullhash=0x26ce99c83df33cf6373ff33beea7f8c0339367bf3034c2a891679aaad20b10ca recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:57:38.204] Submitted transaction                    fullhash=0xfdd5bf0003c582d8b26033113ed19198f0df5b395027d38b528c3d07255662bd recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:57:39.582] Submitted transaction                    fullhash=0xff84dd5bf5118216dcf0b845097b94488ca6144b265893c16dec7e4f0bc1a102 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:58:11.885] New root chain block mined               number=10065256 numTxs=177 gasUsed=9992410 gasLimit=10000000
INFO [05-14|15:58:28.139] New root chain block mined               number=10065256 numTxs=35  gasUsed=9983717 gasLimit=9990227
INFO [05-14|15:58:28.660] New root chain block mined               number=10065257 numTxs=186 gasUsed=9993124 gasLimit=9999982
INFO [05-14|15:58:35.112] New root chain block mined               number=10065256 numTxs=177 gasUsed=9992410 gasLimit=10000000
INFO [05-14|15:58:35.613] New root chain block mined               number=10065257 numTxs=107 gasUsed=9992702 gasLimit=10000000
INFO [05-14|15:58:35.878] New root chain block mined               number=10065258 numTxs=199 gasUsed=9985369 gasLimit=10000000
INFO [05-14|15:58:36.097] New root chain block mined               number=10065256 numTxs=35  gasUsed=9983717 gasLimit=9990227
INFO [05-14|15:58:36.621] New root chain block mined               number=10065257 numTxs=186 gasUsed=9993124 gasLimit=9999982
INFO [05-14|15:58:36.897] New root chain block mined               number=10065258 numTxs=153 gasUsed=9981540 gasLimit=9990218
INFO [05-14|15:58:40.517] Submitted transaction                    fullhash=0x0bba5ac2e823c368f167539c802cf3d2acf7c0360255c4c4e0e791b590b34523 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:58:41.069] Submitted transaction                    fullhash=0xf4a7729d76a43b58e80c87613a686dc5bbb2371e721c7bd2e1ce7253867adbe6 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:58:42.250] Submitted transaction                    fullhash=0x83fde29cf2e4cd04254349956ad9e29547c7ad9179e4792371f5d3a08eede4f5 recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:58:42.428] New root chain block mined               number=10065259 numTxs=149 gasUsed=9976410 gasLimit=9995084
INFO [05-14|15:58:42.726] Submitted transaction                    fullhash=0xcdf35c357d5a2b313424d7a27f3b3f39044d8839c652d0babc4881b823aff45a recipient=0x340C44089bc45F86060922d2d89eFee9e0CDF5c7
INFO [05-14|15:58:45.970] New root chain block mined               number=10065260 numTxs=110 gasUsed=9992202 gasLimit=9999938
INFO [05-14|15:58:51.245] New root chain block mined               number=10065261 numTxs=150 gasUsed=9956358 gasLimit=9990174
INFO [05-14|15:58:55.522] New root chain block mined               number=10065262 numTxs=10  gasUsed=399171  gasLimit=9980454
INFO [05-14|15:59:21.953] New root chain block mined               number=10065263 numTxs=131 gasUsed=9959555 gasLimit=9970709

Fix cmd/bootnode

bootnode to peer discovery doesn't work currently. should be fixed.

This issues covers

  • fix cmd/bootnode or other packages
  • update puppeth bootnode deployment (not full node)
  • add puppeth deployment type: full node (public node for JSONRPC or others..)

Does childchain option work? what is purpose of this function?

PLASMA EVM - CHILDCHAIN OPTIONS:
--childchain.url value JSONRPC endpoint of child chain provider.
--childchain.sender value Sender address of child chain transaction
--childchain.gasprice value Gas price for child chain transaction in GWei (default: 0)

  1. If it does not implemented, it should be deleted from help command
  2. If it is implemented, decide whether this command stays here or should be gone.

cmd/geth: Change to default gcmode preventing lost blocks

When Plasma-EVM process killed by accidently.

If not using --gcmode "archive" for running plasma-evm, you will see result like this when restart plasma-evm after process killed abnormally.

INFO [05-08|13:34:42.947] Commit new mining work                   number=6 sealhash=a5773d…36db3f uncles=0 txs=2 gas=42000 fees=4.2e-05 elapsed=1.139ms
INFO [05-08|13:34:42.947] Successfully sealed new block            number=6 sealhash=a5773d…36db3f hash=6d082b…870200 elapsed=427.697µs
INFO [05-08|13:34:42.948] 🔨 mined potential block                  number=6 hash=6d082b…870200
INFO [05-08|13:34:42.948] New block is mined                       number=6
INFO [05-08|13:34:42.948] IPC endpoint opened                      url=/Users/jinhwan/gitrepo/plasma-evm/.pls.staking/operator2/geth.ipc
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x49759d4]

goroutine 195 [running]:
github.com/Onther-Tech/plasma-evm/core/types.(*Block).Number(...)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/core/types/block.go:312
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).addEpochSubmitTransaction(0xc000828320, 0xc0000c6f00, 0x2, 0x2, 0xc00151fe38, 0x6)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:352 +0x274
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runSubmitter.func1(0xc000922240, 0x0, 0x0)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:451 +0x726
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runSubmitter(0xc000828320)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:474 +0x201
created by github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).run
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:175 +0x65

currently, gcmode is "full" have to change gcmode to "archive".

Update chain config for each plasma networks

Chain config in Ethereum udpated whenever hardfork happens. Original go-ethereum apply chain config changes by updating go-ethereum itself, and all nodes must update their client due to follow the changes and hard forks.

Those are implemented in params/config.go.

But plasma-evm client is used for each networks with different chain config, because it is meant to make a lot of plasma network with a same client.

We need to support updating chain config system for each sub-networks, not by inserting sub-network config in plasma-evm implementation as go-ethereum does.

Failed to deploy rootchain contract from remote instance to private rootchain.

System information

  • Geth version: 917ac4a
  • OS & Version: Ubuntu 18.04

behaviour

This is rootchain settings. I allowed to wsaddr "0.0.0.0", and unlock firewall in OS.

build/bin/geth \
  --dev \
  --dev.period 1 \
  --dev.faucetkey "$OPERATOR_PRIV_KEY,$KEY0,$KEY1,$KEY2,$KEY3,$CHALLENGER_KEY" \
  --miner.gastarget 7500000 \
  --miner.gasprice "10" \
  --rpc \
  --rpcport 8545 \
  --rpcapi eth,debug,net\
  --ws \
  --wsaddr "0.0.0.0"\
  --wsport 8546

I tried to connect from remote instance, this is parameters.

# rootchain.deploy.sh
#!/usr/bin/env bash

OPERATOR_KEY="<op key>"
KEY2="<key2>"
KEY3="<key3>"
KEY4="<key4>"
KEY5="<key5>"
CHALLENGER_KEY="<ch key>"

DATADIR=pls.data
OPERATOR="<op addrs>"
CHALLENGER="<ch addrs>"

ROOTCHAIN_IP=<rootchain's IP Address> # ROOTCHAIN instance's IP address

# Deploy contracts at rootchain
echo "Deploy rootchain contract and others"
make geth && build/bin/geth \
    --rootchain.url "wss://$ROOTCHAIN_IP:8546" \
    --operator.key $OPERATOR_KEY \
    --datadir $DATADIR \
    deploy "./genesis.json" 16 true 4096

# deploy params : chainID, isInitialAsset, Epochlength
# you can checkout "$geth deploy --help" for more information

Backtrace

It constantly fails.

ubuntu@ip-172-31-26-130:~/plasma-evm$ bash rootchain.deploy.sh
Deploy rootchain contract and others
build/env.sh go run build/ci.go install ./cmd/geth
>>> /usr/lib/go-1.10/bin/go install -ldflags -X main.gitCommit=917ac4a04a595fe9535bf26a71211bd2daa1c021 -X main.gitDate=20190930 -v ./cmd/geth
Done building.
Run "/home/ubuntu/plasma-evm/build/bin/geth" to launch geth.
INFO [02-24|20:38:02.305] Maximum peer count                       ETH=50 LES=0 total=50
INFO [02-24|20:38:02.305] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
ERROR[02-24|20:38:02.305] Failed to enumerate USB devices          hub=ledger vendor=11415 failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[02-24|20:38:02.305] Failed to enumerate USB devices          hub=trezor vendor=21324 failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[02-24|20:38:02.305] Failed to enumerate USB devices          hub=trezor vendor=4617  failcount=1 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[02-24|20:38:02.305] Failed to enumerate USB devices          hub=ledger vendor=11415 failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[02-24|20:38:02.306] Failed to enumerate USB devices          hub=trezor vendor=21324 failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
ERROR[02-24|20:38:02.306] Failed to enumerate USB devices          hub=trezor vendor=4617  failcount=2 err="failed to initialize libusb: libusb: unknown error [code -99]"
Fatal: Failed to connect rootchain: tls: oversized record received with length 20527

Did I miss any parameters in deploying shell script?

cmd/geth: need to unify `gasprice` flags

currently, rootchain.gasprice flag is set at STAKING OPTIONS. but If we are gonna unify gasprice flags, It would be better to set at ROOTCHAIN CONTRACT OPTIONS.

considering user(developer) interface

cmd/geth : Enhancing Negative Input for commission rate

Currently, Negative Input for setCommission like this.

build/bin/geth  manage-staking setCommissionRate \
    --datadir ./.pls.staking/operator1 \
    --rootchain.url ws://127.0.0.1:8546 \           
    --unlock 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f  \
    --password pwd.pass   \
    --rootchain.sender 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f  \
    -- -0.4

Cause CLI could not recognize with - operator as a minus. treat as starting flag.

And also, the negative commission rate output as following.

rootchain=0xd6662103d7Ffd6D44792d9866AfAD0Beef5d3c32 commissionRate=-0.010

User and Operator may mis reading as a positive rate In a terminal.

I suggest that using prefix "M" with commission rate input.

Expecting result.

build/bin/geth  manage-staking setCommissionRate M0.01 \
    --datadir ./.pls.staking/operator1 \
    --rootchain.url ws://127.0.0.1:8546 \           
    --unlock 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f  \
    --password pwd.pass   \
    --rootchain.sender 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f 

rootchain=0xd6662103d7Ffd6D44792d9866AfAD0Beef5d3c32 commissionRate=M0.010

pls package test failed, even all test code successfully done.

test pls package got failed even all test code well run in most of the times.

In the same condition.

Fail : https://app.circleci.com/pipelines/github/sifnoc/plasma-evm/91/workflows/eac48142-d481-4e1d-8d05-b8e5e0b257c7/jobs/209
Pass : https://app.circleci.com/pipelines/github/sifnoc/plasma-evm/91/workflows/b461c836-3fd3-46be-9986-dad01c41ea86/jobs/213

System information

Geth version: geth 1.10
OS & Version: go1.13 & Linux
Commit hash : edb61b2

Expected behavior

Pass test TestInvalidExit

Actual behaviour

Sometimes Fail, even all test procedures done.

DEBUG[04-10|16:12:19.003|rpc/server.go:123]                  RPC server shutting down 
INFO [04-10|16:12:19.003|core/blockchain.go:911]             Writing cached state to disk             block=19 hash=3d3d22…552ff4 root=fc9a7e…87c2d6
DEBUG[04-10|16:12:19.003|rpc/client.go:555]                  RPC connection read error                err="io: read/write on closed pipe"
DEBUG[04-10|16:12:19.003|rpc/client.go:555]                  RPC connection read error                err=EOF
INFO [04-10|16:12:19.003|trie/database.go:748]               Persisted trie from memory database      nodes=22 size=6.20KiB   time=237.91µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=58 livesize=11.40KiB
INFO [04-10|16:12:19.003|core/blockchain.go:911]             Writing cached state to disk             block=18 hash=d8ea08…2c7a21 root=120432…e7754a
INFO [04-10|16:12:19.003|trie/database.go:748]               Persisted trie from memory database      nodes=3  size=659.00B   time=32.911µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=55 livesize=10.75KiB
INFO [04-10|16:12:19.003|tx/manager.go:681]                  Transaction is confirmed                 addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[04-10|16:12:19.003|tx/manager.go:675]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(15: [18-19])"
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=6.624µs  gcnodes=3 gcsize=595.00B gctime=6.351µs livenodes=52 livesize=10.17KiB
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=3.714µs  gcnodes=6 gcsize=1.16KiB gctime=9.955µs livenodes=49 livesize=9.59KiB
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=3.308µs  gcnodes=9 gcsize=1.74KiB gctime=13.182µs livenodes=46 livesize=9.01KiB
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=4  size=677.00B   time=6.732µs  gcnodes=13 gcsize=2.40KiB gctime=19.78µs  livenodes=42 livesize=8.35KiB
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=3.546µs  gcnodes=16 gcsize=3.05KiB gctime=23.232µs livenodes=39 livesize=7.70KiB
DEBUG[04-10|16:12:19.003|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.799µs  gcnodes=19 gcsize=3.69KiB gctime=27.921µs livenodes=36 livesize=7.06KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=5  size=863.00B   time=6.22µs   gcnodes=24 gcsize=4.53KiB gctime=34.033µs livenodes=31 livesize=6.22KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=5.791µs  gcnodes=27 gcsize=5.18KiB gctime=39.72µs  livenodes=28 livesize=5.57KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.214µs  gcnodes=30 gcsize=5.82KiB gctime=43.84µs  livenodes=25 livesize=4.93KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.155µs  gcnodes=33 gcsize=6.46KiB gctime=47.896µs livenodes=22 livesize=4.29KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.768µs  gcnodes=36 gcsize=7.11KiB gctime=52.558µs livenodes=19 livesize=3.64KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=634.00B   time=3.89µs   gcnodes=39 gcsize=7.73KiB gctime=56.343µs livenodes=16 livesize=3.02KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.103µs  gcnodes=42 gcsize=8.37KiB gctime=60.337µs livenodes=13 livesize=2.38KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=3.934µs  gcnodes=45 gcsize=9.01KiB gctime=64.17µs  livenodes=10 livesize=1.74KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=3.832µs  gcnodes=48 gcsize=9.66KiB gctime=67.906µs livenodes=7  livesize=1.09KiB
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.616µs  gcnodes=51 gcsize=10.30KiB gctime=72.428µs livenodes=4  livesize=461.00B
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=3.235µs  gcnodes=54 gcsize=10.95KiB gctime=75.584µs livenodes=1  livesize=-198.00B
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=544ns    gcnodes=54 gcsize=10.95KiB gctime=76.036µs livenodes=1  livesize=-198.00B
DEBUG[04-10|16:12:19.004|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=499ns    gcnodes=54 gcsize=10.95KiB gctime=76.456µs livenodes=1  livesize=-198.00B
INFO [04-10|16:12:19.004|core/blockchain.go:924]             Blockchain manager stopped 
INFO [04-10|16:12:19.004|pls/handler.go:265]                 Stopping Plasma protocol 
INFO [04-10|16:12:19.004|pls/handler.go:286]                 Plasma protocol stopped 
INFO [04-10|16:12:19.004|core/tx_pool.go:424]                Transaction pool stopped 
DEBUG[04-10|16:12:19.004|pls/downloader/downloader.go:578]   Reset ancient limit to zero 
CRIT [04-10|16:12:19.004|tx/rawdb.go:207]                    Failed to store number of raw transactions err="database closed"
FAIL	github.com/Onther-Tech/plasma-evm/pls	299.623s
FAIL

More details in : https://app.circleci.com/pipelines/github/sifnoc/plasma-evm/94/workflows/fb8e2e37-51a6-440c-9b77-7ef640694630/jobs/223

Steps to reproduce the behavior

Configuration is here

Docker Image build error.

There are some directory path error in Dockerfiles

for Example,

FROM alpine:3.7

RUN \
  apk add --update go git make gcc musl-dev linux-headers ca-certificates && \
  git clone --depth 1 https://github.com/Onther-Tech/plasma-evm && \
  (cd go-ethereum && make geth) && \
  cp go-ethereum/build/bin/geth /geth && \
  apk del go git make gcc musl-dev linux-headers && \
  rm -rf /go-ethereum && rm -rf /var/cache/apk/*

Cannot progress after cd go-ethereum bacause clone directory name is plasma-evm

Should change to plasma-evm from go-ethereum.
Target files
plasma-evm/containers/docker/develop-alpine/Dockerfile
plasma-evm/containers/docker/develop-ubuntu/Dockerfile
plasma-evm/containers/docker/master-alpine/Dockefile
plasma-evm/containers/docker/master-ubuntu/Dockefile

System information

OS & Version: Ubuntu:16.04

Expected behaviour

Build Image well

Actual behaviour

Could not make build docker image from dockerfile

Steps to reproduce the behaviour

> docker build -f Dockerfile

Backtrace

[backtrace]
(20/20) Installing musl-dev (1.1.16-r14)
Executing busybox-1.26.2-r9.trigger
OK: 125 MiB in 32 packages
Cloning into 'plasma-evm'...
/bin/sh: cd: line 1: can't cd to go-ethereum

crashed in handleBlockFinalized

System information

Geth version:

Geth
Version: 1.9.1-stable
Git Commit: 4bf7d7e315e19a2b31683935e866ae952b32ab7d
Git Commit Date: 20200406
Architecture: amd64
Protocol Versions: [63]
Network Id: 1
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

Plasma-evm version:

Version: 1.9.10-stable
Git Commit: 3fd45f8a7ad8f478c23ad1a0587e12ae2a824e99
Git Commit Date: 20200520
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

OS & Version: Ubuntu 18.04.1 LTS
Commit hash : 3fd45f8

Expected behaviour

shouldn't crash

Actual behaviour

crash

Steps to reproduce the behaviour

test test_requestable.py (https://github.com/Onther-Tech/tokamak-network-test)

Random test backtrace

opcode 2 : 0xaA60af9BD19dc7438fd19457955C52982D070D27, c9059de8e68f483f534ff2bbf9f230d09f9691699b7dbeb8b44257e511f4fb05, 0x00000000000000000000000000000000
opcode 4 : 0xC927A0CF2d4a1B59775B5D0A35ec76d099e1FaD4, 0x48aFf0622a866d77651eAaA462Ea77b5F39D0ae1, 992874217
opcode 0 : 0xec4A610a07e81264e8f7F1CAeAe522fEdD7e59c1, 891332370
opcode 1 : 0xb715125A08140AEA83588a4b569599cde4a0a336, 4c00cacaaf5ef155a8e67f0370e9fc524748551080083036991b1423b2f668db, 000000000000000000000000000000000000000000000000000000001ad72170
opcode 0 : 0x48aFf0622a866d77651eAaA462Ea77b5F39D0ae1, 924508723
opcode 4 : 0xb715125A08140AEA83588a4b569599cde4a0a336, 0xC927A0CF2d4a1B59775B5D0A35ec76d099e1FaD4, 472025900
opcode 3 : 0xaA60af9BD19dc7438fd19457955C52982D070D27, 0x515B385bDc89bCc29077f2B00a88622883bfb498
opcode 4 : 0xb715125A08140AEA83588a4b569599cde4a0a336, 0xec4A610a07e81264e8f7F1CAeAe522fEdD7e59c1, 55656962
opcode 2 : 0x515B385bDc89bCc29077f2B00a88622883bfb498, 9c4df1d8478abc345d9ede2e4386c63af1336152194130e8f1d04f672f99b25f, 0x00000000000000000000000000000000
opcode 1 : 0xb715125A08140AEA83588a4b569599cde4a0a336, 4c00cacaaf5ef155a8e67f0370e9fc524748551080083036991b1423b2f668db, 0000000000000000000000000000000000000000000000000000000000c87d35
opcode 0 : 0xC927A0CF2d4a1B59775B5D0A35ec76d099e1FaD4, 658837980
opcode 4 : 0xC927A0CF2d4a1B59775B5D0A35ec76d099e1FaD4, 0xb715125A08140AEA83588a4b569599cde4a0a336, 34540094
opcode 1 : 0x515B385bDc89bCc29077f2B00a88622883bfb498, 9c4df1d8478abc345d9ede2e4386c63af1336152194130e8f1d04f672f99b25f, 0000000000000000000000000000000000000000000000000000000010337d3c
opcode 3 : 0x515B385bDc89bCc29077f2B00a88622883bfb498, 0x48aFf0622a866d77651eAaA462Ea77b5F39D0ae1
opcode 1 : 0xec4A610a07e81264e8f7F1CAeAe522fEdD7e59c1, bd160060985bbbe5f53447c152178512818b28eca9204127c957b64863a68e2e, 000000000000000000000000000000000000000000000000000000002d1b9f70
opcode 0 : 0x499De281cd965781F1422b7cB73367C15DC416D2, 129546203
opcode 2 : 0x37da08b6Cd15c3aE905A25Df57B6841A5D80aC93, 0e142ce7154cbeb747506ea79357c7a76808498eefa4437168728cbf2aaf01fb, 0x00000000000000000000000000000000
opcode 3 : 0x5E3230019fEd7aB462e3AC277E7709B9b2716b4F, 0xec4A610a07e81264e8f7F1CAeAe522fEdD7e59c1
opcode 3 : 0xC927A0CF2d4a1B59775B5D0A35ec76d099e1FaD4, 0xaA60af9BD19dc7438fd19457955C52982D070D27
opcode 3 : 0x515B385bDc89bCc29077f2B00a88622883bfb498, 0xec4A610a07e81264e8f7F1CAeAe522fEdD7e59c1
opcode 3 : 0x5E3230019fEd7aB462e3AC277E7709B9b2716b4F, 0x48aFf0622a866d77651eAaA462Ea77b5F39D0ae1
opcode 1 : 0xaA60af9BD19dc7438fd19457955C52982D070D27, c9059de8e68f483f534ff2bbf9f230d09f9691699b7dbeb8b44257e511f4fb05, 000000000000000000000000000000000000000000000000000000002ce22498

geth backtrace

goroutine 87 [running]:
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).handleBlockFinalized(0xc000540b40, 0xc001c58780,      0x0, 0x0)
    /home/modagi/github/onther/plasma-evm/pls/rootchain_manager.go:727 +0xb25
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runHandlers(0xc000540b40)
    /home/modagi/github/onther/plasma-evm/pls/rootchain_manager.go:501 +0x15f
created by github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).run
    /home/modagi/github/onther/plasma-evm/pls/rootchain_manager.go:174 +0x43

TestBasic/TestInvalidExit failure case(request transaction in NRE)

TestBasic/TestInvalidExit in pla sometimes failed. NRE must occur after ORE in the tests, but the test fails because it contains a request transaction.

System information

Geth version:

Version: 1.9.1-stable
Git Commit: 4bf7d7e315e19a2b31683935e866ae952b32ab7d
Git Commit Date: 20200406
Architecture: amd64
Protocol Versions: [63]
Network Id: 1
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

plasma-evm:

Version: 1.9.10-stable
Git Commit: 3fd45f8a7ad8f478c23ad1a0587e12ae2a824e99
Git Commit Date: 20200520
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

OS & Version: Ubuntu 18.04.1 LTS
Commit hash : 3fd45f8

Expected behaviour

Pass TestBasic/TestInvalidExit in pls

Actual behaviour

Sometimes fail

Steps to reproduce the behaviour

go test -v --timeout 3600s ./pls -run TestBasic
go test -v --timeout 3600s ./pls -run TestInvalidExit

Backtrace

...
INFO [06-14|21:46:32.008|miner/unconfirmed.go:107]           🔗 block reached canonical chain          number=12     hash=c24ec5…7be547
INFO [06-14|21:46:32.008|miner/unconfirmed.go:85]            🔨 mined potential block                  number=19     hash=fdc46e…2c17e9
INFO [06-14|21:46:32.009|miner/worker.go:1177]               Commit new mining work                   number=20     sealhash=b21ec7…ccffa7 uncles=0 txs=0 gas=0      fees=0           elapsed=308.586µs
DEBUG[06-14|21:46:32.009|core/tx_pool.go:1254]               Reinjecting stale transactions           count=0
INFO [06-14|21:46:32.009|pls/rootchain_manager.go:424]       New block is mined                       number=19
DEBUG[06-14|21:46:32.010|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=65 t=1.758675ms
WARN [06-14|21:46:32.010|pls/rootchain_manager_test.go:2555] Check Block Number                       expectedBlockNumber=19 minedBlockNumber=19 forkNumber=1
WARN [06-14|21:46:32.010|pls/rootchain_manager_test.go:2633] Check epoch after submission             expectedEpochNumber=15
INFO [06-14|21:46:32.012|tx/manager.go:779]                  New root chain block mined               number=151212 numTxs=0 gasUsed=0      gasLimit=100000000
ERROR[06-14|21:46:32.012|pls/rootchain_manager.go:433]       Failed to get balance of operator account from rootchain err="json: cannot unmarshal hex number > 256 bits into Go value of type *hexutil.Big"
WARN [06-14|21:46:32.012|pls/rootchain_manager.go:437]       Operator account balance on rootchain is too low
DEBUG[06-14|21:46:32.012|pls/rootchain_manager.go:452]       Read blocks for NRE                      epochNumber=15 numBlocks=2 elapsed=2.395µs
DEBUG[06-14|21:46:32.014|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:32.015|tx/manager.go:815]                  Inspect queue                            addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 total=10 confirmed=9 unconfiemd=1 pending=0
INFO [06-14|21:46:32.015|tx/manager.go:234]                  Raw transaction added                    caption="submitNRE(15: [18-19])" from=0xb79749F25Ef64F9AC277A4705887101D3311A0F4
DEBUG[06-14|21:46:32.058|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
WARN [06-14|21:46:32.060|tx/manager.go:396]                  Account nonce has increased by another transaction previousNonce=638 currentNonce=639
INFO [06-14|21:46:32.062|tx/manager.go:347]                  Transaction sent                         hash=fe0b1d…83e2ac nonce=639 caption="submitNRE(15: [18-19])" gasprice=1000000000
WARN [06-14|21:46:32.063|tx/manager.go:494]                  Ethereum Transaction not found. It may be pending err="not found"  caption="submitNRE(15: [18-19])" hash=0xfe0b1d2623815b4c42ee014b2d67d686820315f256d657da3ed260cf6b83e2ac
INFO [06-14|21:46:32.063|tx/manager.go:565]                  Gas price adjusted                       caption="submitNRE(15: [18-19])" decrease=false previous="1 Gwei"           adjusted="1.19921875 Gwei"
INFO [06-14|21:46:32.065|tx/manager.go:347]                  Transaction sent                         hash=1e3a3d…c4d1ad nonce=639 caption="submitNRE(15: [18-19])" gasprice=1200000000
INFO [06-14|21:46:33.010|tx/manager.go:779]                  New root chain block mined               number=151213 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:33.011|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:33.953|core/tx_pool.go:379]                Transaction pool status report           executable=0 queued=0 stales=0
INFO [06-14|21:46:34.002|pls/rootchain_manager.go:533]       RootChain epoch prepared                 epochNumber=16 startBlockNumber=20 endBlockNumber=20 epochLength=1 isRequest=true  userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [06-14|21:46:34.002|miner/miner.go:178]                 ORB epoch is prepared, ORB epoch is started epochLength=1
INFO [06-14|21:46:34.003|pls/rootchain_manager_test.go:2641] Next prepared epoch                      e="&{ForkNumber:+0 EpochNumber:+16 StartBlockNumber:+20 EndBlockNumber:+20 RequestStart:+6 RequestEnd:+6 EpochIsEmpty:false IsRequest:true UserActivated:false Rebase:false Raw:{Address:[76 244 8 242 68 50 47 236 223 40 186 34 23 214 43 12 41 65 166 160] Topics:[[26 105 192 118 10 163 41 183 111 114 87 145 41 134 144 19 235 211 212 21 148 219 1 156 14 153 123 147 159 203 50 227]] Data:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] BlockNumber:151214 TxHash:[30 58 61 177 61 194 24 198 26 213 94 228 68 111 248 73 79 101 233 124 21 164 140 193 3 233 1 244 189 196 209 173] TxIndex:0 BlockHash:[109 5 117 58 210 242 30 111 51 48 37 40 206 119 139 202 150 151 227 87 65 71 242 37 64 183 114 20 183 215 126 92] Index:1 Removed:false}}"
WARN [06-14|21:46:34.007|pls/rootchain_manager_test.go:2652] Epoch?                                   e="{StartBlockNumber:18 EndBlockNumber:19 Timestamp:1592171172 IsEmpty:false Initialized:true IsRequest:false UserActivated:false Rebase:false RE:{RequestStart:0 RequestEnd:0 FirstRequestBlockId:0 NumEnter:0 NextEnterEpoch:0 NextEpoch:0} NRE:{EpochStateRoot:[210 149 108 7 80 237 124 215 193 28 121 121 167 169 23 215 158 241 135 138 70 103 16 79 92 123 229 96 173 147 166 193] EpochTransactionsRoot:[169 240 182 249 58 214 183 198 130 75 98 191 42 79 235 25 82 59 141 232 12 243 244 10 16 85 239 84 142 102 132 201] EpochReceiptsRoot:[166 41 201 135 49 55 146 231 78 143 209 46 203 121 141 142 167 216 224 235 31 55 230 115 3 18 197 198 242 253 218 24] SubmittedAt:1592171194 FinalizedAt:0 Finalized:false Challenging:false Challenged:false}}"
WARN [06-14|21:46:34.007|pls/rootchain_manager_test.go:2532] Check mined block                        expectedBlockNumber=20
INFO [06-14|21:46:34.008|tx/manager.go:779]                  New root chain block mined               number=151214 numTxs=1 gasUsed=268779 gasLimit=100000000
DEBUG[06-14|21:46:34.008|pls/rootchain_manager.go:569]       rcm.getEpoch                             epoch="{StartBlockNumber:20 EndBlockNumber:20 Timestamp:1592171194 IsEmpty:false Initialized:true IsRequest:true UserActivated:false Rebase:false RE:{RequestStart:6 RequestEnd:6 FirstRequestBlockId:3 NumEnter:0 NextEnterEpoch:0 NextEpoch:0} NRE:{EpochStateRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochTransactionsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochReceiptsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SubmittedAt:0 FinalizedAt:0 Finalized:false Challenging:false Challenged:false}}"
DEBUG[06-14|21:46:34.008|pls/rootchain_manager.go:574]       Num Orbs                                 epochNumber=16 numORBs=1 requestBlockId=3 e.EndBlockNumber=20 e.StartBlockNumber=20
DEBUG[06-14|21:46:34.010|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:34.010|pls/rootchain_manager.go:584]       Fetching ORB                             blockNumber=20     requestStart=6 requestEnd=6 requestBlockId=3
DEBUG[06-14|21:46:34.012|pls/rootchain_manager.go:594]       Request fetched                          requestId=6 hash=23afa563ab243d4426cf695d4e36b645e139fc953bd05116587a6a858e210fa7 request="{Timestamp:1592171162 IsExit:true IsTransfer:false Finalized:false Challenged:false Value:+0 Requestor:[81 91 56 91 220 137 188 194 144 119 242 176 10 136 98 40 131 191 180 152] To:[0 123 22 61 15 112 151 123 228 114 24 61 229 48 60 19 41 179 165 68] TrieKey:[156 77 241 216 71 138 188 52 93 158 222 46 67 134 198 58 241 51 97 82 25 65 48 232 241 208 79 103 47 153 178 95] Hash:[35 175 165 99 171 36 61 68 38 207 105 93 78 54 182 69 225 57 252 149 59 208 81 22 88 122 106 133 142 33 15 167] TrieValue:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 120 45 172 233 217 0 0]}"
DEBUG[06-14|21:46:34.013|pls/rootchain_manager.go:619]       Request tx.data                          payload=141ecf4600000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000006000000000000000000000000515b385bdc89bcc29077f2b00a88622883bfb4989c4df1d8478abc345d9ede2e4386c63af1336152194130e8f1d04f672f99b25f00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000003782dace9d90000
DEBUG[06-14|21:46:34.013|pls/rootchain_manager.go:626]       Request Transaction                      tx="&{data:{AccountNonce:0 Price:0xc021c72640 GasLimit:100000 Recipient:0xc021c39d20 Amount:0xc021c72620 Payload:[20 30 207 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 81 91 56 91 220 137 188 194 144 119 242 176 10 136 98 40 131 191 180 152 156 77 241 216 71 138 188 52 93 158 222 46 67 134 198 58 241 51 97 82 25 65 48 232 241 208 79 103 47 153 178 95 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 120 45 172 233 217 0 0] V:0xc021c72660 R:0xc021c72680 S:0xc021c726a0 Hash:<nil>} hash:{v:[35 175 165 99 171 36 61 68 38 207 105 93 78 54 182 69 225 57 252 149 59 208 81 22 88 122 106 133 142 33 15 167]} size:{v:<nil>} from:{v:<nil>}}"
INFO [06-14|21:46:34.013|pls/rootchain_manager.go:632]       Request txs fetched                      blockNumber=20     requestBlockId=3 numRequests=1 elapsed=4.90567ms
INFO [06-14|21:46:34.013|pls/rootchain_manager.go:654]       Waiting new request block mined event...
INFO [06-14|21:46:34.058|tx/manager.go:593]                  Transaction is mined                     nonce=639 caption="submitNRE(15: [18-19])" reverted=false from=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 hash=0x1e3a3db13dc218c61ad55ee4446ff8494f65e97c15a48cc103e901f4bdc4d1ad
INFO [06-14|21:46:34.059|tx/manager.go:565]                  Gas price adjusted                       caption="submitNRE(15: [18-19])" decrease=true  previous="1.19921875 Gwei"  adjusted="1 Gwei"
DEBUG[06-14|21:46:34.061|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:35.010|tx/manager.go:779]                  New root chain block mined               number=151215 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:35.012|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:36.014|tx/manager.go:779]                  New root chain block mined               number=151216 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:36.016|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:36.058|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:37.008|tx/manager.go:779]                  New root chain block mined               number=151217 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:37.011|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:38.004|tx/manager.go:779]                  New root chain block mined               number=151218 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:38.004|tx/manager.go:815]                  Inspect queue                            addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 total=11 confirmed=9 unconfiemd=2 pending=0
DEBUG[06-14|21:46:38.007|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:38.059|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:39.008|tx/manager.go:779]                  New root chain block mined               number=151219 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:39.010|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:40.011|tx/manager.go:779]                  New root chain block mined               number=151220 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:40.013|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:40.058|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:41.010|tx/manager.go:779]                  New root chain block mined               number=151221 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:41.012|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:42.008|tx/manager.go:779]                  New root chain block mined               number=151222 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:42.012|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:42.058|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
INFO [06-14|21:46:43.004|tx/manager.go:779]                  New root chain block mined               number=151223 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:43.006|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:44.016|miner/worker.go:925]                Request tx to mine                       rtx="&{data:{AccountNonce:0 Price:0xc021c72640 GasLimit:100000 Recipient:0xc021c39d20 Amount:0xc021c72620 Payload:[20 30 207 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 81 91 56 91 220 137 188 194 144 119 242 176 10 136 98 40 131 191 180 152 156 77 241 216 71 138 188 52 93 158 222 46 67 134 198 58 241 51 97 82 25 65 48 232 241 208 79 103 47 153 178 95 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 120 45 172 233 217 0 0] V:0xc021c72660 R:0xc021c72680 S:0xc021c726a0 Hash:<nil>} hash:{v:[35 175 165 99 171 36 61 68 38 207 105 93 78 54 182 69 225 57 252 149 59 208 81 22 88 122 106 133 142 33 15 167]} size:{v:<nil>} from:{v:{signer:{chainId:0xc00000f060 chainIdMul:0xc00067e1e0} from:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}}}" hash=0x23afa563ab243d4426cf695d4e36b645e139fc953bd05116587a6a858e210fa7
INFO [06-14|21:46:44.019|miner/worker.go:1177]               Commit new mining work                   number=20     sealhash=a45c87…f058ed uncles=0 txs=1 gas=55177  fees=5.5177e-05  elapsed=4.659ms
INFO [06-14|21:46:44.020|miner/worker.go:635]                Successfully sealed new block            number=20     sealhash=a45c87…f058ed hash=6b7d11…ed0817 elapsed=1.285ms
DEBUG[06-14|21:46:44.020|core/tx_pool.go:1254]               Reinjecting stale transactions           count=0
INFO [06-14|21:46:44.021|tx/manager.go:779]                  New root chain block mined               number=151224 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:44.023|tx/manager.go:815]                  Inspect queue                            addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 total=11 confirmed=9 unconfiemd=2 pending=0
DEBUG[06-14|21:46:44.029|miner/worker.go:925]                Request tx to mine                       rtx="&{data:{AccountNonce:0 Price:0xc021c72640 GasLimit:100000 Recipient:0xc021c39d20 Amount:0xc021c72620 Payload:[20 30 207 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 81 91 56 91 220 137 188 194 144 119 242 176 10 136 98 40 131 191 180 152 156 77 241 216 71 138 188 52 93 158 222 46 67 134 198 58 241 51 97 82 25 65 48 232 241 208 79 103 47 153 178 95 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 160 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 120 45 172 233 217 0 0] V:0xc021c72660 R:0xc021c72680 S:0xc021c726a0 Hash:<nil>} hash:{v:[35 175 165 99 171 36 61 68 38 207 105 93 78 54 182 69 225 57 252 149 59 208 81 22 88 122 106 133 142 33 15 167]} size:{v:<nil>} from:{v:{signer:{chainId:0xc00000f060 chainIdMul:0xc00067e1e0} from:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}}}" hash=0x23afa563ab243d4426cf695d4e36b645e139fc953bd05116587a6a858e210fa7
DEBUG[06-14|21:46:44.030|core/state_transition.go:309]       VM returned with error                   err="evm: execution reverted"
INFO [06-14|21:46:44.030|miner/unconfirmed.go:107]           🔗 block reached canonical chain          number=13     hash=18fea6…2a500e
INFO [06-14|21:46:44.030|miner/worker.go:1177]               Commit new mining work                   number=21     sealhash=c0533e…848c82 uncles=0 txs=1 gas=24054  fees=2.4054e-05  elapsed=8.725ms
INFO [06-14|21:46:44.031|miner/unconfirmed.go:85]            🔨 mined potential block                  number=20     hash=6b7d11…ed0817
INFO [06-14|21:46:44.031|miner/worker.go:635]                Successfully sealed new block            number=21     sealhash=c0533e…848c82 hash=d90ee0…a4b496 elapsed=877.419µs
INFO [06-14|21:46:44.032|miner/worker.go:1081]               Mining too far in the future             wait=2s
INFO [06-14|21:46:44.032|pls/rootchain_manager.go:424]       New block is mined                       number=20
DEBUG[06-14|21:46:44.032|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=66 t=96.048µs
INFO [06-14|21:46:44.033|pls/rootchain_manager.go:659]       New request block is mined               blockNumber=20     txs=1
DEBUG[06-14|21:46:44.033|core/tx_pool.go:1254]               Reinjecting stale transactions           count=0
WARN [06-14|21:46:44.033|pls/rootchain_manager_test.go:2555] Check Block Number                       expectedBlockNumber=20 minedBlockNumber=20 forkNumber=1
WARN [06-14|21:46:44.033|pls/rootchain_manager_test.go:2581] Check mined block                        expectedBlockNumber=20
DEBUG[06-14|21:46:44.033|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
ERROR[06-14|21:46:44.034|pls/rootchain_manager.go:433]       Failed to get balance of operator account from rootchain err="json: cannot unmarshal hex number > 256 bits into Go value of type *hexutil.Big"
WARN [06-14|21:46:44.035|pls/rootchain_manager.go:437]       Operator account balance on rootchain is too low
INFO [06-14|21:46:44.035|tx/manager.go:686]                  Transaction is confirmed                 addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(13: [16-17])"
DEBUG[06-14|21:46:44.035|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(15: [18-19])"
DEBUG[06-14|21:46:44.037|tx/manager.go:815]                  Inspect queue                            addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 total=11 confirmed=10 unconfiemd=1 pending=0
INFO [06-14|21:46:44.037|tx/manager.go:234]                  Raw transaction added                    caption=submitORB(20)            from=0xb79749F25Ef64F9AC277A4705887101D3311A0F4
INFO [06-14|21:46:44.037|pls/rootchain_manager.go:424]       New block is mined                       number=21
ERROR[06-14|21:46:44.038|pls/rootchain_manager.go:433]       Failed to get balance of operator account from rootchain err="json: cannot unmarshal hex number > 256 bits into Go value of type *hexutil.Big"
WARN [06-14|21:46:44.038|pls/rootchain_manager.go:437]       Operator account balance on rootchain is too low
DEBUG[06-14|21:46:44.038|tx/manager.go:815]                  Inspect queue                            addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 total=12 confirmed=10 unconfiemd=1 pending=1
INFO [06-14|21:46:44.038|tx/manager.go:234]                  Raw transaction added                    caption=submitORB(21)            from=0xb79749F25Ef64F9AC277A4705887101D3311A0F4
INFO [06-14|21:46:44.040|pls/rootchain_manager.go:690]       RootChain block finalized                forkNumber=0 blockNubmer=15
INFO [06-14|21:46:44.041|pls/rootchain_manager.go:800]       Invalid Exit Detected                    invalidExit="&{forkNumber:0xc021e99ae0 blockNumber:0xc021e99b00 receipt:0xc021e88700 index:0 proof:[]}" forkNumber=0 blockNumber=21
DEBUG[06-14|21:46:44.058|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(15: [18-19])"
WARN [06-14|21:46:44.062|tx/manager.go:396]                  Account nonce has increased by another transaction previousNonce=639 currentNonce=640
INFO [06-14|21:46:44.063|tx/manager.go:347]                  Transaction sent                         hash=ba49de…db0289 nonce=640 caption=submitORB(20)            gasprice=1000000000
WARN [06-14|21:46:44.065|tx/manager.go:494]                  Ethereum Transaction not found. It may be pending err="not found"               caption=submitORB(20)            hash=0xba49de77dd8929fdb197fc1e1ca33d9284218d27f9d6318012be09b73cdb0289
INFO [06-14|21:46:44.065|tx/manager.go:565]                  Gas price adjusted                       caption=submitORB(20)            decrease=false previous="1 Gwei"           adjusted="1.19921875 Gwei"
INFO [06-14|21:46:44.066|tx/manager.go:347]                  Transaction sent                         hash=8aca3b…a501ce nonce=640 caption=submitORB(20)            gasprice=1200000000
INFO [06-14|21:46:45.005|tx/manager.go:779]                  New root chain block mined               number=151225 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-14|21:46:45.008|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(15: [18-19])"
WARN [06-14|21:46:46.007|pls/rootchain_manager_test.go:2595] Check Submitted Block Number             expectedBlockNumber=20 minedBlockNumber=20 forkNumber=1
INFO [06-14|21:46:46.007|pls/rootchain_manager.go:533]       RootChain epoch prepared                 epochNumber=17 startBlockNumber=21 endBlockNumber=22 epochLength=2 isRequest=false userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [06-14|21:46:46.010|tx/manager.go:779]                  New root chain block mined               number=151226 numTxs=1 gasUsed=214254 gasLimit=100000000
DEBUG[06-14|21:46:46.012|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(15: [18-19])"
WARN [06-14|21:46:46.012|pls/rootchain_manager_test.go:2633] Check epoch after submission             expectedEpochNumber=16
INFO [06-14|21:46:46.012|pls/rootchain_manager_test.go:2641] Next prepared epoch                      e="&{ForkNumber:+0 EpochNumber:+17 StartBlockNumber:+21 EndBlockNumber:+22 RequestStart:+0 RequestEnd:+0 EpochIsEmpty:false IsRequest:false UserActivated:false Rebase:false Raw:{Address:[76 244 8 242 68 50 47 236 223 40 186 34 23 214 43 12 41 65 166 160] Topics:[[26 105 192 118 10 163 41 183 111 114 87 145 41 134 144 19 235 211 212 21 148 219 1 156 14 153 123 147 159 203 50 227]] Data:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 22 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] BlockNumber:151226 TxHash:[138 202 59 227 249 160 54 13 50 220 140 85 250 83 121 41 50 55 193 69 102 218 115 234 0 240 18 152 151 165 1 206] TxIndex:0 BlockHash:[199 119 120 187 169 103 103 236 234 208 27 67 78 72 3 91 42 242 5 70 195 180 181 60 121 201 232 9 235 39 108 112] Index:2 Removed:false}}"
WARN [06-14|21:46:46.014|pls/rootchain_manager_test.go:2652] Epoch?                                   e="{StartBlockNumber:20 EndBlockNumber:20 Timestamp:1592171194 IsEmpty:false Initialized:true IsRequest:true UserActivated:false Rebase:false RE:{RequestStart:6 RequestEnd:6 FirstRequestBlockId:3 NumEnter:0 NextEnterEpoch:0 NextEpoch:0} NRE:{EpochStateRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochTransactionsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochReceiptsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SubmittedAt:0 FinalizedAt:0 Finalized:false Challenging:false Challenged:false}}"
DEBUG[06-14|21:46:46.015|internal/plsapi/api.go:761]         Executing EVM call finished              runtime=362.676µs
DEBUG[06-14|21:46:46.015|rpc/handler.go:302]                 Served eth_call                          reqid=67 t=503.906µs
DEBUG[06-14|21:46:46.015|internal/plsapi/api.go:761]         Executing EVM call finished              runtime=140.546µs
DEBUG[06-14|21:46:46.015|rpc/handler.go:302]                 Served eth_call                          reqid=68 t=268.228µs
DEBUG[06-14|21:46:46.016|internal/plsapi/api.go:761]         Executing EVM call finished              runtime=130.183µs
DEBUG[06-14|21:46:46.016|rpc/handler.go:302]                 Served eth_call                          reqid=69 t=260.484µs
DEBUG[06-14|21:46:46.016|internal/plsapi/api.go:761]         Executing EVM call finished              runtime=134.637µs
DEBUG[06-14|21:46:46.016|rpc/handler.go:302]                 Served eth_call                          reqid=70 t=274.154µs
DEBUG[06-14|21:46:46.017|pls/rootchain_manager_test.go:2522] Sample transaction is submitted in child chian
WARN [06-14|21:46:46.017|pls/rootchain_manager_test.go:2532] Check mined block                        expectedBlockNumber=21
DEBUG[06-14|21:46:46.018|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=71 t=175.589µs
INFO [06-14|21:46:46.018|miner/unconfirmed.go:107]           🔗 block reached canonical chain          number=14     hash=2d763c…dd7413
INFO [06-14|21:46:46.018|miner/unconfirmed.go:85]            🔨 mined potential block                  number=21     hash=d90ee0…a4b496
WARN [06-14|21:46:46.019|pls/rootchain_manager_test.go:2555] Check Block Number                       expectedBlockNumber=21 minedBlockNumber=21 forkNumber=1
    TestBasic: rootchain_manager_test.go:658: Expected isRequest: false, Actual isRequest true
DEBUG[06-14|21:46:46.020|rpc/server.go:123]                  RPC server shutting down
INFO [06-14|21:46:46.020|core/blockchain.go:911]             Writing cached state to disk             block=21 hash=d90ee0…a4b496 root=ec9e32…af19cd
INFO [06-14|21:46:46.020|trie/database.go:748]               Persisted trie from memory database      nodes=24 size=6.40KiB   time=182.964µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=80 livesize=14.68KiB
INFO [06-14|21:46:46.020|core/blockchain.go:911]             Writing cached state to disk             block=20 hash=6b7d11…ed0817 root=3adeeb…f09142
INFO [06-14|21:46:46.021|trie/database.go:748]               Persisted trie from memory database      nodes=3  size=634.00B   time=25.372µs  gcnodes=0 gcsize=0.00B gctime=0s livenodes=77 livesize=14.07KiB
DEBUG[06-14|21:46:46.021|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=4.119µs   gcnodes=3 gcsize=595.00B gctime=3.847µs livenodes=74 livesize=13.48KiB
DEBUG[06-14|21:46:46.021|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=3.815µs   gcnodes=6 gcsize=1.16KiB gctime=7.396µs livenodes=71 livesize=12.90KiB
DEBUG[06-14|21:46:46.021|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=3.636µs   gcnodes=9 gcsize=1.74KiB gctime=10.782µs livenodes=68 livesize=12.32KiB
DEBUG[06-14|21:46:46.021|trie/database.go:526]               Dereferenced trie from memory database   nodes=4  size=677.00B   time=5.501µs   gcnodes=13 gcsize=2.40KiB gctime=16.014µs livenodes=64 livesize=11.66KiB
DEBUG[06-14|21:46:46.021|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.13µs    gcnodes=16 gcsize=3.05KiB gctime=19.891µs livenodes=61 livesize=11.02KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.1µs     gcnodes=19 gcsize=3.69KiB gctime=23.724µs livenodes=58 livesize=10.37KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=5  size=863.00B   time=19.569µs  gcnodes=24 gcsize=4.53KiB gctime=43.032µs livenodes=53 livesize=9.53KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=8  size=1.28KiB   time=20.605µs  gcnodes=32 gcsize=5.82KiB gctime=63.375µs livenodes=45 livesize=8.25KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=8  size=1.32KiB   time=21.641µs  gcnodes=40 gcsize=7.13KiB gctime=84.756µs livenodes=37 livesize=6.93KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=17.038µs  gcnodes=43 gcsize=7.78KiB gctime=101.519µs livenodes=34 livesize=6.29KiB
DEBUG[06-14|21:46:46.022|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=3.902µs   gcnodes=46 gcsize=8.42KiB gctime=105.164µs livenodes=31 livesize=5.64KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.188µs   gcnodes=49 gcsize=9.06KiB gctime=109.088µs livenodes=28 livesize=5.00KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=18.507µs  gcnodes=52 gcsize=9.71KiB gctime=127.327µs livenodes=25 livesize=4.36KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=6  size=996.00B   time=6.762µs   gcnodes=58 gcsize=10.68KiB gctime=133.826µs livenodes=19 livesize=3.38KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=17.314µs  gcnodes=61 gcsize=11.32KiB gctime=150.877µs livenodes=16 livesize=2.74KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.097µs   gcnodes=64 gcsize=11.97KiB gctime=154.713µs livenodes=13 livesize=2.10KiB
DEBUG[06-14|21:46:46.023|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.334µs   gcnodes=67 gcsize=12.61KiB gctime=158.783µs livenodes=10 livesize=1.45KiB
DEBUG[06-14|21:46:46.024|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=659.00B   time=4.515µs   gcnodes=70 gcsize=13.25KiB gctime=163.043µs livenodes=7  livesize=830.00B
DEBUG[06-14|21:46:46.024|trie/database.go:526]               Dereferenced trie from memory database   nodes=6  size=1.00KiB   time=6.988µs   gcnodes=76 gcsize=14.26KiB gctime=169.761µs livenodes=1  livesize=-198.00B
DEBUG[06-14|21:46:46.021|rpc/client.go:555]                  RPC connection read error                err=EOF
DEBUG[06-14|21:46:46.024|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=1.176µs   gcnodes=76 gcsize=14.26KiB gctime=170.69µs  livenodes=1  livesize=-198.00B
DEBUG[06-14|21:46:46.024|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=1.158µs   gcnodes=76 gcsize=14.26KiB gctime=171.595µs livenodes=1  livesize=-198.00B
INFO [06-14|21:46:46.024|core/blockchain.go:924]             Blockchain manager stopped
INFO [06-14|21:46:46.025|pls/handler.go:265]                 Stopping Plasma protocol
INFO [06-14|21:46:46.025|pls/handler.go:286]                 Plasma protocol stopped
INFO [06-14|21:46:46.025|core/tx_pool.go:425]                Transaction pool stopped
INFO [06-14|21:46:46.025|tx/manager.go:513]                  TransactionManager stopped
DEBUG[06-14|21:46:46.025|pls/downloader/downloader.go:578]   Reset ancient limit to zero
ERROR[06-14|21:46:46.048|tx/manager.go:795]                  New block event unsubscribed             err=nil
ERROR[06-14|21:46:46.074|tx/manager.go:747]                  Failed to re-subscribe root chian new block event err="client is closed"
--- FAIL: TestBasic (303.20s)

Add plasma chain script `--rootchain.url` flag

Should consider to add --rootchain.url flag into /run.pls.sh script, Explicitly.

We can know default params through this line, but need to search for know this.
https://github.com/Onther-Tech/plasma-evm/blob/1efc2256e48e3acd29f5d42bb69a96e8dbbf7ab4/cmd/utils/flags.go#L636-L639

System information

OS & Version: Ubuntu:16.04

Expected behaviour

Running plasma-evm-geth smoothly

Actual behaviour

got error then exit

Fatal: Error starting protocol stack: dial tcp 127.0.0.1:8546: connect: connection refused

Steps to reproduce the behaviour

sh ./run.pls.sh without running geth which open 8546 as websocket.

Backtrace

If there no opened websocket port to access rootchain connection, will got error.

INFO [01-15|06:39:15.509] Loaded most recent local header          number=0 hash=01ff84…020bc6 td=1 age=49y9mo1d
INFO [01-15|06:39:15.509] Loaded most recent local full block      number=0 hash=01ff84…020bc6 td=1 age=49y9mo1d
INFO [01-15|06:39:15.509] Loaded most recent local fast block      number=0 hash=01ff84…020bc6 td=1 age=49y9mo1d
INFO [01-15|06:39:15.509] Regenerated local transaction journal    transactions=0 accounts=0
Fatal: Error starting protocol stack: dial tcp 127.0.0.1:8546: connect: connection refused

For the record, if you insert --rootchain.url "http://127.0.0.1:8545" then you got meesage like this.

[backtrace]
INFO [01-15|06:46:39.049] Started P2P networking                   self=enode://27e2f06987bb521f0cbb6f1cb8c65dcae8eb1d2217091a802f602fc326f8852f64600cf1d33e9e982cc7dae6af55ab6005c22bbf30dd789c094510e9df19cae9@127.0.0.1:30305
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb55067]

goroutine 131 [running]:
github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).runSubmitter(0xc0000322d0)
	/home/plasma-evm/build/_workspace/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:259 +0x157
created by github.com/Onther-Tech/plasma-evm/pls.(*RootChainManager).run
	/home/plasma-evm/build/_workspace/src/github.com/Onther-Tech/plasma-evm/pls/rootchain_manager.go:139 +0x65

cmd/geth : Could not set negative commission with `setCommissionRate` sub-command.

System information

Geth version: 1.9.10
OS & Version: MacOS
Commit hash : Develop - v0.0.0.rc7.1

Expected behaviour

Set

Actual behaviour

Set negative commission rate like positive one

Steps to reproduce the behaviour

root@981aa7fd1824:/home/ubuntu/plasma-evm# build/bin/geth manage-staking setCommissionRate "-0.01" \
>             --datadir ./.pls.staking/operator1 \
>             --rootchain.url ws://127.0.0.1:8546 \
>             --unlock 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f \
>             --password pwd.pass \
>             --rootchain.sender 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f
Incorrect Usage: flag provided but not defined: -0.01

setCommissionRate [command options] [arguments...]

                                                                                                                                                        geth staking setCommissionRate <rate>

Set commission rate of the root chain (operator only)

NOTE:
rate should be 0 or between 0.01 and 1.00

Figure

build/bin/geth \
>             --datadir ./.pls.staking/operator1 \
>             --rootchain.url ws://127.0.0.1:8546 \
>             --unlock 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f \
>             --password pwd.pass \
>             --rootchain.sender 0x5e3230019fed7ab462e3ac277e7709b9b2716b4f \
>            manage-staking setCommissionRate -- -0.01

Except not checking commitssion rate range with this code line

https://github.com/Onther-Tech/plasma-evm/blob/develop/cmd/geth/stakecmd.go#L1160-L1162

Could not start operator node in private testnet

There is problem for running operator node.

System information

Geth version: geth version
OS & Version: Windows/Linux/OSX
Commit hash develop-2cae772f03cc69469f3655c7a0e0cc7b037e42c5

Expected behaviour

Run plasma-evm operator well with.

plasma-evm$ build/bin/geth \
    --nousb \
    --datadir ./chaindata-oper \
    --syncmode='full' \
    --networkid 16 \
    --rootchain.url ws://localhost:8546 \
    --operator 0x71562b71999873DB5b286dF957af199Ec94617F7 \
    --port 30306 \
    --nat extip:::1 \
    --maxpeers 50 \
    --unlock 0x71562b71999873DB5b286dF957af199Ec94617F7 \
    --password signer.pass \
    --nodekeyhex e854e2f029be6364f0f961bd7571fd4431f99355b51ab79d23c56506f5f1a7c3 \
    --mine \
    --miner.gastarget 7500000 \
    --miner.gaslimit 10000000

And also tried modified command for new commit.

plasma-evm$ build/bin/geth \
    --nousb \
    --datadir ./chaindata-oper \
    --syncmode='full' \
    --networkid 16 \
    --rootchain.url ws://localhost:8546 \
    --unlock 0x71562b71999873DB5b286dF957af199Ec94617F7 \
    --password signer.pass \
    --rootchain.sender 0x71562b71999873DB5b286dF957af199Ec94617F7
    --port 30306 \
    --nat extip:::1 \
    --maxpeers 50 \
    --nodekeyhex e854e2f029be6364f0f961bd7571fd4431f99355b51ab79d23c56506f5f1a7c3 \
    --mine \
    --miner.gastarget 7500000 \
    --miner.gaslimit 10000000

Actual behaviour

Both Panic

Steps to reproduce the behaviour

As followed, step 1 to 5 in docs.tokamak.network - setup-operator-node

Not using any stamina flags.

Backtrace

[genesis.json]

{
  "config": {
    "chainId": 16,
    "homesteadBlock": 0,
    "eip150Block": 0,
    "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "eip155Block": 0,
    "eip158Block": 0,
    "byzantiumBlock": 0,
    "constantinopleBlock": 0,
    "petersburgBlock": 0,
    "istanbulBlock": 0,
    "muirGlacierBlock": 0,
    "ethash": {},
    "Stamina": {
      "initialized": true,
      "operatorAmount": 1000000000000000000,
      "minDeposit": 500000000000000000,
      "recoveryEpochLength": 120960,
      "withdrarwalDelay": 362880
    }
  },
  "nonce": "0x0",
  "timestamp": "0x0",
  "extraData": "0x1acdf9985559919b7de44d86a6faf7852a62f146",
  "gasLimit": "0x5f5e100",
  "difficulty": "0x1",
  "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x0000000000000000000000000000000000000000",
  "alloc": {
    "0000000000000000000000000000000000000001": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000002": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000003": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000004": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000005": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000006": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000007": {
      "balance": "0x1"
    },
    "0000000000000000000000000000000000000008": {
      "balance": "0x1"
    },
    "000000000000000000000000000000000000dead": {
      "code": "<too long to pasted>",
      "storage": {
        "0x0000000000000000000000000000000000000000000000000000000000000008": "0x0000000000000000000000000000000000000000000000000000000000000001",
        "0x0000000000000000000000000000000000000000000000000000000000000009": "0x00000000000000000000000000000000000000000000000006f05b59d3b20000",
        "0x000000000000000000000000000000000000000000000000000000000000000a": "0x000000000000000000000000000000000000000000000000000000000001d880",
        "0x000000000000000000000000000000000000000000000000000000000000000b": "0x0000000000000000000000000000000000000000000000000000000000058980",
        "0x78b708b837682e6270dbef34cca5b6d3a3fb2b6c6b8bd38a36a62bed9cf03033": "0x00000000000000000000000071562b71999873db5b286df957af199ec94617f7",
        "0x9541d803110b392ecde8e03af7ae34d4457eb4934dac09903ccee819bec4a355": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"
      },
      "balance": "0x0"
    },
    "71562b71999873db5b286df957af199ec94617f7": {
      "balance": "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7"
    }
  },
  "number": "0x0",
  "gasUsed": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}


[backtrace]
plasma-evm $ run.oper.sh

INFO [03-24|17:57:35.567] Maximum peer count                       ETH=50 LES=0 total=50
INFO [03-24|17:57:35.576] Set options for submitting a block       mingaspirce=1000000000 maxgasprice=100000000000 resubmit=10s
INFO [03-24|17:57:35.576] Starting peer-to-peer node               instance=Geth/v1.9.10-stable-2cae772f/darwin-amd64/go1.13
INFO [03-24|17:57:35.576] Allocated trie memory caches             clean=256.00MiB dirty=256.00MiB
INFO [03-24|17:57:35.577] Allocated cache and file handles         database=/Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/chaindata-oper/geth/chaindata cache=512.00MiB handles=5120
INFO [03-24|17:57:37.032] Opened ancient database                  database=/Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/chaindata-oper/geth/chaindata/ancient
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4957758]

goroutine 1 [running]:
github.com/Onther-Tech/plasma-evm/pls.New(0xc0003d1c60, 0xc0000cbc00, 0x4ee6800, 0xc000675808, 0x400f438)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/pls/backend.go:143 +0x318
github.com/Onther-Tech/plasma-evm/cmd/utils.RegisterPlsService.func2(0xc0003d1c60, 0xc0002bfa70, 0xc0006759b8, 0xc0003d1c20, 0x2)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/cmd/utils/flags.go:1878 +0x3d
github.com/Onther-Tech/plasma-evm/node.(*Node).Start(0xc0002cca00, 0x0, 0x0)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/node/node.go:206 +0x408
github.com/Onther-Tech/plasma-evm/cmd/utils.StartNode(0xc0002cca00)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/cmd/utils/cmd.go:67 +0x2f
main.startNode(0xc00011e000, 0xc0002cca00)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/cmd/geth/main.go:359 +0x70
main.geth(0xc00011e000, 0x0, 0x0)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/cmd/geth/main.go:347 +0xc8
gopkg.in/urfave/cli%2ev1.HandleAction(0x4d54740, 0x51584b8, 0xc00011e000, 0xc0000da360, 0x0)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/pkg/mod/gopkg.in/urfave/[email protected]/app.go:490 +0xc8
gopkg.in/urfave/cli%2ev1.(*App).Run(0xc0000c6000, 0xc0000e2000, 0x1b, 0x1c, 0x0, 0x0)
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/pkg/mod/gopkg.in/urfave/[email protected]/app.go:264 +0x58c
main.main()
        /Users/jinhwan/.gvm/pkgsets/go1.13/global/src/github.com/Onther-Tech/plasma-evm/cmd/geth/main.go:287 +0x55

Get chainid from rootchain to prevent invalid sender error

Sometimes an invalid sender error occurs when submitting a submit transaction to a rootchain contract. This error occurs when the chainid of rootchain and the chainid used in plasma-evm are different. If the networkid of the rootchain is the same as the chainid of the rootchain, the error does not occur.

Therefore, we need to get the rootchain's chainid separately and make it use plasma-evm.

WON? WTON?

Hi there,

please note that this is an issue tracker reserved for bug reports and feature requests.

For general questions please use the gitter channel or the Ethereum stack exchange at https://ethereum.stackexchange.com.

System information

Geth version: geth v1.9.3
OS & Version: Windows/Linux/OSX
Commit hash : feature/stake

Expected behaviour

INFO [02-14|05:59:09.579|geth/stakecmd.go:857]          WTON Balance                              amount="0 WTON"      depositor=0x5E3230019fEd7aB462e3AC277E7709B9b2716b4F

Actual behaviour

INFO [02-14|05:59:09.579|geth/stakecmd.go:857]          WON Balance                              amount="0 WTON"      depositor=0x5E3230019fEd7aB462e3AC277E7709B9b2716b4F

Steps to reproduce the behaviour

It occurs when I'm running staking balances command.

Backtrace

failed to estimate gas needed, with `requestWithdrawal`.

Failed to send Tx via requestWithdrawal command.

Tried on rinkeby testnet with infura node. (also same issue with onther rinkeby node)

System information

Geth version: 1.9.10-stable - v0.0.0-rc6.0
OS & Version: Ubuntu
Commit hash : 16e9e03

Expected behaviour

Well sent requestWithdrawal transaction

Actual behaviour

gas required exceeds allowance (10000000)

Steps to reproduce the behaviour

Run this script.
https://gist.github.com/sifnoc/ca062a7c2c91fceb67fbd1ebdd021c96

~/plasma-evm$ build/bin/geth --nousb staking requestWithdrawal 100.0 \
               --datadir ./operator \
               --rootchain.url wss://rinkeby.infura.io/ws/v3/ \
               --unlock 0x226b9CD9D1E91eBEd907A80dB73aF58B5AfCf7bF \
               --password pwd.pass \
               --rootchain.sender 0x226b9CD9D1E91eBEd907A80dB73aF58B5AfCf7bF

Backtrace

Result -

INFO [04-07|09:08:02.626] Maximum peer count                       ETH=50 LES=0 total=50
INFO [04-07|09:08:02.626] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [04-07|09:08:03.935] Set options for submitting a block       mingaspirce=1000000000 maxgasprice=100000000000 resubmit=0s
INFO [04-07|09:08:04.860] Unlocked account                         address=0x226b9CD9D1E91eBEd907A80dB73aF58B5AfCf7bF
INFO [04-07|09:08:04.860] Root chain transaction sender found      address=0x226b9CD9D1E91eBEd907A80dB73aF58B5AfCf7bF
INFO [04-07|09:08:05.632] Allocated cache and file handles         database=/home/ubuntu/plasma-evm/operator/geth/stakingdata cache=16.00MiB handles=16
INFO [04-07|09:08:05.648] Using manager contracts                  TON=0xBe41233606E135f17DE0865790e94fC26338afD3 WTON=0xAd7CF0421998e6223B0C55Ed251607D8c3d2f319 DepositManager=0x425835cfedcc2e634cC742628Fb94E8Ad5485464 RootChainRegistry=0x2B7F58b8ba55d22e29B6aA638018E9BB7A038986 SeigManager=0x6f00c47BbB6266942f2FCb0605400E02E42d65B7 PowerTON=0x5278A437b8c53c9019f5887ab6ac8F2E458F7cB9
failed to estimate gas needed: gas required exceeds allowance (10000000) or always failing transaction

TestInvalidExit failure case(PETH balance mismatch)

TestInvalidExit in pls sometimes failed like below.

System information

Geth version:

Version: 1.9.1-stable
Git Commit: 4bf7d7e315e19a2b31683935e866ae952b32ab7d
Git Commit Date: 20200406
Architecture: amd64
Protocol Versions: [63]
Network Id: 1
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

plasma-evm version:

Version: 1.9.10-stable
Git Commit: 3fd45f8a7ad8f478c23ad1a0587e12ae2a824e99
Git Commit Date: 20200520
Architecture: amd64
Protocol Versions: [64 63]
Go Version: go1.14
Operating System: linux
GOPATH=
GOROOT=/usr/lib/go-1.14

OS & Version: Ubuntu 18.04.1 LTS
Commit hash : 3fd45f8

Expected behaviour

Pass test TestInvalidExit

Actual behaviour

Sometimes fail

Steps to reproduce the behaviour

go test -v --timeout 3600s ./pls -run TestInvalidExit

Backtrace

...
INFO [06-15|00:43:14.005|tx/manager.go:779]                  New root chain block mined               number=595 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-15|00:43:14.009|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(3: [3-4])"
INFO [06-15|00:43:15.007|tx/manager.go:779]                  New root chain block mined               number=596 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-15|00:43:15.010|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(3: [3-4])"
DEBUG[06-15|00:43:15.199|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(3: [3-4])"
WARN [06-15|00:43:15.864|pls/rootchain_manager_test.go:2577] Check mined block                        expectedBlockNumber=5
DEBUG[06-15|00:43:15.864|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=18 t=102.471µs
INFO [06-15|00:43:15.865|miner/unconfirmed.go:85]            🔨 mined potential block                  number=5   hash=443163…0ad8f1
INFO [06-15|00:43:15.865|miner/worker.go:635]                Successfully sealed new block            number=6   sealhash=e41db9…1aeea1 hash=1d80e3…bb9d0c elapsed=8.853s
DEBUG[06-15|00:43:15.865|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=19 t=83.482µs
INFO [06-15|00:43:15.865|pls/rootchain_manager.go:659]       New request block is mined               blockNumber=5   txs=4
INFO [06-15|00:43:15.865|pls/rootchain_manager.go:533]       RootChain epoch prepared                 epochNumber=5 startBlockNumber=6 endBlockNumber=7 epochLength=2 isRequest=false userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [06-15|00:43:15.865|miner/miner.go:180]                 NRB epoch is prepared, NRB epoch is started epochLength=2
DEBUG[06-15|00:43:15.866|core/tx_pool.go:1254]               Reinjecting stale transactions           count=0
INFO [06-15|00:43:15.866|pls/rootchain_manager.go:424]       New block is mined                       number=6
DEBUG[06-15|00:43:15.867|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=20 t=59.888µs
DEBUG[06-15|00:43:15.867|rpc/handler.go:302]                 Served eth_getTransactionReceipt         reqid=21 t=63.17µs
WARN [06-15|00:43:15.868|pls/rootchain_manager_test.go:2600] Check Block Number                       expectedBlockNumber=5 minedBlockNumber=5 forkNumber=1
WARN [06-15|00:43:15.868|pls/rootchain_manager_test.go:2626] Check mined block                        expectedBlockNumber=5
WARN [06-15|00:43:15.868|pls/rootchain_manager_test.go:2640] Check Submitted Block Number             expectedBlockNumber=5 minedBlockNumber=5 forkNumber=1
WARN [06-15|00:43:15.869|pls/rootchain_manager_test.go:2678] Check epoch after submission             expectedEpochNumber=4
INFO [06-15|00:43:15.870|pls/rootchain_manager_test.go:2686] Next prepared epoch                      e="&{ForkNumber:+0 EpochNumber:+5 StartBlockNumber:+6 EndBlockNumber:+7 RequestStart:+0 RequestEnd:+0 EpochIsEmpty:false IsRequest:false UserActivated:false Rebase:false Raw:{Address:[21 41 76 48 113 1 112 6 24 207 201 161 54 64 150 205 208 158 91 40] Topics:[[26 105 192 118 10 163 41 183 111 114 87 145 41 134 144 19 235 211 212 21 148 219 1 156 14 153 123 147 159 203 50 227]] Data:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] BlockNumber:590 TxHash:[160 110 245 25 118 21 223 173 244 254 88 83 233 227 69 116 249 146 130 220 19 112 166 64 7 63 202 114 31 72 228 101] TxIndex:0 BlockHash:[227 165 123 90 91 159 39 250 77 197 235 115 152 109 37 203 41 8 109 142 117 230 31 227 108 68 149 11 86 184 24 222] Index:1 Removed:false}}"
ERROR[06-15|00:43:15.871|pls/rootchain_manager.go:433]       Failed to get balance of operator account from rootchain err="json: cannot unmarshal hex number > 256 bits into Go value of type *hexutil.Big"
WARN [06-15|00:43:15.871|pls/rootchain_manager.go:437]       Operator account balance on rootchain is too low
INFO [06-15|00:43:15.871|pls/rootchain_manager.go:456]       Non-request epoch is not completed yet   epochNumber=5
WARN [06-15|00:43:15.872|pls/rootchain_manager_test.go:2697] Epoch?                                   e="{StartBlockNumber:5 EndBlockNumber:5 Timestamp:1592181777 IsEmpty:false Initialized:true IsRequest:true UserActivated:false Rebase:false RE:{RequestStart:0 RequestEnd:3 FirstRequestBlockId:0 NumEnter:8 NextEnterEpoch:0 NextEpoch:0} NRE:{EpochStateRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochTransactionsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] EpochReceiptsRoot:[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] SubmittedAt:0 FinalizedAt:0 Finalized:false Challenging:false Challenged:false}}"
DEBUG[06-15|00:43:15.876|rpc/handler.go:302]                 Served eth_getBalance                    reqid=22 t=42.086µs
DEBUG[06-15|00:43:15.876|rpc/handler.go:302]                 Served eth_getBalance                    reqid=23 t=34.648µs
DEBUG[06-15|00:43:15.876|rpc/handler.go:302]                 Served eth_getBalance                    reqid=24 t=36.946µs
DEBUG[06-15|00:43:15.877|rpc/handler.go:302]                 Served eth_getBalance                    reqid=25 t=33.082µs
INFO [06-15|00:43:16.020|tx/manager.go:779]                  New root chain block mined               number=597 numTxs=0 gasUsed=0      gasLimit=100000000
DEBUG[06-15|00:43:16.024|tx/manager.go:680]                  check raw is confirmed                   addr=0xb79749F25Ef64F9AC277A4705887101D3311A0F4 caption="submitNRE(3: [3-4])"
    TestInvalidExit: rootchain_manager_test.go:958: Failed to check ETH balance(1)       : Expected 20.0 (after) == 0.0 (before) + 10.0 (diff), but it isn't
INFO [06-15|00:43:16.882|miner/unconfirmed.go:85]            🔨 mined potential block                  number=6   hash=1d80e3…bb9d0c
DEBUG[06-15|00:43:16.882|rpc/server.go:123]                  RPC server shutting down
INFO [06-15|00:43:16.882|core/blockchain.go:911]             Writing cached state to disk             block=6 hash=1d80e3…bb9d0c root=2155ba…070878
INFO [06-15|00:43:16.883|trie/database.go:748]               Persisted trie from memory database      nodes=19 size=5.92KiB   time=232.322µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=24 livesize=3.77KiB
INFO [06-15|00:43:16.883|core/blockchain.go:911]             Writing cached state to disk             block=5 hash=443163…0ad8f1 root=7ebdd5…825212
INFO [06-15|00:43:16.883|trie/database.go:748]               Persisted trie from memory database      nodes=10 size=1.56KiB   time=71.907µs  gcnodes=0 gcsize=0.00B gctime=0s livenodes=14 livesize=2.21KiB
DEBUG[06-15|00:43:16.883|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=3.787µs   gcnodes=3 gcsize=595.00B gctime=3.516µs livenodes=11 livesize=1.63KiB
DEBUG[06-15|00:43:16.884|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=4.294µs   gcnodes=6 gcsize=1.16KiB gctime=7.544µs livenodes=8  livesize=1.05KiB
DEBUG[06-15|00:43:16.884|trie/database.go:526]               Dereferenced trie from memory database   nodes=3  size=595.00B   time=4.169µs   gcnodes=9 gcsize=1.74KiB gctime=11.44µs livenodes=5  livesize=479.00B
DEBUG[06-15|00:43:16.884|trie/database.go:526]               Dereferenced trie from memory database   nodes=4  size=677.00B   time=5.263µs   gcnodes=13 gcsize=2.40KiB gctime=16.439µs livenodes=1  livesize=-198.00B
DEBUG[06-15|00:43:16.884|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=1.255µs   gcnodes=13 gcsize=2.40KiB gctime=17.432µs livenodes=1  livesize=-198.00B
DEBUG[06-15|00:43:16.884|trie/database.go:526]               Dereferenced trie from memory database   nodes=0  size=0.00B     time=1.227µs   gcnodes=13 gcsize=2.40KiB gctime=18.403µs livenodes=1  livesize=-198.00B
INFO [06-15|00:43:16.885|core/blockchain.go:924]             Blockchain manager stopped
INFO [06-15|00:43:16.885|pls/handler.go:265]                 Stopping Plasma protocol
INFO [06-15|00:43:16.885|pls/handler.go:286]                 Plasma protocol stopped
INFO [06-15|00:43:16.885|core/tx_pool.go:425]                Transaction pool stopped
DEBUG[06-15|00:43:16.885|rpc/client.go:555]                  RPC connection read error                err=EOF
DEBUG[06-15|00:43:16.885|pls/downloader/downloader.go:578]   Reset ancient limit to zero
ERROR[06-15|00:43:16.922|tx/manager.go:795]                  New block event unsubscribed             err=nil
ERROR[06-15|00:43:16.947|tx/manager.go:747]                  Failed to re-subscribe root chian new block event err="client is closed"
INFO [06-15|00:43:16.923|tx/manager.go:513]                  TransactionManager stopped
--- FAIL: TestInvalidExit (172.88s)
FAIL
FAIL    github.com/Onther-Tech/plasma-evm/pls   172.910s
FAIL

Create Wiki Page for help text of `Plasma-evm`

Request PLASMA EVM command help text into Wiki page by @ggs134.

PLASMA EVM - DEVELOPMENT MODE OPTIONS:
  --dev                               Ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
  --dev.period value                  Block period to use in developer mode (0 = mine only if transaction pending) (default: 0)
  --dev.key value                     Comma seperated developer account key as hex(for dev)
  
PLASMA EVM - OPERATOR OPTIONS:
  --operator value                    Plasma operator address as hex.
  --operator.key value                Plasma operator key as hex(for dev)
  --operator.password value           Operator password file to use for non-interactive password input
  --operator.minether value           Plasma operator minimum balance (default = 0.5 ether) (default: "0.5")
  --miner.recommit value              Time interval to recreate the block being mined (default: 3s)
  
PLASMA EVM - ROOTCHAIN TRANSACTION MANAGER OPTIONS:
  --tx.gasprice value                 Gas price for transaction (default = 10 Gwei) (default: 0)
  --tx.mingasprice value              Minimum gas price for submitting a block (default = 1 Gwei) (default: 1000000000)
  --tx.maxgasprice value              Maximum gas price for submitting a block (default = 100 Gwei) (default: 100000000000)
  --tx.interval value                 Pending interval time after submitting a block (default = 10s). If block submit transaction is not mined in 2 intervals, gas price will be adjusted. See https://golang.org/pkg/time/#ParseDuration (default: 10s)
  
PLASMA EVM - STAMINA OPTIONS:
  --stamina.operatoramount value      Operator stamina amount at genesis block in ETH (default: 1)
  --stamina.mindeposit value          Minimum deposit amount in ETH (default: 0.5)
  --stamina.recoverepochlength value  The length of recovery epoch in block (default: 120960)
  --stamina.withdrawaldelay value     Withdrawal delay in block (default: 362880)
  
PLASMA EVM - CHALLENGER OPTIONS:
  --rootchain.challenger value        Address of challenger account
  --challenger.password value         Challenger password file to use for non-interactive password input
  
PLASMA EVM - ROOTCHAIN CONTRACT OPTIONS:
  --rootchain.url value               JSONRPC endpoint of rootchain provider. If URL is empty, ignore the provider.
  --rootchain.contract value          Address of the RootChain contract
  
PLASMA EVM - STAKING OPTIONS OPTIONS:
  --unlock value                      Comma separated list of accounts to unlock
  --password value                    Password file to use for non-interactive password input
  --rootchain.sender value            Address of root chain transaction sender account. it MUST be unlocked by --unlock, --password flags (CAVEAT: To set plasma operator, use --operator flag)
  --rootchain.gasPrice value          Transaction gas price to root chain in GWei (default: 10000000000)
  --rootchain.ton value               Address of TON token contract
  --rootchain.wton value              Address of WTON token contract
  --rootchain.registry value          Address of RootChainRegistry contract
  --rootchain.depositManager value    Address of Deposit Manager contract
  --rootchain.seigManager value       Address of SeigManager contract
  --rootchain.powerton value          Address of PowerTON contract
  

Dev mode does not start with Parity node.

If --dev flag on, Plasma-evm rootchain Deploy Process does not work via Parity node.

There is worked well go-ethereum. @Jake-Song confirmed this.

System information

parity version: version Parity-Ethereum/v2.2.9-stable-5d5b372-20190203/x86_64-linux-gnu/rustc1.31.1
OS & Version: Ubuntu 16.04
Commit hash : develop commit b732d15

Expected behaviour

RootChain Contract deployed well.

Actual behaviour

RootChain Contract Deployed failed via plasma-evm dev mode.

Steps to reproduce the behaviour

Modified run.pls.sh as like below

build/bin/geth \
  --datadir $DATADIR \
  --miner.etherbase 0xcd433f027339ad4f86b94463d1b0416a86dc3705 \
  --dev \
  --rpc \
  --rpcport 8547 \
  --dev.key $KEY1,$KEY2,$KEY3,$KEY4,$KEY5 \
  --rootchain.operatorkey $OPERATOR_KEY \
  --rootchain.url http://[parity node ip]:8545

It was same does not work both http / ws endpoint.

Backtrace

Plasma-evm run log

INFO [02-14|06:15:25.130] Deploying contracts for development mode
INFO [02-14|06:15:25.312] Deploy epoch handler contract            hash=084d4a…86748b address=0x5ff3aFff10a4EfC1564f0B629B00a9BB6A9c29Ca
INFO [02-14|06:15:25.317] Wait until deploy transaction is mined
Fatal: Failed to deploy rootchain contract

Parity RPC trace log

2019-02-14 06:01:24 UTC  TRACE rpc  Request: {"jsonrpc":"2.0","id":8,"method":"eth_estimateGas","params" [{"data":"0x608060405234 ... , "from":"0xcd433f027339ad4f86b94463d1b0416a86dc3705","to":null,"value":"0x0"}

2019-02-14 06:01:24 UTC jsonrpc-eventloop-0 DEBUG rpc  Response: {"jsonrpc":"2.0","error":{"code":-32016,"message":"The execution failed due to an exception."},"id":8}.

Sync problem between two nodes starting with genesis block.

There is problem with syncing between operator node & bootnode both has at genesis block.

But, Sync well when restart bootnode after operator node has not genesis block( 1 more block.).

System information

Geth version: geth v1.9.10
OS & Version: MacOSX
Commit hash : migrate/1.9.10

Expected behaviour

Synced Well between Operator node and Bootnode

Actual behaviour

Could not sync at all just after operator node generated block from Operator & Bootnode has genesis block.

Steps to reproduce the behaviour

Pre-process

  • Compiled plasma-evm(geth) migrated v1.9.10 version.
  • Running go-ethereum as rootchain at localhost.
  • Starting Position at plasma-evm $.

Reproduce

  1. deploy rootchain

    Run script for deploy contract on rootchain.

    #!/bin/bash
    
    OPERATOR_KEY="b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291"
    
    DATADIR=pls.data
    OPERATOR="0x71562b71999873DB5b286dF957af199Ec94617F7"
    
    ROOTCHAIN_IP=localhost # Onther Ropsten Geth Node IP.
    
    # Deploy contracts at rootchain
    echo "Deploy rootchain contract and others"
    build/bin/geth \
        --rootchain.url "ws://$ROOTCHAIN_IP:8546" \
        --operator.key $OPERATOR_KEY \
        --datadir $DATADIR \
        deploy "./genesis.json" 77 true 4
    
  2. Generate boot keyfile

    plasma-evm $ echo "e854e2f029be6364f0f961bd7571fd4431f99355b51ab79d23c56506f5f1a7c3" > boot.key
    
    
  3. Run Bootnode

    Run this script for geme

    #!/bin/bash
    build/bin/geth --cache 512 init --datadir ./chaindata-user --rootchain.url ws://localhost:8546 ./genesis.json
    build/bin/geth --syncmode="full" \
                    --datadir ./chaindata-user \
                    --networkid 77 \
                    --rootchain.url ws://localhost:8546 \
                    --rpc --rpcaddr '0.0.0.0' \
                    --rpcport 8548 \
                    --rpcapi eth,net,debug \
                    --rpccorsdomain "*" \
                    --rpcvhosts=localhost \
                    --ws --wsorigins '*' \
                    --wsaddr '0.0.0.0' \
                    --wsport 8549 \
                    --cache 512 \
                    --port 30307 \
                    --nat extip:::1 \
                    --maxpeers 512 \
                    --lightpeers=256 \
                    --lightserv=50 \
                    --nodekey ./boot.key \
                    --miner.gastarget 0 \
                    --miner.gaslimit 0 \
                    --miner.gasprice 0
    
  4. Run Bootnode

    Run this script for geme

    #!/bin/bash
    build/bin/geth --cache 512 init --datadir ./chaindata-oper --rootchain.url ws://localhost:8546 ./genesis.json
    build/bin/geth account importKey b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291 --datadir ./chaindata-oper
    build/bin/geth --datadir ./chaindata \
                    --syncmode="full" \
                    --networkid 77 \
                    --datadir ./chaindata-oper \
                    --rootchain.url ws://localhost:8546 \
                    --operator 0x71562b71999873DB5b286dF957af199Ec94617F7 \
                    --rootchain.challenger 0x3616BE06D68dD22886505e9c2CaAa9EcA84564b8 \
                    --port 30306 \
                    -nat extip:::1 \
                    --bootnodes "enode:/4966a7e4621c2c0b1b1b3295b4a35ccc4224ba1d529bf5aa2323e4650f6075bd5eb6618372b2579965819347307f1f97315ce91b09ca342d60c2e98ad88db9f3@127.0.0.1:30307" \
                    --maxpeers 50 \
                    --password ./signer.pass \
                    --mine \
                    --miner.gastarget 1000000000 \
                    --miner.gaslimit 1000000000 \
                    --miner.gasprice 0 \
                    --targetgaslimit 1000000000   
    
  5. Check connecting peer between operator & bootnod

  6. Generate dummy block in operator node

Backtrace

Attached Bootnode log.. Propagated block has invalid body ..

[backtrace]
bash geth.local.migrate.user.sh
INFO [02-13|18:34:28.595] Root chain backend connected             url=ws://localhost:8546
INFO [02-13|18:34:28.598] Stamina config is set                    mindeposit=500000000000000000 recoverepochlength=10080 withdrawaldelay=30240
INFO [02-13|18:34:28.598] Maximum peer count                       ETH=50 LES=0 total=50
INFO [02-13|18:34:28.623] Set options for submitting a block       mingaspirce=1000000000 maxgasprice=100000000000 resubmit=0s
INFO [02-13|18:34:28.623] Allocated cache and file handles         database=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/chaindata cache=16.00MiB handles=16
INFO [02-13|18:34:28.671] Writing custom genesis block             rootChainContract=0x3Dc2cd8F2E345951508427872d8ac9f635fBe0EC
INFO [02-13|18:34:28.672] Persisted trie from memory database      nodes=21 size=6.54KiB time=290.508µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-116.00B
INFO [02-13|18:34:28.673] Genesis stored                           file=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/genesis.json
INFO [02-13|18:34:28.674] Successfully wrote genesis state         database=chaindata hash=19a9bb…be3953
INFO [02-13|18:34:28.674] Allocated cache and file handles         database=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/lightchaindata cache=16.00MiB handles=16
INFO [02-13|18:34:28.691] Writing custom genesis block             rootChainContract=0x3Dc2cd8F2E345951508427872d8ac9f635fBe0EC
INFO [02-13|18:34:28.692] Persisted trie from memory database      nodes=21 size=6.54KiB time=434.853µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-116.00B
INFO [02-13|18:34:28.692] Genesis stored                           file=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/genesis.json
INFO [02-13|18:34:28.693] Successfully wrote genesis state         database=lightchaindata hash=19a9bb…be3953
INFO [02-13|18:34:28.753] Maximum peer count                       ETH=256 LES=256 total=512
INFO [02-13|18:34:28.781] Set options for submitting a block       mingaspirce=1000000000 maxgasprice=100000000000 resubmit=10s
INFO [02-13|18:34:28.781] Starting peer-to-peer node               instance=Geth/v1.9.10-stable-31018f52/darwin-amd64/go1.13.4
WARN [02-13|18:34:28.781] Sanitizing invalid miner gas price       provided=0 updated=0
INFO [02-13|18:34:28.781] Allocated trie memory caches             clean=128.00MiB dirty=128.00MiB
INFO [02-13|18:34:28.781] Allocated cache and file handles         database=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/chaindata cache=256.00MiB handles=5120
INFO [02-13|18:34:28.847] Opened ancient database                  database=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth/chaindata/ancient
INFO [02-13|18:34:28.848] Initialised chain configuration          config="{ChainID: 77 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: 0, Muir Glacier: 0, E
ngine: ethash}"
WARN [02-13|18:34:28.848] Ethash used in fake mode
INFO [02-13|18:34:28.848] Initialising Plasma protocol             versions="[64 63]" network=77 dbversion=<nil>
WARN [02-13|18:34:28.848] Upgrade blockchain database version      from=<nil> to=7
INFO [02-13|18:34:28.849] Loaded most recent local header          number=0 hash=19a9bb…be3953 td=1 age=50y10mo5d
INFO [02-13|18:34:28.849] Loaded most recent local full block      number=0 hash=19a9bb…be3953 td=1 age=50y10mo5d
INFO [02-13|18:34:28.849] Loaded most recent local fast block      number=0 hash=19a9bb…be3953 td=1 age=50y10mo5d
INFO [02-13|18:34:28.850] Regenerated local transaction journal    transactions=0 accounts=0
INFO [02-13|18:34:28.852] Rootchain provider connected             url=ws://localhost:8546
INFO [02-13|18:34:28.854] Transaction manager loaded               numAccounts=0
INFO [02-13|18:34:28.865] Checkpoint registrar is not enabled
INFO [02-13|18:34:28.887] Mapped network port                      proto=tcp extport=30307 intport=30307 interface=ExtIP(::1)
INFO [02-13|18:34:28.887] Mapped network port                      proto=udp extport=30307 intport=30307 interface=ExtIP(::1)
INFO [02-13|18:34:28.889] New local node record                    seq=1 id=c075b353195d7b96 ip=127.0.0.1 udp=30307 tcp=30307
INFO [02-13|18:34:28.890] UDP listener up                          net=enode://4966a7e4621c2c0b1b1b3295b4a35ccc4224ba1d529bf5aa2323e4650f6075bd5eb6618372b2579965819347307f1f97315ce91b09ca342d60c2e98ad88db9f3@[::]:30307
INFO [02-13|18:34:28.891] Started P2P networking                   self=enode://4966a7e4621c2c0b1b1b3295b4a35ccc4224ba1d529bf5aa2323e4650f6075bd5eb6618372b2579965819347307f1f97315ce91b09ca342d60c2e98ad88db9f3@127.0.0.1:30307
INFO [02-13|18:34:28.891] Starting topic registration              topic=LES2@19a9bbb52b470d6a
INFO [02-13|18:34:28.894] Iterating epoch prepared event
INFO [02-13|18:34:28.894] RootChain epoch prepared                 epochNumber=1 startBlockNumber=1 endBlockNumber=4 epochLength=4 isRequest=false userActivated=false isEmpty=false ForkNumber=0 isRebase=false
INFO [02-13|18:34:28.895] Iterating block finalized event
INFO [02-13|18:34:28.895] RootChain block finalized                forkNumber=0 blockNubmer=0
ERROR[02-13|18:34:28.895] Failed to get challenger account         err="unknown account"
INFO [02-13|18:34:28.896] Watching epoch prepared event            startBlockNumber=0
INFO [02-13|18:34:28.897] Watching block finalized event           startBlockNumber=0
INFO [02-13|18:34:28.900] IPC endpoint opened                      url=/Users/jinhwan/gitrepo/plasma-evm/chaindata-user/geth.ipc
INFO [02-13|18:34:28.900] HTTP endpoint opened                     url=http://0.0.0.0:8548 cors=* vhosts=localhost
INFO [02-13|18:34:28.900] WebSocket endpoint opened                url=ws://[::]:8549
...
INFO [02-13|18:35:07.003] New root chain block mined               number=148 numTxs=0 gasUsed=0 gasLimit=7500000
WARN [02-13|18:35:07.542] Propagated block has invalid body        have=b6455d…bd9df8 exp=a01044…f4c96f
INFO [02-13|18:35:08.003] New root chain block mined               number=149 numTxs=0 gasUsed=0 gasLimit=7500000
...

Fix synchronization delay

Don't know why operator node doesn't propagate blocks in new NRE, even though epoch submission transaction calling submitNRE is mined about 1-5 minute ago.

cmd/geth : multiple init error

System information

Geth version: 16dfa8a
OS & Version: ubuntu 18.04
Commit hash : (if develop) 16dfa8a

Expected behaviour

multiple init doesn't make any error

Actual behaviour

ubuntu@ip-172-31-31-234:~/plasma-evm$ build/bin/geth --nousb init genesis.json \
>             --datadir ./operator  \
>             --rootchain.url wss://rinkeby.infura.io/ws/v3/d738213eecc341feb0bf0021390c75e4
INFO [05-11|03:03:34.402] Root chain backend connected             url=wss://rinkeby.infura.io/ws/v3/d738213eecc341feb0bf0021390c75e4
INFO [05-11|03:03:34.599] Stamina config is set                    mindeposit=500000000000000000 recoverepochlength=120960 withdrawaldelay=362880
INFO [05-11|03:03:34.599] Maximum peer count                       ETH=50 LES=0 total=50
INFO [05-11|03:03:34.599] Smartcard socket not found, disabling    err="stat /run/pcscd/pcscd.comm: no such file or directory"
INFO [05-11|03:03:35.604] Set options for submitting a block       mingaspirce=1000000000 maxgasprice=100000000000 resubmit=0s
INFO [05-11|03:03:35.604] Allocated cache and file handles         database=/home/ubuntu/plasma-evm/operator/geth/chaindata cache=16.00MiB handles=16
INFO [05-11|03:03:35.630] Persisted trie from memory database      nodes=19 size=6.26KiB time=88.549µs gcnodes=0 gcsize=0.00B gctime=0s livenodes=1 livesize=-116.00B
Fatal: Failed to write genesis block: database contains incompatible genesis (have 8efa79a5bc52b0eaf4c43d4947ff41289f0166ef7fbff8463b5597a1289c4dec, new 8b3145a803b66727526023dc00e941dfdaba1efbce0362f39be74a377e15fd0a)

Steps to reproduce the behaviour

  1. deploy
  2. init
  3. deploy again
  4. init again --> error : Failed to write genesis block: database contains incompatible genesis

Backtrace

[backtrace]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.