Skip to content

Fix certstore to use ResponseMsgType for identity message hook#5423

Open
aayushbaluni wants to merge 1 commit intohyperledger:mainfrom
aayushbaluni:fix/4934-certstore-response-msg-type
Open

Fix certstore to use ResponseMsgType for identity message hook#5423
aayushbaluni wants to merge 1 commit intohyperledger:mainfrom
aayushbaluni:fix/4934-certstore-response-msg-type

Conversation

@aayushbaluni
Copy link

Description

Fixes #4934

The certStore's RegisterMsgHook was incorrectly registered for RequestMsgType. Identity messages (certs) are delivered in pull responses (DataUpdate), not in requests (DataReq).

In pullstore.go, when a DataReq is received, items is empty (only itemIDs from digests are populated). When a DataUpdate (response) is received, items contains the actual identity messages. The hook iterates over msgs to add identities to the mapper, so it must be registered for ResponseMsgType to receive the certs.

Root cause

Wrong message type in RegisterMsgHook - RequestMsgType hooks receive empty items; ResponseMsgType hooks receive the actual identity messages from pull responses.

Changes

  • gossip/gossip/certstore.go: Change RequestMsgType to ResponseMsgType in RegisterMsgHook

Made with Cursor

The certStore's RegisterMsgHook was incorrectly registered for
RequestMsgType. Identity messages (certs) are delivered in pull
responses (DataUpdate), not in requests (DataReq). RequestMsgType
hooks receive empty items; ResponseMsgType hooks receive the
actual identity messages.

Fixes hyperledger#4934
@aayushbaluni aayushbaluni requested a review from a team as a code owner March 17, 2026 16:28
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.

fabric/gossip/gossip /certstore.go第53行代码有点问题?

1 participant