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

Add total CPU weight and total NET weight to get_info 📦 #10923

Merged
merged 2 commits into from
Dec 6, 2021

Conversation

linhuang-blockone
Copy link
Contributor

@linhuang-blockone linhuang-blockone commented Dec 2, 2021

Change Description

Total CPU and NET weights are added to get_info (https://blockone.atlassian.net/browse/EPE-1801). They are made as optional such that different versions of cleos and nodeos can work.

A sample run of cleos run against the same version of nodeos looks like

./cleos get info
{
  "server_version": "57fdf3b7",
  "chain_id": "8a34ec7df1b8cd06ff4a8abbaa7cc50300823350cadc59ab296cb00d104d2b8f",
  "head_block_num": 2204,
  "last_irreversible_block_num": 2203,
  "last_irreversible_block_id": "0000089bafe800c9dbe39819fc5e875d71d9a712bc591270835f9b2855598923",
  "head_block_id": "0000089c4ea6b4c97c80c7697721a608438959441e1bf92f6a5148c997f7c069",
  "head_block_time": "2021-12-02T18:14:48.500",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 1808373,
  "virtual_block_net_limit": 9498325,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576,
  "server_version_string": "v2.1.0",
  "fork_db_head_block_num": 2204,
  "fork_db_head_block_id": "0000089c4ea6b4c97c80c7697721a608438959441e1bf92f6a5148c997f7c069",
  "server_full_version_string": "v2.1.0-57fdf3b74a97b2ec7286a352e10de8c03fe6ec01-dirty",
  "last_irreversible_block_time": "2021-12-02T18:14:48.000",
  "total_cpu_weight": 0,
  "total_net_weight": 0
}

A sample run of cleos run against an older version of nodeos looks like

./cleos get info
{
  "server_version": "57fdf3b7",
  "chain_id": "8a34ec7df1b8cd06ff4a8abbaa7cc50300823350cadc59ab296cb00d104d2b8f",
  "head_block_num": 481,
  "last_irreversible_block_num": 480,
  "last_irreversible_block_id": "000001e0ac8805e57055fc6f1c05d579b5112953b623dd9ef59151f4a5f33f33",
  "head_block_id": "000001e19dbe5edbd3da930a4857303f112cda346c6c36e90e147ca52f322542",
  "head_block_time": "2021-12-03T14:30:23.000",
  "head_block_producer": "eosio",
  "virtual_block_cpu_limit": 322985,
  "virtual_block_net_limit": 1694682,
  "block_cpu_limit": 199900,
  "block_net_limit": 1048576,
  "server_version_string": "v2.1.0",
  "fork_db_head_block_num": 481,
  "fork_db_head_block_id": "000001e19dbe5edbd3da930a4857303f112cda346c6c36e90e147ca52f322542",
  "server_full_version_string": "v2.1.0-57fdf3b74a97b2ec7286a352e10de8c03fe6ec01",
  "last_irreversible_block_time": "2021-12-03T14:30:22.500"
}

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

total_cpu_weight and total_net_weight are added to get_info chain API endpoint.

@heifner heifner changed the title Add total CPU weight and total NET weight to get_info Add total CPU weight and total NET weight to get_info 📦 Dec 3, 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.

2 participants