-
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
Remove global-level endpoints from channel config - WIP #4778
Remove global-level endpoints from channel config - WIP #4778
Conversation
ccc955b
to
2bc8ea1
Compare
@@ -15,6 +15,8 @@ import ( | |||
"syscall" | |||
"time" | |||
|
|||
"github.com/hyperledger/fabric/common/channelconfig" | |||
|
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.
please delete the empty line and run the command 'goimports -l -w'
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.
Done.
I'm still working on this PR, the title is updated to be W.I.P.
@@ -329,6 +329,8 @@ func NewOrdererOrgGroup(conf *genesisconfig.Organization) (*cb.ConfigGroup, erro | |||
|
|||
if len(conf.OrdererEndpoints) > 0 { | |||
addValue(ordererOrgGroup, channelconfig.EndpointsValue(conf.OrdererEndpoints), channelconfig.AdminsPolicyKey) | |||
} else { | |||
return nil, errors.Errorf("orderer endpoints for organization %s are missing and must be cofigured", conf.Name) |
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.
Do we really want to make OrdererEndpoints required? For example, could an OrdererOrg be added to the channel initially without OrdererEndpoints (without any orderer nodes), with the intent for that organization to later add their own nodes.
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.
Dave, this is encoder.go
. It's only used when creating genesis blocks.
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.
When we add to a new channel we don't use that, but we download the existing config.
5b40832
to
51bd13c
Compare
Signed-off-by: May Rosenbaum <mayro1595@gmail.com>
Signed-off-by: May Rosenbaum <mayro1595@gmail.com> Signed-off-by: Yacov Manevich <yacov.manevich@ibm.com>
@@ -142,7 +142,7 @@ func NewChannelGroup(conf *genesisconfig.Profile) (*cb.ConfigGroup, error) { | |||
addValue(channelGroup, channelconfig.HashingAlgorithmValue(), channelconfig.AdminsPolicyKey) | |||
addValue(channelGroup, channelconfig.BlockDataHashingStructureValue(), channelconfig.AdminsPolicyKey) | |||
if conf.Orderer != nil && len(conf.Orderer.Addresses) > 0 { | |||
addValue(channelGroup, channelconfig.OrdererAddressesValue(conf.Orderer.Addresses), ordererAdminsPolicyName) | |||
return nil, errors.New("error adding global level endpoints to channel group, in V3.0 global level endpoints are not supported") |
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.
this should not be here but outside the if
@@ -161,6 +161,9 @@ func (cs *ChainSupport) ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEn | |||
} | |||
|
|||
if err = cs.ValidateConsensusMetadata(oldOrdererConfig, newOrdererConfig, false); err != nil { | |||
if env.Config.ChannelGroup.Values["OrdererAddressesKey"] != nil && env.Config.ChannelGroup.Values["OrdererAddressesKey"].Value == nil { | |||
return nil, errors.WithMessage(err, "consensus metadata update for channel config update is invalid since it includes global level endpoints which are not supported in V3.0") |
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.
errors.WithMessage
returns nil
if the err
is nil. It wraps an error if it's not nil.
You need to use errors.Errof
or something similar... otherwise we return here nil, nil
Signed-off-by: May Rosenbaum <mayro1595@gmail.com>
51bd13c
to
d5dcb47
Compare
@MayRosenbaum which one is the relevant one? This one or #4800 ? Please close the other one. |
Type of change
Description
This PR aims to block the option to specify global-level endpoints and enforce that endpoints per org are defined.
Related issues
issue #4763