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

Runtime Limiters #1692

Closed
MaksymZavershynskyi opened this issue Nov 14, 2019 · 7 comments
Closed

Runtime Limiters #1692

MaksymZavershynskyi opened this issue Nov 14, 2019 · 7 comments
Assignees
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-epic Category: an epic P-high Priority: High

Comments

@MaksymZavershynskyi
Copy link
Contributor

Currently runtime lacks limiters in several places, e.g. limiting the number of method names in access keys.

@MaksymZavershynskyi MaksymZavershynskyi added A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) runtime-stability labels Nov 14, 2019
@MaksymZavershynskyi MaksymZavershynskyi self-assigned this Nov 15, 2019
@evgenykuzyakov evgenykuzyakov self-assigned this Nov 16, 2019
@MaksymZavershynskyi MaksymZavershynskyi changed the title [Runtime] Limiters Limiters Nov 19, 2019
@MaksymZavershynskyi MaksymZavershynskyi removed their assignment Nov 19, 2019
@ilblackdragon ilblackdragon added this to the MainNet milestone Dec 8, 2019
@evgenykuzyakov
Copy link
Collaborator

evgenykuzyakov commented Dec 11, 2019

Limiters are needed for

  • Max burnt gas per view method
  • Max prepaid gas per function call
  • Max number of actions per receipt
  • Max length of allowed method names
  • Max length of a method name
  • Max length of returned data
  • Max contract size
  • Max storage key size
  • Max storage value size
  • Max number of promises that a function call can create
  • Max number of data dependencies
  • Max number of outgoing data
  • Max prepaid gas
  • Max number of logs

Might need to add more

@evgenykuzyakov evgenykuzyakov mentioned this issue Jan 2, 2020
5 tasks
@MaksymZavershynskyi MaksymZavershynskyi added P-critical Priority: critical and removed runtime-stability labels Jan 20, 2020
@MaksymZavershynskyi MaksymZavershynskyi changed the title Limiters [Epic] Limiters Jan 20, 2020
@MaksymZavershynskyi MaksymZavershynskyi added the C-epic Category: an epic label Jan 21, 2020
@MaksymZavershynskyi MaksymZavershynskyi changed the title [Epic] Limiters Runtime Limiters Jan 21, 2020
@MaksymZavershynskyi MaksymZavershynskyi removed the P-critical Priority: critical label Feb 4, 2020
@MaksymZavershynskyi
Copy link
Contributor Author

  • Moved this Epic to docs pipeline so that @amgando can start working on adding this information to docs, adding him to Assignees.
  • Removed other issues that were under this epic (the one about splitting gas limit can be a standalone task, the other one about state splitting is in its own context and mostly related to storage).
  • Changed priority to P1 since documentation has no urgency for this issue.

@amgando amgando added the P-high Priority: High label Feb 8, 2020
@amgando
Copy link
Contributor

amgando commented Feb 8, 2020

@nearmax how do you imagine this landing in the docs?

i can imagine

  • as little as a "simple list of possible errors", basically translating the code and comments into markdown and including them in some sensible location
  • or as much as "samples of code that induces each error", where each error includes a short snippet that, if applied in the correct context, will repeatably induce the error (not sure if this is even possible for all of these errors)

is it one of these extremes or something entirely different?

for educational purposes, being able to repeatably induce an error is much more useful than just a list of errors (which will still be somewhat useful when they match search results of course)

@evgenykuzyakov
Copy link
Collaborator

@amgando
I think we need to document limits that we have within Runtime. E.g. maximum length of key to store, or maximum size of a contract that can be deployed, etc.

Here is the configuration for different limits. Each field has inline comments. If some comments are unclear then we need to expand on them:
https://github.com/nearprotocol/nearcore/blob/9ed24269598ac1f1e8e33319c80c17faac51ba93/runtime/near-vm-logic/src/config.rs#L22

Here is the default values of these limits. We use these values in the genesis, so these are the numbers that are currently in prod (or going to be soon, once we merge staging).
https://github.com/nearprotocol/nearcore/blob/9ed24269598ac1f1e8e33319c80c17faac51ba93/runtime/near-vm-logic/src/config.rs#L116

@ilblackdragon
Copy link
Member

@amgando @evgenykuzyakov is this finished?

@MaksymZavershynskyi MaksymZavershynskyi removed this from the MainNet milestone Mar 21, 2020
@amgando
Copy link
Contributor

amgando commented Mar 30, 2020

@ilblackdragon i think so, we published to docs and NEPs. assuming it's done
https://docs.nearprotocol.com/docs/api/vm-limits
near/NEPs#36

@amgando
Copy link
Contributor

amgando commented Apr 1, 2020

closing

@amgando amgando closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) C-epic Category: an epic P-high Priority: High
Projects
None yet
Development

No branches or pull requests

4 participants