本页跟踪 v0.39.0 的发布与变更。完整发布历史请参阅 GitHub 上的 CHANGELOG。
缺陷修复
[evidence]为轻客户端攻击证据中的ByzantineValidators增加校验[types]修复ProposerPriorityHash中的缓冲区偏移缺陷,该问题会在验证者优先级不同时导致哈希冲突[p2p]修复privval的临时端口耗尽问题[blocksync]修复通过后续区块LastCommit验证ExtendedCommit的逻辑[p2p]强制限制 stream 最大大小 (#5647)[metrics]修复peer_send_queue_size[statesync]修复adaptive_sync并简化stateSync逻辑[blocksync]将 blocksync 改为使用完整 commit 校验,而非轻量校验[adaptivesync]简化循环并复用blockExec.ValidateBlock
改进
[ci]新增 lp2p 测试网 (#5643)[mempool]引入follower-mode,改进 lib-p2p integraap 访问[types]为共识参数中的AuthorityParams.Authority字段增加校验,强制最大长度为 256 个字符 (#5511)[mempool]优化LRUTxCache.Remove,减少锁竞争和 map 访问[e2e]增加对不同密钥类型测试的支持,包括 BLS[crypto]通过增大 pubkey 大小,将 BLS 签名大小缩减至 48 字节[statesync]增加可配置的max-snapshot-chunks参数,用于校验SnapshotResponse中允许的最大 chunk 数量。[p2p]让 reactor 队列可配置[cli]打印 lib-p2p peer id[p2p]在启用 go-libp2p transport 时增加警告,提示该设置[p2p]为 comet-p2p 增加 adaptive sync
功能
[p2p]实现资源限制器 (#5671)[p2p]添加从 blocksync 到 consensus 的 adaptive sync 接入 (#5633)[p2p]实现 Peer 信息方法(NodeInfo、RemoteIP、RemoteAddr、IsOutbound)[p2p]停止并重连失败的 peers (#5618)[p2p]增加对 lib-p2p 网络的实验性支持 (#5463)[crypto]增加对 BLS12-381 密钥的支持。由于该实现需要[mempool]新增一个指标(计数器),用于衡量 tx 是否被接收超过一次。[p2p]将IPeerSet#List重命名为Copy,并新增Random、ForEach方法。[mempool]当节点执行 block sync 或 state sync 时,mempool- 优化 PSQL 索引器
[p2p]提升PeerSet.Remove效率(作者:@odeke-em)[light]移除light.VerifyNonAdjacent中的重复签名检查[state/indexer]降低交易搜索的堆分配[libs/json]通过内部使用 JSON 编码器降低 JSON 编码的内存开销[log]允许在编译时通过构建标志从二进制中剔除所有 debug 级别代码[types]通过在VoteSet中以Equals替换Key,小幅减少内存分配[event-bus]移除PublishEventTx中的 debug 日志,此前已观察到其会导致生产环境变慢。[state/execution]在Block类型内部缓存区块哈希计算,从而只计算一次。[consensus/state]移除FinalizeCommit中冗余的VerifyBlock调用[p2p/channel]加快ProtoIOwriter 的创建时间,从而让 channel 写入提速 5%。[p2p/conn]通过移除MinInt调用,让connection.WritePacketMsgTo小幅提速(3%)。[blockstore]移除LoadBlockMeta中冗余的Header.ValidateBasic调用,使这部分耗时降低 75%。[p2p]将flush_throttle_timeout降低到 10ms[types]显著加快types.MakePartSet和types.AddPart,它们用于创建区块提案[types]为ValSet新增GetByAddressMut方法,不会复制返回的验证者。[consensus]让 Vote 消息只获取一个 peerstate mutex[consensus]让 consensus reactor 在接收数据包时不再获取 consensus 锁。现在 consensus 会通过现有的同步事件总线订阅,在每次相关变更后更新 reactor 视图。[p2p/conn]通过缓冲到底层连接的写入,加快 secret connection 的大块写入。[consensus]让广播HasVote和HasProposalBlockPart控制消息时使用TrySend而不是Send。这带来可观的性能收益,同时这些消息仅用于避免冗余、并非关键消息,因此丢弃也不会对协议带来风险。[p2p/conn]移除每次发送 packet 时的若干堆分配,这些分配来自我们在 connection 层进行 proto 编组前对 packet 的双重封装。此变更降低了内存开销并提升了代码速度。[p2p/conn]通过缓冲到底层连接的读取,加快 secret connection 的大包读取。[mempool]在广播例程中,在开始遍历交易列表之前一次性获取指向 peer 状态的指针。[consensus]让 mempool 更新相对于 consensus 的 Commit 异步执行,[consensus]向 consensus reactor 的 peer state 增加 peer height 指标发布。
缺陷修复
[evidence]对 consensus buffer flush error 使用结构化日志[consensus]拒绝超大 proposals[store]正确清理 extended commits[mempool]通过将读锁改为写锁,修复CListMempool.Flush方法中的 mutex 问题[crypto/bls12381]修复私钥的 JSON 编组[crypto/bls12381]将Sign、Verify修改为使用dstMinPk[bits]校验BitArray中Bits与Elems长度不匹配的情况[cli]防止cometbft testnet配置生成器中 IP 意外回卷
API 破坏性变更
[p2p]将IPeerSet#List重命名为Copy,并新增Random、ForEach方法。[crypto]移除 Sr25519 曲线[rpc]当节点处于特定状态时,broadcast_tx_*端点现在会返回错误
This page tracks releases and changes for v0.39.0. For the full release history, see the CHANGELOG on GitHub.
BUG FIXES
[evidence]Add validation for Light Client Attack evidence ByzantineValidators[types]Fix buffer offset bug inProposerPriorityHashthat caused hash collisions when validator priorities differed[p2p]fix(privval): Ephemeral Port Exhaustion[blocksync]fix(blocksync):ExtendedCommitverification via next blocksLastCommit- [p2p] fix(lp2p): enforce stream max size (#5647)
[metrics]fix(metrics)!: peer_send_queue_size[statesync]fix adaptive_sync and streamline stateSync logic[blocksync]Modify blocksync to use full commit verification instead of light[adaptivesync]Simplify loop, reuse blockExec.ValidateBlock
IMPROVEMENTS
[ci]: add lp2p testnet (#5643)[mempool]feat!(p2p): introduce follower-mode. Improve lib-p2p integraap access[types]Add validation forAuthorityParams.Authorityfield in consensus params, enforcing a maximum length of 256 characters (#5511)[mempool]perf(mempool/cache): Optimize LRUTxCache.Remove to reduce lock contention and map access[e2e]add support for testing different keytypes, including BLS[crypto]Reduce BLS signature size to 48 bytes by increasing pubkey size to[statesync]Add configurablemax-snapshot-chunksparameter to validate max amount of chunks in aSnapshotResponse.[p2p]feat(lp2p): make reactor queue configurable[cli]print lib-p2p peer id[p2p]Add warning when go-libp2p transport is enabled, conveying that the setting[p2p]feat(p2p): add adaptive sync for comet-p2p
FEATURES
[p2p]feat(lp2p): implemented resource limiter (#5671)[p2p]feat(consensus): add adaptive sync blocksync-to-consensus ingestion (#5633)[p2p]feat(lp2p): implement Peer info methods (NodeInfo,RemoteIP,RemoteAddr,IsOutbound)[p2p]feat(lp2p): stop/reconnect peers that failed (#5618)[p2p]Add experimental support for lib-p2p networking (#5463)[crypto]Add support for BLS12-381 keys. Since the implementation needs[mempool]Add a metric (a counter) to measure whether a tx was received more than once.[p2p]RenameIPeerSet#ListtoCopy, addRandom,ForEachmethods.[mempool]When the node is performing block sync or state sync, the mempool- Optimized the PSQL indexer
[p2p]makePeerSet.Removemore efficient (Author: @odeke-em)[light]Remove duplicated signature checks inlight.VerifyNonAdjacent[state/indexer]Lower the heap allocation of transaction searches[libs/json]Lower the memory overhead of JSON encoding by using JSON encoders internally[log]allow strip out all debug-level code from the binary at compile time using build flags[types]Small reduction in memory allocation via swapping Key with Equals in VoteSet[event-bus]Remove the debug logs in PublishEventTx, which were noticed production slowdowns.[state/execution]Cache the block hash computation inside of the Block Type, so we only compute it once.[consensus/state]Remove a redundantVerifyBlockcall inFinalizeCommit[p2p/channel]SpeedupProtoIOwriter creation time, and thereby speedup channel writing by 5%.[p2p/conn]Minor speedup (3%) to connection.WritePacketMsgTo, by removing MinInt calls.[blockstore]Remove a redundantHeader.ValidateBasiccall inLoadBlockMeta, 75% reducing this time.[p2p]Lowerflush_throttle_timeoutto 10ms[types]Significantly speedup types.MakePartSet and types.AddPart, which are used in creating a block proposal[types] Make a new methodGetByAddressMutforValSet`, which does not copy the returned validator.[consensus]Make Vote messages only take one peerstate mutex[consensus]Make the consensus reactor no longer have packets on receive take the consensus lock. Consensus will now update the reactor’s view after every relevant change through the existing synchronous event bus subscription.[p2p/conn]Speedup secret connection large writes, by buffering the write to the underlying connection.[consensus]Make broadcastingHasVoteandHasProposalBlockPartcontrol messages useTrySendinstead ofSend. This saves notable amounts of performance, while at the same time those messages are for preventing redundancy, not critical, and may be dropped without risks for the protocol.[p2p/conn]Removes several heap allocations per packet send, stemming from how we double-wrap packets prior to proto marshalling them in the connection layer. This change reduces the memory overhead and speeds up the code.[p2p/conn]Speedup secret connection large packet reads, by buffering the read to the underlying connection.[mempool]In the broadcast routine, get the pointer to the peer’s state once, before starting to iterate through the list of transactions.[consensus]Make mempool updates asynchronous from consensus Commit’s,- [consensus] Add peer height metric publication to the consensus reactor’s peer state.
BUG-FIXES
[evidence]Use structured logging for consensus buffer flush error[consensus]Reject oversized proposals[store]Prune extended commits properly[mempool]Fix mutex inCListMempool.Flushmethod, by changing it from read-lock to write-lock[crypto/bls12381]Fix JSON marshal of private key[crypto/bls12381]ModifySign,Verifyto usedstMinPk[bits]Validate BitArray mismatched Bits and Elems length[cli]Prevent inadvertent rollover of IPs incometbft testnetconfig generator
API-BREAKING
[p2p]RenameIPeerSet#ListtoCopy, addRandom,ForEachmethods.[crypto]Remove Sr25519 curve[rpc]The endpointsbroadcast_tx_*now return an error when the node is