Skip to content

Resume stalled balloting immediately on tx set arrival - #5346

Open
bboston7 wants to merge 5 commits into
stellar:masterfrom
bboston7:resume-on-arrival-cp
Open

Resume stalled balloting immediately on tx set arrival#5346
bboston7 wants to merge 5 commits into
stellar:masterfrom
bboston7:resume-on-arrival-cp

Conversation

@bboston7

Copy link
Copy Markdown
Contributor

This change allows stellar-core to quickly resume balloting when a transaction set arrives, rather than waiting for a ballot timeout to resume.

It creates a registry of stalled slots, and checks tx sets that arrive to see if they could potentially unstick those slots. A stall can only be resolved by a tx set if the ballot protocol has not undergone any changes since hitting the stall point. This prevents prevents us from resuming with a ballot when the node may have moved on to a different value.

This change also adds c to the calculation of ballot ordering. This is necessary because without it, a node that exercises this quick-resume path has no way of informing the network as they will discard a ballot where the other variables are unchanged.

@MonsieurNicolas

Copy link
Copy Markdown
Contributor

wrt ordering using c, should it be the other way around (b,p,p',c,h) ? -- maybe talk to @nano-o

@bboston7

Copy link
Copy Markdown
Contributor Author

wrt ordering using c, should it be the other way around (b,p,p',c,h) ? -- maybe talk to @nano-o

I asked @nano-o about this and the conclusion we came to was that either ordering would technically work, but that the h,c ordering is intuitive because setting c follows from setting h (that is, we confirm prepared (h) that we can set c).

@nano-o , please correct me if I'm wrong here.

@bboston7
bboston7 marked this pull request as ready for review July 16, 2026 22:12
Copilot AI review requested due to automatic review settings July 16, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables stalled SCP balloting to resume immediately when its transaction set arrives.

Changes:

  • Tracks stalled commits and transaction-set dependencies.
  • Resumes safely when ballot state remains unchanged.
  • Adds nC to CAP-0083 PREPARE ordering and expands tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/scp/test/SCPTests.cpp Tests immediate and guarded resume behavior.
src/scp/Slot.h Declares transaction-set notification API.
src/scp/Slot.cpp Forwards notifications to ballot protocol.
src/scp/SCP.h Exposes SCP-level notification API.
src/scp/SCP.cpp Routes notifications to existing slots.
src/scp/BallotProtocol.h Defines stalled-commit state and API.
src/scp/BallotProtocol.cpp Implements ordering and safe resumption.
src/herder/HerderSCPDriver.h Declares stalled-slot registry.
src/herder/HerderSCPDriver.cpp Registers, cleans, and resumes stalled slots.

Comment thread src/scp/BallotProtocol.cpp
Comment thread src/herder/HerderSCPDriver.cpp
Comment thread src/scp/test/SCPTests.cpp
bboston7 added 5 commits July 21, 2026 15:35
This change allows stellar-core to quickly resume balloting when a
transaction set arrives, rather than waiting for a ballot timeout to
resume.

It creates a registry of stalled slots, and checks tx sets that arrive to
see if they could potentially unstick those slots. A stall can only be
resolved by a tx set if the ballot protocol has not undergone any
changes since hitting the stall point. This prevents prevents us from
resuming with a ballot when the node may have moved on to a different
value.

This change also adds `c` to the calculation of ballot ordering. This is
necessary because without it, a node that exercises this quick-resume
path has no way of informing the network as they will discard a ballot
where the other variables are unchanged.
@bboston7
bboston7 force-pushed the resume-on-arrival-cp branch from 9131faf to fca1d9b Compare July 21, 2026 23:11
@bboston7
bboston7 requested a review from marta-lokhova July 22, 2026 17:10
@marta-lokhova

Copy link
Copy Markdown
Contributor

what's our testing/validation strategy here?

I'm having a bit of a hard time validating that this change is correct. For example, I also thought (b,p,p',c,h) was a more intuitive ordering, because c is lowest and h is highest ballot (I'm still not quite sure why it works the other way, but that could be because I'm not well-versed in the intricacies of SCP implementation).

@nano-o

nano-o commented Jul 23, 2026

Copy link
Copy Markdown

I think both orders are fine, but logically it is h that causes c to change (even if with a delay), so h c makes more sense to me.

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.

5 participants