EXECUTION_LIMIT_REACHED occurred when a "view" function is called. #357
-
Discord user IDbyron1st Describe your question in detail.Hello! I'm running a private blockchain network including 8 validators (Version 1.16.3). The fact that this error occurred at a view function is definitely true because, according to the stacktrace, this error occurred at the According to the stacktrace, the error occurred during calling a native function of table module, and my view function calls This view function is quite heavy and this function traverse many elements of Table. So I'm wondering if there is a limit to call some native functions (such as If you need more information, please let me know. I will provide as many as possible. Thanks!!
What error, if any, are you getting?EXECUTION_LIMIT_REACHED What have you tried or looked at? Or how can we reproduce the error?No response Which operating system are you using?macOS Which SDK or tool are you using? (if any)REST API Describe your environment or tooling in detailRunning a private blockchain networking consisting of 8 Aptos validators (version 1.16.3, no custom code). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Normally, execution gas applied to submitted transactions. There is a max gas limit default for view functions to prevent DoS attacks. It's useful to ensure users don't make full nodes spend all their time running long view functions. But since you're running a private blockchain you can just adjust max_gas_view_function in the config to increase the limit. Similarly if you were running your own full node for the public networks, you can adjust this field to allow you to make more complex view functions. https://github.com/aptos-labs/aptos-core/blob/main/config/src/config/api_config.rs Other option is to optimize the function |
Beta Was this translation helpful? Give feedback.
Normally, execution gas applied to submitted transactions. There is a max gas limit default for view functions to prevent DoS attacks. It's useful to ensure users don't make full nodes spend all their time running long view functions. But since you're running a private blockchain you can just adjust max_gas_view_function in the config to increase the limit. Similarly if you were running your own full node for the public networks, you can adjust this field to allow you to make more complex view functions.
https://github.com/aptos-labs/aptos-core/blob/main/config/src/config/api_config.rs
Other option is to optimize the function