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

Add setting to not query daily stats #8142

Closed
wants to merge 1 commit into from

Conversation

yabirgb
Copy link
Member

@yabirgb yabirgb commented Jun 21, 2024

Closes #8120

@yabirgb yabirgb added the ready for final review Backend PR ready to be reviewed by great Lefteris label Jun 21, 2024
Copy link
Member

@LefterisJP LefterisJP left a comment

Choose a reason for hiding this comment

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

You did what we discussed!

But looking at this I got a bit confused and torn if this is the right approach. What do we want to achieve with this PR?

  1. To have a way to not query daily stats automatically if we want to. We can decide whether this is gonna be default or not, but that's another question.
  2. To be able to query them manually if we want to.

As far as I know daily stats do not get populated by any of the long running tasks right?
So seeing that our current function has the "only_cache" argument already ... isn't this setting redundant for the backend?

Couldn't we just make this a frontend only setting? The frontend would query with only_cache: True at the page load. And then depending on if the setting is on it would also do an only_cache: False to trigger a remote query only if this setting is on.

And if the user ever wanted to manually refresh the daily stats, irrespective of the setting value they should press the "refresh" button on daily stats and have them refresh. This requires a separate daily stats refresh button if there is none at the moment.


That's on the setting.

Now I also have a question on the new daily stats API. Does it return data only for completed days? I hope yes. Otherwise we may have problems.

@@ -654,6 +654,7 @@ Getting or modifying settings
:resjson int oracle_penalty_threshold_count: The number of failures after which an oracle is penalized. Default is 5.
:resjson int oracle_penalty_duration: The duration in seconds for which an oracle is penalized. Default is 1800.
:resjson bool auto_create_calendar_reminders: A boolean denoting whether reminders are created automatically for calendar entries based on the decoded history events. Default is ``true``.
:resjson bool query_daily_stats_from_beaconchain: A boolean denoting whether we are allowed to query beaconchain for daily stats. Default is ``true``.
Copy link
Member

Choose a reason for hiding this comment

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

Some clarification.

Suggested change
:resjson bool query_daily_stats_from_beaconchain: A boolean denoting whether we are allowed to query beaconchain for daily stats. Default is ``true``.
:resjson bool query_daily_stats_from_beaconchain: A boolean denoting whether we are allowed to query beaconchain for daily stats. The reason for the existence of the setting is to limit the rate limiting as this information is purely for informatonal purposes. Default is ``true``.

Also shouldn't we mark it as false by default? To limit rate limiting by default?

As far as I understand in the UI we can still just press refresh on daily stats on demand if we want more data to fetch on demand.

@LefterisJP LefterisJP added PR review work work on PR review comments and removed ready for final review Backend PR ready to be reviewed by great Lefteris labels Jun 22, 2024
@yabirgb
Copy link
Member Author

yabirgb commented Jun 24, 2024

Closing since we are adding it as a frontend setting

@yabirgb yabirgb closed this Jun 24, 2024
@yabirgb yabirgb deleted the validator-settings branch June 24, 2024 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR review work work on PR review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants