Skip to content

Commit

Permalink
Address review comments for Remove global endpoints (#4887)
Browse files Browse the repository at this point in the history
Address review comments for Remove global endpoints.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart authored Jun 6, 2024
1 parent e658b85 commit 8dec754
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/channelconfig/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type Channel interface {
// Merkle tree to compute the BlockData hash
BlockDataHashingStructureWidth() uint32

// OrdererAddresses returns the list of valid orderer addresses to connect to invoke Broadcast/Deliver
// OrdererAddresses returns the list of valid global orderer addresses (does not include org-specific orderer endpoints)
// Deprecated
OrdererAddresses() []string

Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (b *Bundle) ValidateNew(nb Resources) error {
}
}

// When we move from V2 to V3 we insist on per Org endpoints for every org
// When we move to capability V3_0 we insist on per Org endpoints for every org
isOldV3 := b.ChannelConfig().Capabilities().ConsensusTypeBFT()
isNewV3 := nb.ChannelConfig().Capabilities().ConsensusTypeBFT()
if !isOldV3 && isNewV3 {
Expand Down
5 changes: 3 additions & 2 deletions common/channelconfig/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ type ChannelValues interface {
// Merkle tree to compute the BlockData hash
BlockDataHashingStructureWidth() uint32

// OrdererAddresses returns the list of valid orderer addresses to connect to invoke Broadcast/Deliver
// OrdererAddresses returns the list of valid global orderer addresses (does not include org-specific orderer endpoints)
// Deprecated
OrdererAddresses() []string
}

Expand Down Expand Up @@ -224,7 +225,7 @@ func (cc *ChannelConfig) validateOrdererAddresses() error {

func (cc *ChannelConfig) validateNoOrdererAddresses() error {
if len(cc.protos.OrdererAddresses.Addresses) > 0 {
return fmt.Errorf("global OrdererAddresses are not allowed in V3, use org specific addresses only")
return fmt.Errorf("global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only")
}
return nil
}
2 changes: 1 addition & 1 deletion integration/raft/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ func updateOrdererEndpointsConfigFails(n *nwo.Network, orderer *nwo.Orderer, cha
})
Expect(err).NotTo(HaveOccurred())
Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(1))
Expect(sess.Err).To(gbytes.Say("error applying config update to existing channel 'testchannel': initializing channelconfig failed: global OrdererAddresses are not allowed in V3, use org specific addresses only"))
Expect(sess.Err).To(gbytes.Say("error applying config update to existing channel 'testchannel': initializing channelconfig failed: global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only"))
}

func prepareTransition(
Expand Down
2 changes: 1 addition & 1 deletion orderer/common/cluster/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ func TestEndpointconfigFromConfigBlockGreenPath(t *testing.T) {
// In V3, we do not allow global endpoints
injectGlobalOrdererEndpoint(t, block, "globalEndpoint", "orgEndpoint")
endpointConfig, err := cluster.EndpointconfigFromConfigBlock(block, cryptoProvider)
require.EqualError(t, err, "failed extracting bundle from envelope: initializing channelconfig failed: global OrdererAddresses are not allowed in V3, use org specific addresses only")
require.EqualError(t, err, "failed extracting bundle from envelope: initializing channelconfig failed: global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only")
require.Nil(t, endpointConfig)
})

Expand Down

0 comments on commit 8dec754

Please sign in to comment.