Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Add chain API get_consensus_parameters 📦 #10898

Merged

Conversation

linhuang-blockone
Copy link
Contributor

@linhuang-blockone linhuang-blockone commented Nov 19, 2021

Add chain api endpoint and cleos get command to retrieve consensus parameters.

The chain API endpoint is /v1/chain/get_consensus_parameters. The cleos command syntax is cleos get consensus_parameters.

An example cleos session looks like

./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": 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
  },
  "kv_database_config": {
    "max_key_size": 0,
    "max_value_size": 0,
    "max_iterators": 0
  },
  "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
  }
}

Change Description

Change Type

Select ONE:

  • Documentation
  • Stability bug fix
  • Other
  • Other - special case

Testing Changes

Select ANY that apply:

  • New Tests
  • Existing Tests
  • Test Framework
  • CI System
  • Other

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

A new chain API endpoint /v1/chain/get_consensus_parameters and cleos get subcommad consensus_parameters are added to retrieve consensus parameters.

Copy link

@praphael praphael left a comment

Choose a reason for hiding this comment

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

Approved with comment: Unit tests should be added, particularly to chain_plugin_tests.cpp and plugin_http_api_test.py. For example as was done here https://github.com/EOSIO/eos/pull/10772/files

If this cannot be done a part of this PR please create a JIRA issue.

@linhuang-blockone
Copy link
Contributor Author

https://blockone.atlassian.net/browse/EPE-1760 was created to track the test case.

@heifner heifner changed the title Add chain API endpoint and cleos command to retrieve consensus parame… Add chain API get_consensus_parameters 📦 Nov 22, 2021
@linhuang-blockone linhuang-blockone merged commit 580a0e6 into develop-boxed Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants