Updated Tari protocol definitions

Also removed mining helper binaries
This commit is contained in:
SChernykh 2024-04-22 20:32:26 +02:00
parent d6d9b5bc22
commit 929e1ca01c
8 changed files with 606 additions and 297 deletions

View file

@ -1,202 +0,0 @@
// Copyright 2024. The Tari Project
// SPDX-License-Identifier: BSD-3-Clause
// This file was generated by cargo-bindgen. Please do not edit manually.
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
/**
* The latest version of the Identity Signature.
*/
#define IdentitySignature_LATEST_VERSION 0
struct ByteVector;
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
/**
* Creates a ByteVector
*
* ## Arguments
* `byte_array` - The pointer to the byte array
* `element_count` - The number of elements in byte_array
* `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions
* as an out parameter.
*
* ## Returns
* `*mut ByteVector` - Pointer to the created ByteVector. Note that it will be ptr::null_mut()
* if the byte_array pointer was null or if the elements in the byte_vector don't match
* element_count when it is created
*
* # Safety
* The ```byte_vector_destroy``` function must be called when finished with a ByteVector to prevent a memory leak
*/
struct ByteVector *byte_vector_create(const unsigned char *byte_array,
unsigned int element_count,
int *error_out);
/**
* Frees memory for a ByteVector
*
* ## Arguments
* `bytes` - The pointer to a ByteVector
*
* ## Returns
* `()` - Does not return a value, equivalent to void in C
*
* # Safety
* None
*/
void byte_vector_destroy(struct ByteVector *bytes);
/**
* Gets a c_uchar at position in a ByteVector
*
* ## Arguments
* `ptr` - The pointer to a ByteVector
* `position` - The integer position
* `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions
* as an out parameter.
*
* ## Returns
* `c_uchar` - Returns a character. Note that the character will be a null terminator (0) if ptr
* is null or if the position is invalid
*
* # Safety
* None
*/
unsigned char byte_vector_get_at(struct ByteVector *ptr,
unsigned int position,
int *error_out);
/**
* Gets the number of elements in a ByteVector
*
* ## Arguments
* `ptr` - The pointer to a ByteVector
* `error_out` - Pointer to an int which will be modified to an error code should one occur, may not be null. Functions
* as an out parameter.
*
* ## Returns
* `c_uint` - Returns the integer number of elements in the ByteVector. Note that it will be zero
* if ptr is null
*
* # Safety
* None
*/
unsigned int byte_vector_get_length(const struct ByteVector *vec,
int *error_out);
/**
* Validates a hex string is convertible into a TariPublicKey
*
* ## Arguments
* `hex` - The hex formatted cstring to be validated
*
* ## Returns
* `bool` - Returns true/false
* `error_out` - Error code returned, 0 means no error
*
* # Safety
* None
*/
bool public_key_hex_validate(const char *hex, int *error_out);
/**
* Injects a nonce into a blocktemplate
*
* ## Arguments
* `hex` - The hex formatted cstring
* `nonce` - The nonce to be injected
*
* ## Returns
* `c_char` - The updated hex formatted cstring or null on error
* `error_out` - Error code returned, 0 means no error
*
* # Safety
* None
*/
void inject_nonce(struct ByteVector *header, unsigned long long nonce, int *error_out);
/**
* Injects a coinbase into a blocktemplate
*
* ## Arguments
* `block_template_bytes` - The block template as bytes, serialized with borsh.io
* `value` - The value of the coinbase
* `stealth_payment` - Boolean value, is this a stealh payment or normal one-sided
* `revealed_value_proof` - Boolean value, should this use the reveal value proof, or BP+
* `wallet_payment_address` - The address to pay the coinbase to
* `coinbase_extra` - The value of the coinbase extra field
* `network` - The value of the network
*
* ## Returns
* `block_template_bytes` - The updated block template
* `error_out` - Error code returned, 0 means no error
*
* # Safety
* None
*/
void inject_coinbase(struct ByteVector *block_template_bytes,
unsigned long long coibase_value,
bool stealth_payment,
bool revealed_value_proof,
const char *wallet_payment_address,
const char *coinbase_extra,
unsigned int network,
int *error_out);
/**
* Returns the difficulty of a share
*
* ## Arguments
* `hex` - The hex formatted cstring to be validated
*
* ## Returns
* `c_ulonglong` - Difficulty, 0 on error
* `error_out` - Error code returned, 0 means no error
*
* # Safety
* None
*/
unsigned long long share_difficulty(struct ByteVector *header,
unsigned int network,
int *error_out);
/**
* Validates a share submission
*
* ## Arguments
* `hex` - The hex representation of the share to be validated
* `hash` - The hash of the share to be validated
* `nonce` - The nonce for the share to be validated
* `stratum_difficulty` - The stratum difficulty to be checked against (meeting this means that the share is valid for
* payout) `template_difficulty` - The difficulty to be checked against (meeting this means the share is also a block
* to be submitted to the chain)
*
* ## Returns
* `c_uint` - Returns one of the following:
* 0: Valid Block
* 1: Valid Share
* 2: Invalid Share
* 3: Invalid Difficulty
* `error_out` - Error code returned, 0 means no error
*
* # Safety
* None
*/
int share_validate(struct ByteVector *header,
const char *hash,
unsigned int network,
unsigned long long share_difficulty,
unsigned long long template_difficulty,
int *error_out);
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus

View file

