-
Notifications
You must be signed in to change notification settings - Fork 31
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
ValidatorManager is PoA when deployed on its own #711
ValidatorManager is PoA when deployed on its own #711
Conversation
@@ -53,12 +53,11 @@ | |||
* | |||
* @custom:security-contact https://github.com/ava-labs/icm-contracts/blob/main/SECURITY.md | |||
*/ | |||
contract ValidatorManager is Initializable, ContextUpgradeable, ACP99Manager { | |||
contract ValidatorManager is Initializable, OwnableUpgradeable, ACP99Manager { |
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: solidity.best-practice.use-ownable2step.use-ownable2step Note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this simplification -- even if the majority of the deletion delta is from the .sol and bindings, I think it also makes it simpler to explain and being able to verbally distinguish between "staking manager" and "validator manager' without the "validator manager" term being overloaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this simplification -- even if the majority of the deletion delta is from the .sol and bindings, I think it also makes it simpler to explain and being able to verbally distinguish between "staking manager" and "validator manager' without the "validator manager" term being overloaded.
To solidify that, I renamed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a comment in my draft that I can drop now from the main separation PR. I was happy to wait until the big one is merged to suggest it but I agree that now is as good a time as any!
It's also more accurate since it no longer handles validator state updates just stake related ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally makes sense to me.
1a13fa0
into
acp-99-reference-impl-multi-contract
Why this should be merged
To implement a multi contract validator manager,
ValidatorManager
functions that modify validator state are restricted to the "specialization" contract (e.g.PoSValidatorManager
) via anonlyAdmin
modifier. This is identical to how OpenZeppelinOwnable
contracts work, which is the only meaningful logic contained inPoAValidatorManager
. Given these similarities, folding the PoA use case intoValidatorManager
directly is the simpler approach.One consequence of this design is that in the PoA case, only the admin may deliver ICM messages to complete validator registration or removal. This can of course be worked around, but I'm not convinced this is a use case worth supporting, since permissionless interaction with a PoA contract is antithetical.
How this works
Removes
PoAValidatorManager
and modifiesValidatorManager
to implementOwnableUpgradeable
.How this was tested
Updated e2e subnet conversion flow to support `
ValidatorManager
(i.e. PoA)ValidatorManager
's ownerHow is this documented
Updated README and class diagrams