Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
13 KiB
Protocol Documentation
Table of Contents
-
Services
-
Messages
reputation/service.proto
Service "neo.fs.v2.reputation.ReputationService"
ReputationService
provides mechanisms for exchanging trust values with
other NeoFS nodes. Nodes rate each other's reputation based on how good they
process requests and set a trust level based on that rating. The trust
information is passed to the next nodes to check and aggregate unless the
final result is recorded.
rpc AnnounceLocalTrust(AnnounceLocalTrustRequest) returns (AnnounceLocalTrustResponse);
rpc AnnounceIntermediateResult(AnnounceIntermediateResultRequest) returns (AnnounceIntermediateResultResponse);
Method AnnounceLocalTrust
Announce local client trust information to any node in NeoFS network.
Statuses:
- OK (0, SECTION_SUCCESS): local trust has been successfully announced;
- Common failures (SECTION_FAILURE_COMMON).
Name | Input | Output |
---|---|---|
AnnounceLocalTrust | AnnounceLocalTrustRequest | AnnounceLocalTrustResponse |
Method AnnounceIntermediateResult
Announce the intermediate result of the iterative algorithm for calculating the global reputation of the node in NeoFS network.
Statuses:
- OK (0, SECTION_SUCCESS): intermediate trust estimation has been successfully announced;
- Common failures (SECTION_FAILURE_COMMON).
Name | Input | Output |
---|---|---|
AnnounceIntermediateResult | AnnounceIntermediateResultRequest | AnnounceIntermediateResultResponse |
Message AnnounceIntermediateResultRequest
Announce intermediate global trust information.
Field | Type | Label | Description |
---|---|---|---|
body | AnnounceIntermediateResultRequest.Body | Body of the request message. | |
meta_header | neo.fs.v2.session.RequestMetaHeader | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | |
verify_header | neo.fs.v2.session.RequestVerificationHeader | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. |
Message AnnounceIntermediateResultRequest.Body
Announce intermediate global trust information.
Field | Type | Label | Description |
---|---|---|---|
epoch | uint64 | Iteration execution Epoch number | |
iteration | uint32 | Iteration sequence number | |
trust | PeerToPeerTrust | Current global trust value calculated at the specified iteration |
Message AnnounceIntermediateResultResponse
Intermediate global trust information announcement response.
Field | Type | Label | Description |
---|---|---|---|
body | AnnounceIntermediateResultResponse.Body | Body of the response message. | |
meta_header | neo.fs.v2.session.ResponseMetaHeader | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | |
verify_header | neo.fs.v2.session.ResponseVerificationHeader | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. |
Message AnnounceIntermediateResultResponse.Body
Response to the node's intermediate global trust information announcement has an empty body because the trust exchange operation is asynchronous. If Trust information does not pass sanity checks, it is silently ignored.
Message AnnounceLocalTrustRequest
Announce node's local trust information.
Field | Type | Label | Description |
---|---|---|---|
body | AnnounceLocalTrustRequest.Body | Body of the request message. | |
meta_header | neo.fs.v2.session.RequestMetaHeader | Carries request meta information. Header data is used only to regulate message transport and does not affect request execution. | |
verify_header | neo.fs.v2.session.RequestVerificationHeader | Carries request verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. |
Message AnnounceLocalTrustRequest.Body
Announce node's local trust information.
Field | Type | Label | Description |
---|---|---|---|
epoch | uint64 | Trust assessment Epoch number | |
trusts | Trust | repeated | List of normalized local trust values to other NeoFS nodes. The value is calculated according to EigenTrust++ algorithm and must be a floating point number in [0;1] range. |
Message AnnounceLocalTrustResponse
Node's local trust information announcement response.
Field | Type | Label | Description |
---|---|---|---|
body | AnnounceLocalTrustResponse.Body | Body of the response message. | |
meta_header | neo.fs.v2.session.ResponseMetaHeader | Carries response meta information. Header data is used only to regulate message transport and does not affect request execution. | |
verify_header | neo.fs.v2.session.ResponseVerificationHeader | Carries response verification information. This header is used to authenticate the nodes of the message route and check the correctness of transmission. |
Message AnnounceLocalTrustResponse.Body
Response to the node's local trust information announcement has an empty body because the trust exchange operation is asynchronous. If Trust information does not pass sanity checks, it is silently ignored.
reputation/types.proto
Message GlobalTrust
Global trust level to NeoFS node.
Field | Type | Label | Description |
---|---|---|---|
version | neo.fs.v2.refs.Version | Message format version. Effectively, the version of API library used to create the message. | |
body | GlobalTrust.Body | Message body | |
signature | neo.fs.v2.refs.Signature | Signature of the binary body field by the manager. |
Message GlobalTrust.Body
Message body structure.
Field | Type | Label | Description |
---|---|---|---|
manager | PeerID | Node manager ID | |
trust | Trust | Global trust level |
Message PeerID
NeoFS unique peer identifier is a 33 byte long compressed public key of the node, the same as the one stored in the network map.
String presentation is a base58 encoded string.
JSON value will be data encoded as a string using standard base64 encoding with paddings. Either standard or URL-safe base64 encoding with/without paddings are accepted.
Field | Type | Label | Description |
---|---|---|---|
public_key | bytes | Peer node's public key |
Message PeerToPeerTrust
Trust level of a peer to a peer.
Field | Type | Label | Description |
---|---|---|---|
trusting_peer | PeerID | Identifier of the trusting peer | |
trust | Trust | Trust level |
Message Trust
Trust level to a NeoFS network peer.
Field | Type | Label | Description |
---|---|---|---|
peer | PeerID | Identifier of the trusted peer | |
value | double | Trust level in [0:1] range |
Scalar Value Types
.proto Type | Notes | C++ Type | Java Type | Python Type |
---|---|---|---|---|
double | double | double | float | |
float | float | float | float | |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long |
uint32 | Uses variable-length encoding. | uint32 | int | int/long |
uint64 | Uses variable-length encoding. | uint64 | long | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long |
sfixed32 | Always four bytes. | int32 | int | int |
sfixed64 | Always eight bytes. | int64 | long | int/long |
bool | bool | boolean | boolean | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str |