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

Move EnsureCanonical off main loop tx processing #7471

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

benaadams
Copy link
Member

@benaadams benaadams commented Sep 21, 2024

Changes

  • Move EnsureCanonical to the background task and off main tx processing thread

2.8% of archive since since its processing blocks so fast
image

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

@benaadams benaadams marked this pull request as ready for review September 21, 2024 13:30
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

This is very much by design. If we move this to background thread we allow a situation where Head is already changed, but receipts cannot be found for given transactions through RPC. Data inconsistency for the user.

This is generally not acceptable in normal processing. Although we could design a separate batch mode for archive sync where this happens.

#6422

Copy link
Contributor

@smartprogrammer93 smartprogrammer93 left a comment

Choose a reason for hiding this comment

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

Yeah, maybe only on Archive or we can also do it under a certain flag in the configs. this way if someone wants the absolute speed, they can ignore receipts being consistent with head

@benaadams
Copy link
Member Author

Yeah, maybe only on Archive or we can also do it under a certain flag in the configs. this way if someone wants the absolute speed, they can ignore receipts being consistent with head

Or add a cache for recent receipts?

@benaadams
Copy link
Member Author

This is generally not acceptable in normal processing. Although we could design a separate batch mode for archive sync where this happens.

Added change work?

@LukaszRozmej
Copy link
Member

This is generally not acceptable in normal processing. Although we could design a separate batch mode for archive sync where this happens.

Added change work?

Not really, so one could subscribe to newhead subscription or just pull from standard rpc and then not find the receipts. Would be bad.

We need to delay the tree head to be completely safe.

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

Successfully merging this pull request may close these issues.

3 participants