smartbft dynamic reconfig#959
Open
HagarMeir wants to merge 2 commits into
Open
Conversation
660e97f to
7131f8d
Compare
7131f8d to
66223cc
Compare
Contributor
There was a problem hiding this comment.
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 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() |
Contributor
Author
There was a problem hiding this comment.
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 { |
Contributor
Author
There was a problem hiding this comment.
how should we handle this potential race?
66223cc to
8461412
Compare
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
Signed-off-by: Hagar Meir <hagar.meir@ibm.com>
8461412 to
f085e7e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#830