-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 program size to 100KBs #2384
Conversation
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.
We have N::MAX_IMPORTS
. Can we also enforce that size here?
This issue is still unaddressed @vicsn |
The limit was already enforced. Test was added here: 81e51a8 Let me know if you have something else in mind. |
I missed that commit, thanks @vicsn |
Motivation
Closes https://github.com/AleoHQ/snarkOS/issues/3141
Introduces:
MAX_PROGRAM_SIZE
MAX_STRUCTS
MAX_RECORDS
MAX_CLOSURES
Some notes:
MAX_STRUCTS
,MAX_CLOSURES
andMAX_RECORDS
don't add security but don't hurt either and were requested in the issue above. Even existing parameters likeMAX_INSTRUCTIONS
can't be fully utilized as it will now quickly lead to programs which surpass the size limit.Can't add you as reviewer do doing it manually: @miazn
Test Plan
Added extensive unit test