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

perf: offload tx signature verification from chunk production #12999

Open
mooori opened this issue Feb 25, 2025 · 1 comment
Open

perf: offload tx signature verification from chunk production #12999

mooori opened this issue Feb 25, 2025 · 1 comment
Assignees

Comments

@mooori
Copy link
Contributor

mooori commented Feb 25, 2025

During chunk production transaction signatures are verified sequentially (called from here) on the critical path. To get that work off the critical path, add a second pool containing only transactions for which the signature has been verified.

High level overview

Assume the pool is called SigVerifiedPool:

  • A node receives a transaction.
  • After it's checks excluding signature verification have passed, it sends the transaction to SigVerifiedPool.
  • SigVerifiedPool continuously runs signature verification on a dedicated thread and rejects transactions with invalid signature.
  • A CP interacts with SigVerifiedPool and then can skip signature verification during chunk production.

To consider

  • Make sure all transactions are sent to SigVerifiedPool or add a mechanism for SigVerifiedPool to pull in transactions.
  • Under high load, more than one thread might be required to verify signatures fast enough.
  • Are there opportunities to skip signature verification in other places too by interacting with SigVerifiedPool?
@mooori mooori self-assigned this Feb 25, 2025
@nagisa
Copy link
Collaborator

nagisa commented Feb 25, 2025

Good ideas. I wonder if we need a separate type at all. Couldn't we have the good ol' regular pool verify signatures in the background? In order to mitigate any potential problems with latency due to queue effects (though pool itself is a queue so maybe it isn't a problem...) the pool could return to the callers something akin to Future<SignedTransaction>1 -- if the signature was successfully verified before returning, the future would be already resolved, if not the computation would transparently happen on the "current" thread.

Footnotes

  1. It doesn't have to be a Future -- just an enum that represents delayed computation would be perfectly adequate.

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

No branches or pull requests

2 participants