v0.22.0 Braised Pork
Sorry to keep you waiting for a long time! With the release of this version, we will present a new dish for you - "Braised Pork". This is a must-have traditional dish in South China for festival days and always has a good moral which means "ride on the crest of success".
In this version, our P2P protocol has been released finally! You just need to fill in a known node in the network and P2P protocol will discover other nodes automatically instead of adding or deleting nodes through changing the network profile by yourselves.
As a regular user of CITA, you must also be very concerned about the disk usage. This version will help you to save more than 90% of the disk space (Without no transactions, the daily disk growth will be reduced from 500M to 50M). This is an amazing optimization!
Certainly, we also fixed some bugs that you have discovered or that you have not found. For example, JSON-RPC can't cross-domain access, Executor is inexplicably quit, and so on.
In a word, Spring is coming and here we present this "Braised Pork". Hope all of you could enjoy it.
抱歉让大家久等了!随着此次版本发布,我们将为大家呈上一道新菜——“扣肉”。“扣肉”是中国南方喜事中必备的一道传统大菜,又名“大展宏图”,寓意非凡。
在这次的版本中,P2P 协议终于和大家见面了!你再也不用通过更改网络配置文件来添加或删除节点,只需填写一个网络中已知的节点,P2P 将自动发现网络中其它节点并加入这个网络。
作为 CITA 的忠实用户,你也一定非常关心磁盘占用率的问题,这次的版本将为你节省 90% 以上的磁盘空间(在没有交易的情况下,每天的磁盘增长从 500M 降到 50M 以内),这是一个了不起的优化!
当然,我们还修复了一些你已经发现的或者你没有发现的 Bug。比如说 JSON-RPC 不能跨域访问的问题,Executor 被莫名退出的问题等等。
总之,喜事已至,为大家呈上“扣肉”这道新菜,敬请细细品尝。
Changelog
Upgrade Note
The v0.22.0 version of the node configurations is compatible with the v0.21 version. Means that you can run v0.22.0 directly using the v0.21 node configurations. However, due to the refactoring of the network, the nodes executed with v0.22.0 are incompatible with the original nodes (they have different node discovery and transfer protocols), so all nodes need to be upgraded to v0.22.0 at the same time.
Following Upgrade Instructions to upgrade the nodes.
New Feature Description
The new feature of integrating P2P to network service, we add discovery of the network node when the original configuration is compatible. But we still need to make some changes to the network configuration file definition:
The old version network.toml
looks like:
port = 4000
enable_tls = true
id_card = 9
[[peers]]
ip = "127.0.0.1"
port = 4001
common_name = "test1.cita"
[[peers]]
ip = "127.0.0.1"
port = 4002
In the version of v0.22.0, we will discard the item id_card
and common_name
.
In the old version, when a new node is added to the network, we need to change the item [[peers]]
in all
nodes' network.toml
to reconstruct the network. It is a very complicated operation. But in v0.22.0, the item [[peers]]
means known nodes
in the network, you can set only one [[peers]]
, then it can discovery all the network nodes through a discovery protocol.
Framework
- [Optimization] Replace std channel with crossbeam channel. @kaikai @Yaorong
- [Optimization] Reconfigure the parameters of rocksdb, and this can greatly reduce the
.sst
files in the database. @jerry-yu
Executor
- [Fix] Executor crashes when receives staled BlockWithProof. @WPF @keroro520
Network
- [Feature] The network service is refactored by using the P2P protocol. @Yaorong
Consensus
- [Fix] Consensus goes into
panic
when timer min peek is extremely close to Instant::now(). @KaoImin
RPC
- [Optimization] Update test token info. @kaikai
- [Feature] Add
from
tobody
ofgetBlockByNumber
andgetBlockByHash
. @CL - [Fix] Fix the missing CORS header. @yangby
Scripts
- [Optimization] Format Python codes. @WPF
Doc
- [Doc] Update Rust SDK info in readme. @u2
- [Doc] More info about automatic execution. @wangfh666
- [Doc] Fix start CITA command in log management. @77liyan
更新日志
升级说明
v0.22.0 版本的节点配置文件可以与 v0.21 的兼容,这意味着你可以直接使用 v0.21 的节点配置文件来启动v0.22.0。但是,由于在 v0.22.0 版本引入了 P2P 协议,这是与 v.21 运行的节点不兼容的 (两者采用了不同的节点发现和数据传输协议)。所以,在升级时,需要将网络中的所有节点同时升级成到 v0.22.0 。
请参考 升级操作说明 升级节点。
新特性描述
在 v0.22.0,我们将 P2P 集成到了网络服务中,可以使节点之间能够自动发现。在设计上,我们对网络配置文件做了向前兼容。不过,与 v0.21 的配置文件相比,v0.22.0 的配置文件还是做了如下一些改变:
v0.21 的配置文件如下:
port = 4000
enable_tls = true
id_card = 9
[[peers]]
ip = "127.0.0.1"
port = 4001
common_name = "test1.cita"
[[peers]]
ip = "127.0.0.1"
port = 4002
在 v0.22.0 的配置文件中,我们将忽略 id_card
和 common_name
这两个配置项(如果你重新写配置文件,这两个配置项可以不写)。
在 v0.21 以前的版本,如果你打算新添加一个节点到网络中的话,需要更改所有已经在运行的节点配置文件 network.toml
来重构建这个网络,这是一个很麻烦的操作!但在 v0.22.0 中,配置项中的 [[peers]]
代表的是网络中的已经节点,你只需要配置一个已经节点,它就能通过网络发现协议发现其它节点并自动加入到网络中。
Framework
- [Optimization] 使用 crossbeam channel 替换 std channel。@kaikai @Yaorong
- [Optimization] 重新优化 rocksdb 的配置参数, 使数据库中的
.sst
文件大幅减少。 @jerry-yu
Executor
- [Fix] 修复因 staled BlockWithProof 而引起 executor 崩溃的问题。 @WPF @keroro520
Network
- [Feature] 使用 P2P 协议重构 network 服务。 @Yaorong
Consensus
- [Fix] 修复因时钟间隔非常接近当前时间而引起共识崩溃的问题。 @KaoImin
RPC
- [Optimization] 更新测试token的信息。 @kaikai
- [Feature] 在
getBlockByNumber
及getBlockByHash
的body
中添加from
字段。 @CL - [Fix] 修复 JSON-RPC 跨域访问问题。 @yangby
Scripts
- [Optimization] 格式化 Python 代码。 @WPF
Doc
- [Doc] 在 readme 中更新 Rust SDK 的信息。 @u2
- [Doc] 为自动执行这个特性添加更多说明。 @wangfh666
- [Doc] 在日志管理中修复 CITA 启动命令说明。@77liyan