Skip to content

Proving Period Library #115

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

Open
wants to merge 24 commits into
base: delayed-publications/configurable-precision
Choose a base branch
from

Conversation

nikeshnazareth
Copy link
Collaborator

The PR is almost a pure refactor. The only functional changes are:

  • a bug fix in finalizePastPeriod to ensure the target period is closed.
  • finalizePastPeriod now zeroes out the prover and requires the period to have a non-zero prover. This means it can only be called once per period.

The main changes are moving period-related functionality to a new library for better readability and encapsulation. It also moves the balance accounting and configuration parameters into their own abstract contracts for better encapsulation.

These are conceptually different operations. Also, I think it is now
clearer that we are only updating values in a period that hasn't
started (even though that it is not enforced in the function)
This should always be true in practice but since we do use a zero prover
to identify a vacant period, I think we should check it explicitly
Before this commit the finalizePastPeriod function confirmed there
is a publication after period.end but it did not confirm that
period.end was non-zero
Also ensure users can only initialize periods with a non-zero prover.
This prevents finalizing the same period multiple times. In practice,
there is no reason to do so, because the stake is already distributed,
but it is better to prevent it explicitly for clarity
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.

1 participant