omni / poa-bridge

POA <-> Ethereum bridge for self transfers of POA native token to POA20 (ERC20 representation). Not supported. Use TokenBridge instead
https://github.com/poanetwork/token-bridge
GNU General Public License v3.0
80 stars 39 forks source link

Database file got corrupted when running parity bridge #45

Open peterjoel opened 6 years ago

peterjoel commented 6 years ago

I'm running Parity-bridge, based on the current version of the README, using:

./parity-bridge/target/release/bridge --config config.toml --database db.toml

And my db.toml file is like this:

home_contract_address = "0x74A71bFb6C4903d79EbDd77C556D2d43A9346BdD"
foreign_contract_address = "0xD6fE4c32ADDe8e4b5eD6272Ecb5c434Dc7b120c4"
home_deploy = 2025251 # block number at which the contract was created for home contract you can find in `bridgeDeploymentResults.json`
foreign_deploy = 6923247 # block number at which the contract was created for foreign contract you can find in `bridgeDeploymentResults.json`
checked_deposit_relay = 2025251 # last checked deposits events on Home network
checked_withdraw_relay = 6923247 # last checked withdraw events on Foreign network
checked_withdraw_confirm = 6923247 # last checked withdraw events on Foreign network

However, once the parity-bridge process starts, the file gets corrupted. It looks like this:

home_contract_address = "0x74a71bfb6c4903d79ebdd77c556d2d43a9346bdd"
foreign_contract_address = "0xd6fe4c32adde8e4b5ed6272ecb5c434dc7b120c4"
home_deploy = 2025251
foreign_deploy = 6923247
checked_deposit_relay = 2026365
checked_withdraw_relay = 6924041
checked_withdraw_confirm = 6924041
loy = 6923247 # block number at which the contract was created for foreign contract you can find in `bridgeDeploymentResults.json`
checked_deposit_relay = 2025251 # last checked deposits events on Home network
checked_withdraw_relay = 6923247 # last checked withdraw events on Foreign network
checked_withdraw_confirm = 6923247 # last checked withdraw events on Foreign network

The Home and Foreign account balances show as zero, even though I transferred ETH into them, and I suspect this is the cause.

peterjoel commented 6 years ago

Moved from https://github.com/poanetwork/bridge-ui/issues/26, which was the wrong repository.

peterjoel commented 6 years ago

@snd It's probable that I had an extra process running - perhaps it didn't quit correctly on a previous run. Having restarted my machine cleanly, it works correctly now.

But even so, as you said on the other thread, it shouldn't be corrupting the file, regardless.

peterjoel commented 6 years ago

I take that back. It's still doing it.

I'm using the current master of both parity-bridge (commit e885fdfe21c41ff0efa94d1ca07c9b99ab805a30) and bridge-ui (commit 4aefece)

snd commented 6 years ago

could you try https://github.com/paritytech/parity-bridge/ to see whether your problem occurs there as well?

peterjoel commented 6 years ago

Removing the comments in the Config.toml appears to have fixed it.

snd commented 6 years ago

strange

maxidev commented 6 years ago

Same problem here. +1

igorbarinov commented 6 years ago

@yrashk any ideas why?

maxidev commented 6 years ago

Also deleting config.toml comments problem disapeared.

akolotov commented 6 years ago

@maxidev could you provide more details on the exact project, branch and commit you are using to build the bridge. What steps to reproduce the issue are?

maxidev commented 6 years ago

@akolotov to have the bridge working I had to checkout to latest commit from Apr 11 (commit da91da9db70ac7c4a971eb86eab8e7adf6ce4884) OS: Ubuntu server 16.04 Parity: 1.9.5 Stable cargo --version cargo 0.26.0 (41480f5cc 2018-02-26)

yrashk commented 6 years ago

@maxidev have you tried any recent version of the bridge?