-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the peer delivery client to select policy #4856
base: main
Are you sure you want to change the base?
Conversation
b7416c0
to
aebff31
Compare
…Delivere Signed-off-by: Emil Elizarov <emil.elizarov@ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Just a few minor comments.
We'll need to add an integration test that checks that this indeed works (another PR). We can use the same approach is in the orderer.ReplicationPolicy: copy a simple test from the smartbft test suite (that uses a peer) and simply change to Policy="simple".
@@ -52,6 +54,7 @@ type DeliverServiceConfig struct { | |||
// OrdererEndpointOverrides is a map of orderer addresses which should be | |||
// re-mapped to a different orderer endpoint. | |||
OrdererEndpointOverrides map[string]*orderers.Endpoint | |||
Policy string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment with an explanation, same as in the yaml file.
case "BFT": | ||
d.blockDeliverer, err = d.createBlockDelivererBFT(chainID, ledgerInfo) | ||
switch d.conf.DeliverServiceConfig.Policy { | ||
case "cluster", "": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this stage the policy should not be "", as we det the default "cluster" much earlier.
if createCftDeliverer { | ||
d.blockDeliverer, err = d.createBlockDelivererCFT(chainID, ledgerInfo) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not simply call this function from 2 places? it will save 4 line of code, no? (and would be more readable in my opinion).
Type of change
Description
Issue: #4847
Related issues
#4847