Skip to content

Remove notary disabled code#8

Open
acid-ant wants to merge 2 commits intoTrueCloudLab:masterfrom
acid-ant:feature/7-remove-notary-disabled-code
Open

Remove notary disabled code#8
acid-ant wants to merge 2 commits intoTrueCloudLab:masterfrom
acid-ant:feature/7-remove-notary-disabled-code

Conversation

@acid-ant
Copy link

Close #7

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Comment on lines 219 to 221
// AddPeer accepts information about the network map candidate in the FrostFS
// binary protocol format, identifies the caller and behaves depending on different
// conditions listed below.
Copy link

Choose a reason for hiding this comment

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

It produces a notification in case 1a, I don't think we can remove it safely. Have you checked whether it is called in node?

Copy link
Author

Choose a reason for hiding this comment

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

In our case this method degrades to following lines:

common.CheckWitness(publicKey)
return

In CheckWitness we are producing notification?
As for code in node, yes, we have few places where we invoke AddPeer.
For example here pkg/morph/client/netmap/add_peer.go:24
So if it is really produces some notifications in CheckWitness I'll revert this changes. In other case we need to do some cleanup in node too.

Copy link

@fyrchik fyrchik Feb 14, 2023

Choose a reason for hiding this comment

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

Yes, but storage node creates a notary transaction with this method which produces a notary notification (implicit here). I think we should leave this method for now and revisit how we handle node addition/state update later.

I think we considered producing AddPeer with runtime.Notify here too, but I forgot the outcome of this discussion. cc @alexvanin

Copy link
Author

Choose a reason for hiding this comment

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

Changes for AddPeer were reverted.

KirillovDenis
KirillovDenis previously approved these changes Feb 13, 2023
Copy link

@KirillovDenis KirillovDenis left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 38 to 40
if data.([]interface{})[0].(bool) {
panic(common.PanicMsgForNotaryDisabledEnv)
}
Copy link

Choose a reason for hiding this comment

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

It looks complex, can we move args := data.(struct cast here (it is already done below) and check args.notaryDisabled field?

Copy link
Author

Choose a reason for hiding this comment

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

Ok, refactored.

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
ctx := storage.GetContext()

//TODO(@acid-ant): #9 remove notaryDisabled from args in future version
if data.([]interface{})[0].(bool) {

Choose a reason for hiding this comment

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

Looks complex too.

Choose a reason for hiding this comment

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

Same code in many files, it's better to move to method.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove notary disabled code

4 participants