Skip to content
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

Address review comments for Remove global endpoints #4887

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading