Skip to content

Commit caabdbe

Browse files
committed
[FAB-12649] Address minor cosmetic issues in orderer
This change set addresses minor cosmetic issues pointed out in code review to the orderer cluster commit chain. Change-Id: I1e27f69e251d9946d21f4eb5a4d890de214b7378 Signed-off-by: yacovm <yacovm@il.ibm.com>
1 parent d92a41d commit caabdbe

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

orderer/common/cluster/replication.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,34 +105,34 @@ type ChainInspector struct {
105105

106106
// Channels returns the list of channels
107107
// that exist in the chain
108-
func (cw *ChainInspector) Channels() []string {
108+
func (ci *ChainInspector) Channels() []string {
109109
channels := make(map[string]struct{})
110-
lastConfigBlockNum := cw.LastConfigBlock.Header.Number
110+
lastConfigBlockNum := ci.LastConfigBlock.Header.Number
111111
var block *common.Block
112112
for seq := uint64(1); seq < lastConfigBlockNum; seq++ {
113-
block = cw.Puller.PullBlock(seq)
113+
block = ci.Puller.PullBlock(seq)
114114
channel, err := IsNewChannelBlock(block)
115115
if err != nil {
116116
// If we failed to classify a block, something is wrong in the system chain
117117
// we're trying to pull, so abort.
118-
cw.Logger.Panic("Failed classifying block", seq, ":", err)
118+
ci.Logger.Panic("Failed classifying block", seq, ":", err)
119119
continue
120120
}
121121
if channel == "" {
122-
cw.Logger.Info("Block", seq, "doesn't contain a new channel")
122+
ci.Logger.Info("Block", seq, "doesn't contain a new channel")
123123
continue
124124
}
125-
cw.Logger.Info("Block", seq, "contains channel", channel)
125+
ci.Logger.Info("Block", seq, "contains channel", channel)
126126
channels[channel] = struct{}{}
127127
}
128128
// At this point, block holds reference to the last block pulled.
129129
// We ensure that the hash of the last block pulled, is the previous hash
130130
// of the LastConfigBlock we were initialized with.
131131
// We don't need to verify the entire chain of all blocks we pulled,
132132
// because the block puller calls VerifyBlockHash on all blocks it pulls.
133-
last2Blocks := []*common.Block{block, cw.LastConfigBlock}
133+
last2Blocks := []*common.Block{block, ci.LastConfigBlock}
134134
if err := VerifyBlockHash(1, last2Blocks); err != nil {
135-
cw.Logger.Panic("System channel pulled doesn't match the boot last config block:", err)
135+
ci.Logger.Panic("System channel pulled doesn't match the boot last config block:", err)
136136
}
137137

138138
return flattenChannelMap(channels)

orderer/consensus/consensus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ConsenterSupport interface {
8888
// Note that either WriteBlock or WriteConfigBlock must be called before invoking this method a second time.
8989
CreateNextBlock(messages []*cb.Envelope) *cb.Block
9090

91-
// Block returns a block with the following number,
91+
// Block returns a block with the given number,
9292
// or nil if such a block doesn't exist.
9393
Block(number uint64) *cb.Block
9494

orderer/consensus/kafka/chain_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3635,7 +3635,6 @@ type mockConsenterSupport struct {
36353635
}
36363636

36373637
func (c *mockConsenterSupport) Block(seq uint64) *cb.Block {
3638-
// TODO: implement this
36393638
return nil
36403639
}
36413640

sampleconfig/orderer.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ General:
6969
- tls/ca.crt
7070
# ReplicationBuffersSize is the maximum number of bytes that can be allocated
7171
# for each in-memory buffer used for block replication from other cluster nodes.
72+
# Each channel has its own memory buffer.
7273
ReplicationBufferSize: 20971520 # 20MB
7374
# PullTimeout is the maximum duration the ordering node will wait for a block
7475
# to be received before it aborts.

0 commit comments

Comments
 (0)