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

[5.0 -> main] Only return wasm config settings if configurable wasm limits enabled #1775

Merged
merged 6 commits into from
Oct 16, 2023

Conversation

heifner
Copy link
Member

@heifner heifner commented Oct 13, 2023

The wasm config settings returned by /v1/chain/get_consensus_parameters are only valid if the protocol feature CONFIGURABLE_WASM_LIMITS2 is enabled. Only return "wasm_config" if protocol feature CONFIGURABLE_WASM_LIMITS2 is enabled.

With protocol activated:

./cleos get consensus_parameters
{
  "chain_config": {
    "max_block_net_usage": 1048576,
    "target_block_net_usage_pct": 1000,
    "max_transaction_net_usage": 524288,
    "base_per_transaction_net_usage": 12,
    "net_usage_leeway": 500,
    "context_free_discount_net_usage_num": 20,
    "context_free_discount_net_usage_den": 100,
    "max_block_cpu_usage": 500000,
    "target_block_cpu_usage_pct": 1000,
    "max_transaction_cpu_usage": 475000,
    "min_transaction_cpu_usage": 100,
    "max_transaction_lifetime": 3600,
    "deferred_trx_expiration_window": 600,
    "max_transaction_delay": 3888000,
    "max_inline_action_size": 524288,
    "max_inline_action_depth": 4,
    "max_authority_depth": 6,
    "max_action_return_value_size": 256
  },
  "wasm_config": {
    "max_mutable_global_bytes": 1024,
    "max_table_elements": 1024,
    "max_section_elements": 8192,
    "max_linear_memory_init": 65536,
    "max_func_local_bytes": 8192,
    "max_nested_structures": 1024,
    "max_symbol_bytes": 8192,
    "max_module_bytes": 20971520,
    "max_code_bytes": 20971520,
    "max_pages": 528,
    "max_call_depth": 251
  }
}

Without protocol activated:

./cleos get consensus_parameters
{
  "chain_config": {
    "max_block_net_usage": 1048576,
    "target_block_net_usage_pct": 1000,
    "max_transaction_net_usage": 524288,
    "base_per_transaction_net_usage": 12,
    "net_usage_leeway": 500,
    "context_free_discount_net_usage_num": 20,
    "context_free_discount_net_usage_den": 100,
    "max_block_cpu_usage": 200000,
    "target_block_cpu_usage_pct": 2500,
    "max_transaction_cpu_usage": 150000,
    "min_transaction_cpu_usage": 100,
    "max_transaction_lifetime": 3600,
    "deferred_trx_expiration_window": 600,
    "max_transaction_delay": 3888000,
    "max_inline_action_size": 524287,
    "max_inline_action_depth": 10,
    "max_authority_depth": 10,
    "max_action_return_value_size": 256
  }
}

Merges release/5.0 into main including #1770 & #1773

Resolves #1660

@heifner heifner added the OCI Work exclusive to OCI team label Oct 13, 2023
@heifner heifner merged commit fc7b07a into main Oct 16, 2023
21 checks passed
@heifner heifner deleted the GH-1660-consensus-params-main branch October 16, 2023 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wasm Serialization check seems to use hardcoded default instead of configurable value
3 participants