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

Refactor round tracker to not block service startup #311

Open
Tracked by #104
bajtos opened this issue May 16, 2024 · 2 comments
Open
Tracked by #104

Refactor round tracker to not block service startup #311

bajtos opened this issue May 16, 2024 · 2 comments

Comments

@bajtos
Copy link
Member

bajtos commented May 16, 2024

When Glif API performance is degraded, we are not able to deploy new versions of spark-api because the startup times out while fetching RoundStart logs from the chain history.

Let's redesign our code to initialise the round tracker in background and no longer block service startup.

@juliangruber
Copy link
Member

Adding more context:

  • @bajtos: "We can also refactor the startup code to try to check if we are already tracking the current round in the database, I had that in mind, but never found time to implement it."
  • I recently increased the block count for the events query from 250 to 500, since spark-evaluate had an issue, and the last event was too old. This blocked spark-api from starting up, as it couldn't find any event. The query shouldn't be too big, as it causes performance degradation from Glif. Idea: add an exponential increase there (check 10 blocks, then 100, etc)

juliangruber added a commit that referenced this issue Jan 20, 2025
* Add exponential backoff to `getRoundStartEpoch()`. #311

* typo

* Update api/lib/round-tracker.js

Co-authored-by: Miroslav Bajtoš <[email protected]>

---------

Co-authored-by: Miroslav Bajtoš <[email protected]>
@bajtos
Copy link
Member Author

bajtos commented Feb 11, 2025

We have already made quite a few improvements in this area. See the list of PRs linked to this issue.

Image Image

The next step is to assess the current situation, identify the remaining conditions in which the service startup is blocked, and propose an implementation plan.

@bajtos bajtos moved this to 📥 todo in Space Meridian Feb 14, 2025
@bajtos bajtos removed their assignment Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📥 next
Development

No branches or pull requests

2 participants