fix(smartbft): implement Errored() on BFTChain#5451
Open
FirePheonix wants to merge 1 commit intohyperledger:mainfrom
Open
fix(smartbft): implement Errored() on BFTChain#5451FirePheonix wants to merge 1 commit intohyperledger:mainfrom
FirePheonix wants to merge 1 commit intohyperledger:mainfrom
Conversation
Signed-off-by: Shubham Singh <[email protected]>
There was a problem hiding this comment.
Pull request overview
Implements the consensus.Chain Errored() signal for SmartBFT so Deliver clients can detect when a BFT chain halts and stop waiting.
Changes:
- Added an
exitCchannel toBFTChain, initialized inNewChain(), returned byErrored(). - Closed
exitCduringHalt()in a double-close-safe way. - Added a unit/integration test validating
Errored()behavior before/afterHalt()and that repeatedHalt()does not panic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
orderer/consensus/smartbft/chain.go |
Adds/returns a halt/error notification channel and closes it on shutdown. |
orderer/consensus/smartbft/chain_test.go |
Adds coverage for Errored() channel semantics across Halt(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Added a new test
Description
Errored()onBFTChainhad a// TODO: Implement Erroredstub returningnilsince SmartBFT was introduced.The Deliver service uses this channel to detect when a consenter stops and terminate waiting clients, returning
nilmeant BFT chains were invisible to the Deliver client on halt.This PR resolves the TODO by adding
exitC chan struct{}toBFTChain, initialized inNewChain(), closed inHalt()(double-close safe via select), and returned byErrored().This thng actually pattern mirrors the existing
etcdraftChain implementation.