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

Add more getters to the ValidatorManager contract #645

Closed
Nuttymoon opened this issue Nov 14, 2024 · 0 comments · Fixed by #655
Closed

Add more getters to the ValidatorManager contract #645

Nuttymoon opened this issue Nov 14, 2024 · 0 comments · Fixed by #655
Assignees
Labels

Comments

@Nuttymoon
Copy link
Contributor

Nuttymoon commented Nov 14, 2024

Context and scope
The ValidatorManager abstract contract holds a lot of useful information in its state (ValidatorManagerStorage), but they are inaccessible to child contracts and users.

I am currently writing a contract that inherits ValidatorManager and I have trouble retrieving such information, e.g. my contract has no knowledge of the current totalWeight of the L1.

It would be very useful to have more getter functions to access variables like:

  • $._subnetID
  • $._churnTracker.totalWeight

For the sake of simplicity, it would make sense to make most, if not all, of those variables accessible through getters (if not publicly, at least internally).

Discussion and alternatives
An alternative would be to make _getValidatorManagerStorage() internal but this is not a good practice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done ✅
Development

Successfully merging a pull request may close this issue.

2 participants