Jump to content
Enumivo Community
Sign in to follow this  
ansen

Let's upgrade ENU system contract to version 1.2.1

Recommended Posts

Let's upgrade ENU‘s system contract to version 1.2.1

Hi, all BP's of enumivo, we are now preparing for our first upgrade of system contract.

ENU的超级节点们,我们正在准则进行首次系统合约的升级。

Why should we upgrade to 1.2.1, rather than the latest release version? 为什么要升级到1.2.1版本而不是最新版本?

For now, the latest release of ENU contract is 1.3.1, but we don't plan to upgrade to 1.3.1 directly. EOS is now on 1.2.1 version, so I suggest ENU follows and upgrade to 1.2.1, too.

目前最新的ENU系统合约发布版本是1.3.1,但是我们不准备直接升级到1.3.1。因为EOS目前部署的是1.2.1版本,因此我建议ENU跟随EOS,升级到1.2.1版本。

Can we upgrade contract with enu.msig? 我们能用enu.msig(提案-同意-执行)来升级合约吗?

No and Yes. The original version of enu.msig contract can not process transactions with multiple actions. Upgrading a contract requires both setcode and setabi actions. The issue was solved in a later release of enumivo V1.1.0.

暂时还不可以。原始版本的enu.msig合约不能处理含有过个action的交易。升级合约需要在一个交易中完成setcode和setabi两个action。这个问题在后来的发布V1.1.0版本中解决了。

So we have to first upgrade enu.msig contract to v1.2.1. Then we can utilize the upgraded enu.msig to upgrade both the system and token contract.

因此我们需要首先升级enu.msig合约到v1.2.1版本。然后后面我们就可以用enu.msig来升级系统合约和代币合约。

How to upgrade the enu.msig contract? 如何升级enu.msig合约?

We have to go through a offline-signing process to upgrade the enu.msig contract. The offline-signning approach of EOS is here.

我们需要通过一个线下签名的过程来升级enu.msig合约。EOS的线下合约升级教程在这儿

The following is a forked version for enumivo's enu.msig contract: 以下是改为升级ENU的enu.msig合约的说明。

Environment preparing

Below is the version of the required environment (enumivo, enumivo.cdt, enumivo.contracts). Note to generate the same wasm code from the same source cpp, please keep our enviroment consistent: 下面是我的合约编译环境,注意为了保证编译出来的wasm的完全一致,请大家验证合约时保持一致的编译环境。

OS: ubuntu 16.04 or 18.04

enumivo: 1.3.0

enumivo.cdt: 1.1.1

enumivo.contracts: 1.2.1

Note: One may have to modify the depenency of enu.contracts in CMakeLists.txt 需要修改enu.contracts项目的CMakeLists.txt文件中的依赖。

~/enumivo.contracts# git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 19b618d..41ae627 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.5)
 project(enumivo_contracts VERSION 1.2.1)

-set(ENUMIVO_DEPENDENCY "1.2")
+set(ENUMIVO_DEPENDENCY "1.3")
 set(ENUMIVO_WASMSDK_DEPENDENCY "1.1")

Below is the hash of the output enu.msig.wasm of my environment. Everyone should have the same hash of hise wasm code. 以下是在上述环境中编译得到的enu.msig.wasm的哈希值,每个人在同样环境下编译出来得到的值应该是一样的。

sha256sum enu.msig.wasm 
2e585c92323c9ae846adc01193171cef7f4fd161f3ac719d794e1883e38758a3  enu.msig.wasm

Upgrading routine

