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

Initial support of simple deployment procedure for several bridge instances #24

Closed akolotov closed 6 years ago

akolotov commented 6 years ago

proposed changes for https://github.com/poanetwork/parity-bridge/issues/20 and https://github.com/poanetwork/parity-bridge/issues/18

rstormsf commented 6 years ago

Testing...

rstormsf commented 6 years ago

Only 1 side .The only thing I had to do is to call extra methods in order for bridge to work @phahulin should be aware of this in order to modify his deployment script to call setGas methods

https://kovan.etherscan.io/tx/0x1d963d4968e9cb9b0de626067e1c014fc1a7b9bec13c7ee8a218940de6df586f

Update after some debugging with @akolotov I got it working https://kovan.etherscan.io/tx/0xb4154352dcbbca74bc8e37b233a65260249297b40b0a7c29f76347b67c1d32ff

phahulin commented 6 years ago

@rstormsf @akolotov thanks for mentioning me. So I call three setGas... methods after bridge deployment, but for now still keep withdraw_confirm_gas, deposit_relay_gas and withdraw_relay_gas parameters in bridge config, correct? later when some other issues are closed these three parameters will also be removed from bridge config?

akolotov commented 6 years ago

@phahulin, the intention of re-design was to use setGas... by the bridge contract upgrade procecedure in order to change gas usage limits when the bridge contract is deploed initially or changed. The bridge instance (Rust code) will:

  1. read gasLimitWithdrawRelay, gasLimitDepositRelay and gasLimitWithdrawConfirm as part of initialization procedure and we can get rid of withdraw_confirm_gas, deposit_relay_gas and withdraw_relay_gas from configuration file
  2. watch for event from contracts and as soon as limits are changed, re-initialize internal variables reflecting the limits to use them in new transactions.