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

Sync notify reward calls for all GIVpower staking programs to be timed with GIVbacks round rollovers (11am ET every other Tuesday) #4687

Closed
laurenluz opened this issue Sep 4, 2024 · 12 comments
Assignees

Comments

@laurenluz
Copy link
Member

The notify reward calls for our GIVpower pools are out of sync and also too late!

We should have new rewards calls happen at the same time that new GIVbacks rounds start (for me, it's 11am Toronto time every other Tuesday).

Not sure if we can change this sooner... or if we should wait until the next time we extend the rewards.

This includes the rewards for Polygon zkEVM, Gnosis Chain, and OP Mainnet for GIV stakers.

@mohammadranjbarz @aminlatifi

@aminlatifi
Copy link
Member

In order to sync, we can modify the script less than one hour before the boundary to notify reward regardless of previous round is finished or not. Then after the notify time, we revert the changes.

@laurenluz
Copy link
Member Author

oh that's nice! then it would be great to do that perhaps in time for Sept 17, so we have everything lined up for the future. wdyt @mohammadranjbarz @aminlatifi ?

@aminlatifi
Copy link
Member

oh that's nice! then it would be great to do that perhaps in time for Sept 17, so we have everything lined up for the future. wdyt @mohammadranjbarz @aminlatifi ?

Yes, I and @mohammadranjbarz must make an event to be available then. I will create

@aminlatifi
Copy link
Member

@laurenluz When must be the exact time in GMT?

@laurenluz
Copy link
Member Author

3pm GMT

mohammadranjbarz added a commit to Giveth/giv-token-contracts that referenced this issue Sep 6, 2024
@mohammadranjbarz
Copy link
Contributor

@aminlatifi I created a PR for that, and this is my idea, look and say what is your idea:

  1. Comment current cronjobs for these three farms in crontab , so we make sure the current scripts would not execute automatically
  2. Channge the init times for these 3 farms to 3 hours earlier
  3. Create a copy from each script(I called them temp scripts) and change
    // 10 minutes of precision
    if (periodFinish < currentTime + 60 * 10) {

to

    // 24 hours of precision
    if (periodFinish < currentTime + 60 * 60 * 24) {

For instance because of some problem OP period finish is for Wednesday now, so I used 24 hours to make sure it will be executed when I run the script
4. On Tuesday 3pm GMT we will run all temp scripts manually
5. Then uncomment the crontab jobs for calling notifyReward

@aminlatifi WDYT about my approach?

@aminlatifi
Copy link
Member

3pm GMT

Good, we can go for it. Just are you 100% sure? Asking since I double-checked and saw that givpower rounds are aligned on Tuesdays at 4 PM GMT. Also, previous notify reward scripts were mostly aligned to Tuesdays at 6 PM GMT.
It's good to set a GMT based time as the reference point and align everything with that.

@aminlatifi
Copy link
Member

@aminlatifi I created a PR for that, and this is my idea, look and say what is your idea:

  1. Comment current cronjobs for these three farms in crontab , so we make sure the current scripts would not execute automatically
  2. Channge the init times for these 3 farms to 3 hours earlier
  3. Create a copy from each script(I called them temp scripts) and change
    // 10 minutes of precision
    if (periodFinish < currentTime + 60 * 10) {

to

    // 24 hours of precision
    if (periodFinish < currentTime + 60 * 60 * 24) {

For instance because of some problem OP period finish is for Wednesday now, so I used 24 hours to make sure it will be executed when I run the script 4. On Tuesday 3pm GMT we will run all temp scripts manually 5. Then uncomment the crontab jobs for calling notifyReward

@aminlatifi WDYT about my approach?

I like the idea, we must change the init time to align with the time @laurenluz will declare.
Just, I don't think we need to clutter source code with that _tmp scripts. If we want to run the manually, we can just be around during the edge time and manually manipulate that rule and let the cronjob run them at the top of hour

@laurenluz
Copy link
Member Author

Good, we can go for it. Just are you 100% sure? Asking since I double-checked and saw that givpower rounds are aligned on Tuesdays at 4 PM GMT. Also, previous notify reward scripts were mostly aligned to Tuesdays at 6 PM GMT.
It's good to set a GMT based time as the reference point and align everything with that.

oh man, I think it's 3pm GMT. Sorry. I want them to be synced with the same time GIVbacks rounds roll over. for me, i see 11am on my machine when I look at the GIVbacks page... but I think I'm in daylight savings time... so EDT... I checked 11am EST....

But yeah, I think 3pm GMT or, to be more clear... the same time GIVbacks rounds rolls over. can you confirm?

@mohammadranjbarz
Copy link
Contributor

Good, we can go for it. Just are you 100% sure? Asking since I double-checked and saw that givpower rounds are aligned on Tuesdays at 4 PM GMT. Also, previous notify reward scripts were mostly aligned to Tuesdays at 6 PM GMT.
It's good to set a GMT based time as the reference point and align everything with that.

oh man, I think it's 3pm GMT. Sorry. I want them to be synced with the same time GIVbacks rounds roll over. for me, i see 11am on my machine when I look at the GIVbacks page... but I think I'm in daylight savings time... so EDT... I checked 11am EST....

But yeah, I think 3pm GMT or, to be more clear... the same time GIVbacks rounds rolls over. can you confirm?

Thanks, it's all clear

@mohammadranjbarz
Copy link
Contributor

@aminlatifi I created a PR for that, and this is my idea, look and say what is your idea:

  1. Comment current cronjobs for these three farms in crontab , so we make sure the current scripts would not execute automatically
  2. Channge the init times for these 3 farms to 3 hours earlier
  3. Create a copy from each script(I called them temp scripts) and change
    // 10 minutes of precision
    if (periodFinish < currentTime + 60 * 10) {

to

    // 24 hours of precision
    if (periodFinish < currentTime + 60 * 60 * 24) {

For instance because of some problem OP period finish is for Wednesday now, so I used 24 hours to make sure it will be executed when I run the script 4. On Tuesday 3pm GMT we will run all temp scripts manually 5. Then uncomment the crontab jobs for calling notifyReward
@aminlatifi WDYT about my approach?

I like the idea, we must change the init time to align with the time @laurenluz will declare. Just, I don't think we need to clutter source code with that _tmp scripts. If we want to run the manually, we can just be around during the edge time and manually manipulate that rule and let the cronjob run them at the top of hour

Yeah you are right, it could be more simple

mohammadranjbarz added a commit to Giveth/giv-token-contracts that referenced this issue Sep 17, 2024
@mohammadranjbarz mohammadranjbarz moved this from New Issues to QA in All-Devs Sep 18, 2024
@maryjaf maryjaf moved this from QA to Done in All-Devs Sep 29, 2024
@divine-comedian divine-comedian moved this from Done to Merged to Production in All-Devs Oct 4, 2024
@divine-comedian divine-comedian closed this as completed by moving to Merged to Production in All-Devs Oct 4, 2024
@github-project-automation github-project-automation bot moved this from Merged to Production to Done in All-Devs Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants