Remove notary disabled code #8

Merged
acid-ant merged 1 commits from acid-ant/feature/7-remove-notary-disabled-code into master 2023-07-26 21:08:03 +00:00
acid-ant commented 2023-02-10 09:39:30 +00:00 (Migrated from github.com)

Close #7

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

Close #7 Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
alexvanin (Migrated from github.com) reviewed 2023-02-10 09:39:30 +00:00
carpawell (Migrated from github.com) reviewed 2023-02-10 09:39:30 +00:00
fyrchik (Migrated from github.com) reviewed 2023-02-10 09:39:30 +00:00
ale64bit (Migrated from github.com) reviewed 2023-02-10 09:39:30 +00:00
fyrchik (Migrated from github.com) reviewed 2023-02-10 11:18:30 +00:00
@ -34,13 +33,17 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
fyrchik (Migrated from github.com) commented 2023-02-10 10:56:45 +00:00

Can you link it with some issue?

Can you link it with some issue?
@ -49,7 +52,11 @@ func _deploy(data interface{}, isUpdate bool) {
total int
fyrchik (Migrated from github.com) commented 2023-02-10 11:06:21 +00:00

In theory, everything done by InitVote as well as any "in-progress" votes should also be removed.
For us it makes no sense because all the networks we use are already notary-enabled. But I would at least mention this in the commit message.

In theory, everything done by `InitVote` as well as any "in-progress" votes should also be removed. For us it makes no sense because all the networks we use are already notary-enabled. But I would at least mention this in the commit message.
fyrchik (Migrated from github.com) commented 2023-02-10 11:09:34 +00:00

I would also do some refactoring in another commit but in this PR.
For example, CheckAlphabetWitness could accept no argumets, it always uses common.AlphabetAddress, right?

I would also do some refactoring in another commit but in this PR. For example, `CheckAlphabetWitness` could accept no argumets, it always uses `common.AlphabetAddress`, right?
fyrchik (Migrated from github.com) commented 2023-02-10 11:11:41 +00:00

We delete it in _deploy, this line can be removed.

We delete it in `_deploy`, this line can be removed.
@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
fyrchik (Migrated from github.com) commented 2023-02-10 11:15:49 +00:00

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?

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`?
@ -20,2 +20,3 @@
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
//TODO(@acid-ant): #9 remove notaryDisabled from args in future version
args := data.([]interface{})
fyrchik (Migrated from github.com) commented 2023-02-10 11:17:04 +00:00

I would check that notaryDisabled is false and panic otherwise in all _deploy functions.

I would check that `notaryDisabled` is false and panic otherwise in all `_deploy` functions.
acid-ant (Migrated from github.com) reviewed 2023-02-10 12:54:44 +00:00
@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
acid-ant (Migrated from github.com) commented 2023-02-10 12:54:35 +00:00

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.

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](https://github.com/TrueCloudLab/frostfs-node/blob/master/pkg/morph/client/netmap/add_peer.go#L24) 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.
acid-ant (Migrated from github.com) reviewed 2023-02-10 15:08:24 +00:00
@ -34,13 +33,17 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
acid-ant (Migrated from github.com) commented 2023-02-10 15:08:24 +00:00

Created #9

Created #9
acid-ant (Migrated from github.com) reviewed 2023-02-10 15:09:19 +00:00
acid-ant (Migrated from github.com) commented 2023-02-10 15:09:19 +00:00

Added new commit with refactoring for common.CheckAlphabetWitness.

Added new commit with refactoring for `common.CheckAlphabetWitness`.
acid-ant (Migrated from github.com) reviewed 2023-02-10 15:09:31 +00:00
acid-ant (Migrated from github.com) commented 2023-02-10 15:09:31 +00:00

Thanks, removed.

Thanks, removed.
acid-ant (Migrated from github.com) reviewed 2023-02-10 15:10:13 +00:00
@ -20,2 +20,3 @@
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
//TODO(@acid-ant): #9 remove notaryDisabled from args in future version
args := data.([]interface{})
acid-ant (Migrated from github.com) commented 2023-02-10 15:10:13 +00:00

Sounds good, updated.

Sounds good, updated.
KirillovDenis (Migrated from github.com) reviewed 2023-02-13 06:33:49 +00:00
KirillovDenis (Migrated from github.com) left a comment

LGTM

LGTM
fyrchik (Migrated from github.com) reviewed 2023-02-14 14:39:45 +00:00
@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
fyrchik (Migrated from github.com) commented 2023-02-14 14:39:44 +00:00

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

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
acid-ant (Migrated from github.com) reviewed 2023-02-15 07:06:49 +00:00
@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
acid-ant (Migrated from github.com) commented 2023-02-15 07:06:49 +00:00

Changes for AddPeer were reverted.

Changes for `AddPeer` were reverted.
fyrchik (Migrated from github.com) reviewed 2023-02-16 06:19:55 +00:00
fyrchik (Migrated from github.com) commented 2023-02-16 06:19:55 +00:00

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

It looks complex, can we move `args := data.(struct` cast here (it is already done below) and check `args.notaryDisabled` field?
acid-ant (Migrated from github.com) reviewed 2023-02-16 08:49:46 +00:00
acid-ant (Migrated from github.com) commented 2023-02-16 08:49:46 +00:00

Ok, refactored.

Ok, refactored.
dstepanov-yadro (Migrated from github.com) reviewed 2023-03-01 08:42:58 +00:00
@ -46,1 +46,4 @@
ctx := storage.GetContext()
//TODO(@acid-ant): #9 remove notaryDisabled from args in future version
if data.([]interface{})[0].(bool) {
dstepanov-yadro (Migrated from github.com) commented 2023-03-01 08:33:34 +00:00

Looks complex too.

Looks complex too.
dstepanov-yadro (Migrated from github.com) commented 2023-03-01 08:42:28 +00:00

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

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

Done.

Done.
dstepanov-yadro approved these changes 2023-03-07 11:03:48 +00:00
acid-ant force-pushed acid-ant/feature/7-remove-notary-disabled-code from 771e59623f to b9be2ac036 2023-03-14 09:09:49 +00:00 Compare
alexvanin approved these changes 2023-03-14 11:56:08 +00:00
alexvanin left a comment
Owner

Overall looks good. Hope it was tested with basic operation like:

  • deployment,
  • contract update,
  • container creation.
Overall looks good. Hope it was tested with basic operation like: - deployment, - contract update, - container creation.
@ -1,5 +1,5 @@
name: "FrostFS"
safemethods: ["alphabetList", "alphabetAddress", "innerRingCandidates", "config", "listConfig", "version"]

I would rather remove alphabetAddress method in notary disabled environment or make it private.

I would rather remove `alphabetAddress` method in notary disabled environment or make it private.
Collaborator

Created #17 to track this.

Created #17 to track this.
Collaborator

Overall looks good. Hope it was tested with basic operation like:

  • deployment,
  • contract update,
  • container creation.

Yes, tested in dev-env this scenario:

  • deploy prev, create container, update, create container
  • deploy newest, create container
> Overall looks good. Hope it was tested with basic operation like: > - deployment, > - contract update, > - container creation. Yes, tested in dev-env this scenario: - deploy prev, create container, update, create container - deploy newest, create container
fyrchik merged commit b9be2ac036 into master 2023-03-15 09:47:04 +00:00
fyrchik deleted branch acid-ant/feature/7-remove-notary-disabled-code 2023-03-15 09:47:04 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-contract#8
There is no content yet.