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

Change the way we store Enrollments #735

Closed
2 tasks done
Geod24 opened this issue Apr 7, 2020 · 4 comments
Closed
2 tasks done

Change the way we store Enrollments #735

Geod24 opened this issue Apr 7, 2020 · 4 comments
Assignees
Labels
prio-high Will have an effect in the next three sprints Story-Points:5 This takes 3 to 5 days to complete type-bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense type-enhancement An improvement of existing functionalities
Milestone

Comments

@Geod24
Copy link
Collaborator

Geod24 commented Apr 7, 2020

Currently we add Enrollment to the EnrollmentManager when they are received but before they are validated:
https://github.com/bpfkorea/agora/blob/05bfe591aec457544bfe9fc8b799f592d4d6b303/source/agora/node/Node.d#L507-L518

Then consensus is made on them. This has a few issues:

  • It is impossible to replace an enrollment, lest the user change their key (so there's a 2 week waiting period);
  • This table is never cleaned up;
  • We mix the data we use before and after consensus, which is error-prone.
  • addValidatedBlock does not add Enrollments, only update their height, which mean catch-up is broken.

It would be best to have those two data set apart, and only have active enrollments in the EnrollmentManager. The separation should probably be similar to transaction pool / UTXO set.

Definition of Done:

  • Make the way to sotre Enrollments like the way similar to to transaction pool / UTXO set.
  • Clean up the table when a enrollment is expired.
@Geod24 Geod24 added the prio-high Will have an effect in the next three sprints label Apr 7, 2020
@Geod24 Geod24 added this to the 2. Validator milestone Apr 7, 2020
@bpalaggi bpalaggi added type-bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense type-enhancement An improvement of existing functionalities labels Apr 7, 2020
@linked0
Copy link
Contributor

linked0 commented Apr 8, 2020

Among the issues to be resovled, some issues as follows can be split into another issue.

  • It is impossible to replace an enrollment, lest the user change their key (so there's a 2 week waiting period);
  • This table is never cleaned up;

Those can be handled after chaning the way we store the Enrollments. So I will create new issue named like "Add the feature to change or delete enrollments stored".

@linked0
Copy link
Contributor

linked0 commented Apr 22, 2020

After the PR #748 , there will be more PRs for tasks as follows.

  • Refactor the relations between classes related to the enrollment process and other classes that use the classes(including the change of the name and function modifier of member functions.
  • Refine the API endpoints related to the enrollment process, for example, getPreimage.
  • Remove table in the EnrollmentManager.
  • Refine test code in the test.EnrollmentManager package.

@Geod24
Copy link
Collaborator Author

Geod24 commented May 4, 2020

@linked0 : I think we can reasonably consider this closed. Could you open issues for any remaining tasks so they can be addressed in the next sprint ?

@Geod24 Geod24 closed this as completed May 4, 2020
@linked0
Copy link
Contributor

linked0 commented May 6, 2020

@linked0 : I think we can reasonably consider this closed. Could you open issues for any remaining tasks so they can be addressed in the next sprint ?

There is one remaining task which is to remove the table from the EnrollmentManager. I will create an issue and address it in the next sprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio-high Will have an effect in the next three sprints Story-Points:5 This takes 3 to 5 days to complete type-bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense type-enhancement An improvement of existing functionalities
Projects
None yet
Development

No branches or pull requests

3 participants