跳到主要内容

v2.1

Conflux-Rust v2.1.0 版本是一个小型的硬分叉升级。 这次升级将激活 5 个新的 CIP,并对存储和 RPC 进行了一些改进。

新的 CIP

  • CIP-94: proposes to use on-chain DAO voting to decide and update reward parameters without hardfork.
  • CIP-97: proposes to remove account's staking lists.
  • CIP-98: Fix a bug in BLOCKHASH opcode in eSpace.
  • CIP-99: Allow more not-voting terms before we force-retire a node, and make the unlock period of a retiring node shorter to allow the node to rejoin the PoS voting faster.
  • CIP-105 PoS staking based minimal DAO vote count.

新增的内部合约

CIP-94 also has introduce a new InternalContract ParamControl at hex address 0x0888000000000000000000000000000000000007. This contract can be used to retrive parameter info and participate in DAO vote.

// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

interface ParamsControl {
struct Vote {
uint16 topic_index;
uint256[3] votes;
}

/*** 查询函数 ***/
/**
* @dev 为参数投票
* @param vote_round 投票轮次
* @param vote_data 投票列表
*/
function castVote(uint64 vote_round, Vote[] calldata vote_data) external;

/**
* @dev 读取账户的投票数据
* @param addr 要读取的账户地址
*/
function readVote(address addr) external view returns (Vote[] memory);

/**
* @dev 当前投票轮次
*/
function currentRound() external view returns (uint64);

/**
* @dev 读取指定轮次的总投票数
* @param vote_round 投票轮次
*/
function totalVotes(uint64 vote_round) external view returns (Vote[] memory);

/**
* @dev 读取该轮次的 PoS 质押额。
*/
function posStakeForVotes(uint64) external view returns (uint256);

event CastVote(uint64 indexed vote_round, address indexed addr, uint16 indexed topic_index, uint256[3] votes);
event RevokeVote(uint64 indexed vote_round, address indexed addr, uint16 indexed topic_index, uint256[3] votes);

Improvements

Storage

Allow snapshots to be removed during recovery. This reduces the disk space requirement for full node sync or recovery.

In v2.1.0 Conflux-Rust also brought support for fullstate query, which means we can query state at any blockchain height. For example we can query an address cfx:aaketjh9tkj5g2k4zx3kfvb9vkku8nr956n0en4fhe's balance at height 100000 with method cfx_getBalance by specifying the second parameter.

curl --location --request POST 'https://main.confluxrpc.com' \
--header 'Content-Type: application/json' \
--data-raw ' {
"jsonrpc": "2.0",
"id": "15922956697249514502",
"method": "cfx_getBalance",
"params": [
"cfx:aaketjh9tkj5g2k4zx3kfvb9vkku8nr956n0en4fhe",
"0x186a0"
]
}'

To support conflux fullstate query, a archive node with configuration enable_single_mpt_storage enabled is required. And the node need sync data from genesis to construct all the history states. Besides nodes can also set single_mpt_space = "evm" to only store eSpace states.

RPC

  • Support eth_subscribe and eth_unsubscribe in eSpace RPCs.
  • Add a RPC method cfx_getParamsFromVote to return the currently used value of the voted parameters.
  • Return null for getting skipped transactions and receipts. Whether they will be returned was nondeterministic before, but now they are ensured to be null.

Update schedule

主网

  • v2.1.0 hardfork epochNumber has been set to 56800000 (estimated on Oct. 18th, 2022 (GMT+8))
  • CIP-94 activate blockNumber is 133800000 (estimated on Oct. 25th, 2022 (GMT+8))
  • CIP-99 activate PoS blockNumber is 330000 (estimated on Oct. 25th, 2022 (GMT+8))

测试网

  • v2.1.0 hardfork epochNumber has been set to 88100000 (around 22:00 Aug.17th, 2022(GMT+8))
  • CIP-94 activate blockNumber is 112400000
  • CIP-99 activate PoS blockNumber is 342000

相关链接