-
Notifications
You must be signed in to change notification settings - Fork 9
config submitter part 2 #298
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
base: main
Are you sure you want to change the base?
Conversation
08e65db
to
4e5dc6c
Compare
config/config.go
Outdated
} | ||
func (config *Configuration) ExtractRouterInParty() nodeconfig.RouterInfo { | ||
partyID := config.LocalConfig.NodeLocalConfig.PartyID | ||
party := config.SharedConfig.PartiesConfig[partyID-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot assume that PartiesConfig[partyID-1] corresponds to the correct party.
Instead, you should iterate over PartiesConfig and check if PartiesConfig[i].PartyID == partyID.
config/config.go
Outdated
func (config *Configuration) ExtractConsenterInParty() nodeconfig.ConsenterInfo { | ||
partyID := config.LocalConfig.NodeLocalConfig.PartyID | ||
consenterInfos := config.ExtractConsenters() | ||
return consenterInfos[partyID-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, loop over consenterInfos to find the correct party
node/consensus/consensus.go
Outdated
|
||
// compare the two certificates | ||
if !bytes.Equal(pemBlock.Bytes, cert.Raw) { | ||
return fmt.Errorf("error: access denied; client certificatte is different than the router's certificate") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client certificate is different from the router's certificate.
4e5dc6c
to
2755521
Compare
node/consensus/consensus.go
Outdated
func (sc *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) { | ||
return nil, fmt.Errorf("SubmitConfig not implemented") | ||
func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) { | ||
err := c.validateRouterFromContext(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do this in the same line with the if statement
node/consensus/consensus.go
Outdated
func (c *Consensus) SubmitConfig(ctx context.Context, request *protos.Request) (*protos.SubmitResponse, error) { | ||
err := c.validateRouterFromContext(ctx) | ||
if err != nil { | ||
return nil, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe wrap the err
add router info to consenter config router's certificate pinning in SubmitConfig add configSubmitter to router, without forwarding config requests Signed-off-by: Dor.Katzelnick <Dor.Katzelnick@ibm.com>
2755521
to
c0cb710
Compare
issue: #192