@ -136,17 +136,36 @@ struct GetIdentityRequestDefaultTypeInternal {
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetIdentityRequestDefaultTypeInternal _GetIdentityRequest_default_instance_; PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GetIdentityRequestDefaultTypeInternal _GetIdentityRequest_default_instance_;
inline constexpr AverageLatency::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept
: latency_{::uint64_t{0u}},
_cached_size_{0} {}
template <typename>
PROTOBUF_CONSTEXPR AverageLatency::AverageLatency(::_pbi::ConstantInitialized)
: _impl_(::_pbi::ConstantInitialized()) {}
struct AverageLatencyDefaultTypeInternal {
PROTOBUF_CONSTEXPR AverageLatencyDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {}
~AverageLatencyDefaultTypeInternal() {}
union {
AverageLatency _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 AverageLatencyDefaultTypeInternal _AverageLatency_default_instance_;
inline constexpr Address::Impl_::Impl_( inline constexpr Address::Impl_::Impl_(
::_pbi::ConstantInitialized) noexcept ::_pbi::ConstantInitialized) noexcept
: address_( : _cached_size_{0},
address_(
&::google::protobuf::internal::fixed_address_empty_string, &::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()), ::_pbi::ConstantInitialized()),
last_seen_( last_seen_(
&::google::protobuf::internal::fixed_address_empty_string, &::google::protobuf::internal::fixed_address_empty_string,
::_pbi::ConstantInitialized()), ::_pbi::ConstantInitialized()),
avg_latency_{::uint64_t{0u}}, avg_latency_{nullptr},
connection_attempts_{0u}, connection_attempts_{0u} {}
_cached_size_{0} {}
template <typename> template <typename>
PROTOBUF_CONSTEXPR Address::Address(::_pbi::ConstantInitialized) PROTOBUF_CONSTEXPR Address::Address(::_pbi::ConstantInitialized)
@ -219,7 +238,7 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT
PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListConnectedPeersResponseDefaultTypeInternal _ListConnectedPeersResponse_default_instance_; PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ListConnectedPeersResponseDefaultTypeInternal _ListConnectedPeersResponse_default_instance_;
} // namespace rpc } // namespace rpc
} // namespace tari } // namespace tari
static ::_pb::Metadata file_level_metadata_network_2eproto[8]; static ::_pb::Metadata file_level_metadata_network_2eproto[9];
static const ::_pb::EnumDescriptor* file_level_enum_descriptors_network_2eproto[1]; static const ::_pb::EnumDescriptor* file_level_enum_descriptors_network_2eproto[1];
static constexpr const ::_pb::ServiceDescriptor** static constexpr const ::_pb::ServiceDescriptor**
file_level_service_descriptors_network_2eproto = nullptr; file_level_service_descriptors_network_2eproto = nullptr;
@ -266,7 +285,7 @@ const ::uint32_t TableStruct_network_2eproto::offsets[] PROTOBUF_SECTION_VARIABL
PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.status_), PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.status_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.avg_latency_ms_), PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.avg_latency_ms_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.num_node_connections_), PROTOBUF_FIELD_OFFSET(::tari::rpc::NetworkStatusResponse, _impl_.num_node_connections_),
~0u, // no _has_bits_ PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_._has_bits_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
~0u, // no _oneof_case_ ~0u, // no _oneof_case_
@ -278,6 +297,19 @@ const ::uint32_t TableStruct_network_2eproto::offsets[] PROTOBUF_SECTION_VARIABL
PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.last_seen_), PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.last_seen_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.connection_attempts_), PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.connection_attempts_),
PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.avg_latency_), PROTOBUF_FIELD_OFFSET(::tari::rpc::Address, _impl_.avg_latency_),
~0u,
~0u,
~0u,
0,
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::tari::rpc::AverageLatency, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
~0u, // no _inlined_string_donated_
~0u, // no _split_
~0u, // no sizeof(Split)
PROTOBUF_FIELD_OFFSET(::tari::rpc::AverageLatency, _impl_.latency_),
~0u, // no _has_bits_ ~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::tari::rpc::ListConnectedPeersResponse, _internal_metadata_), PROTOBUF_FIELD_OFFSET(::tari::rpc::ListConnectedPeersResponse, _internal_metadata_),
~0u, // no _extensions_ ~0u, // no _extensions_
@ -325,11 +357,12 @@ static const ::_pbi::MigrationSchema
{0, -1, -1, sizeof(::tari::rpc::NodeIdentity)}, {0, -1, -1, sizeof(::tari::rpc::NodeIdentity)},
{11, -1, -1, sizeof(::tari::rpc::Peer)}, {11, -1, -1, sizeof(::tari::rpc::Peer)},
{30, -1, -1, sizeof(::tari::rpc::NetworkStatusResponse)}, {30, -1, -1, sizeof(::tari::rpc::NetworkStatusResponse)},
{41, -1, -1, sizeof(::tari::rpc::Address)}, {41, 53, -1, sizeof(::tari::rpc::Address)},
{53, -1, -1, sizeof(::tari::rpc::ListConnectedPeersResponse)}, {57, -1, -1, sizeof(::tari::rpc::AverageLatency)},
{62, -1, -1, sizeof(::tari::rpc::SoftwareUpdate)}, {66, -1, -1, sizeof(::tari::rpc::ListConnectedPeersResponse)},
{74, -1, -1, sizeof(::tari::rpc::GetIdentityRequest)}, {75, -1, -1, sizeof(::tari::rpc::SoftwareUpdate)},
{82, -1, -1, sizeof(::tari::rpc::GetIdentityResponse)}, {87, -1, -1, sizeof(::tari::rpc::GetIdentityRequest)},
{95, -1, -1, sizeof(::tari::rpc::GetIdentityResponse)},
}; };
static const ::_pb::Message* const file_default_instances[] = { static const ::_pb::Message* const file_default_instances[] = {
@ -337,6 +370,7 @@ static const ::_pb::Message* const file_default_instances[] = {
&::tari::rpc::_Peer_default_instance_._instance, &::tari::rpc::_Peer_default_instance_._instance,
&::tari::rpc::_NetworkStatusResponse_default_instance_._instance, &::tari::rpc::_NetworkStatusResponse_default_instance_._instance,
&::tari::rpc::_Address_default_instance_._instance, &::tari::rpc::_Address_default_instance_._instance,
&::tari::rpc::_AverageLatency_default_instance_._instance,
&::tari::rpc::_ListConnectedPeersResponse_default_instance_._instance, &::tari::rpc::_ListConnectedPeersResponse_default_instance_._instance,
&::tari::rpc::_SoftwareUpdate_default_instance_._instance, &::tari::rpc::_SoftwareUpdate_default_instance_._instance,
&::tari::rpc::_GetIdentityRequest_default_instance_._instance, &::tari::rpc::_GetIdentityRequest_default_instance_._instance,
@ -355,19 +389,20 @@ const char descriptor_table_protodef_network_2eproto[] PROTOBUF_SECTION_VARIABLE
"otocols\030\013 \003(\014\022\022\n\nuser_agent\030\014 \001(\t\"{\n\025Net" "otocols\030\013 \003(\014\022\022\n\nuser_agent\030\014 \001(\t\"{\n\025Net"
"workStatusResponse\022,\n\006status\030\001 \001(\0162\034.tar" "workStatusResponse\022,\n\006status\030\001 \001(\0162\034.tar"
"i.rpc.ConnectivityStatus\022\026\n\016avg_latency_" "i.rpc.ConnectivityStatus\022\026\n\016avg_latency_"
"ms\030\002 \001(\r\022\034\n\024num_node_connections\030\003 \001(\r\"_" "ms\030\002 \001(\r\022\034\n\024num_node_connections\030\003 \001(\r\"y"
"\n\007Address\022\017\n\007address\030\001 \001(\014\022\021\n\tlast_seen\030" "\n\007Address\022\017\n\007address\030\001 \001(\014\022\021\n\tlast_seen\030"
"\002 \001(\t\022\033\n\023connection_attempts\030\003 \001(\r\022\023\n\013av" "\002 \001(\t\022\033\n\023connection_attempts\030\003 \001(\r\022-\n\013av"
"g_latency\030\005 \001(\004\"E\n\032ListConnectedPeersRes" "g_latency\030\005 \001(\0132\030.tari.rpc.AverageLatenc"
"ponse\022\'\n\017connected_peers\030\001 \003(\0132\016.tari.rp" "y\"!\n\016AverageLatency\022\017\n\007latency\030\001 \001(\004\"E\n\032"
"c.Peer\"X\n\016SoftwareUpdate\022\022\n\nhas_update\030\001" "ListConnectedPeersResponse\022\'\n\017connected_"
" \001(\010\022\017\n\007version\030\002 \001(\t\022\013\n\003sha\030\003 \001(\t\022\024\n\014do" "peers\030\001 \003(\0132\016.tari.rpc.Peer\"X\n\016SoftwareU"
"wnload_url\030\004 \001(\t\"\024\n\022GetIdentityRequest\"R" "pdate\022\022\n\nhas_update\030\001 \001(\010\022\017\n\007version\030\002 \001"
"\n\023GetIdentityResponse\022\022\n\npublic_key\030\001 \001(" "(\t\022\013\n\003sha\030\003 \001(\t\022\024\n\014download_url\030\004 \001(\t\"\024\n"
"\014\022\026\n\016public_address\030\002 \001(\t\022\017\n\007node_id\030\003 \001" "\022GetIdentityRequest\"R\n\023GetIdentityRespon"
"(\014*M\n\022ConnectivityStatus\022\020\n\014Initializing" "se\022\022\n\npublic_key\030\001 \001(\014\022\026\n\016public_address"
"\020\000\022\n\n\006Online\020\001\022\014\n\010Degraded\020\002\022\013\n\007Offline\020" "\030\002 \001(\t\022\017\n\007node_id\030\003 \001(\014*M\n\022ConnectivityS"
"\003b\006proto3" "tatus\022\020\n\014Initializing\020\000\022\n\n\006Online\020\001\022\014\n\010D"
"egraded\020\002\022\013\n\007Offline\020\003b\006proto3"
}; };
static const ::_pbi::DescriptorTable* const descriptor_table_network_2eproto_deps[1] = static const ::_pbi::DescriptorTable* const descriptor_table_network_2eproto_deps[1] =
{ {
@ -377,13 +412,13 @@ static ::absl::once_flag descriptor_table_network_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_network_2eproto = { const ::_pbi::DescriptorTable descriptor_table_network_2eproto = {
false, false,
false, false,
969, 1030,
descriptor_table_protodef_network_2eproto, descriptor_table_protodef_network_2eproto,
"network.proto", "network.proto",
&descriptor_table_network_2eproto_once, &descriptor_table_network_2eproto_once,
descriptor_table_network_2eproto_deps, descriptor_table_network_2eproto_deps,
1, 1,
8, 9,
schemas, schemas,
file_default_instances, file_default_instances,
TableStruct_network_2eproto::offsets, TableStruct_network_2eproto::offsets,
@ -1348,8 +1383,18 @@ void NetworkStatusResponse::InternalSwap(NetworkStatusResponse* PROTOBUF_RESTRIC
class Address::_Internal { class Address::_Internal {
public: public:
using HasBits = decltype(std::declval<Address>()._impl_._has_bits_);
static constexpr ::int32_t kHasBitsOffset =
8 * PROTOBUF_FIELD_OFFSET(Address, _impl_._has_bits_);
static const ::tari::rpc::AverageLatency& avg_latency(const Address* msg);
static void set_has_avg_latency(HasBits* has_bits) {
(*has_bits)[0] |= 1u;
}
}; };
const ::tari::rpc::AverageLatency& Address::_Internal::avg_latency(const Address* msg) {
return *msg->_impl_.avg_latency_;
}
Address::Address(::google::protobuf::Arena* arena) Address::Address(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) { : ::google::protobuf::Message(arena) {
SharedCtor(arena); SharedCtor(arena);
@ -1358,9 +1403,10 @@ Address::Address(::google::protobuf::Arena* arena)
inline PROTOBUF_NDEBUG_INLINE Address::Impl_::Impl_( inline PROTOBUF_NDEBUG_INLINE Address::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena,
const Impl_& from) const Impl_& from)
: address_(arena, from.address_), : _has_bits_{from._has_bits_},
last_seen_(arena, from.last_seen_), _cached_size_{0},
_cached_size_{0} {} address_(arena, from.address_),
last_seen_(arena, from.last_seen_) {}
Address::Address( Address::Address(
::google::protobuf::Arena* arena, ::google::protobuf::Arena* arena,
@ -1371,22 +1417,20 @@ Address::Address(
_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(
from._internal_metadata_); from._internal_metadata_);
new (&_impl_) Impl_(internal_visibility(), arena, from._impl_); new (&_impl_) Impl_(internal_visibility(), arena, from._impl_);
::memcpy(reinterpret_cast<char *>(&_impl_) + ::uint32_t cached_has_bits = _impl_._has_bits_[0];
offsetof(Impl_, avg_latency_), _impl_.avg_latency_ = (cached_has_bits & 0x00000001u)
reinterpret_cast<const char *>(&from._impl_) + ? CreateMaybeMessage<::tari::rpc::AverageLatency>(arena, *from._impl_.avg_latency_)
offsetof(Impl_, avg_latency_), : nullptr;
offsetof(Impl_, connection_attempts_) - _impl_.connection_attempts_ = from._impl_.connection_attempts_;
offsetof(Impl_, avg_latency_) +
sizeof(Impl_::connection_attempts_));
// @@protoc_insertion_point(copy_constructor:tari.rpc.Address) // @@protoc_insertion_point(copy_constructor:tari.rpc.Address)
} }
inline PROTOBUF_NDEBUG_INLINE Address::Impl_::Impl_( inline PROTOBUF_NDEBUG_INLINE Address::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena) ::google::protobuf::Arena* arena)
: address_(arena), : _cached_size_{0},
last_seen_(arena), address_(arena),
_cached_size_{0} {} last_seen_(arena) {}
inline void Address::SharedCtor(::_pb::Arena* arena) { inline void Address::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena); new (&_impl_) Impl_(internal_visibility(), arena);
@ -1406,6 +1450,7 @@ inline void Address::SharedDtor() {
ABSL_DCHECK(GetArena() == nullptr); ABSL_DCHECK(GetArena() == nullptr);
_impl_.address_.Destroy(); _impl_.address_.Destroy();
_impl_.last_seen_.Destroy(); _impl_.last_seen_.Destroy();
delete _impl_.avg_latency_;
_impl_.~Impl_(); _impl_.~Impl_();
} }
@ -1418,9 +1463,13 @@ PROTOBUF_NOINLINE void Address::Clear() {
_impl_.address_.ClearToEmpty(); _impl_.address_.ClearToEmpty();
_impl_.last_seen_.ClearToEmpty(); _impl_.last_seen_.ClearToEmpty();
::memset(&_impl_.avg_latency_, 0, static_cast<::size_t>( cached_has_bits = _impl_._has_bits_[0];
reinterpret_cast<char*>(&_impl_.connection_attempts_) - if (cached_has_bits & 0x00000001u) {
reinterpret_cast<char*>(&_impl_.avg_latency_)) + sizeof(_impl_.connection_attempts_)); ABSL_DCHECK(_impl_.avg_latency_ != nullptr);
_impl_.avg_latency_->Clear();
}
_impl_.connection_attempts_ = 0u;
_impl_._has_bits_.Clear();
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
} }
@ -1432,17 +1481,17 @@ const char* Address::_InternalParse(
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<3, 4, 0, 34, 2> Address::_table_ = { const ::_pbi::TcParseTable<3, 4, 1, 34, 2> Address::_table_ = {
{ {
0, // no _has_bits_ PROTOBUF_FIELD_OFFSET(Address, _impl_._has_bits_),
0, // no _extensions_ 0, // no _extensions_
5, 56, // max_field_number, fast_idx_mask 5, 56, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table), offsetof(decltype(_table_), field_lookup_table),
4294967272, // skipmap 4294967272, // skipmap
offsetof(decltype(_table_), field_entries), offsetof(decltype(_table_), field_entries),
4, // num_field_entries 4, // num_field_entries
0, // num_aux_entries 1, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries offsetof(decltype(_table_), aux_entries),
&_Address_default_instance_._instance, &_Address_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback ::_pbi::TcParser::GenericFallback, // fallback
}, {{ }, {{
@ -1457,29 +1506,29 @@ const ::_pbi::TcParseTable<3, 4, 0, 34, 2> Address::_table_ = {
{::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Address, _impl_.connection_attempts_), 63>(), {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(Address, _impl_.connection_attempts_), 63>(),
{24, 63, 0, PROTOBUF_FIELD_OFFSET(Address, _impl_.connection_attempts_)}}, {24, 63, 0, PROTOBUF_FIELD_OFFSET(Address, _impl_.connection_attempts_)}},
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
// uint64 avg_latency = 5; // .tari.rpc.AverageLatency avg_latency = 5;
{::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(Address, _impl_.avg_latency_), 63>(), {::_pbi::TcParser::FastMtS1,
{40, 63, 0, PROTOBUF_FIELD_OFFSET(Address, _impl_.avg_latency_)}}, {42, 0, 0, PROTOBUF_FIELD_OFFSET(Address, _impl_.avg_latency_)}},
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
{::_pbi::TcParser::MiniParse, {}}, {::_pbi::TcParser::MiniParse, {}},
}}, {{ }}, {{
65535, 65535 65535, 65535
}}, {{ }}, {{
// bytes address = 1; // bytes address = 1;
{PROTOBUF_FIELD_OFFSET(Address, _impl_.address_), 0, 0, {PROTOBUF_FIELD_OFFSET(Address, _impl_.address_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)}, (0 | ::_fl::kFcSingular | ::_fl::kBytes | ::_fl::kRepAString)},
// string last_seen = 2; // string last_seen = 2;
{PROTOBUF_FIELD_OFFSET(Address, _impl_.last_seen_), 0, 0, {PROTOBUF_FIELD_OFFSET(Address, _impl_.last_seen_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
// uint32 connection_attempts = 3; // uint32 connection_attempts = 3;
{PROTOBUF_FIELD_OFFSET(Address, _impl_.connection_attempts_), 0, 0, {PROTOBUF_FIELD_OFFSET(Address, _impl_.connection_attempts_), -1, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt32)}, (0 | ::_fl::kFcSingular | ::_fl::kUInt32)},
// uint64 avg_latency = 5; // .tari.rpc.AverageLatency avg_latency = 5;
{PROTOBUF_FIELD_OFFSET(Address, _impl_.avg_latency_), 0, 0, {PROTOBUF_FIELD_OFFSET(Address, _impl_.avg_latency_), _Internal::kHasBitsOffset + 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt64)}, (0 | ::_fl::kFcOptional | ::_fl::kMessage | ::_fl::kTvTable)},
}}, }}, {{
// no aux_entries {::_pbi::TcParser::GetTable<::tari::rpc::AverageLatency>()},
{{ }}, {{
"\20\0\11\0\0\0\0\0" "\20\0\11\0\0\0\0\0"
"tari.rpc.Address" "tari.rpc.Address"
"last_seen" "last_seen"
@ -1514,11 +1563,12 @@ const ::_pbi::TcParseTable<3, 4, 0, 34, 2> Address::_table_ = {
3, this->_internal_connection_attempts(), target); 3, this->_internal_connection_attempts(), target);
} }
// uint64 avg_latency = 5; cached_has_bits = _impl_._has_bits_[0];
if (this->_internal_avg_latency() != 0) { // .tari.rpc.AverageLatency avg_latency = 5;
target = stream->EnsureSpace(target); if (cached_has_bits & 0x00000001u) {
target = ::_pbi::WireFormatLite::WriteUInt64ToArray( target = ::google::protobuf::internal::WireFormatLite::InternalWriteMessage(
5, this->_internal_avg_latency(), target); 5, _Internal::avg_latency(this),
_Internal::avg_latency(this).GetCachedSize(), target, stream);
} }
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
@ -1550,10 +1600,11 @@ const ::_pbi::TcParseTable<3, 4, 0, 34, 2> Address::_table_ = {
this->_internal_last_seen()); this->_internal_last_seen());
} }
// uint64 avg_latency = 5; // .tari.rpc.AverageLatency avg_latency = 5;
if (this->_internal_avg_latency() != 0) { cached_has_bits = _impl_._has_bits_[0];
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne( if (cached_has_bits & 0x00000001u) {
this->_internal_avg_latency()); total_size +=
1 + ::google::protobuf::internal::WireFormatLite::MessageSize(*_impl_.avg_latency_);
} }
// uint32 connection_attempts = 3; // uint32 connection_attempts = 3;
@ -1587,8 +1638,9 @@ void Address::MergeImpl(::google::protobuf::Message& to_msg, const ::google::pro
if (!from._internal_last_seen().empty()) { if (!from._internal_last_seen().empty()) {
_this->_internal_set_last_seen(from._internal_last_seen()); _this->_internal_set_last_seen(from._internal_last_seen());
} }
if (from._internal_avg_latency() != 0) { if ((from._impl_._has_bits_[0] & 0x00000001u) != 0) {
_this->_internal_set_avg_latency(from._internal_avg_latency()); _this->_internal_mutable_avg_latency()->::tari::rpc::AverageLatency::MergeFrom(
from._internal_avg_latency());
} }
if (from._internal_connection_attempts() != 0) { if (from._internal_connection_attempts() != 0) {
_this->_internal_set_connection_attempts(from._internal_connection_attempts()); _this->_internal_set_connection_attempts(from._internal_connection_attempts());
@ -1615,6 +1667,7 @@ void Address::InternalSwap(Address* PROTOBUF_RESTRICT other) {
auto* arena = GetArena(); auto* arena = GetArena();
ABSL_DCHECK_EQ(arena, other->GetArena()); ABSL_DCHECK_EQ(arena, other->GetArena());
_internal_metadata_.InternalSwap(&other->_internal_metadata_); _internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.address_, &other->_impl_.address_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.address_, &other->_impl_.address_, arena);
::_pbi::ArenaStringPtr::InternalSwap(&_impl_.last_seen_, &other->_impl_.last_seen_, arena); ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.last_seen_, &other->_impl_.last_seen_, arena);
::google::protobuf::internal::memswap< ::google::protobuf::internal::memswap<
@ -1632,6 +1685,176 @@ void Address::InternalSwap(Address* PROTOBUF_RESTRICT other) {
} }
// =================================================================== // ===================================================================
class AverageLatency::_Internal {
public:
};
AverageLatency::AverageLatency(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(arena) {
SharedCtor(arena);
// @@protoc_insertion_point(arena_constructor:tari.rpc.AverageLatency)
}
AverageLatency::AverageLatency(
::google::protobuf::Arena* arena, const AverageLatency& from)
: AverageLatency(arena) {
MergeFrom(from);
}
inline PROTOBUF_NDEBUG_INLINE AverageLatency::Impl_::Impl_(
::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena)
: _cached_size_{0} {}
inline void AverageLatency::SharedCtor(::_pb::Arena* arena) {
new (&_impl_) Impl_(internal_visibility(), arena);
_impl_.latency_ = {};
}
AverageLatency::~AverageLatency() {
// @@protoc_insertion_point(destructor:tari.rpc.AverageLatency)
_internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>();
SharedDtor();
}
inline void AverageLatency::SharedDtor() {
ABSL_DCHECK(GetArena() == nullptr);
_impl_.~Impl_();
}
PROTOBUF_NOINLINE void AverageLatency::Clear() {
// @@protoc_insertion_point(message_clear_start:tari.rpc.AverageLatency)
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
_impl_.latency_ = ::uint64_t{0u};
_internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>();
}
const char* AverageLatency::_InternalParse(
const char* ptr, ::_pbi::ParseContext* ctx) {
ptr = ::_pbi::TcParser::ParseLoop(this, ptr, ctx, &_table_.header);
return ptr;
}
PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1
const ::_pbi::TcParseTable<0, 1, 0, 0, 2> AverageLatency::_table_ = {
{
0, // no _has_bits_
0, // no _extensions_
1, 0, // max_field_number, fast_idx_mask
offsetof(decltype(_table_), field_lookup_table),
4294967294, // skipmap
offsetof(decltype(_table_), field_entries),
1, // num_field_entries
0, // num_aux_entries
offsetof(decltype(_table_), field_names), // no aux_entries
&_AverageLatency_default_instance_._instance,
::_pbi::TcParser::GenericFallback, // fallback
}, {{
// uint64 latency = 1;
{::_pbi::TcParser::SingularVarintNoZag1<::uint64_t, offsetof(AverageLatency, _impl_.latency_), 63>(),
{8, 63, 0, PROTOBUF_FIELD_OFFSET(AverageLatency, _impl_.latency_)}},
}}, {{
65535, 65535
}}, {{
// uint64 latency = 1;
{PROTOBUF_FIELD_OFFSET(AverageLatency, _impl_.latency_), 0, 0,
(0 | ::_fl::kFcSingular | ::_fl::kUInt64)},
}},
// no aux_entries
{{
}},
};
::uint8_t* AverageLatency::_InternalSerialize(
::uint8_t* target,
::google::protobuf::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:tari.rpc.AverageLatency)
::uint32_t cached_has_bits = 0;
(void)cached_has_bits;
// uint64 latency = 1;
if (this->_internal_latency() != 0) {
target = stream->EnsureSpace(target);
target = ::_pbi::WireFormatLite::WriteUInt64ToArray(
1, this->_internal_latency(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target =
::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:tari.rpc.AverageLatency)
return target;
}
::size_t AverageLatency::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tari.rpc.AverageLatency)
::size_t total_size = 0;
::uint32_t cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// uint64 latency = 1;
if (this->_internal_latency() != 0) {
total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(
this->_internal_latency());
}
return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_);
}
const ::google::protobuf::Message::ClassData AverageLatency::_class_data_ = {
AverageLatency::MergeImpl,
nullptr, // OnDemandRegisterArenaDtor
};
const ::google::protobuf::Message::ClassData* AverageLatency::GetClassData() const {
return &_class_data_;
}
void AverageLatency::MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg) {
auto* const _this = static_cast<AverageLatency*>(&to_msg);
auto& from = static_cast<const AverageLatency&>(from_msg);
// @@protoc_insertion_point(class_specific_merge_from_start:tari.rpc.AverageLatency)
ABSL_DCHECK_NE(&from, _this);
::uint32_t cached_has_bits = 0;
(void) cached_has_bits;
if (from._internal_latency() != 0) {
_this->_internal_set_latency(from._internal_latency());
}
_this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_);
}
void AverageLatency::CopyFrom(const AverageLatency& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tari.rpc.AverageLatency)
if (&from == this) return;
Clear();
MergeFrom(from);
}
PROTOBUF_NOINLINE bool AverageLatency::IsInitialized() const {
return true;
}
::_pbi::CachedSize* AverageLatency::AccessCachedSize() const {
return &_impl_._cached_size_;
}
void AverageLatency::InternalSwap(AverageLatency* PROTOBUF_RESTRICT other) {
using std::swap;
_internal_metadata_.InternalSwap(&other->_internal_metadata_);
swap(_impl_.latency_, other->_impl_.latency_);
}
::google::protobuf::Metadata AverageLatency::GetMetadata() const {
return ::_pbi::AssignDescriptors(
&descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once,
file_level_metadata_network_2eproto[4]);
}
// ===================================================================
class ListConnectedPeersResponse::_Internal { class ListConnectedPeersResponse::_Internal {
public: public:
}; };
@ -1811,7 +2034,7 @@ void ListConnectedPeersResponse::InternalSwap(ListConnectedPeersResponse* PROTOB
::google::protobuf::Metadata ListConnectedPeersResponse::GetMetadata() const { ::google::protobuf::Metadata ListConnectedPeersResponse::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once, &descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once,
file_level_metadata_network_2eproto[4]); file_level_metadata_network_2eproto[5]);
} }
// =================================================================== // ===================================================================
@ -2084,7 +2307,7 @@ void SoftwareUpdate::InternalSwap(SoftwareUpdate* PROTOBUF_RESTRICT other) {
::google::protobuf::Metadata SoftwareUpdate::GetMetadata() const { ::google::protobuf::Metadata SoftwareUpdate::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once, &descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once,
file_level_metadata_network_2eproto[5]); file_level_metadata_network_2eproto[6]);
} }
// =================================================================== // ===================================================================
@ -2119,7 +2342,7 @@ GetIdentityRequest::GetIdentityRequest(
::google::protobuf::Metadata GetIdentityRequest::GetMetadata() const { ::google::protobuf::Metadata GetIdentityRequest::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once, &descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once,
file_level_metadata_network_2eproto[6]); file_level_metadata_network_2eproto[7]);
} }
// =================================================================== // ===================================================================
@ -2362,7 +2585,7 @@ void GetIdentityResponse::InternalSwap(GetIdentityResponse* PROTOBUF_RESTRICT ot
::google::protobuf::Metadata GetIdentityResponse::GetMetadata() const { ::google::protobuf::Metadata GetIdentityResponse::GetMetadata() const {
return ::_pbi::AssignDescriptors( return ::_pbi::AssignDescriptors(
&descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once, &descriptor_table_network_2eproto_getter, &descriptor_table_network_2eproto_once,
file_level_metadata_network_2eproto[7]); file_level_metadata_network_2eproto[8]);
} }
// @@protoc_insertion_point(namespace_scope) // @@protoc_insertion_point(namespace_scope)
} // namespace rpc } // namespace rpc

View file

@ -63,6 +63,9 @@ namespace rpc {
class Address; class Address;
struct AddressDefaultTypeInternal; struct AddressDefaultTypeInternal;
extern AddressDefaultTypeInternal _Address_default_instance_; extern AddressDefaultTypeInternal _Address_default_instance_;
class AverageLatency;
struct AverageLatencyDefaultTypeInternal;
extern AverageLatencyDefaultTypeInternal _AverageLatency_default_instance_;
class GetIdentityRequest; class GetIdentityRequest;
struct GetIdentityRequestDefaultTypeInternal; struct GetIdentityRequestDefaultTypeInternal;
extern GetIdentityRequestDefaultTypeInternal _GetIdentityRequest_default_instance_; extern GetIdentityRequestDefaultTypeInternal _GetIdentityRequest_default_instance_;
@ -193,7 +196,7 @@ class SoftwareUpdate final :
&_SoftwareUpdate_default_instance_); &_SoftwareUpdate_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
5; 6;
friend void swap(SoftwareUpdate& a, SoftwareUpdate& b) { friend void swap(SoftwareUpdate& a, SoftwareUpdate& b) {
a.Swap(&b); a.Swap(&b);
@ -850,7 +853,7 @@ class GetIdentityResponse final :
&_GetIdentityResponse_default_instance_); &_GetIdentityResponse_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
7; 8;
friend void swap(GetIdentityResponse& a, GetIdentityResponse& b) { friend void swap(GetIdentityResponse& a, GetIdentityResponse& b) {
a.Swap(&b); a.Swap(&b);
@ -1066,7 +1069,7 @@ class GetIdentityRequest final :
&_GetIdentityRequest_default_instance_); &_GetIdentityRequest_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
6; 7;
friend void swap(GetIdentityRequest& a, GetIdentityRequest& b) { friend void swap(GetIdentityRequest& a, GetIdentityRequest& b) {
a.Swap(&b); a.Swap(&b);
@ -1144,6 +1147,181 @@ class GetIdentityRequest final :
friend struct ::TableStruct_network_2eproto; friend struct ::TableStruct_network_2eproto;
};// ------------------------------------------------------------------- };// -------------------------------------------------------------------
class AverageLatency final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tari.rpc.AverageLatency) */ {
public:
inline AverageLatency() : AverageLatency(nullptr) {}
~AverageLatency() override;
template<typename = void>
explicit PROTOBUF_CONSTEXPR AverageLatency(::google::protobuf::internal::ConstantInitialized);
inline AverageLatency(const AverageLatency& from)
: AverageLatency(nullptr, from) {}
AverageLatency(AverageLatency&& from) noexcept
: AverageLatency() {
*this = ::std::move(from);
}
inline AverageLatency& operator=(const AverageLatency& from) {
CopyFrom(from);
return *this;
}
inline AverageLatency& operator=(AverageLatency&& from) noexcept {
if (this == &from) return *this;
if (GetArena() == from.GetArena()
#ifdef PROTOBUF_FORCE_COPY_IN_MOVE
&& GetArena() != nullptr
#endif // !PROTOBUF_FORCE_COPY_IN_MOVE
) {
InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance);
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields()
ABSL_ATTRIBUTE_LIFETIME_BOUND {
return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>();
}
static const ::google::protobuf::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::google::protobuf::Descriptor* GetDescriptor() {
return default_instance().GetMetadata().descriptor;
}
static const ::google::protobuf::Reflection* GetReflection() {
return default_instance().GetMetadata().reflection;
}
static const AverageLatency& default_instance() {
return *internal_default_instance();
}
static inline const AverageLatency* internal_default_instance() {
return reinterpret_cast<const AverageLatency*>(
&_AverageLatency_default_instance_);
}
static constexpr int kIndexInFileMessages =
4;
friend void swap(AverageLatency& a, AverageLatency& b) {
a.Swap(&b);
}
inline void Swap(AverageLatency* other) {
if (other == this) return;
#ifdef PROTOBUF_FORCE_COPY_IN_SWAP
if (GetArena() != nullptr &&
GetArena() == other->GetArena()) {
#else // PROTOBUF_FORCE_COPY_IN_SWAP
if (GetArena() == other->GetArena()) {
#endif // !PROTOBUF_FORCE_COPY_IN_SWAP
InternalSwap(other);
} else {
::google::protobuf::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(AverageLatency* other) {
if (other == this) return;
ABSL_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
AverageLatency* New(::google::protobuf::Arena* arena = nullptr) const final {
return CreateMaybeMessage<AverageLatency>(arena);
}
using ::google::protobuf::Message::CopyFrom;
void CopyFrom(const AverageLatency& from);
using ::google::protobuf::Message::MergeFrom;
void MergeFrom( const AverageLatency& from) {
AverageLatency::MergeImpl(*this, from);
}
private:
static void MergeImpl(::google::protobuf::Message& to_msg, const ::google::protobuf::Message& from_msg);
public:
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
::size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::google::protobuf::internal::ParseContext* ctx) final;
::uint8_t* _InternalSerialize(
::uint8_t* target, ::google::protobuf::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const { return _impl_._cached_size_.Get(); }
private:
::google::protobuf::internal::CachedSize* AccessCachedSize() const final;
void SharedCtor(::google::protobuf::Arena* arena);
void SharedDtor();
void InternalSwap(AverageLatency* other);
private:
friend class ::google::protobuf::internal::AnyMetadata;
static ::absl::string_view FullMessageName() {
return "tari.rpc.AverageLatency";
}
protected:
explicit AverageLatency(::google::protobuf::Arena* arena);
AverageLatency(::google::protobuf::Arena* arena, const AverageLatency& from);
public:
static const ClassData _class_data_;
const ::google::protobuf::Message::ClassData*GetClassData() const final;
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kLatencyFieldNumber = 1,
};
// uint64 latency = 1;
void clear_latency() ;
::uint64_t latency() const;
void set_latency(::uint64_t value);
private:
::uint64_t _internal_latency() const;
void _internal_set_latency(::uint64_t value);
public:
// @@protoc_insertion_point(class_scope:tari.rpc.AverageLatency)
private:
class _Internal;
friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable<
0, 1, 0,
0, 2>
_table_;
friend class ::google::protobuf::MessageLite;
friend class ::google::protobuf::Arena;
template <typename T>
friend class ::google::protobuf::Arena::InternalHelper;
using InternalArenaConstructable_ = void;
using DestructorSkippable_ = void;
struct Impl_ {
inline explicit constexpr Impl_(
::google::protobuf::internal::ConstantInitialized) noexcept;
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from);
::uint64_t latency_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER
};
union { Impl_ _impl_; };
friend struct ::TableStruct_network_2eproto;
};// -------------------------------------------------------------------
class Address final : class Address final :
public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tari.rpc.Address) */ { public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tari.rpc.Address) */ {
public: public:
@ -1313,14 +1491,19 @@ class Address final :
std::string* _internal_mutable_last_seen(); std::string* _internal_mutable_last_seen();
public: public:
// uint64 avg_latency = 5; // .tari.rpc.AverageLatency avg_latency = 5;
bool has_avg_latency() const;
void clear_avg_latency() ; void clear_avg_latency() ;
::uint64_t avg_latency() const; const ::tari::rpc::AverageLatency& avg_latency() const;
void set_avg_latency(::uint64_t value); PROTOBUF_NODISCARD ::tari::rpc::AverageLatency* release_avg_latency();
::tari::rpc::AverageLatency* mutable_avg_latency();
void set_allocated_avg_latency(::tari::rpc::AverageLatency* value);
void unsafe_arena_set_allocated_avg_latency(::tari::rpc::AverageLatency* value);
::tari::rpc::AverageLatency* unsafe_arena_release_avg_latency();
private: private:
::uint64_t _internal_avg_latency() const; const ::tari::rpc::AverageLatency& _internal_avg_latency() const;
void _internal_set_avg_latency(::uint64_t value); ::tari::rpc::AverageLatency* _internal_mutable_avg_latency();
public: public:
// uint32 connection_attempts = 3; // uint32 connection_attempts = 3;
@ -1339,7 +1522,7 @@ class Address final :
friend class ::google::protobuf::internal::TcParser; friend class ::google::protobuf::internal::TcParser;
static const ::google::protobuf::internal::TcParseTable< static const ::google::protobuf::internal::TcParseTable<
3, 4, 0, 3, 4, 1,
34, 2> 34, 2>
_table_; _table_;
friend class ::google::protobuf::MessageLite; friend class ::google::protobuf::MessageLite;
@ -1356,11 +1539,12 @@ class Address final :
::google::protobuf::Arena* arena); ::google::protobuf::Arena* arena);
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
::google::protobuf::Arena* arena, const Impl_& from); ::google::protobuf::Arena* arena, const Impl_& from);
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr address_; ::google::protobuf::internal::ArenaStringPtr address_;
::google::protobuf::internal::ArenaStringPtr last_seen_; ::google::protobuf::internal::ArenaStringPtr last_seen_;
::uint64_t avg_latency_; ::tari::rpc::AverageLatency* avg_latency_;
::uint32_t connection_attempts_; ::uint32_t connection_attempts_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
PROTOBUF_TSAN_DECLARE_MEMBER PROTOBUF_TSAN_DECLARE_MEMBER
}; };
union { Impl_ _impl_; }; union { Impl_ _impl_; };
@ -1771,7 +1955,7 @@ class ListConnectedPeersResponse final :
&_ListConnectedPeersResponse_default_instance_); &_ListConnectedPeersResponse_default_instance_);
} }
static constexpr int kIndexInFileMessages = static constexpr int kIndexInFileMessages =
4; 5;
friend void swap(ListConnectedPeersResponse& a, ListConnectedPeersResponse& b) { friend void swap(ListConnectedPeersResponse& a, ListConnectedPeersResponse& b) {
a.Swap(&b); a.Swap(&b);
@ -2805,27 +2989,127 @@ inline void Address::_internal_set_connection_attempts(::uint32_t value) {
_impl_.connection_attempts_ = value; _impl_.connection_attempts_ = value;
} }
// uint64 avg_latency = 5; // .tari.rpc.AverageLatency avg_latency = 5;
inline bool Address::has_avg_latency() const {
bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0;
PROTOBUF_ASSUME(!value || _impl_.avg_latency_ != nullptr);
return value;
}
inline void Address::clear_avg_latency() { inline void Address::clear_avg_latency() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.avg_latency_ = ::uint64_t{0u}; if (_impl_.avg_latency_ != nullptr) _impl_.avg_latency_->Clear();
_impl_._has_bits_[0] &= ~0x00000001u;
} }
inline ::uint64_t Address::avg_latency() const { inline const ::tari::rpc::AverageLatency& Address::_internal_avg_latency() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
const ::tari::rpc::AverageLatency* p = _impl_.avg_latency_;
return p != nullptr ? *p : reinterpret_cast<const ::tari::rpc::AverageLatency&>(::tari::rpc::_AverageLatency_default_instance_);
}
inline const ::tari::rpc::AverageLatency& Address::avg_latency() const ABSL_ATTRIBUTE_LIFETIME_BOUND {
// @@protoc_insertion_point(field_get:tari.rpc.Address.avg_latency) // @@protoc_insertion_point(field_get:tari.rpc.Address.avg_latency)
return _internal_avg_latency(); return _internal_avg_latency();
} }
inline void Address::set_avg_latency(::uint64_t value) { inline void Address::unsafe_arena_set_allocated_avg_latency(::tari::rpc::AverageLatency* value) {
_internal_set_avg_latency(value); PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_set:tari.rpc.Address.avg_latency) if (GetArena() == nullptr) {
delete reinterpret_cast<::google::protobuf::MessageLite*>(_impl_.avg_latency_);
}
_impl_.avg_latency_ = reinterpret_cast<::tari::rpc::AverageLatency*>(value);
if (value != nullptr) {
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tari.rpc.Address.avg_latency)
} }
inline ::uint64_t Address::_internal_avg_latency() const { inline ::tari::rpc::AverageLatency* Address::release_avg_latency() {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race); PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] &= ~0x00000001u;
::tari::rpc::AverageLatency* released = _impl_.avg_latency_;
_impl_.avg_latency_ = nullptr;
#ifdef PROTOBUF_FORCE_COPY_IN_RELEASE
auto* old = reinterpret_cast<::google::protobuf::MessageLite*>(released);
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
if (GetArena() == nullptr) {
delete old;
}
#else // PROTOBUF_FORCE_COPY_IN_RELEASE
if (GetArena() != nullptr) {
released = ::google::protobuf::internal::DuplicateIfNonNull(released);
}
#endif // !PROTOBUF_FORCE_COPY_IN_RELEASE
return released;
}
inline ::tari::rpc::AverageLatency* Address::unsafe_arena_release_avg_latency() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
// @@protoc_insertion_point(field_release:tari.rpc.Address.avg_latency)
_impl_._has_bits_[0] &= ~0x00000001u;
::tari::rpc::AverageLatency* temp = _impl_.avg_latency_;
_impl_.avg_latency_ = nullptr;
return temp;
}
inline ::tari::rpc::AverageLatency* Address::_internal_mutable_avg_latency() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_._has_bits_[0] |= 0x00000001u;
if (_impl_.avg_latency_ == nullptr) {
auto* p = CreateMaybeMessage<::tari::rpc::AverageLatency>(GetArena());
_impl_.avg_latency_ = reinterpret_cast<::tari::rpc::AverageLatency*>(p);
}
return _impl_.avg_latency_; return _impl_.avg_latency_;
} }
inline void Address::_internal_set_avg_latency(::uint64_t value) { inline ::tari::rpc::AverageLatency* Address::mutable_avg_latency() ABSL_ATTRIBUTE_LIFETIME_BOUND {
::tari::rpc::AverageLatency* _msg = _internal_mutable_avg_latency();
// @@protoc_insertion_point(field_mutable:tari.rpc.Address.avg_latency)
return _msg;
}
inline void Address::set_allocated_avg_latency(::tari::rpc::AverageLatency* value) {
::google::protobuf::Arena* message_arena = GetArena();
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
if (message_arena == nullptr) {
delete reinterpret_cast<::tari::rpc::AverageLatency*>(_impl_.avg_latency_);
}
if (value != nullptr) {
::google::protobuf::Arena* submessage_arena = reinterpret_cast<::tari::rpc::AverageLatency*>(value)->GetArena();
if (message_arena != submessage_arena) {
value = ::google::protobuf::internal::GetOwnedMessage(message_arena, value, submessage_arena);
}
_impl_._has_bits_[0] |= 0x00000001u;
} else {
_impl_._has_bits_[0] &= ~0x00000001u;
}
_impl_.avg_latency_ = reinterpret_cast<::tari::rpc::AverageLatency*>(value);
// @@protoc_insertion_point(field_set_allocated:tari.rpc.Address.avg_latency)
}
// -------------------------------------------------------------------
// AverageLatency
// uint64 latency = 1;
inline void AverageLatency::clear_latency() {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
_impl_.latency_ = ::uint64_t{0u};
}
inline ::uint64_t AverageLatency::latency() const {
// @@protoc_insertion_point(field_get:tari.rpc.AverageLatency.latency)
return _internal_latency();
}
inline void AverageLatency::set_latency(::uint64_t value) {
_internal_set_latency(value);
// @@protoc_insertion_point(field_set:tari.rpc.AverageLatency.latency)
}
inline ::uint64_t AverageLatency::_internal_latency() const {
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
return _impl_.latency_;
}
inline void AverageLatency::_internal_set_latency(::uint64_t value) {
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race); PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
; ;
_impl_.avg_latency_ = value; _impl_.latency_ = value;
} }
// ------------------------------------------------------------------- // -------------------------------------------------------------------

View file

@ -70,7 +70,11 @@ message Address{
bytes address =1; bytes address =1;
string last_seen = 2; string last_seen = 2;
uint32 connection_attempts = 3; uint32 connection_attempts = 3;
uint64 avg_latency = 5; AverageLatency avg_latency = 5;
}
message AverageLatency {
uint64 latency = 1;
} }
message ListConnectedPeersResponse { message ListConnectedPeersResponse {