Skip to content

Conversation

@spoonincode
Copy link
Contributor

@spoonincode spoonincode commented Mar 27, 2025

In AntelopeIO/leap#1770 we decided to hide the wasm_configuration in get_consensus_parameters when CONFIGURABLE_WASM_LIMITS2 is not activated. This helps resolve some confusion (see AntelopeIO/leap#1660).

But this introduced an inconsistency: we still show max_action_return_value_size even if ACTION_RETURN_VALUE is not activated. To fix this inconsistency, now hide max_action_return_value_size until ACTION_RETURN_VALUE is activated.

Example response when starting from genesis
{
  "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": 1000,
    "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": 524288,
    "max_inline_action_depth": 4,
    "max_authority_depth": 6
  }
}
Example response after activating `ACTION_RETURN_VALUE`
{
  "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": 1000,
    "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": 524288,
    "max_inline_action_depth": 4,
    "max_authority_depth": 6,
    "max_action_return_value_size": 256
  }
}
Example response after activating `ACTION_RETURN_VALUE` and `CONFIGURABLE_WASM_LIMITS2`
{
  "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": 1000,
    "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": 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
  }
}

@spoonincode
Copy link
Contributor Author

If OK, will explore what a test would look like

ah okay there is a test already; so if OK I will explore fixing and improving the test

Copy link
Contributor

@linh2931 linh2931 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and simple! I can follow the same pattern for #1257 after you merge into the main.

@spoonincode spoonincode changed the title [RFC] hide max_action_return_value_size in get_consensus_parameters when feature not activated hide max_action_return_value_size in get_consensus_parameters when feature not activated Mar 28, 2025
@spoonincode spoonincode marked this pull request as ready for review March 28, 2025 17:53
@spoonincode spoonincode merged commit ba4fbc8 into main Mar 28, 2025
36 checks passed
@spoonincode spoonincode deleted the gcp_scrub_chainconfig branch March 28, 2025 19:44
@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: Internal
summary: Only show action return information when ACTION_RETURN is activated.
Note:end

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

Successfully merging this pull request may close these issues.

4 participants