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

Near-sandbox with custom log length limits #73

Open
njelich opened this issue Oct 30, 2023 · 3 comments
Open

Near-sandbox with custom log length limits #73

njelich opened this issue Oct 30, 2023 · 3 comments

Comments

@njelich
Copy link

njelich commented Oct 30, 2023

I'm working on coverage for WASM smart contracts, and to do that I'm using a near-sandbox node.

To do that, one idea was to use logs to pass data, but logs have a length limit set in parameters.yaml config. I'm wondering how this can be changed for a near-sandbox instance?

Thanks!

@akhi3030
Copy link

CC: @ChaoticTempest. Could you help with this query please?

@njelich
Copy link
Author

njelich commented Nov 3, 2023

In the meantime I've found the EstimatorContext, which could be used for this.

There is an override in it that takes care of all the parameters that matter to me.

        // Override vm limits config to simplify block processing.
        runtime_config.wasm_config.limit_config = LimitConfig {
            max_total_log_length: u64::MAX,
            max_number_registers: u64::MAX,
            max_gas_burnt: u64::MAX,
            max_register_size: u64::MAX,
            max_number_logs: u64::MAX,

            max_actions_per_receipt: u64::MAX,
            max_promises_per_function_call_action: u64::MAX,
            max_number_input_data_dependencies: u64::MAX,
            max_length_storage_key: u64::MAX,

            max_total_prepaid_gas: u64::MAX,

            ..runtime_config.wasm_config.limit_config
        };
        runtime_config.account_creation_config.min_allowed_top_level_account_length = 0;

@ChaoticTempest
Copy link
Member

Unfortunately, it doesn't seem like these parameters can be configured from either config.json or genesis.json in the home directory. So, one way to override these parameters is to define a new paramters.yaml file similar to how we have parameters_testnet.yaml already, but name it something like parameters_sandbox.yaml. We will then need to load it in core/runtime/config_store.rs where specifying ${sandbox-binary} inint --chain-id sandbox should point to the paramters_sandbox.yaml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants