You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the bridge deployment process it is necessary to create configuration file for every bridge instance. There is a section in the configuration file which allows to define gas consumption limits which will be used in the bridge transactions:
deposit_relay
withdraw_confirm
withdraw_relay
Since these limits are common for every bridge instance it is redundant to distribute this info among all nodes before deployment begins.
Moreover these limits needs to be updated in case of gas consumption changes if the bridge contract is upgraded as per #7. In order to reduce human factor it is worth to update this automatically.
Some big constant value for these parameters is not good option to have - it could cause delays in validation since limits will be too big for block validators especially in the Ethereum Foundation network.
Proposal for changes
Solidity
Introduce gasLimitWithdrawRelay in the contract HomeBridge.
Introduce gasLimitDepositRelay and gasLimitWithdrawConfirm field in the contract ForeignBridge.
Setup this parameter as part of bridge contracts deployment process.
Introduce ability to change these parameters as part of bridge contract upgrade process as soon as (Feature) Make bridge contract upgradable #7 is implemented. Events must be raised in case of gas limit changes.
Rust
Change bridge/src/bridge/deploy.rs to setup gasLimitWithdrawRelay, gasLimitDepositRelay and gasLimitWithdrawConfirm as part of deployment process.
Introduce new functionality in bridge/src/bridge/deposit_relay.rs, bridge/src/bridge/withdraw_confirm.rs and bridge/src/bridge/withdraw_relay.rs in order to pickup gas limits from the corresponding contract. In order to optimize number of requests made to the blockchain nodes the limits could be re-read as soon as the corresponding event received from the bridge contracts.
The text was updated successfully, but these errors were encountered:
As per the bridge deployment process it is necessary to create configuration file for every bridge instance. There is a section in the configuration file which allows to define gas consumption limits which will be used in the bridge transactions:
Since these limits are common for every bridge instance it is redundant to distribute this info among all nodes before deployment begins.
Moreover these limits needs to be updated in case of gas consumption changes if the bridge contract is upgraded as per #7. In order to reduce human factor it is worth to update this automatically.
Some big constant value for these parameters is not good option to have - it could cause delays in validation since limits will be too big for block validators especially in the Ethereum Foundation network.
Proposal for changes
Solidity
gasLimitWithdrawRelay
in the contract HomeBridge.gasLimitDepositRelay
andgasLimitWithdrawConfirm
field in the contract ForeignBridge.Rust
bridge/src/bridge/deploy.rs
to setupgasLimitWithdrawRelay
,gasLimitDepositRelay
andgasLimitWithdrawConfirm
as part of deployment process.bridge/src/bridge/deposit_relay.rs
,bridge/src/bridge/withdraw_confirm.rs
andbridge/src/bridge/withdraw_relay.rs
in order to pickup gas limits from the corresponding contract. In order to optimize number of requests made to the blockchain nodes the limits could be re-read as soon as the corresponding event received from the bridge contracts.The text was updated successfully, but these errors were encountered: