ViewData can pair the in-flight proposal with the prepared flag of another proposal

クローズ 初心者向け
#710 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@HagarMeir がすでに取り組んでいます。

2026年10月18日 から。

  • #711 @HagarMeir による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

internal/bft/viewchanger.go、特に prepareViewDataMsg を読み、呼び出される InFlightData のメソッドを調べてください。issue で説明されている、提案とprepared状態への一貫性のあるアクセスを追加し、ViewDataの構築時にそれを使用してください。関連するGoパッケージのテストを実行し、報告される提案とpreparedフラグが同じ一貫した状態に由来することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Written by Claude (Anthropic's AI assistant) on behalf of Hagar Meir.

What happens

ViewChanger.prepareViewDataMsg (internal/bft/viewchanger.go) builds the ViewData from two separate calls to InFlightData:

inFlight := v.getInFlight(lastDecision)      // calls v.InFlight.InFlightProposal()
prepared := v.InFlight.IsInFlightPrepared()

Each call takes the InFlightData lock on its own. While the view changer builds the ViewData, the current view can still be running, because AbortView only queues the abort. It can then store a new in-flight proposal between the two calls, through StoreProposal when it saves a pre-prepare, or StorePrepares when it saves a commit. The ViewData then reports one proposal with the prepared flag of another, for example a proposal as prepared although it never was.

How to reproduce

Build ViewData with prepareViewDataMsg repeatedly while another goroutine stores proposals, and marks only some of them as prepared. On main, a few hundred out of 100,000 ViewData messages report as prepared a proposal that was never prepared.

Proposed fix

Add InFlightData.InFlightProposalAndPrepared, which returns the proposal and its prepared flag under one lock, and use it in prepareViewDataMsg.

This doesn't change any message format. The view data simply reports a consistent pair. Making the view changer wait for the previous view to stop before it builds the ViewData is a separate, larger change.

主要言語
Go
スター
110
フォーク
40
平均マージ
1日 7時間
マージ済み PR(30日)
34

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperledger/SmartBFT のほかの issue

hyperledger/SmartBFT の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。