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

StakingManager initiatlizer validates return value from ValidatorManager #716

Open
cam-schultz opened this issue Feb 6, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@cam-schultz
Copy link
Contributor

Context and scope
#707 splits the validator manager deployment into two contracts for the PoS case - a ValidatorManager, and StakingManager that holds a reference to the ValidatorManager. The ValidatorManager's address is provided to StakingManager at initialization, but there's not a great way to verify that the provided address actually contains a ValidatorManager.

Formal verification of an external contract is not practical for this use case (as discussed in the description of the linked PR). Instead, the approach that is implemented mitigates against human error when initializing the StakingManager by calling a known ValidatorManager function. This can be improved upon by calling a function with an agreed upon authenticating value (such as a hard coded magic number), and validating this on the caller.

Open questions
How much added dev X would this buy us? Currently, we call ValidatorManager.getChurnPeriodSeconds. The main pitfall here is if another contract also implements this method (with the same signature) and that contract is provided to the StakingManager. Also validating return data would be an improvement, but the failure scenario in the current setup is already very unlikely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog 🗄️
Development

No branches or pull requests

1 participant