From e835f562b8d22d1f06e8f33e5aae1eb5b17a2928 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 3 May 2023 21:48:31 +0300 Subject: [PATCH 1/2] *: drop obsolete non-notary events from the config An omission of e9ad34b3cdea321b6db14c842cf59ff218f9a10b. Signed-off-by: Roman Khimov --- CHANGELOG.md | 1 + container/config.yml | 28 ---------------------------- netmap/config.yml | 10 ---------- subnet/config.yml | 8 -------- 4 files changed, 1 insertion(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d354e209..7505cfe5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Changelog for NeoFS Contract ### Updated ### Removed +- old unused (notary-disabled) events ### Fixed - migration of non-notary network to notarized one with stale votes diff --git a/container/config.yml b/container/config.yml index 73f77126..026efa88 100644 --- a/container/config.yml +++ b/container/config.yml @@ -4,44 +4,16 @@ permissions: - methods: ["update", "addKey", "transferX", "register", "addRecord", "deleteRecords"] events: - - name: containerPut - parameters: - - name: container - type: ByteArray - - name: signature - type: Signature - - name: publicKey - type: PublicKey - - name: token - type: ByteArray - name: PutSuccess parameters: - name: containerID type: Hash256 - name: publicKey type: PublicKey - - name: containerDelete - parameters: - - name: containerID - type: ByteArray - - name: signature - type: Signature - - name: token - type: ByteArray - name: DeleteSuccess parameters: - name: containerID type: ByteArray - - name: setEACL - parameters: - - name: eACL - type: ByteArray - - name: signature - type: Signature - - name: publicKey - type: PublicKey - - name: token - type: ByteArray - name: SetEACLSuccess parameters: - name: containerID diff --git a/netmap/config.yml b/netmap/config.yml index 407e7f68..4cfe858b 100644 --- a/netmap/config.yml +++ b/netmap/config.yml @@ -3,20 +3,10 @@ safemethods: ["innerRingList", "epoch", "netmap", "netmapCandidates", "snapshot" permissions: - methods: ["update", "newEpoch"] events: - - name: AddPeer - parameters: - - name: nodeInfo - type: ByteArray - name: AddPeerSuccess parameters: - name: publicKey type: PublicKey - - name: UpdateState - parameters: - - name: state - type: Integer - - name: publicKey - type: PublicKey - name: UpdateStateSuccess parameters: - name: publicKey diff --git a/subnet/config.yml b/subnet/config.yml index a73f086f..eae19734 100644 --- a/subnet/config.yml +++ b/subnet/config.yml @@ -3,14 +3,6 @@ safemethods: ["version"] permissions: - methods: ["update"] events: - - name: Put - parameters: - - name: id - type: ByteArray - - name: ownerKey - type: PublicKey - - name: info - type: ByteArray - name: Delete parameters: - name: id From 47cc24742a6f3664346b7e708711f5ca2179e013 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 3 May 2023 23:38:12 +0300 Subject: [PATCH 2/2] reputation: remove unused !alpha handler from reputation.Put In notary-enabled mode it's never called without a complete alphabet signature, so this branch never happens. Even if it is to happen, notary-enabled IR will ignore the event. Signed-off-by: Roman Khimov --- reputation/config.yml | 8 -------- reputation/reputation_contract.go | 9 ++------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/reputation/config.yml b/reputation/config.yml index ce8ded01..b68ec6ad 100644 --- a/reputation/config.yml +++ b/reputation/config.yml @@ -3,11 +3,3 @@ safemethods: ["get", "getByID", "listByEpoch"] permissions: - methods: ["update"] events: - - name: reputationPut - parameters: - - name: epoch - type: Integer - - name: peerID - type: ByteArray - - name: value - type: ByteArray diff --git a/reputation/reputation_contract.go b/reputation/reputation_contract.go index 4e597aa3..60c2f2d1 100644 --- a/reputation/reputation_contract.go +++ b/reputation/reputation_contract.go @@ -85,7 +85,7 @@ func Update(script []byte, manifest []byte, data interface{}) { } // Put method saves DataAuditResult in contract storage. It can be invoked only by -// Inner Ring nodes. It does not require multisignature invocations. +// storage nodes with Alphabet assistance (multisignature witness). // // Epoch is the epoch number when DataAuditResult structure was generated. // PeerID contains public keys of the Inner Ring node that has produced DataAuditResult. @@ -94,12 +94,7 @@ func Put(epoch int, peerID []byte, value []byte) { ctx := storage.GetContext() multiaddr := common.AlphabetAddress() - alphabetCall := runtime.CheckWitness(multiaddr) - - if !alphabetCall { - runtime.Notify("reputationPut", epoch, peerID, value) - return - } + common.CheckAlphabetWitness(multiaddr) id := storageID(epoch, peerID)