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
The current version of the code deployed as the xDai bridge estimates gas usage before sending every transaction in order to sets gas limit in the transaction. Actual gas limit equals the estimated gas multiplied by 2 (implemented as part of #111). The multiplier was identified empirically during the test of erc20-to-native version of the bridge contracts.
Due to this confirmations sent by the validators to the bridge contracts to mint new xDai coins failed when the number of required signatures was increased:
The solution is to increase EXTRA_GAS_PERCENTAGE in src/utils/constants.js. In order to identify the correct value that can be used for EXTRA_GAS_PERCENTAGE, it is necessary to perfom tests with an adequate BlockReward сontract (omni/tokenbridge-contracts#121) for 3 or 5 validators (2 of 3 or 3 of 5 signatures must be required).
Here are examples of transactions with confirmations for the xDai bridge run with a workaround applied (EXTRA_GAS_PERCENTAGE was set to 4)
The current version of the code deployed as the xDai bridge estimates gas usage before sending every transaction in order to sets gas limit in the transaction. Actual gas limit equals the estimated gas multiplied by 2 (implemented as part of #111). The multiplier was identified empirically during the test of
erc20-to-native
version of the bridge contracts.During the testing the simplified version of the
BlockReward
contract was used:https://github.com/poanetwork/poa-bridge-contracts/blob/339bd4ab0411b83f093af33d1d6a00a39af79654/contracts/test/BlockReward.sol#L21-L27
This implementation consumes less gas than the actual
RewardByBlock
contract:https://github.com/poanetwork/poa-network-consensus-contracts/blob/b0fc8789850ef44f0eb0c277748415d3d194e94a/contracts/RewardByBlock.sol#L45-L58
Due to this confirmations sent by the validators to the bridge contracts to mint new xDai coins failed when the number of required signatures was increased:
2
): https://blockscout.com/poa/dai/tx/0xf0432ea4f9f496330627e181215f70aaabed1c0e79ec9ef2ca7cde345fda11af/internal_transactions. It fails due to gas limit when tries to invokeRewardByBlock.addExtraReceiver
.The solution is to increase
EXTRA_GAS_PERCENTAGE
insrc/utils/constants.js
. In order to identify the correct value that can be used forEXTRA_GAS_PERCENTAGE
, it is necessary to perfom tests with an adequateBlockReward
сontract (omni/tokenbridge-contracts#121) for 3 or 5 validators (2 of 3 or 3 of 5 signatures must be required).Here are examples of transactions with confirmations for the xDai bridge run with a workaround applied (
EXTRA_GAS_PERCENTAGE
was set to4
)The text was updated successfully, but these errors were encountered: