Skip to content

Conversation

TsvetanG
Copy link

Type of change

  • Bug fix

Description

Fixed an issue that causes the joining of a peer on a channel failure when using an imported ordering service.
Issue #819

@@ -585,6 +588,18 @@ class OrdererRestApi {
cert: ordererCerts ? ordererCerts.cert : null,
private_key: ordererCerts ? ordererCerts.private_key : null,
};
if (!test.cert && !test.private_key && options.requestingMspId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I was able to verify the fix locally and it works as expected. I’m digging into the code to better understand it, and I had a quick question about this block.

From my testing, options.requestingMspId is always empty, so this block never runs. I also tested the fix without this block, and it still works as expected by throwing the appropriate exceptions. I was curious, if there a specific scenario where this block would be triggered, or is it intended for other use cases?

Copy link
Author

Choose a reason for hiding this comment

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

Hi , yes requestingMspId is used but when the join is triggered from the peer page. This is when we know exactly the peer that we are joining to the channel and its MSPID. Hence we can use the admin user of the peer to fetch the channel block. The difference when we don't have a peer is that in such case we cannot determine the MSP admin user to use and therefore, we cannot really filter the channels in case we don't have the admin user of the ordering service.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I might not fully understand the context, could you provide an example of when this scenario would occur?

When I tested in the Org2 Console (which includes Org1's Ordering Services) with a valid Associate identity, the cert, private_key, and requestingMSP were all present.
Screenshot 2025-04-25 at 3 56 04 PM

However, after I removed the associate identity from the ordering service, the cert and private_key were set to null, which is expected, but requestingMSP was not populated. Instead, an identityInfo object was created.
Screenshot 2025-04-28 at 3 18 49 PM

I'm trying to understand when a case would arise that satisfies the if-statement you mentioned.

@ketulsha
Copy link
Contributor

ketulsha commented Apr 9, 2025

@TsvetanG - Thank you for raising the PR. NPM Audit is failing for Apollo CI for @babel/helpers and @babel/runtime.

Can you please update your branch/fork so we can discuss if we can merge with main branch?

@TsvetanG
Copy link
Author

TsvetanG commented Apr 9, 2025

@TsvetanG - Thank you for raising the PR. NPM Audit is failing for Apollo CI for @babel/helpers and @babel/runtime.

Can you please update your branch/fork so we can discuss if we can merge with main branch?

Yes I will look at that and will let you know when ready

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.

3 participants