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(dapi): caching of headers prone to reorgs #578

Merged
merged 5 commits into from
Oct 13, 2022

Conversation

markin-io
Copy link
Contributor

Issue being fixed or feature implemented

The fix makes dapi to cache only chainlocked headers, or in the absence of the chainlock, headers with height less than current chain height - 6

What was done?

  • Fixed bug with wrong header heights assigned to cached items
  • Tweaked cache logic to save only headers behind certain height (chain locked or latest chain height - 6)

How Has This Been Tested?

  • CI
  • Manual tests with block headers sync worker on wallet

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@markin-io markin-io added this to the v0.23.0 milestone Oct 12, 2022
jawid-h
jawid-h previously approved these changes Oct 12, 2022
Copy link
Collaborator

@jawid-h jawid-h left a comment

Choose a reason for hiding this comment

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

Looks legit

shuplenkov
shuplenkov previously approved these changes Oct 12, 2022
@markin-io markin-io dismissed stale reviews from shuplenkov and jawid-h via 97d81ff October 13, 2022 08:18
@markin-io markin-io changed the title fix(dapi): cache only chainlocked headers fix(dapi): caching of headers prone to reorgs Oct 13, 2022
Copy link
Member

@shumkov shumkov left a comment

Choose a reason for hiding this comment

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

Good job! 👍

@markin-io markin-io merged commit fc6ba1d into master Oct 13, 2022
@markin-io markin-io deleted the fix/cache-only-chainlocked-headers branch October 13, 2022 09:07
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.

4 participants