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

updated economic metrics to reflect new spec #19

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

samlaf
Copy link
Collaborator

@samlaf samlaf commented Oct 6, 2023

Fixes # .

Motivation

Solution

Open questions

@samlaf samlaf requested a review from shrimalmadhur October 6, 2023 00:55
maxNumberOfQuorums = 192
)

func BitmapToQuorumIds(bitmap *big.Int) []QuorumNum {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be in operator.go or some utils.go files?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it here because we otherwise have a circular dependency between utils and types...
this types package will require a refactor. I was thinking of putting your operator stuff in types/operator maybe, or something like that. Needs to be thought through how we want to separate utils and types. In some sense I'm thinking we should only have types here and all your operator methods (like Validate) should maybe be functions defined in utils?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reason I added Validate is because it's a part of struct - as in you have to have operator object to call it. you can't call that without creating an object first. It would be confusing to put it in utils.
This function here doesn't require any object to be calling this - that's why it can added independently to utils. That's kind of my thought process in separating types vs utils.

I feel we can have multiple utils based on package too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't understand your point. You can always turn a method into a function. Your Validate function could also just be written

Validate (operator, ...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any case I can't move it to utils.go because that would create a circular dependency. What's your suggestion here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea I didn't realize the circular dependency part. okay. I think it's fine here. we maybe have to think of clear separation.

You can always turn a method into a function - I think it's cleaner and very specific that validate is acted on the operator, where utils function can be more generic, like checking an eth address or a valid url vs utilities of our own types. We can think about that separation

@samlaf samlaf merged commit 0305254 into master Oct 6, 2023
3 checks passed
@samlaf samlaf deleted the samlaf/update-economic-metrics branch October 6, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants