-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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] Limit number of deployments in mempool. #3089
Conversation
At 10 deployments we won't run out of memory. At 5 deployments, we won't take too much compute time. We always interweave the verification of some executions and deployments.
fe1f0af
to
be8e6ce
Compare
node/consensus/src/lib.rs
Outdated
let mut deployments_queue = self.deployments_queue.lock(); | ||
// Acquire the lock on the executions queue. | ||
let mut executions_queue = self.executions_queue.lock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
future consideration: ideally, collections that are always accessed together could be under a single lock (for added performance), though that may require a little bit more type boilerplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made it anyway so Howard can decide: f93060b
Did not implement any further methods for TransactionsQueue to avoid having to add input checking for those methods and to keep it simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
A new approach to https://github.com/AleoHQ/snarkOS/pull/2999 with a focus on simplicity and readability.
At 10 deployments at most in the deployments_queue, we won't run out of memory (the network message size is at most 300 MB).
And we will never verify more than 1 deployment sequentially if there are any executions around, making sure we won't take too much compute time.
We always interweave the verification of some executions and deployments.