Skip to content

config ack sender and receiver#985

Open
MayRosenbaum wants to merge 2 commits into
hyperledger:mainfrom
MayRosenbaum:config_ack_sender_and_receiver
Open

config ack sender and receiver#985
MayRosenbaum wants to merge 2 commits into
hyperledger:mainfrom
MayRosenbaum:config_ack_sender_and_receiver

Conversation

@MayRosenbaum

@MayRosenbaum MayRosenbaum commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

issue #641

@MayRosenbaum MayRosenbaum force-pushed the config_ack_sender_and_receiver branch from aa672cd to 6eb8a25 Compare July 5, 2026 19:13
@tock-ibm tock-ibm requested a review from Copilot July 6, 2026 13:52
@tock-ibm tock-ibm force-pushed the config_ack_sender_and_receiver branch from 6eb8a25 to 8c78389 Compare July 6, 2026 13:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces initial sender/receiver components for the ConfigAck flow intended to coordinate consenter restart after a config block, per issue #641.

Changes:

  • Adds a ConfigAcker client with retry/backoff to deliver AckConfig RPCs to the consenter.
  • Adds a ConfigAckHandler receiver to collect per-client acknowledgments and allow waiting for all acks at a given config sequence.
  • Adds unit tests for sender retry behavior and receiver ack collection logic.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
node/consensus/consensus.go Alters the AckConfig RPC handler stub behavior.
common/configack/config_ack_sender.go Adds the ConfigAck sender with retry/backoff and TLS dialing.
common/configack/config_ack_sender_test.go Adds tests for sender success, retry, and stop/cancel behavior.
common/configack/config_ack_receiver.go Adds an ack-collection handler with blocking wait for all clients.
common/configack/config_ack_receiver_test.go Adds tests for receiver sequencing, concurrency, and stop behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread node/consensus/consensus.go
Comment thread common/configack/config_ack_sender.go Outdated
Comment thread common/configack/config_ack_sender.go
Comment on lines +82 to +101
func (ca *ConfigAckHandler) AddAck(request *protos.ConfigAck) error {
ca.lock.Lock()
defer ca.lock.Unlock()

clientID := ClientID{
NodeType: request.NodeType,
Shard: types.ShardID(request.Shard),
}

if uint64(request.ConfigSeq) != ca.acks[clientID]+1 {
ca.logger.Warnf("config ack has been received on sequence %d but the last acknowledged sequence is %d", request.ConfigSeq, ca.acks[clientID])
return fmt.Errorf("config ack has been received on sequence %d but the last acknowledged sequence is %d", request.ConfigSeq, ca.acks[clientID])
}

ca.acks[clientID] = uint64(request.ConfigSeq)
ca.logger.Infof("config ack has been received on sequence %d", request.ConfigSeq)

ca.signalChan <- struct{}{}
return nil
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check the identity of the sender (including its certificate) before AddAck is called in the consensus side.

Comment on lines +103 to +105
func (ca *ConfigAckHandler) ExpectAck(configSeq uint64) bool {
for {
select {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AddAck send a signal to signalChan

Comment thread common/configack/config_ack_receiver_test.go Outdated
Comment thread common/configack/config_ack_sender_test.go
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
@MayRosenbaum MayRosenbaum force-pushed the config_ack_sender_and_receiver branch from 8c78389 to 108918a Compare July 7, 2026 14:45
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
@MayRosenbaum MayRosenbaum force-pushed the config_ack_sender_and_receiver branch from 108918a to 12d2997 Compare July 7, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants