How do I select a hard fork of my environment?

You may perform an update of your environment that adds new EIPs (hard fork) to your chain at a future block using either the UI or the API. All applicable hard fork EIPs will be applied.

Kaleido orchestrates the EIPs on all the running nodes in the chain by picking a future block with respect to the maximum block height among the nodes in the chain, at the time the hardfork request is issued.

Using UI

Navigate to the Environment Settings. The Hard Fork section has a Details sub-section that shows:

hard_fork_details.png

  • Current Chain Configuration: the list of EIPs that are already applied to the environment and the block number at which they are active.

hard_fork_eips_applied.png

  • Available for Hard Fork: the list of EIPs which are available to be applied to the environment using a Hard Fork.

hard_fork_eips_available.png

Click Apply, and then click Hard Fork Upgrade to apply the new EIPs.

hard_fork_apply.png

Using API

Alternatively, you can use the API to hard fork new EIPs. The request must specify an empty body.

To check the list of EIPs available to apply via a hard fork, refer to the optional_hardfork_eips section of environment status response.

The following are the steps involved in hard fork upgrading an environment using API:

Get the environment /status. The chain_config section lists the EIPs that are currently active in the environment, along with the block number from which they are active. The optional_hardfork_eips shows the list of EIPs that will automatically be added in a hard fork request.

The prereq_hardfork_eips field shows the target release has mandatory EIPs that the current environment is missing. If this list contains any entries, a hard fork must be performed first, before the upgrade to the target release is allowed to proceed.

# replace the placeholders with the actual values for your Kaleido resourcescurl -X GET -H "$HDR_AUTH" -H "$HDR_CT""$APIURL/consortia/{consortia_id}/environments/{environment_id}/status"| jq

The following is a sample response. Here constantinopleBlock is the new EIP that is available to add to the environment.

{
  "state": "live",
  "node_list": [
      "zzmzk4tuil",
      "zznlavdexi"
  ],
  "service_list": [],
  "upgrade": {
      "available": true,
      "chain_config": {
          "chainId": 812882247,
          "homesteadBlock": 0,
          "eip150Block": 0,
          "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "eip155Block": 0,
          "eip158Block": 0,
          "byzantiumBlock": 0,
          "petersburgBlock": 0,
          "clique": {
              "period": 5,
              "epoch": 30000
          }
      },
      "prereq_hardfork_eips": [],
      "optional_hardfork_eips": [
          "constantinopleBlock"
      ],
      "current_release": {
          ...
      },
      "target_release": {
          ...
      }
  },
  "health": {
      "all_nodes_up": true,
      "nodes_up": 2,
      "nodes_down": 0,
      "nodes_stopped": 0,
      "highest_block_height": 10,
      "lowest_block_height": 10
  }
}

The following properties from the status response are now deprecated:

  • hard_fork: use the array optional_hardfork_eips instead to determine if a hardfork operation is available to the current environment
  • optional_chain_config: use the array optional_hardfork_eips instead to determine which EIPs will be applied if a hard fork operation is performed
  • missing_chain_config: use the array optional_hardfork_eips instead to determine which EIPs are missing in the current environment and will be applied if a hard fork operation is performed

Use the /hardfork api to perform the hard fork. Note that all the EIPs listed in the optional_hardfork_eipswill be automatically applied.

# replace the placeholders with the actual values for your Kaleido resourcescurl -X POST -H "$HDR_AUTH" -H "$HDR_CT""$APIURL/consortia/{consortia_id}/environments/{environment_id}/hardfork" -d '{}'| jq

You'll get a 200 OK response with the environment state as upgrading. Once, the environment comes back to live state, you can check the environment /status and now since constantinopleBlock is added to the environment, you'll find that it is present in the chain_config section and removed from the optional_chain_config section. The following is a sample response:

{
  "state": "live",
  "node_list": [
      "zzmzk4tuil",
      "zznlavdexi"
  ],
  "service_list": [],
  "upgrade": {
      "available": false,
      "chain_config": {
          "chainId": 812882247,
          "homesteadBlock": 0,
          "eip150Block": 0,
          "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
          "eip155Block": 0,
          "eip158Block": 0,
          "byzantiumBlock": 0,
          "constantinopleBlock": 130,
          "petersburgBlock": 0,
          "clique": {
              "period": 5,
              "epoch": 30000
          }
      },
      "prereq_hardfork_eips": [],
      "optional_hardfork_eips": [],
      "current_release": {
          ...
      },
      "target_release": {
          ...
      }
  },
  "health": {
      "all_nodes_up": true,
      "nodes_up": 2,
      "nodes_down": 0,
      "nodes_stopped": 0,
      "highest_block_height": 15,
      "lowest_block_height": 15
  }
}

Note that constantinopleBlock has been set to a block that is further than the highest_block_height in the initial environment /status call, i.e, the new EIP is forked to your chain at a future block.

Was this article helpful?
0 out of 0 found this helpful