本页跟踪 v0.39.0 的发布与变更。完整发布历史请参阅 GitHub 上的 CHANGELOG。
发布
COMETBFT发布
v0.39.0

缺陷修复

  • [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] 加快 ProtoIO writer 的创建时间,从而让 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.
Release
COMETBFTRelease
v0.39.0

BUG FIXES

  • [evidence] Add validation for Light Client Attack evidence ByzantineValidators
  • [types] Fix buffer offset bug in ProposerPriorityHash that caused hash collisions when validator priorities differed
  • [p2p] fix(privval): Ephemeral Port Exhaustion
  • [blocksync] fix(blocksync): ExtendedCommit verification via next blocks LastCommit
  • [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 for AuthorityParams.Authority field 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 configurable max-snapshot-chunks parameter to validate max amount of chunks in a SnapshotResponse.
  • [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] Rename IPeerSet#List to Copy, add Random, ForEach methods.
  • [mempool] When the node is performing block sync or state sync, the mempool
  • Optimized the PSQL indexer
  • [p2p] make PeerSet.Remove more efficient (Author: @odeke-em)
  • [light] Remove duplicated signature checks in light.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 redundant VerifyBlock call in FinalizeCommit
  • [p2p/channel] Speedup ProtoIO writer creation time, and thereby speedup channel writing by 5%.
  • [p2p/conn] Minor speedup (3%) to connection.WritePacketMsgTo, by removing MinInt calls.
  • [blockstore] Remove a redundant Header.ValidateBasic call in LoadBlockMeta, 75% reducing this time.
  • [p2p] Lower flush_throttle_timeout to 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 broadcasting HasVote and HasProposalBlockPart control messages use TrySend instead of Send. 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 in CListMempool.Flush method, by changing it from read-lock to write-lock
  • [crypto/bls12381] Fix JSON marshal of private key
  • [crypto/bls12381] Modify Sign, Verify to use dstMinPk
  • [bits] Validate BitArray mismatched Bits and Elems length
  • [cli] Prevent inadvertent rollover of IPs in cometbft testnet config generator

API-BREAKING

  • [p2p] Rename IPeerSet#List to Copy, add Random, ForEach methods.
  • [crypto] Remove Sr25519 curve
  • [rpc] The endpoints broadcast_tx_* now return an error when the node is