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

Verify initial validator weights are removable #598

Open
cam-schultz opened this issue Oct 14, 2024 · 0 comments
Open

Verify initial validator weights are removable #598

cam-schultz opened this issue Oct 14, 2024 · 0 comments
Assignees
Labels

Comments

@cam-schultz
Copy link
Contributor

Context and scope
As part of permissionless L1 initialization, an initial validator set is provided in the call to [initializeValidatorSet](https://github.com/ava-labs/teleporter/blob/validator-manager/contracts/validator-manager/ValidatorManager.sol#L143). The weights of these validators are checked against the signed Warp message from the P-Chain attesting that the subnet was converted.

Not all initial validator weights allow the validator set to be changed without violated the churn tracking limits. The maximum one-shot churn percentage is capped at 20% of the L1's current weight. For example, if the initial validator set consisted of a single validator with weight 3, then it would be impossible to add or remove a validator, since a weight change of 1 (the minimum amount) would be a 33% change.

There's nothing we can do on the contract side to ensure the ConvertSubnetTx specifies valid weights, but validation on the contract level would at least cause an early failure, rather than when trying to change the validator set, at which point it may no longer be feasible to tear down the L1 and start again.

Discussion and alternatives
We should at the very least validate that the L1's total initial weight is at least 5, so that validators can be added after the fact. We should also disallow removing validators if it would cause the total weight to dip below 5.

Open questions
Should we implement this validation check in ConvertSubnetTx on the P-Chain side as well?

@cam-schultz cam-schultz added the enhancement New feature or request label Oct 14, 2024
@geoff-vball geoff-vball self-assigned this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Progress 🏗
Development

No branches or pull requests

2 participants