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

CNS-385: project propagate charge of CU onward #427

Merged
merged 5 commits into from
May 1, 2023

Conversation

orenl-lava
Copy link
Contributor

Charging CUs to a project always happens to a certain fixation version (by block).
When doing so, the charge should propagate from that version onward: until the
most recent version, or until a re-charged version (i.e. after subscription month
end) is reached, as marked by a new snapshot.

@orenl-lava orenl-lava requested review from Yaroms and oren-lava April 16, 2023 17:03
@orenl-lava orenl-lava force-pushed the CNS-385-project-propagate-charge-cu branch from 987b666 to 87be59a Compare April 18, 2023 17:39
@orenl-lava orenl-lava force-pushed the CNS-381-timer-versioning-and-migration branch from af72527 to fbe2b87 Compare April 20, 2023 03:15
@orenl-lava orenl-lava force-pushed the CNS-385-project-propagate-charge-cu branch 2 times, most recently from 0c36c1c to c0baf28 Compare April 20, 2023 06:53
@orenl-lava orenl-lava force-pushed the CNS-381-timer-versioning-and-migration branch from fbe2b87 to 6c81d2c Compare April 20, 2023 06:53
Base automatically changed from CNS-381-timer-versioning-and-migration to CNS-376-fixation-versioning-and-migration April 23, 2023 07:53
Base automatically changed from CNS-376-fixation-versioning-and-migration to main April 24, 2023 10:55
@orenl-lava orenl-lava force-pushed the CNS-385-project-propagate-charge-cu branch 3 times, most recently from 65ee217 to 588f10d Compare April 27, 2023 16:49
FixationStore methods "ModifyEntry" and "PutEntry" always expect valid
index/block arguments of an existing entry (as opposed to "FindEntry" which
returns the entry with nearst-smaller block). Adjust their logic as needed
and do not use the iterator in getUnmarshaledEntryForBlock().

Also introduce new method "ReadEntry" which reads/copies an existing entry
by index/block.
Add method GetEntryVersionRange(ctx, index, block, ceiling), which returns
list of block versions of an entry, starting from the nearest-smaller block
and capped by ceiling.

If block is 0 and ceiling is math.MaxUint64, then this gives all versions.
If ceiling is block + STALE_ENTRY_TIME then this returns range of versions
that are may belong in the same "snapshot" (e.g. for a project).
Charging CUs to a project always happens to a certain fixation version (by
block). When doing so, the charge should propagate from that version onward:
until the most recent version, or until a re-charged version (i.e. after
subscription month end) is reached, as marked by a new snapshot.
@orenl-lava orenl-lava force-pushed the CNS-385-project-propagate-charge-cu branch from 588f10d to ea131cb Compare April 30, 2023 14:25
x/projects/keeper/project.go Show resolved Hide resolved
@Yaroms Yaroms merged commit c094633 into main May 1, 2023
@Yaroms Yaroms deleted the CNS-385-project-propagate-charge-cu branch May 1, 2023 14:18
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