Skip to content

smartbft dynamic reconfig#959

Open
HagarMeir wants to merge 2 commits into
hyperledger:mainfrom
HagarMeir:smartbft-dynamic-reconfig
Open

smartbft dynamic reconfig#959
HagarMeir wants to merge 2 commits into
hyperledger:mainfrom
HagarMeir:smartbft-dynamic-reconfig

Conversation

@HagarMeir

@HagarMeir HagarMeir commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

@HagarMeir HagarMeir force-pushed the smartbft-dynamic-reconfig branch from 660e97f to 7131f8d Compare June 28, 2026 12:31
@HagarMeir HagarMeir marked this pull request as ready for review June 28, 2026 12:51
@HagarMeir HagarMeir force-pushed the smartbft-dynamic-reconfig branch from 7131f8d to 66223cc Compare June 30, 2026 09:12
@tock-ibm tock-ibm requested a review from Copilot June 30, 2026 11:29

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

Implements dynamic SmartBFT reconfiguration behavior to avoid fully stopping/restarting the BFT instance during membership/config updates, and adds communication-layer reconfiguration primitives to update membership/streams at runtime.

Changes:

  • Refactors consensus startup/reconfig flow to restart network/ops without restarting SmartBFT (preserving mempool state).
  • Introduces runtime reconfiguration for comm egress/RPC (reset streams + reconfigure communicator/membership).
  • Adjusts comm membership handling to refresh stubs/connections when membership info changes.

Reviewed changes

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

Show a summary per file
File Description
node/consensus/consensus.go Adds “start without BFT” path and changes SoftStop/reconfig flow to avoid stopping SmartBFT on dynamic reconfig.
node/consensus/consensus_builder.go Splits comm setup vs comm reconfiguration; embeds Egress into Consensus so SmartBFT can use it as Comm.
node/comm/rpc.go Adds RPC.Reconfigure to reset stream maps and reconfigure communicator; improves SendConsensus error wrapping.
node/comm/egress.go Adds locking and Egress.Reconfigure to update node list + reconfigure RPC safely.
node/comm/connectionsmgr.go Fixes a comment typo.
node/comm/commauth.go Changes stub update behavior to force deactivate/disconnect/activate on updates; adjusts log formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread node/comm/commauth.go Outdated
Comment on lines +149 to +153
// First deactivate the stub
stub.Deactivate()
ac.Connections.Disconnect(stub.Endpoint)

// Activate the stub
// Now activate the stub
Comment on lines 253 to 257
c.Logger.Infof("Soft stopping consensus node")
close(c.softStopCh)
c.BFT.Stop()
c.Synchronizer.Stop()
c.BADB.Close()
c.Metrics.StopMetricsTracker()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is true
What should be done if let's say there is a call to AssembleProposal but we are in soft-stop?

Comment on lines +148 to +151
c.lock.Lock()
c.status.SetState(node_utils.StateRunning)
c.softStopCh = make(chan struct{})
if err := c.opsSystem.Start(); err != nil {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

how should we handle this potential race?

@HagarMeir HagarMeir force-pushed the smartbft-dynamic-reconfig branch from 66223cc to 8461412 Compare July 1, 2026 12:46
HagarMeir added 2 commits July 1, 2026 15:46
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
@HagarMeir HagarMeir force-pushed the smartbft-dynamic-reconfig branch from 8461412 to f085e7e Compare July 1, 2026 12:46
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.

2 participants