audit

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package audit contains implementation of Audit contract deployed in NeoFS sidechain.

Inner Ring nodes perform audit of the registered containers during every epoch. If a container contains StorageGroup objects, an Inner Ring node initializes a series of audit checks. Based on the results of these checks, the Inner Ring node creates a DataAuditResult structure for the container. The content of this structure makes it possible to determine which storage nodes have been examined and see the status of these checks. Regarding this information, the container owner is charged for data storage.

Audit contract is used as a reliable and verifiable storage for all DataAuditResult structures. At the end of data audit routine, Inner Ring nodes send a stable marshaled version of the DataAuditResult structure to the contract. When Alphabet nodes of the Inner Ring perform settlement operations, they make a list and get these AuditResultStructures from the audit contract.

Contract notifications

Audit contract does not produce notifications to process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(id []byte) []byte

Get method returns a stable marshaled DataAuditResult structure.

The ID of the DataAuditResult can be obtained from listing methods.

func List

func List() [][]byte

List method returns a list of all available DataAuditResult IDs from the contract storage.

func ListByCID

func ListByCID(epoch int, cid []byte) [][]byte

ListByCID method returns a list of DataAuditResult IDs generated during the specified epoch for the specified container.

func ListByEpoch

func ListByEpoch(epoch int) [][]byte

ListByEpoch method returns a list of DataAuditResult IDs generated during the specified epoch.

func ListByNode

func ListByNode(epoch int, cid []byte, key interop.PublicKey) [][]byte

ListByNode method returns a list of DataAuditResult IDs generated in the specified epoch for the specified container by the specified Inner Ring node.

func Put

func Put(rawAuditResult []byte)

Put method stores a stable marshalled `DataAuditResult` structure. It can be invoked only by Inner Ring nodes.

Inner Ring nodes perform audit of containers and produce `DataAuditResult` structures. They are stored in audit contract and used for settlements in later epochs.

func Update added in v0.11.0

func Update(script []byte, manifest []byte, data any)

Update method updates contract source code and manifest. It can be invoked only by committee.

func Version

func Version() int

Version returns the version of the contract.

Types

type AuditHeader added in v0.18.0

type AuditHeader struct {
	Epoch int
	CID   []byte
	From  interop.PublicKey
}

func (AuditHeader) ID added in v0.18.0

func (a AuditHeader) ID() []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL