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
79 stars 38 forks source link

Get the message length from the bridge contract #81

Open akolotov opened 6 years ago

akolotov commented 6 years ago

Currently the length of message to withdrawal is hard coded:

https://github.com/poanetwork/poa-bridge-contracts/blob/93969cd934190649d42691f054676d0d16a9777e/contracts/libraries/Message.sol#L65

and it is also hard coded in the bridge code:

https://github.com/poanetwork/poa-bridge/blob/cdb79b9ba72bc7094ab7e03b133d4e03a1b5d48a/bridge/src/message_to_mainnet.rs#L19

So, it is necessary to change the length in both places if format of the message is being changed.

As soon as the issue https://github.com/poanetwork/poa-bridge-contracts/issues/39 is addressed in the bridge contract, it is necessary to change the bridge code as so the bridge calls the new method during startup sequence and gets actual value for the message. It will reduce amount of work when new bridge contracts are being introduced.