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

fix: Move access to database into a blocking task #5612

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ameten
Copy link
Contributor

@ameten ameten commented Mar 6, 2025

Description

Move access to database into a blocking task

The access to rocksdb is synchronous and we discovered that it take about 1 millisecond to make one retrieval of an insertion into a merkle tree from the database when we build internal merkle tree in relayer from scratch. As the result, the worker thread which executes the task, is blocked by access to the database and cannot be used to execute other scheduled tasks.

This change moves the access to the database into a separate thread in the blocking pool. It frees up the worker thread to execute other tasks.

Related issues

Backward compatibility

Yes

Testing

Manual run of relayer locally

Copy link

changeset-bot bot commented Mar 6, 2025

⚠️ No Changeset found

Latest commit: b2635e5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.53%. Comparing base (d6ddf5b) to head (b2635e5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5612   +/-   ##
=======================================
  Coverage   77.53%   77.53%           
=======================================
  Files         103      103           
  Lines        2110     2110           
  Branches      190      190           
=======================================
  Hits         1636     1636           
  Misses        453      453           
  Partials       21       21           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 79.39% <ø> (ø)
isms 83.68% <ø> (ø)
token 91.27% <ø> (ø)
middlewares 79.80% <ø> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants