Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum number of validators handled by a fee manager #238

Open
akolotov opened this issue Jul 16, 2019 · 0 comments
Open

Maximum number of validators handled by a fee manager #238

akolotov opened this issue Jul 16, 2019 · 0 comments

Comments

@akolotov
Copy link
Collaborator

As per the security audit there is a recommendation to explicitly limit the number of iterations assuming that it is not possible to distribute fees to number of validators that exceed some X:

https://github.com/poanetwork/poa-bridge-contracts/blob/786be68cd69526e561dd5654844ac373cda7a539/contracts/upgradeable_contracts/ValidatorsFeeManager.sol#L41-L53

There is no simple way to say what should be a limit since the method refers on the functionality implemented in a particular fee manager.

Let's think of an approach that could estimate possible gas usage of the method onFeeDistribution and recommend a maximum of the validators that can be used for the particular bridge. For example, it could be a script that will deploy particular set contracts (as per the user deployment configuration) but in a local testnet, then the script will run some tests and estimate maximum number of validators handled by distributeFeeProportionally, then this estimation should be recommended to be set up in BaseBridgeValidators to limit _addValidator method properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant