Skip to content

PSE Distribution Timing#37

Merged
TxCorpi0x merged 5 commits into
masterfrom
mehdi/pse-distribution-timing
Nov 28, 2025
Merged

PSE Distribution Timing#37
TxCorpi0x merged 5 commits into
masterfrom
mehdi/pse-distribution-timing

Conversation

@TxCorpi0x

@TxCorpi0x TxCorpi0x commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Description

This pull request updates the distribution schedule logic for PSE allocations to use fixed 30-day intervals for each distribution period instead of calendar months. The changes ensure that all distributions happen exactly every 30 days at midnight UTC, starting from the upgrade date, which improves predictability and consistency across periods. The test suite is also updated to validate the new interval logic and remove assumptions about calendar month boundaries.

Distribution logic changes:

  • The distribution schedule now uses fixed 30-day periods rather than calendar months, with each period starting at 00:00:00 UTC on the upgrade date. The code calculates each period's timestamp by adding exactly 30 days for each period.

  • Allocation amounts and error handling are updated to refer to "periods" rather than "months," and each clearing account's total balance is divided evenly across these periods.

Test suite updates:

  • All tests now validate that distributions occur exactly every 30 days, starting at midnight UTC, and that allocation amounts per period are correct. Month-based checks are replaced with 30-day interval checks.

  • Edge case tests are updated to verify correct behavior across leap years and month boundaries using fixed 30-day intervals, removing reliance on Gregorian calendar month handling.

Reviewers checklist:

  • Try to write more meaningful comments with clear actions to be taken.
  • Nit-picking should be unblocking. Focus on core issues.

Authors checklist

  • Provide a concise and meaningful description
  • Review the code yourself first, before making the PR.
  • Annotate your PR in places that require explanation.
  • Think and try to split the PR to smaller PR if it is big.

This change is Reviewable

@TxCorpi0x TxCorpi0x requested review from a team, masihyeganeh, miladz68 and ysv and removed request for a team November 26, 2025 06:45

@TxCorpi0x TxCorpi0x left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

  • The start time should be the same day at 12:00 GMT
  • The months (no 30 days and no Gregorian calendar) just try do the in the same day in every moth capped to 27th.

@TxCorpi0x reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh, @miladz68, and @ysv)

@TxCorpi0x TxCorpi0x requested a review from a team as a code owner November 26, 2025 13:40

@ysv ysv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ysv reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh and @miladz68)

@miladz68 miladz68 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@miladz68 reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)

@TxCorpi0x TxCorpi0x merged commit 4070d5b into master Nov 28, 2025
9 of 10 checks passed
TxCorpi0x added a commit that referenced this pull request Dec 2, 2025
* PSE start time on upgrade time day start UTC

* Set distribution schedules duration as 30days

* Change start time to 12:00 GMT on 28th of month

* Rename period to month in PSE init
@ysv ysv deleted the mehdi/pse-distribution-timing branch December 19, 2025 14:40
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.

3 participants