Each of the top 21 block producers should do the following: 排名前21的超级节点需要做以下事情:

  1. Get current enu.msig contract for later comparison: 获得当前enu.msig合约,用作后面的对比。

    $enucli get code -c original_enumsig_contract.wast -a original_enumsig_contract.abi enu.msig
    code hash: 0c62f070b2b34ab742d79465b21c92ba2cf9b94c23adb9315ca374bfc33fdc26
    saving wast to original_enumsig_contract.wast
    saving abi to original_enumsig_contract.abi
  1. Comiple the v1.2.1 enumivo.contracts code. (run ./build.sh). Generate the unsigned transaction which upgrades the enu.msig contract: 编译1.2.1版本的enumivo.contracts项目代码(执行./build.sh)。执行下面命令产生未签名的用来升级enu.msig的交易。

    (in enumivo.contracts direcotry; run build.sh already)
    enucli -u https://rpc.enu.one set contract -s -j -d enu.msig build/enu.msig > upgrade_enumsig_contract_trx.json

    The first few lines of the generated file should be something similar to (except with very different numbers for expiration, ref_block_num, and ref_block_prefix):

    生成的交易文件应该类似下面这样,除了expiration, ref_block_num, ref_block_prefix不同以外,其余应该相同。

    {
      "expiration": "2018-09-24T09:54:11",
      "ref_block_num": 38558,
      "ref_block_prefix": 2263549217,
      "max_net_usage_words": 0,
      "max_cpu_usage_ms": 0,
      "delay_sec": 0,
      "context_free_actions": [],
      "actions": [{
          "account": "enumivo",
          "name": "setcode",
          "authorization": [{
              "actor": "enu.msig",
              "permission": "active"
            }
          ],

    and the last few lines should be: 最后几行是这样

        }
      ],
      "transaction_extensions": [],
      "signatures": [],
      "context_free_data": []
    }

    One of the top block producers should be chosen to lead the upgrade process. This lead producer should take their generated upgrade_enumsig_contract_trx.json, rename it to upgrade_enumsig_contract_official_trx.json, and do the following:

    从21个节点中选一个leader节点来主持升级过程。leader节点产生一份上面的交易文件,然后重命名为upgrade_enumsig_contract_official_trx.json,然后执行下面的操作:

    1. Modify the expiration timestamp in upgrade_enumsig_contract_official_trx.json to a time that is sufficiently far in the future to give enough time to collect all the necessary signatures, but not more than 9 hours from the time the transaction was generated. Also, keep in mind that the transaction will not be accepted into the blockchain if the expiration is more than 1 hour from the present time.

      修改expiration时间戳为一个足够远的未来时间来收集全部其他节点的签名,但是这个时间不能大于交易文件生成时间后9个小时。并且,即使提前收集完了全部签名,只能等到离expiration小于1个小时才能提交交易,否则区块链不会接受交易。

    2. Pass the upgrade_enumsig_contract_official_trx.json file to all the other top 21 block producers.

      把修改后的upgrade_enumsig_contract_official_trx.json文件发给全部21个超级节点。

    Then each of the top 21 block producers should do the following: 21个超级节点都要执行下面的操作。

    1. Compare their generated upgrade_enumsig_contract_official_trx.json file with the upgrade_enumsig_contract_official_trx.json provided by the lead producer. The only difference should be in expiration, ref_block_num, ref_block_prefix, for example:

      比较自己产生的upgrade_enumsig_contract_official_trx.json文件和leader节点发来的文件,diff的差别应该只有expiration, ref_block_num和ref_block_prefix这三处,譬如:

      diff upgrade_enumsig_contract_trx.json upgrade_enumsig_contract_trx.check.json
      2,4c2,4
      <   "expiration": "2018-09-24T09:54:11",
      <   "ref_block_num": 38558,
      <   "ref_block_prefix": 2263549217,
      ---
      >   "expiration": "2018-09-24T10:01:59",
      >   "ref_block_num": 39494,
      >   "ref_block_prefix": 2951834115,
    2. If the comparison is good, each block producer should proceed with signing the official upgrade transaction (sent from the leader) with the keys necessary to satisfy their active permission. If the block producer only has a single key (i.e the "active key") in the active permission of their block producing account, then they only need to generate one signature using that active key. This signing process can be done offline for extra security.

      如果文件比较没有问题,每个节点应该继续执行用active权限对leader发来的交易进行签名。如果节点的active权限只有一个私钥(譬如 active私钥),那么就用改私钥来产生交易签名。这个签名过程可以在离线环境进行来提升安全性。

      On a secure computer the producer can sign the transaction (the producer will need to paste in their private key when prompted):

      在一台安全的计算机上,节点可以用下面的命令签名交易(节点需要按照提示粘贴输入私钥)【下面的chain-id已经是enu主网的chain id】

      (the chain-id below is for ENU mainnet already!)
      enucli -u https://rpc.enu.one sign --chain-id cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f upgrade_enumsig_contract_trx.json | tail -n 5
      private key:   "signatures": [
          "SIG_K1_K8QQVUZjs22RQ7kAMBeNVBDzPbNKdhyKwc2G5dJpJ3WTBbGahrqLife4axMoEEYJwaP6RfNAKhJv1cE5BtdzdC5i2G2ass"
        ],
        "context_free_data": []
      }

      The output should include the signature (in this case "SIG_K1_K8QQVUZjs22RQ7kAMBeNVBDzPbNKdhyKwc2G5dJpJ3WTBbGahrqLife4axMoEEYJwaP6RfNAKhJv1cE5BtdzdC5i2G2ass") which the producer should then send to the lead producer.

      输出中应该包含签名("SIG_xxxx"),节点应将签名发给leader节点。

    When the lead producer collects 15 producer signatures, the lead producer should do the following:

    当收集满15个超级节点的签名后,leader节点应该执行下面的操作:

    1. Make a copy of the upgrade_enumsig_contract_official_trx.json and call it upgrade_enumsig_contract_official_trx_signed.json, and then modify the upgrade_enumsig_contract_official_trx_signed.json so that the signatures field includes all 15 collected signatures. So the tail end of upgrade_enumsig_contract_official_trx_signed.json could look something like:

      拷贝一份upgrade_enumsig_contract_official_trx.json文件,重命名为upgrade_enumsig_contract_official_trx_signed.json,然后修改文件中的signatures字段,包含15个BP的签名。最终改完的upgrade_enumsig_contract_official_trx_signed.json文件最后几行应该类似这样:

      $ cat upgrade_enumsig_contract_official_trx_signed.json | tail -n 20
        "transaction_extensions": [],
        "signatures": [
         "SIG_K1_JzABB9gzDGwUHaRmox68UNcfxMVwMnEXqqS1MvtsyUX8KGTbsZ5aZQZjHD5vREQa5BkZ7ft8CceLBLAj8eZ5erZb9cHuy5",
         "SIG_K1_Kj7XJxnPQSxEXZhMA8uK3Q1zAxp7AExzsRd7Xaa7ywcE4iUrhbVA3B6GWre5Ctgikb4q4CeU6Bvv5qmh9uJjqKEbbjd3sX",
         "SIG_K1_KbE7qyz3A9LoQPYWzo4e6kg5ZVojQVAkDKuufUN2EwVUqtFhtjmGoC6QPQqLi8J7ftiysBp52wJBPjtNQUfZiGpGMsnZ1f",
         "SIG_K1_KdQsE7ahHA9swE9SDGg4oF6XahpgHmZfEgQAy9KPBLd9HuwrF6c8m6jz43zizK2oo32Ejg1DYuMfoEvJgVfXo81jsqTHvA",
         "SIG_K1_K6228Hi2z1WabgVdf5bk2UdKyyDSVFwkMaagTn9oLVDV8rCX7aQcjY94c39ah2CkLTsTEqzTPAYknJ8m2m9B7npPkHaFzc",
         "SIG_K1_Jzdx75hBCA2WSaXgrupmrNbcQocUCsP8r1BKkPXMreiAKPZDwX9J3G8fS1HhyqWjc7FbukwZf8sVRdS3wKbJVpytqXe7Nn",
         "SIG_K1_KW7Qu2SdPD3zuQKh2ziFLzn9QbKqeMpeiemULky5Bbg1Mst6ijbCX3k2AVFGNFLkNLA36PM1WAT5oipzu1B1K7ymRxTx1Z",
         "SIG_K1_KXJf1KZNpz73YFKKE7u6jFgsQ8XcX3yA7rDX6ZmG1Qfnc9FLLmT1WViv4bwcPbxaEYfR6SNWfk5cCR9eao2si1soqkXq92",
         "SIG_K1_JynjkHFT5UFGDpEcqdriXTzCGCwS36Xztq4UAWQHLQgRUZT2YFoLhUcc87kvUteqCUGVxsmSbfgWv1KLy24voKN4Qs5zTe",
         "SIG_K1_JxhfCaGBhuNShpDHn7j1CryG3iSebvfi7FUnJsfkXNTiwLyq2NDBkeakwjCMWFbzr6qqWuMDLjfXbzdtU17f1wCXMjKSgk",
         "SIG_K1_KcMSz89QG1ZRFNrXc69R63d5KXbJA8CBjNPYv1VEA3TRfjqVYuhyaHpGXQN4RSKDq4ygr3UTRYBQQVutkJnR6zZ4Ssgd7R",
         "SIG_K1_JuxT6bhUAbDs6Q2ppuKyKauduvbaJLxvh4gBH4e4A9yRhvUBT7w3DcvMyhdaor27Kbu29jnqhTbvXcb57QqKWQDpboLv7e",
         "SIG_K1_K8BuFYpCiC5FhpVK8ZAzc3VUg7vz6WwLoWBrGN6nnuqUjngGqvHp3UxDVzcwhqccHdv8kdPXvF6G1NszwF1dd3wjCrHBYw",
         "SIG_K1_KfH5ZirPwDk1RQKvJv2AGPfsJyPXvXLegZ7LvcPmRtjtMiErs1STXLNT8kiBfhZr4xkWRA5NR1kMF3d49DFMJiB2iWMXJc",
         "SIG_K1_KjJB8jtcqpVe3r5jouFiAa9wJeYqoLMh5xrUV6kBF6UWfbYjimMWBJWz2ZPomGDsk7JtdUESVrYj1AhYbdp3X48KLm5Cev"
        ],
        "context_free_data": []
      }
    2. Push the signed transaction to the blockchain: 推送签名后的交易到区块链。

      enucli push transaction --skip-sign upgrade_enumsig_contract_official_trx_signed.json
      {
        "transaction_id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041",
        "processed": {
          "id": "202888b32e7a0f9de1b8483befac8118188c786380f6e62ced445f93fb2b1041",
          "receipt": {
            "status": "executed",
            "cpu_usage_us": 4909,
            "net_usage_words": 15124
          },
          "elapsed": 4909,
          "net_usage": 120992,
          "scheduled": false,
          "action_traces": [{
      ...
    1. Assuming the transaction successfully executes, everyone can then verify that the new contract is in place: 如果交易执行成功,每个人都可以验证部署好的新合约。

      enucli get code -c new_enumsig_contract.wast -a new_enumsig_contract.abi enu.msig
      code hash: 9fd195bc5a26d3cd82ae76b70bb71d8ce83dcfeb0e5e27e4e740998fdb7b98f8
      saving wast to new_enumsig_contract.wast
      saving abi to new_enumsig_contract.abi
      $ diff original_enumsig_contract.abi new_enumsig_contract.abi
      584,592d583
      <         },{
      <           "name": "deferred_trx_id",
      <           "type": "uint32"
      <         },{
      <           "name": "last_unstake_time",
      <           "type": "time_point_sec"
      <         },{
      <           "name": "unstaking",
      <           "type": "asset"

 

Upgrade enu.system contract and enu.token contract with enu.msig 使用enu.msig合约来升级enumivo系统合约和enu.token合约

After the enu.msig contract is upgraded, we can use it to propose trasactions with multiple actions. Below is t the steps to upgrade enu.system contract forked from contract upgrade for enu.sudo. enu.token contract takes a similar routine.

enu.msig合约升级完以后,我们就能用它来提案多动作交易。以下是升级enu系统合约升级步骤,参考了enu.sudo的升级说明。enu代币合约的升级流程类似。

  1. Generate the transaction to deploy the enu.system contract 生成部署enu.system合约的交易

    The transaction to deploy the contract to the enumivo account will need to be proposed to get the necessary approvals from active block producers before executing it. This transaction needs to first be generated and stored as JSON into a file so that it can be used in the enucli command to propose the transaction to the enu.msig contract.

    部署到enumivo账号的合约的交易需要先提案,获得足够超级节点的同意后才能执行。这个交易需要先生成并且按JSON结构存到文件中,然后使用enucli命令行来提案交易到enu.msig合约。

    The easy way to generate this transaction is using enucli: 可以使用以下命令产生提案交易。

    $enucli set contract -s -j -d enumivo build/enu.system/ > deploy_system_contract_trx.json
    $cat deploy_system_contract_trx.json
    {
      "expiration": "2018-09-24T14:15:26",
      "ref_block_num": 4362,
      "ref_block_prefix": 2619980881,
      "max_net_usage_words": 0,
      "max_cpu_usage_ms": 0,
      "delay_sec": 0,
      "context_free_actions": [],
      "actions": [{
          "account": "enumivo",
          "name": "setcode",
          "authorization": [{
              "actor": "enumivo",
              "permission": "active"
            }
          ],
          "data": ...
          },{
          "account": "enumivo",
          "name": "setabi",
          "authorization": [{
              "actor": "enumivo",
              "permission": "active"
            }
          ],
          "data": ...
          }
      ],
      "transaction_extensions": [],
      "signatures": [],
      "context_free_data": []
    }

    Edit the values of the ref_block_num and ref_block_prefix fields to be 0 and edit the time of the expiration field to some point in the future that provides enough time to approve and execute the proposed transaction. After editing deploy_system_contract_trx.json the first few lines of it may look something like the following:

    修改文件中的ref_block_numref_block_prefix字段为0,然后修改expiration字段为未来某个时间,留足够时间来收集同意提案和执行提案。修改完deploy_system_contract_trx.json后前几行文件应该是这样:

    $ head -n 9 deploy_system_contract_trx.json
    {
      "expiration": "2018-07-06T12:00:00",
      "ref_block_num": 0,
      "ref_block_prefix": 0,
      "max_net_usage_words": 0,
      "max_cpu_usage_ms": 0,
      "delay_sec": 0,
      "context_free_actions": [],
      "actions": [{

    assume that there are 21 active block producers on the chain with account names: blkproducera, blkproducerb, ..., blkproduceru.

    假设21个超级节点的账号名为blkproducera, blkproducerb, ..., blkproduceru.

    In that case, create a file producer_permissions.json with the content shown in the command below:

    按以下内容创建一个producer_permissions.json文件。

    $ cat producer_permissions.json
    [
       {"actor": "blkproducera", "permission": "active"},
       {"actor": "blkproducerb", "permission": "active"},
       {"actor": "blkproducerc", "permission": "active"},
       {"actor": "blkproducerd", "permission": "active"},
       {"actor": "blkproducere", "permission": "active"},
       {"actor": "blkproducerf", "permission": "active"},
       {"actor": "blkproducerg", "permission": "active"},
       {"actor": "blkproducerh", "permission": "active"},
       {"actor": "blkproduceri", "permission": "active"},
       {"actor": "blkproducerj", "permission": "active"},
       {"actor": "blkproducerk", "permission": "active"},
       {"actor": "blkproducerl", "permission": "active"},
       {"actor": "blkproducerm", "permission": "active"},
       {"actor": "blkproducern", "permission": "active"},
       {"actor": "blkproducero", "permission": "active"},
       {"actor": "blkproducerp", "permission": "active"},
       {"actor": "blkproducerq", "permission": "active"},
       {"actor": "blkproducerr", "permission": "active"},
       {"actor": "blkproducers", "permission": "active"},
       {"actor": "blkproducert", "permission": "active"},
       {"actor": "blkproduceru", "permission": "active"}
    ]
  1. Propose the transaction to deploy the enu.system contract 提交部署enu.system合约的提案交易

    assume that blkproducera was chosen as the lead block producer to propose the transaction.

    假设blkproducera被选为leader节点来提交提案。

    The lead block producer (blkproducera) should propose the transaction stored in deploy_system_contract_trx.json:

    Leader节点应该提交存储在deploy_system_contract_trx.json文件中的交易提案。

    $ enucli multisig propose_trx deploysystem producer_permissions.json deploy_sudo_contract_trx.json blkproducera
    executed transaction: 9e50dd40eba25583a657ee8114986a921d413b917002c8fb2d02e2d670f720a8  4312 bytes  871 us
    #    enu.msig <= enu.msig::propose          {"proposer":"blkproducera","proposal_name":"deploysystem","requested":[{"actor":"blkproducera","permis...
    warning: transaction executed locally, but may not be confirmed by the network yet
  2. Review and approve the transaction to deploy the enu.system contract 审查并且同意部署enu.system合约的提案

    Each of the potential approvers of the proposed transaction (i.e. the active block producers) should first review the proposed transaction to make sure they are not approving anything that they do not agree to.

    每一个超级节点应该先审查提交的提案交易,确保他们不会批准通过不希望的内容。

    The proposed transaction can be reviewed using the enucli multisig review command:

    提案交易可以使用enucli multisig review命令来查看。

    $ enucli multisig review blkproducera deploysystem > deploy_system_contract_trx_to_review.json
    $ cat deploy_system_contract_trx_to_review.json
    {
      "proposal_name": "deploysystem",
      "packed_transaction": "...",
      "transaction": {
        "expiration": "2018-07-06T12:00:00",
        "ref_block_num": 0,
        "ref_block_prefix": 0,
        "max_net_usage_words": 0,
        "max_cpu_usage_ms": 0,
        "delay_sec": 0,
        "context_free_actions": [],
        "actions": [{
            "account": "enumivo",
            "name": "setcode",
            "authorization": [{
                "actor": "enumivo",
                "permission": "active"
              }
            ],
            "data": {
              "account": "enumivo",
              "vmtype": 0,
              "vmversion": 0,
              "code": "..."
            },
            "hex_data": "..."
          },{
            "account": "enumivo",
            "name": "setabi",
            "authorization": [{
                "actor": "enumivo",
                "permission": "active"
              }
            ],
            "data": {
              "account": "enumivo",
              "abi": "..."
            },
            "hex_data": "..."
          }
        ],
        "transaction_extensions": []
      }
    }

    Each approver should have already audited the source code of the contract (V1.2.1) to be deployed and has already compiled that code to generate the WebAssembly code that should be byte-for-byte identical to the code that every other approver following the same process should have generated.

    每个超级节点需要先审查v1.2.1的system合约源码,并且编译。生成的webassembly代应该码与提案review中的内容应该保证每字节完全相同。

    Each approver should generate deploy_system_contract_trx.json by itself and get deploy_system_contract_trx_to_review.json with multisig review. Then compare the code with following command. Both should be exactly the same.

    每个超级节点应该执行Step 1的set contract生成deploy_system_contract_trx.json,然后执行以下命令对比期望部署的合约代码与提案部署合约代码,二者应保持完全一致。

    $ enucli multisig propose_trx -j -s -d deploysystem '[]' deploy_system_contract_trx.json blkproducera | grep '"data":' | sed 's/^[ \t]*"data":[ \t]*//;s/[",]//g' | cut -c 35- > expected_deploy_system_trx_serialized.hex
    $ cat expected_deploy_system_trx_serialized.hex | cut -c -50
    c0593f5b00000000000000000000020000000000ea30550000
    $ cat deploy_system_account_trx_to_review.json | grep '"packed_transaction":' | sed 's/^[ \t]*"packed_transaction":[ \t]*//;s/[",]//g' > proposed_deploy_system_trx_serialized.hex
    $ cat proposed_deploy_system_trx_serialized.hex | cut -c -50
    c0593f5b00000000000000000000020000000000ea30550000
    $ diff expected_deploy_system_trx_serialized.hex proposed_deploy_system_trx_serialized.hex

    When an approver (e.g. blkproducerb) is satisfied with the proposed transaction, they can simply approve it:

    如果一个节点(譬如 blkproducerb)同意提案,则执行以下命令同意提案。

    $ enucli multisig approve blkproducera deploysystem '{"actor": "blkproducerb", "permission": "active"}' -p blkproducerb
    executed transaction: d1e424e05ee4d96eb079fcd5190dd0bf35eca8c27dd7231b59df8e464881abfd  128 bytes  483 us
    #    enu.msig <= enu.msig::approve          {"proposer":"blkproducera","proposal_name":"deploysystem","level":{"actor":"blkproducerb","permission"...
    warning: transaction executed locally, but may not be confirmed by the network yet
  3. Execute the transaction to deploy the enu.system contract 执行提案交易部署enu.system合约

    When the necessary approvals are collected (in this example, with 21 block producers, at least 15 of their approvals were required), the lead block producer who proposed the transaction should execute it.

    当必要的提案同意收集足够(譬如21个超级节点中的15个同意),提案交易的leader节点来执行提案。

    $ enucli multisig exec blkproducera deploysystem blkproducera
    executed transaction: e8da14c6f1fdc3255b5413adccfd0d89b18f832a4cc18c4324ea2beec6abd483  160 bytes  1877 us
    #    enu.msig <= enu.msig::exec             {"proposer":"blkproducera","proposal_name":"deploysystem","executer":"blkproducera"}

    Anyone can now verify that the enumivo contract was deployed correctly. 任何人都可以验证enumivo账号上合约正确部署。

    $ enucli get code -a retrieved-enumivo.abi enumivo
    code hash: 1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c
    saving abi to retrieved-enumivo.abi
    $ sha256sum build/enu.system/enu.system.wasm
    1b3456a5eca28bcaca7a2a3360fbb2a72b9772a416c8e11a303bcb26bfe3263c  build/enu.system/enu.system.wasm

    If the two hashes match then the local WebAssembly code is the one deployed on the blockchain. The retrieved ABI, which was stored in the file retrieved-enumivo.abi, can then be compared to the original ABI of the contract (contracts/enu.system/enu.system.abi) to ensure they are semantically the same.

    如果两个哈希值完全一致,则本地的webassembly代码和区块链上部署的完全一致。另外从区块链拉取的retrieved-enumivo.abi文件和本地合约生成的abi文件进行比较,确保语义上完全一致。

  1. Use the enu.msig to upgrade the enu.token contract. 使用enu.msig升级enu.token合约。

upgrading Schedule

  1. Set up a testnet and practice upgrading the contract.

  2. Upgrade contracts on the mainnet.

 

 

 

 

Edited by ansen
  • Like 1

Share this post


Link to post
Share on other sites

Hello, everyone.  

We are going to upgrade the system contracts tomorrow! 

First, we will upgrade enu.msig contract, which enables us to upgrade contracts using propose_trx in the future. THIS IS IMPORTANT!! @Daifuku and me have already upgraded the contracts on the testnet, the code is verified by other BP's. We believe it's safe to upgrade the contract on the mainnet.

Here's the plan:

1. At 2018.11.05 12:00:00 Beijing (2018.11.05 04:00:00 UTC), I'll release the  upgrade_enumsig_contract_official_trx.json in my github repo:  https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig

2. The expiration of the transaction is  2018.11.05 21:00:00 Beijing (2018.11.05 13:00:00 UTC). So before the transaction expires, every BP please do the following:

    a. clone the my github repo:

git clone https://github.com/AnsenYu/ENU-mainnet-contract-upgrade.git

    b. read the README under the folder of enumsig.  https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig

    c. You can perform step 1 to record the original information of current enu.msig contract

   d. Please do the step 3 to sign the transaction. 

   e. Use your bp account to transfer 0.0001 ENU to ansenironman with memo in the format of "enumsig upgrade: YOUR SIGNATURE"

   f.  Post your BP mainnet account and the transfer transaction link in the issue: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/issues/1

3. If more than 15 bp's submit the signatures before expiration time, I'll perform the push transaction step between  20:00:00 and 21:00:00 2018.11.05 Beijing.

If everything goes fine, we will upgrade the enu.msig contract by about 21:00:00 tomorrow!  After that we will go on to upgrade the system and token contract. That will be much easier!!

大家好,我们明天将启动主网系统合约升级程序。首先,我们会先升级enu.msig合约,使得我们后续可以通过异步提案的方式来升级其他系统合约。所以这第一步非常关键!我和大福君已经在测试网络上升级合约,并且经过其他BP的检验。我们认为在主网上进行升级是安全的。

下面是升级计划:

1. 我会在明天(2018.11.05)中午北京时间12点在我的github上公布升级需要的交易文件,

 upgrade_enumsig_contract_official_trx.json Github地址:  https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig

2. 升级合约的交易的过期时间设定为晚上21点,所以在过期时间之前,各位超级节点请执行以下操作:

   a. 克隆github项目到你的本地机器

git clone https://github.com/AnsenYu/ENU-mainnet-contract-upgrade.git

   b.  仔细阅读项目README: https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/tree/master/enumsig .

   c. 你可以执行Step 1 来记录当前合约的abi和wasm

   d. 请执行Step 3来进行签名

   e. 使用你的BP账号转0.0001 ENU到ansenironman这个账号,memo中填写“enumsig upgrade : 你的签名”

   e. 在这个issue下面留言,附带你的超级节点账号和浏览器转账记录。https://github.com/AnsenYu/ENU-mainnet-contract-upgrade/issues/1

3. 如果在过期时间前有超过15个超级节点完成签名,我会在晚上8点到9点之间执行推送交易来升级合约。

如果一切顺利,我们在明晚9点左右就能完成enu.msig合约的升级,后续升级系统合约和token合约就可以用提案系统,那将会简单的多。

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×