Remove notary disabled code #8
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-contract#8
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/feature/7-remove-notary-disabled-code"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #7
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -34,13 +33,17 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
Can you link it with some issue?
@ -49,7 +52,11 @@ func _deploy(data interface{}, isUpdate bool) {
total int
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.
I would also do some refactoring in another commit but in this PR.
For example,
CheckAlphabetWitness
could accept no argumets, it always usescommon.AlphabetAddress
, right?We delete it in
_deploy
, this line can be removed.@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
It produces a notification in case
1a
, I don't think we can remove it safely. Have you checked whether it is called innode
?@ -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{})
I would check that
notaryDisabled
is false and panic otherwise in all_deploy
functions.@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
In our case this method degrades to following lines:
In
CheckWitness
we are producing notification?As for code in
node
, yes, we have few places where we invokeAddPeer
.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.@ -34,13 +33,17 @@ func OnNEP17Payment(from interop.Hash160, amount int, data interface{}) {
func _deploy(data interface{}, isUpdate bool) {
ctx := storage.GetContext()
Created #9
Added new commit with refactoring for
common.CheckAlphabetWitness
.Thanks, removed.
@ -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{})
Sounds good, updated.
LGTM
@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
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
withruntime.Notify
here too, but I forgot the outcome of this discussion. cc @alexvanin@ -208,3 +146,3 @@
common.CheckAlphabetWitness(common.AlphabetAddress())
common.CheckAlphabetWitness()
Changes for
AddPeer
were reverted.It looks complex, can we move
args := data.(struct
cast here (it is already done below) and checkargs.notaryDisabled
field?Ok, refactored.
@ -46,1 +46,4 @@
ctx := storage.GetContext()
//TODO(@acid-ant): #9 remove notaryDisabled from args in future version
if data.([]interface{})[0].(bool) {
Looks complex too.
Same code in many files, it's better to move to method.
Done.
771e59623f
tob9be2ac036
Overall looks good. Hope it was tested with basic operation like:
@ -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.Created #17 to track this.
Yes, tested in dev-env this scenario:
alphabetAddress
fromfrostfs
contract #17EliChin referenced this pull request2023-03-22 17:57:50 +00:00