Increase deploy limits by 8x #2955
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Developers on Aleo are having trouble with the current deployment constraint and variable limits. These limits were put in place to ensure even if an attacker found an avenue to cheaply spam the network with deployments, they would not be able to increase blocktime by too much. However, they need to be increased to allow for a more expressive AleoVM, several developers noted that they are hitting the limits.
Instead of the current transaction-level limits, or proposal-level limits (like we did for finalize spend), this PR proposes a much higher block-level limit.
The main downside of this approach is that it hurts predictability. A deployment might be aborted last-minute because another user deployed at the same time. Note however:
leo deploycan already check whether a deployment was accepted - we can also let it check whether a competing deployment was accepted recently.A nice side-effect of this PR is that it makes DoS attacks with many deployments harder.
A large downside is that encouraging this will increase prover time.
Appendix: how the original limit was set
Deployment verification consists of a mix of single-threaded logic (R1CS synthesis) and multi-threaded logic (polynomial interpolation and evaluation). The original price of 25 microcredits per constraint focused on just the single-threaded runtime - allowing us to be in line with the 10 credits/second across our finalize opcodes. We don't have immediately reproducible benchmarks available unfortunately, this PR does not aim to touch that "constraints per second" metric.
Test Plan