Skip to content

Read the in-flight proposal and its prepared flag together for ViewData - #711

Merged
pfi79 merged 1 commit into
hyperledger:mainfrom
HagarMeir:fix/inflight-data-snapshot
Oct 18, 2026
Merged

pfi79 merged 1 commit into
hyperledger:mainfrom
HagarMeir:fix/inflight-data-snapshot

Conversation

@HagarMeir

Copy link
Copy Markdown
Contributor

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

Fixes #710.

prepareViewDataMsg read the in-flight proposal and whether it is prepared with two separate calls, each taking the InFlightData lock on its own. If a new proposal was stored between the two calls, the ViewData paired one proposal with the prepared flag of another.

Changes

  • InFlightData.InFlightProposalAndPrepared returns both values under one lock.
  • prepareViewDataMsg uses it, and passes the proposal to getInFlight, which no longer reads InFlightData itself.
  • TestViewDataInFlightWhileStored builds 100,000 ViewData messages while proposals are stored concurrently, with only some of them prepared. It checks that no ViewData reports a never-prepared proposal as prepared. On main it fails with a few hundred such messages.

No message format changes.

🤖 Generated with Claude Code

prepareViewDataMsg read the in-flight proposal and whether it is
prepared with two separate calls, each taking the InFlightData lock on
its own. If a new proposal was stored between the two calls, the view
data paired one proposal with the prepared flag of another.

Add InFlightData.InFlightProposalAndPrepared, which returns both under
one lock, and use it when building the view data.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
@pfi79
pfi79 merged commit 58d3bac into hyperledger:main Oct 18, 2026
6 checks passed
@HagarMeir
HagarMeir deleted the fix/inflight-data-snapshot branch October 18, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants