Skip to content

Update the documentation with number of maximum validators #326

@akolotov

Description

@akolotov

There are few places in the code where the list of validators is iterated:

https://github.com/poanetwork/tokenbridge-contracts/blob/20d262702defd3aed39870f3379f1cf0c314305e/contracts/upgradeable_contracts/BaseBridgeValidators.sol#L58-L76

and

https://github.com/poanetwork/tokenbridge-contracts/blob/fdaab2777efe2f48c20a690c9f59196fa89e3631/contracts/upgradeable_contracts/ValidatorsFeeManager.sol#L23-L54

in these methods excessive number of validators could lead to "out of gas" issue.

Consider to do the following:

  • perform a research and update the documentation with maximum number of validators which will not lead to the transaction interruption;
  • update setValidatorCount to limit the number of bridge validator that can be added;
  • update tests that will confirm that the number of invocations of _addValidator that corresponds to the recommended maximum of validators does not exceed some default gas limit (e.g. gas limit for the Ethereum Mainnet)
  • update tests for the initialize methods in both RewardableValidators and BridgeValidators that will confirm that passing the validators list with size corresponding to the recommended maximum of validators does not exceed the default gas limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions