Skip to content

StakingManager initiatlizer validates return value from ValidatorManager #716

@cam-schultz

Description

@cam-schultz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    Backlog 🧊

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions