Skip to content
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

reputation: drop copy/paste garbage from the doc, fix #331 #369

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions reputation/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
Package reputation contains implementation of Reputation contract deployed in NeoFS
sidechain.

Inner Ring nodes produce data audit for each container during each epoch. In the end,
nodes produce DataAuditResult structure that contains information about audit
progress. Reputation contract provides storage for such structures and simple
interface to iterate over available DataAuditResults on specified epoch.

During settlement process, Alphabet nodes fetch all DataAuditResult structures
from the epoch and execute balance transfers from data owners to Storage and
Inner Ring nodes if data audit succeeds.
Storage nodes collect reputation data while communicating with other nodes.
This data is exchanged and the end result (global trust values) is stored in
the contract as opaque data.

# Contract notifications

Expand Down
14 changes: 7 additions & 7 deletions reputation/reputation_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ func Update(script []byte, manifest []byte, data any) {
runtime.Log("reputation contract updated")
}

// Put method saves DataAuditResult in contract storage. It can be invoked only by
// Put method saves global trust data in contract storage. It can be invoked only by
// 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.
// Value contains a stable marshaled structure of DataAuditResult.
// Epoch is the epoch number when GlobalTrust structure was generated.
// PeerID contains public key of the storage node that is the subject of the GlobalTrust.
// Value contains a stable marshaled structure of GlobalTrust.
func Put(epoch int, peerID []byte, value []byte) {
ctx := storage.GetContext()

Expand All @@ -112,14 +112,14 @@ func Put(epoch int, peerID []byte, value []byte) {
storage.Put(ctx, key, value)
}

// Get method returns a list of all stable marshaled DataAuditResult structures
// produced by the specified Inner Ring node during the specified epoch.
// Get method returns a list of all stable marshaled GlobalTrust structures
// known for the given peer during the specified epoch.
func Get(epoch int, peerID []byte) [][]byte {
id := storageID(epoch, peerID)
return GetByID(id)
}

// GetByID method returns a list of all stable marshaled DataAuditResult with
// GetByID method returns a list of all stable marshaled GlobalTrust with
// the specified id. Use ListByEpoch method to obtain the id.
func GetByID(id []byte) [][]byte {
ctx := storage.GetReadOnlyContext()
Expand Down
Loading