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-352: Reset CU at month end #395

Merged
merged 5 commits into from
Apr 17, 2023
Merged

CNS-352: Reset CU at month end #395

merged 5 commits into from
Apr 17, 2023

Conversation

orenl-lava
Copy link
Contributor

This PR ensures that subscriptions at the end of each month reset/recharge the CU usage of their projects. For this, we store (in the Projects module) the list of projects for each subscription.

The PR also fixes calls to DeleteProject() which used the bare project name, rather than the outcome of ProjectIndex() function (which combines the subscription address with the project name).

NOTE: this requires a store-migration to ensure that existing subscriptions get their projects tracked in the Projects module store.

@orenl-lava orenl-lava requested review from omerlavanet and Yaroms April 3, 2023 11:51
@orenl-lava orenl-lava force-pushed the CNS-352-reset-cu-at-month-end branch from e193382 to f6ea05b Compare April 3, 2023 14:26
proto/projects/project.proto Outdated Show resolved Hide resolved
x/pairing/types/expected_keepers.go Outdated Show resolved Hide resolved
x/projects/keeper/creation.go Outdated Show resolved Hide resolved
x/projects/keeper/project.go Outdated Show resolved Hide resolved
x/projects/types/keys.go Outdated Show resolved Hide resolved
GetAllEntryIndicesWthPrefix() returns list of indices a given prefix.
This is useful, for example, to get the list of projects of a subscription.
@orenl-lava orenl-lava force-pushed the CNS-352-reset-cu-at-month-end branch from ed1ac44 to bc092a9 Compare April 10, 2023 15:17
Re-charge the subscription CU at the end of subscription's month, and also
use project's snapshot functionality to re-charge the projects too.

Signed-off-by: Oren Laadan <orenl@lavanet.xyz>
Signed-off-by: Oren Laadan <orenl@lavanet.xyz>
Signed-off-by: Oren Laadan <orenl@lavanet.xyz>
@orenl-lava orenl-lava force-pushed the CNS-352-reset-cu-at-month-end branch from bc092a9 to e9ca5c0 Compare April 10, 2023 15:19
Signed-off-by: Oren Laadan <orenl@lavanet.xyz>
@orenl-lava orenl-lava requested a review from Yaroms April 13, 2023 10:56
@Yaroms Yaroms merged commit dda7615 into main Apr 17, 2023
@Yaroms Yaroms deleted the CNS-352-reset-cu-at-month-end branch April 17, 2023 09:42
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