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

V2 chunk assignment #736

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

mooselumph
Copy link
Contributor

Why are these changes needed?

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@mooselumph mooselumph marked this pull request as ready for review September 4, 2024 19:34
@mooselumph mooselumph changed the title Basic implementation of V2 assignment V2 chunk assignment Sep 4, 2024
@mooselumph mooselumph requested review from ian-shim, jianoaix, hopeyen and cody-littley and removed request for ian-shim September 4, 2024 19:34
Comment on lines +42 to +47
type StdAssignmentCoordinatorV2 struct {
}

var _ AssignmentCoordinatorV2 = (*StdAssignmentCoordinatorV2)(nil)

func (c *StdAssignmentCoordinatorV2) GetAssignments(state *OperatorState, blobVersion byte, quorum QuorumID) (map[OperatorID]Assignment, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this struct (as opposed to having methods that don't operate on a struct)? Is the idea that we may end up having multiple algorithms, and we can toggle between which algorithm we use by using a different struct that implements AssignmentCoordinatorV2?


func (c *StdAssignmentCoordinatorV2) GetAssignment(state *OperatorState, blobVersion byte, quorum QuorumID, id OperatorID) (Assignment, error) {

assignments, err := c.GetAssignments(state, blobVersion, quorum)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure on the planned call patterns for these methods, so it's possible what I'm about to suggest is premature optimization. Would it make sense to cache the value of GetAssignments() instead of recomputing it each time?

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