Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d7b110f15 | |||
| 7cd21f5d0e | |||
| 886da5a73e | |||
| bfa30254df | |||
| b589d373ea | |||
| 8333f7800f | |||
| 91fb15e967 | |||
| e0c1d9377c | |||
| 3f80244d84 | |||
| 433a1991bc | |||
| 915be9e39f | |||
| b9e415c659 | |||
| 1e2e5b85aa | |||
| 40999f0056 |
@@ -89,7 +89,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=${{ matrix.config.arch }}
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
shell: alpine.sh {0}
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cpp }} -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -237,7 +237,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -316,7 +316,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_STRIP=/usr/bin/aarch64-linux-gnu-strip -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_LIBS=ON -DARCH_ID=aarch64 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -400,7 +400,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON -DOPENSSL_NO_ASM=ON
|
||||
make -j$(nproc)
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -541,7 +541,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_ASM_FLAGS='-target x86_64-apple-macos10.13' -DSTATIC_LIBS=ON
|
||||
make -j4
|
||||
make -j4 p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
@@ -609,7 +609,7 @@ jobs:
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="-target arm64-apple-macos-11" -DCMAKE_CXX_FLAGS="-target arm64-apple-macos-11" -DSTATIC_LIBS=ON -DWITH_LTO=OFF -DARCH_ID=aarch64
|
||||
make -j3
|
||||
make -j3 p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
@@ -26,10 +26,10 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout cppcheck
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: danmar/cppcheck
|
||||
path: cppcheck-main
|
||||
run: |
|
||||
git clone https://github.com/danmar/cppcheck cppcheck-main
|
||||
cd cppcheck-main
|
||||
git checkout 6d7dc76052ad36128fae93f994d6a2bf57e93103
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
@@ -74,10 +74,10 @@ jobs:
|
||||
submodules: recursive
|
||||
|
||||
- name: Checkout cppcheck
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: danmar/cppcheck
|
||||
path: cppcheck-main
|
||||
run: |
|
||||
git clone https://github.com/danmar/cppcheck cppcheck-main
|
||||
cd cppcheck-main
|
||||
git checkout 6d7dc76052ad36128fae93f994d6a2bf57e93103
|
||||
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror -Wno-error=inline -Wno-error=unused-function")
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror -Wno-error=inline -Wno-error=unused-function -Wno-error=strict-overflow")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.5.0)
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wstrict-overflow=2")
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)
|
||||
--start-mining N Start built-in miner using N threads (any value between 1 and 64)
|
||||
--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from 37889 to 37888
|
||||
--nano Connect to p2pool-nano sidechain. Note that it will also change default p2p port from 37889 to 37890
|
||||
--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)
|
||||
--rpc-login Specify username[:password] required for Monero RPC server
|
||||
--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections
|
||||
|
||||
+786
-318
File diff suppressed because it is too large
Load Diff
+640
-70
@@ -172,6 +172,9 @@ extern ListAssetRegistrationsResponseDefaultTypeInternal _ListAssetRegistrations
|
||||
class ListHeadersRequest;
|
||||
struct ListHeadersRequestDefaultTypeInternal;
|
||||
extern ListHeadersRequestDefaultTypeInternal _ListHeadersRequest_default_instance_;
|
||||
class LivenessResult;
|
||||
struct LivenessResultDefaultTypeInternal;
|
||||
extern LivenessResultDefaultTypeInternal _LivenessResult_default_instance_;
|
||||
class MempoolStatsResponse;
|
||||
struct MempoolStatsResponseDefaultTypeInternal;
|
||||
extern MempoolStatsResponseDefaultTypeInternal _MempoolStatsResponse_default_instance_;
|
||||
@@ -583,20 +586,31 @@ class ValueAtHeightResponse final : public ::google::protobuf::Message
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
enum : int {
|
||||
kValueFieldNumber = 1,
|
||||
kHeightFieldNumber = 2,
|
||||
kCirculatingSupplyFieldNumber = 1,
|
||||
kSpendableSupplyFieldNumber = 2,
|
||||
kHeightFieldNumber = 3,
|
||||
};
|
||||
// uint64 value = 1;
|
||||
void clear_value() ;
|
||||
::uint64_t value() const;
|
||||
void set_value(::uint64_t value);
|
||||
// uint64 circulating_supply = 1;
|
||||
void clear_circulating_supply() ;
|
||||
::uint64_t circulating_supply() const;
|
||||
void set_circulating_supply(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_value() const;
|
||||
void _internal_set_value(::uint64_t value);
|
||||
::uint64_t _internal_circulating_supply() const;
|
||||
void _internal_set_circulating_supply(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 height = 2;
|
||||
// uint64 spendable_supply = 2;
|
||||
void clear_spendable_supply() ;
|
||||
::uint64_t spendable_supply() const;
|
||||
void set_spendable_supply(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_spendable_supply() const;
|
||||
void _internal_set_spendable_supply(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 height = 3;
|
||||
void clear_height() ;
|
||||
::uint64_t height() const;
|
||||
void set_height(::uint64_t value);
|
||||
@@ -611,7 +625,7 @@ class ValueAtHeightResponse final : public ::google::protobuf::Message
|
||||
class _Internal;
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<
|
||||
1, 2, 0,
|
||||
2, 3, 0,
|
||||
0, 2>
|
||||
_table_;
|
||||
friend class ::google::protobuf::MessageLite;
|
||||
@@ -627,7 +641,8 @@ class ValueAtHeightResponse final : public ::google::protobuf::Message
|
||||
::google::protobuf::Arena* arena);
|
||||
inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility,
|
||||
::google::protobuf::Arena* arena, const Impl_& from);
|
||||
::uint64_t value_;
|
||||
::uint64_t circulating_supply_;
|
||||
::uint64_t spendable_supply_;
|
||||
::uint64_t height_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
@@ -2291,8 +2306,9 @@ class NetworkDifficultyResponse final : public ::google::protobuf::Message
|
||||
kTimestampFieldNumber = 4,
|
||||
kPowAlgoFieldNumber = 5,
|
||||
kSha3XEstimatedHashRateFieldNumber = 6,
|
||||
kRandomxEstimatedHashRateFieldNumber = 7,
|
||||
kMoneroRandomxEstimatedHashRateFieldNumber = 7,
|
||||
kNumCoinbasesFieldNumber = 8,
|
||||
kTariRandomxEstimatedHashRateFieldNumber = 10,
|
||||
};
|
||||
// repeated bytes coinbase_extras = 9;
|
||||
int coinbase_extras_size() const;
|
||||
@@ -2382,14 +2398,14 @@ class NetworkDifficultyResponse final : public ::google::protobuf::Message
|
||||
void _internal_set_sha3x_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 randomx_estimated_hash_rate = 7;
|
||||
void clear_randomx_estimated_hash_rate() ;
|
||||
::uint64_t randomx_estimated_hash_rate() const;
|
||||
void set_randomx_estimated_hash_rate(::uint64_t value);
|
||||
// uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
void clear_monero_randomx_estimated_hash_rate() ;
|
||||
::uint64_t monero_randomx_estimated_hash_rate() const;
|
||||
void set_monero_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_randomx_estimated_hash_rate(::uint64_t value);
|
||||
::uint64_t _internal_monero_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_monero_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 num_coinbases = 8;
|
||||
@@ -2401,13 +2417,23 @@ class NetworkDifficultyResponse final : public ::google::protobuf::Message
|
||||
::uint64_t _internal_num_coinbases() const;
|
||||
void _internal_set_num_coinbases(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
void clear_tari_randomx_estimated_hash_rate() ;
|
||||
::uint64_t tari_randomx_estimated_hash_rate() const;
|
||||
void set_tari_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_tari_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_tari_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// @@protoc_insertion_point(class_scope:tari.rpc.NetworkDifficultyResponse)
|
||||
private:
|
||||
class _Internal;
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<
|
||||
4, 9, 0,
|
||||
4, 10, 0,
|
||||
0, 2>
|
||||
_table_;
|
||||
friend class ::google::protobuf::MessageLite;
|
||||
@@ -2430,8 +2456,9 @@ class NetworkDifficultyResponse final : public ::google::protobuf::Message
|
||||
::uint64_t timestamp_;
|
||||
::uint64_t pow_algo_;
|
||||
::uint64_t sha3x_estimated_hash_rate_;
|
||||
::uint64_t randomx_estimated_hash_rate_;
|
||||
::uint64_t monero_randomx_estimated_hash_rate_;
|
||||
::uint64_t num_coinbases_;
|
||||
::uint64_t tari_randomx_estimated_hash_rate_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
};
|
||||
@@ -2858,6 +2885,203 @@ class MempoolStatsResponse final : public ::google::protobuf::Message
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class LivenessResult final : public ::google::protobuf::Message
|
||||
/* @@protoc_insertion_point(class_definition:tari.rpc.LivenessResult) */ {
|
||||
public:
|
||||
inline LivenessResult() : LivenessResult(nullptr) {}
|
||||
~LivenessResult() override;
|
||||
template <typename = void>
|
||||
explicit PROTOBUF_CONSTEXPR LivenessResult(
|
||||
::google::protobuf::internal::ConstantInitialized);
|
||||
|
||||
inline LivenessResult(const LivenessResult& from) : LivenessResult(nullptr, from) {}
|
||||
inline LivenessResult(LivenessResult&& from) noexcept
|
||||
: LivenessResult(nullptr, std::move(from)) {}
|
||||
inline LivenessResult& operator=(const LivenessResult& from) {
|
||||
CopyFrom(from);
|
||||
return *this;
|
||||
}
|
||||
inline LivenessResult& operator=(LivenessResult&& 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 LivenessResult& default_instance() {
|
||||
return *internal_default_instance();
|
||||
}
|
||||
static inline const LivenessResult* internal_default_instance() {
|
||||
return reinterpret_cast<const LivenessResult*>(
|
||||
&_LivenessResult_default_instance_);
|
||||
}
|
||||
static constexpr int kIndexInFileMessages = 57;
|
||||
friend void swap(LivenessResult& a, LivenessResult& b) { a.Swap(&b); }
|
||||
inline void Swap(LivenessResult* 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(LivenessResult* other) {
|
||||
if (other == this) return;
|
||||
ABSL_DCHECK(GetArena() == other->GetArena());
|
||||
InternalSwap(other);
|
||||
}
|
||||
|
||||
// implements Message ----------------------------------------------
|
||||
|
||||
LivenessResult* New(::google::protobuf::Arena* arena = nullptr) const final {
|
||||
return ::google::protobuf::Message::DefaultConstruct<LivenessResult>(arena);
|
||||
}
|
||||
using ::google::protobuf::Message::CopyFrom;
|
||||
void CopyFrom(const LivenessResult& from);
|
||||
using ::google::protobuf::Message::MergeFrom;
|
||||
void MergeFrom(const LivenessResult& from) { LivenessResult::MergeImpl(*this, from); }
|
||||
|
||||
private:
|
||||
static void MergeImpl(
|
||||
::google::protobuf::MessageLite& to_msg,
|
||||
const ::google::protobuf::MessageLite& from_msg);
|
||||
|
||||
public:
|
||||
ABSL_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:
|
||||
void SharedCtor(::google::protobuf::Arena* arena);
|
||||
void SharedDtor();
|
||||
void InternalSwap(LivenessResult* other);
|
||||
private:
|
||||
friend class ::google::protobuf::internal::AnyMetadata;
|
||||
static ::absl::string_view FullMessageName() { return "tari.rpc.LivenessResult"; }
|
||||
|
||||
protected:
|
||||
explicit LivenessResult(::google::protobuf::Arena* arena);
|
||||
LivenessResult(::google::protobuf::Arena* arena, const LivenessResult& from);
|
||||
LivenessResult(::google::protobuf::Arena* arena, LivenessResult&& from) noexcept
|
||||
: LivenessResult(arena) {
|
||||
*this = ::std::move(from);
|
||||
}
|
||||
const ::google::protobuf::MessageLite::ClassData* GetClassData()
|
||||
const final;
|
||||
|
||||
public:
|
||||
::google::protobuf::Metadata GetMetadata() const final;
|
||||
// nested types ----------------------------------------------------
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
enum : int {
|
||||
kPeerNodeIdFieldNumber = 1,
|
||||
kDiscoverLatencyFieldNumber = 2,
|
||||
kPingLatencyFieldNumber = 3,
|
||||
};
|
||||
// bytes peer_node_id = 1;
|
||||
void clear_peer_node_id() ;
|
||||
const std::string& peer_node_id() const;
|
||||
template <typename Arg_ = const std::string&, typename... Args_>
|
||||
void set_peer_node_id(Arg_&& arg, Args_... args);
|
||||
std::string* mutable_peer_node_id();
|
||||
PROTOBUF_NODISCARD std::string* release_peer_node_id();
|
||||
void set_allocated_peer_node_id(std::string* value);
|
||||
|
||||
private:
|
||||
const std::string& _internal_peer_node_id() const;
|
||||
inline PROTOBUF_ALWAYS_INLINE void _internal_set_peer_node_id(
|
||||
const std::string& value);
|
||||
std::string* _internal_mutable_peer_node_id();
|
||||
|
||||
public:
|
||||
// uint64 discover_latency = 2;
|
||||
void clear_discover_latency() ;
|
||||
::uint64_t discover_latency() const;
|
||||
void set_discover_latency(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_discover_latency() const;
|
||||
void _internal_set_discover_latency(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 ping_latency = 3;
|
||||
void clear_ping_latency() ;
|
||||
::uint64_t ping_latency() const;
|
||||
void set_ping_latency(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_ping_latency() const;
|
||||
void _internal_set_ping_latency(::uint64_t value);
|
||||
|
||||
public:
|
||||
// @@protoc_insertion_point(class_scope:tari.rpc.LivenessResult)
|
||||
private:
|
||||
class _Internal;
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<
|
||||
2, 3, 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);
|
||||
::google::protobuf::internal::ArenaStringPtr peer_node_id_;
|
||||
::uint64_t discover_latency_;
|
||||
::uint64_t ping_latency_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
friend struct ::TableStruct_base_5fnode_2eproto;
|
||||
};
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
class ListHeadersRequest final : public ::google::protobuf::Message
|
||||
/* @@protoc_insertion_point(class_definition:tari.rpc.ListHeadersRequest) */ {
|
||||
public:
|
||||
@@ -8495,14 +8719,34 @@ class GetNetworkStateResponse final : public ::google::protobuf::Message
|
||||
|
||||
// accessors -------------------------------------------------------
|
||||
enum : int {
|
||||
kLivenessResultsFieldNumber = 9,
|
||||
kMetadataFieldNumber = 1,
|
||||
kBaseNodeStateFieldNumber = 3,
|
||||
kInitialSyncAchievedFieldNumber = 2,
|
||||
kFailedCheckpointsFieldNumber = 4,
|
||||
kRewardFieldNumber = 5,
|
||||
kSha3XEstimatedHashRateFieldNumber = 6,
|
||||
kRandomxEstimatedHashRateFieldNumber = 7,
|
||||
kMoneroRandomxEstimatedHashRateFieldNumber = 7,
|
||||
kNumConnectionsFieldNumber = 8,
|
||||
kTariRandomxEstimatedHashRateFieldNumber = 10,
|
||||
};
|
||||
// repeated .tari.rpc.LivenessResult liveness_results = 9;
|
||||
int liveness_results_size() const;
|
||||
private:
|
||||
int _internal_liveness_results_size() const;
|
||||
|
||||
public:
|
||||
void clear_liveness_results() ;
|
||||
::tari::rpc::LivenessResult* mutable_liveness_results(int index);
|
||||
::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>* mutable_liveness_results();
|
||||
|
||||
private:
|
||||
const ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>& _internal_liveness_results() const;
|
||||
::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>* _internal_mutable_liveness_results();
|
||||
public:
|
||||
const ::tari::rpc::LivenessResult& liveness_results(int index) const;
|
||||
::tari::rpc::LivenessResult* add_liveness_results();
|
||||
const ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>& liveness_results() const;
|
||||
// .tari.rpc.MetaData metadata = 1;
|
||||
bool has_metadata() const;
|
||||
void clear_metadata() ;
|
||||
@@ -8568,14 +8812,34 @@ class GetNetworkStateResponse final : public ::google::protobuf::Message
|
||||
void _internal_set_sha3x_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 randomx_estimated_hash_rate = 7;
|
||||
void clear_randomx_estimated_hash_rate() ;
|
||||
::uint64_t randomx_estimated_hash_rate() const;
|
||||
void set_randomx_estimated_hash_rate(::uint64_t value);
|
||||
// uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
void clear_monero_randomx_estimated_hash_rate() ;
|
||||
::uint64_t monero_randomx_estimated_hash_rate() const;
|
||||
void set_monero_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_randomx_estimated_hash_rate(::uint64_t value);
|
||||
::uint64_t _internal_monero_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_monero_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 num_connections = 8;
|
||||
void clear_num_connections() ;
|
||||
::uint64_t num_connections() const;
|
||||
void set_num_connections(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_num_connections() const;
|
||||
void _internal_set_num_connections(::uint64_t value);
|
||||
|
||||
public:
|
||||
// uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
void clear_tari_randomx_estimated_hash_rate() ;
|
||||
::uint64_t tari_randomx_estimated_hash_rate() const;
|
||||
void set_tari_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
private:
|
||||
::uint64_t _internal_tari_randomx_estimated_hash_rate() const;
|
||||
void _internal_set_tari_randomx_estimated_hash_rate(::uint64_t value);
|
||||
|
||||
public:
|
||||
// @@protoc_insertion_point(class_scope:tari.rpc.GetNetworkStateResponse)
|
||||
@@ -8583,7 +8847,7 @@ class GetNetworkStateResponse final : public ::google::protobuf::Message
|
||||
class _Internal;
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<
|
||||
3, 7, 1,
|
||||
4, 10, 2,
|
||||
0, 2>
|
||||
_table_;
|
||||
friend class ::google::protobuf::MessageLite;
|
||||
@@ -8601,13 +8865,16 @@ class GetNetworkStateResponse final : public ::google::protobuf::Message
|
||||
::google::protobuf::Arena* arena, const Impl_& from);
|
||||
::google::protobuf::internal::HasBits<1> _has_bits_;
|
||||
mutable ::google::protobuf::internal::CachedSize _cached_size_;
|
||||
::google::protobuf::RepeatedPtrField< ::tari::rpc::LivenessResult > liveness_results_;
|
||||
::tari::rpc::MetaData* metadata_;
|
||||
int base_node_state_;
|
||||
bool initial_sync_achieved_;
|
||||
bool failed_checkpoints_;
|
||||
::uint64_t reward_;
|
||||
::uint64_t sha3x_estimated_hash_rate_;
|
||||
::uint64_t randomx_estimated_hash_rate_;
|
||||
::uint64_t monero_randomx_estimated_hash_rate_;
|
||||
::uint64_t num_connections_;
|
||||
::uint64_t tari_randomx_estimated_hash_rate_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
};
|
||||
union { Impl_ _impl_; };
|
||||
@@ -11085,6 +11352,7 @@ class GetNewBlockResult final : public ::google::protobuf::Message
|
||||
kBlockHashFieldNumber = 1,
|
||||
kMergeMiningHashFieldNumber = 3,
|
||||
kTariUniqueIdFieldNumber = 4,
|
||||
kVmKeyFieldNumber = 6,
|
||||
kBlockFieldNumber = 2,
|
||||
kMinerDataFieldNumber = 5,
|
||||
};
|
||||
@@ -11135,6 +11403,22 @@ class GetNewBlockResult final : public ::google::protobuf::Message
|
||||
const std::string& value);
|
||||
std::string* _internal_mutable_tari_unique_id();
|
||||
|
||||
public:
|
||||
// bytes vm_key = 6;
|
||||
void clear_vm_key() ;
|
||||
const std::string& vm_key() const;
|
||||
template <typename Arg_ = const std::string&, typename... Args_>
|
||||
void set_vm_key(Arg_&& arg, Args_... args);
|
||||
std::string* mutable_vm_key();
|
||||
PROTOBUF_NODISCARD std::string* release_vm_key();
|
||||
void set_allocated_vm_key(std::string* value);
|
||||
|
||||
private:
|
||||
const std::string& _internal_vm_key() const;
|
||||
inline PROTOBUF_ALWAYS_INLINE void _internal_set_vm_key(
|
||||
const std::string& value);
|
||||
std::string* _internal_mutable_vm_key();
|
||||
|
||||
public:
|
||||
// .tari.rpc.Block block = 2;
|
||||
bool has_block() const;
|
||||
@@ -11171,7 +11455,7 @@ class GetNewBlockResult final : public ::google::protobuf::Message
|
||||
class _Internal;
|
||||
friend class ::google::protobuf::internal::TcParser;
|
||||
static const ::google::protobuf::internal::TcParseTable<
|
||||
3, 5, 2,
|
||||
3, 6, 2,
|
||||
0, 2>
|
||||
_table_;
|
||||
friend class ::google::protobuf::MessageLite;
|
||||
@@ -11192,6 +11476,7 @@ class GetNewBlockResult final : public ::google::protobuf::Message
|
||||
::google::protobuf::internal::ArenaStringPtr block_hash_;
|
||||
::google::protobuf::internal::ArenaStringPtr merge_mining_hash_;
|
||||
::google::protobuf::internal::ArenaStringPtr tari_unique_id_;
|
||||
::google::protobuf::internal::ArenaStringPtr vm_key_;
|
||||
::tari::rpc::Block* block_;
|
||||
::tari::rpc::MinerData* miner_data_;
|
||||
PROTOBUF_TSAN_DECLARE_MEMBER
|
||||
@@ -14188,26 +14473,48 @@ inline void NetworkDifficultyResponse::_internal_set_sha3x_estimated_hash_rate(:
|
||||
_impl_.sha3x_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 randomx_estimated_hash_rate = 7;
|
||||
inline void NetworkDifficultyResponse::clear_randomx_estimated_hash_rate() {
|
||||
// uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
inline void NetworkDifficultyResponse::clear_monero_randomx_estimated_hash_rate() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
_impl_.monero_randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t NetworkDifficultyResponse::randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.NetworkDifficultyResponse.randomx_estimated_hash_rate)
|
||||
return _internal_randomx_estimated_hash_rate();
|
||||
inline ::uint64_t NetworkDifficultyResponse::monero_randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.NetworkDifficultyResponse.monero_randomx_estimated_hash_rate)
|
||||
return _internal_monero_randomx_estimated_hash_rate();
|
||||
}
|
||||
inline void NetworkDifficultyResponse::set_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.NetworkDifficultyResponse.randomx_estimated_hash_rate)
|
||||
inline void NetworkDifficultyResponse::set_monero_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_monero_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.NetworkDifficultyResponse.monero_randomx_estimated_hash_rate)
|
||||
}
|
||||
inline ::uint64_t NetworkDifficultyResponse::_internal_randomx_estimated_hash_rate() const {
|
||||
inline ::uint64_t NetworkDifficultyResponse::_internal_monero_randomx_estimated_hash_rate() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.randomx_estimated_hash_rate_;
|
||||
return _impl_.monero_randomx_estimated_hash_rate_;
|
||||
}
|
||||
inline void NetworkDifficultyResponse::_internal_set_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
inline void NetworkDifficultyResponse::_internal_set_monero_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.randomx_estimated_hash_rate_ = value;
|
||||
_impl_.monero_randomx_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
inline void NetworkDifficultyResponse::clear_tari_randomx_estimated_hash_rate() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.tari_randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t NetworkDifficultyResponse::tari_randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.NetworkDifficultyResponse.tari_randomx_estimated_hash_rate)
|
||||
return _internal_tari_randomx_estimated_hash_rate();
|
||||
}
|
||||
inline void NetworkDifficultyResponse::set_tari_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_tari_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.NetworkDifficultyResponse.tari_randomx_estimated_hash_rate)
|
||||
}
|
||||
inline ::uint64_t NetworkDifficultyResponse::_internal_tari_randomx_estimated_hash_rate() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.tari_randomx_estimated_hash_rate_;
|
||||
}
|
||||
inline void NetworkDifficultyResponse::_internal_set_tari_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.tari_randomx_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 num_coinbases = 8;
|
||||
@@ -14338,29 +14645,51 @@ NetworkDifficultyResponse::_internal_mutable_coinbase_extras() {
|
||||
|
||||
// ValueAtHeightResponse
|
||||
|
||||
// uint64 value = 1;
|
||||
inline void ValueAtHeightResponse::clear_value() {
|
||||
// uint64 circulating_supply = 1;
|
||||
inline void ValueAtHeightResponse::clear_circulating_supply() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.value_ = ::uint64_t{0u};
|
||||
_impl_.circulating_supply_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t ValueAtHeightResponse::value() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.ValueAtHeightResponse.value)
|
||||
return _internal_value();
|
||||
inline ::uint64_t ValueAtHeightResponse::circulating_supply() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.ValueAtHeightResponse.circulating_supply)
|
||||
return _internal_circulating_supply();
|
||||
}
|
||||
inline void ValueAtHeightResponse::set_value(::uint64_t value) {
|
||||
_internal_set_value(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.ValueAtHeightResponse.value)
|
||||
inline void ValueAtHeightResponse::set_circulating_supply(::uint64_t value) {
|
||||
_internal_set_circulating_supply(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.ValueAtHeightResponse.circulating_supply)
|
||||
}
|
||||
inline ::uint64_t ValueAtHeightResponse::_internal_value() const {
|
||||
inline ::uint64_t ValueAtHeightResponse::_internal_circulating_supply() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.value_;
|
||||
return _impl_.circulating_supply_;
|
||||
}
|
||||
inline void ValueAtHeightResponse::_internal_set_value(::uint64_t value) {
|
||||
inline void ValueAtHeightResponse::_internal_set_circulating_supply(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.value_ = value;
|
||||
_impl_.circulating_supply_ = value;
|
||||
}
|
||||
|
||||
// uint64 height = 2;
|
||||
// uint64 spendable_supply = 2;
|
||||
inline void ValueAtHeightResponse::clear_spendable_supply() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.spendable_supply_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t ValueAtHeightResponse::spendable_supply() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.ValueAtHeightResponse.spendable_supply)
|
||||
return _internal_spendable_supply();
|
||||
}
|
||||
inline void ValueAtHeightResponse::set_spendable_supply(::uint64_t value) {
|
||||
_internal_set_spendable_supply(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.ValueAtHeightResponse.spendable_supply)
|
||||
}
|
||||
inline ::uint64_t ValueAtHeightResponse::_internal_spendable_supply() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.spendable_supply_;
|
||||
}
|
||||
inline void ValueAtHeightResponse::_internal_set_spendable_supply(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.spendable_supply_ = value;
|
||||
}
|
||||
|
||||
// uint64 height = 3;
|
||||
inline void ValueAtHeightResponse::clear_height() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.height_ = ::uint64_t{0u};
|
||||
@@ -15973,6 +16302,56 @@ inline void GetNewBlockResult::set_allocated_miner_data(::tari::rpc::MinerData*
|
||||
// @@protoc_insertion_point(field_set_allocated:tari.rpc.GetNewBlockResult.miner_data)
|
||||
}
|
||||
|
||||
// bytes vm_key = 6;
|
||||
inline void GetNewBlockResult::clear_vm_key() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.vm_key_.ClearToEmpty();
|
||||
}
|
||||
inline const std::string& GetNewBlockResult::vm_key() const
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNewBlockResult.vm_key)
|
||||
return _internal_vm_key();
|
||||
}
|
||||
template <typename Arg_, typename... Args_>
|
||||
inline PROTOBUF_ALWAYS_INLINE void GetNewBlockResult::set_vm_key(Arg_&& arg,
|
||||
Args_... args) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.vm_key_.SetBytes(static_cast<Arg_&&>(arg), args..., GetArena());
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.GetNewBlockResult.vm_key)
|
||||
}
|
||||
inline std::string* GetNewBlockResult::mutable_vm_key() ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
std::string* _s = _internal_mutable_vm_key();
|
||||
// @@protoc_insertion_point(field_mutable:tari.rpc.GetNewBlockResult.vm_key)
|
||||
return _s;
|
||||
}
|
||||
inline const std::string& GetNewBlockResult::_internal_vm_key() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.vm_key_.Get();
|
||||
}
|
||||
inline void GetNewBlockResult::_internal_set_vm_key(const std::string& value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.vm_key_.Set(value, GetArena());
|
||||
}
|
||||
inline std::string* GetNewBlockResult::_internal_mutable_vm_key() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
return _impl_.vm_key_.Mutable( GetArena());
|
||||
}
|
||||
inline std::string* GetNewBlockResult::release_vm_key() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
// @@protoc_insertion_point(field_release:tari.rpc.GetNewBlockResult.vm_key)
|
||||
return _impl_.vm_key_.Release();
|
||||
}
|
||||
inline void GetNewBlockResult::set_allocated_vm_key(std::string* value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.vm_key_.SetAllocated(value, GetArena());
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (_impl_.vm_key_.IsDefault()) {
|
||||
_impl_.vm_key_.Set("", GetArena());
|
||||
}
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
// @@protoc_insertion_point(field_set_allocated:tari.rpc.GetNewBlockResult.vm_key)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// GetNewBlockBlobResult
|
||||
@@ -18368,26 +18747,217 @@ inline void GetNetworkStateResponse::_internal_set_sha3x_estimated_hash_rate(::u
|
||||
_impl_.sha3x_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 randomx_estimated_hash_rate = 7;
|
||||
inline void GetNetworkStateResponse::clear_randomx_estimated_hash_rate() {
|
||||
// uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
inline void GetNetworkStateResponse::clear_monero_randomx_estimated_hash_rate() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
_impl_.monero_randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNetworkStateResponse.randomx_estimated_hash_rate)
|
||||
return _internal_randomx_estimated_hash_rate();
|
||||
inline ::uint64_t GetNetworkStateResponse::monero_randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNetworkStateResponse.monero_randomx_estimated_hash_rate)
|
||||
return _internal_monero_randomx_estimated_hash_rate();
|
||||
}
|
||||
inline void GetNetworkStateResponse::set_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.GetNetworkStateResponse.randomx_estimated_hash_rate)
|
||||
inline void GetNetworkStateResponse::set_monero_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_monero_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.GetNetworkStateResponse.monero_randomx_estimated_hash_rate)
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::_internal_randomx_estimated_hash_rate() const {
|
||||
inline ::uint64_t GetNetworkStateResponse::_internal_monero_randomx_estimated_hash_rate() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.randomx_estimated_hash_rate_;
|
||||
return _impl_.monero_randomx_estimated_hash_rate_;
|
||||
}
|
||||
inline void GetNetworkStateResponse::_internal_set_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
inline void GetNetworkStateResponse::_internal_set_monero_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.randomx_estimated_hash_rate_ = value;
|
||||
_impl_.monero_randomx_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
inline void GetNetworkStateResponse::clear_tari_randomx_estimated_hash_rate() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.tari_randomx_estimated_hash_rate_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::tari_randomx_estimated_hash_rate() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNetworkStateResponse.tari_randomx_estimated_hash_rate)
|
||||
return _internal_tari_randomx_estimated_hash_rate();
|
||||
}
|
||||
inline void GetNetworkStateResponse::set_tari_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
_internal_set_tari_randomx_estimated_hash_rate(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.GetNetworkStateResponse.tari_randomx_estimated_hash_rate)
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::_internal_tari_randomx_estimated_hash_rate() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.tari_randomx_estimated_hash_rate_;
|
||||
}
|
||||
inline void GetNetworkStateResponse::_internal_set_tari_randomx_estimated_hash_rate(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.tari_randomx_estimated_hash_rate_ = value;
|
||||
}
|
||||
|
||||
// uint64 num_connections = 8;
|
||||
inline void GetNetworkStateResponse::clear_num_connections() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.num_connections_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::num_connections() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNetworkStateResponse.num_connections)
|
||||
return _internal_num_connections();
|
||||
}
|
||||
inline void GetNetworkStateResponse::set_num_connections(::uint64_t value) {
|
||||
_internal_set_num_connections(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.GetNetworkStateResponse.num_connections)
|
||||
}
|
||||
inline ::uint64_t GetNetworkStateResponse::_internal_num_connections() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.num_connections_;
|
||||
}
|
||||
inline void GetNetworkStateResponse::_internal_set_num_connections(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.num_connections_ = value;
|
||||
}
|
||||
|
||||
// repeated .tari.rpc.LivenessResult liveness_results = 9;
|
||||
inline int GetNetworkStateResponse::_internal_liveness_results_size() const {
|
||||
return _internal_liveness_results().size();
|
||||
}
|
||||
inline int GetNetworkStateResponse::liveness_results_size() const {
|
||||
return _internal_liveness_results_size();
|
||||
}
|
||||
inline void GetNetworkStateResponse::clear_liveness_results() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.liveness_results_.Clear();
|
||||
}
|
||||
inline ::tari::rpc::LivenessResult* GetNetworkStateResponse::mutable_liveness_results(int index)
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_mutable:tari.rpc.GetNetworkStateResponse.liveness_results)
|
||||
return _internal_mutable_liveness_results()->Mutable(index);
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>* GetNetworkStateResponse::mutable_liveness_results()
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_mutable_list:tari.rpc.GetNetworkStateResponse.liveness_results)
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
return _internal_mutable_liveness_results();
|
||||
}
|
||||
inline const ::tari::rpc::LivenessResult& GetNetworkStateResponse::liveness_results(int index) const
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.GetNetworkStateResponse.liveness_results)
|
||||
return _internal_liveness_results().Get(index);
|
||||
}
|
||||
inline ::tari::rpc::LivenessResult* GetNetworkStateResponse::add_liveness_results() ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
::tari::rpc::LivenessResult* _add = _internal_mutable_liveness_results()->Add();
|
||||
// @@protoc_insertion_point(field_add:tari.rpc.GetNetworkStateResponse.liveness_results)
|
||||
return _add;
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>& GetNetworkStateResponse::liveness_results() const
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_list:tari.rpc.GetNetworkStateResponse.liveness_results)
|
||||
return _internal_liveness_results();
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>&
|
||||
GetNetworkStateResponse::_internal_liveness_results() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.liveness_results_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField<::tari::rpc::LivenessResult>*
|
||||
GetNetworkStateResponse::_internal_mutable_liveness_results() {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return &_impl_.liveness_results_;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
|
||||
// LivenessResult
|
||||
|
||||
// bytes peer_node_id = 1;
|
||||
inline void LivenessResult::clear_peer_node_id() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.peer_node_id_.ClearToEmpty();
|
||||
}
|
||||
inline const std::string& LivenessResult::peer_node_id() const
|
||||
ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.LivenessResult.peer_node_id)
|
||||
return _internal_peer_node_id();
|
||||
}
|
||||
template <typename Arg_, typename... Args_>
|
||||
inline PROTOBUF_ALWAYS_INLINE void LivenessResult::set_peer_node_id(Arg_&& arg,
|
||||
Args_... args) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.peer_node_id_.SetBytes(static_cast<Arg_&&>(arg), args..., GetArena());
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.LivenessResult.peer_node_id)
|
||||
}
|
||||
inline std::string* LivenessResult::mutable_peer_node_id() ABSL_ATTRIBUTE_LIFETIME_BOUND {
|
||||
std::string* _s = _internal_mutable_peer_node_id();
|
||||
// @@protoc_insertion_point(field_mutable:tari.rpc.LivenessResult.peer_node_id)
|
||||
return _s;
|
||||
}
|
||||
inline const std::string& LivenessResult::_internal_peer_node_id() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.peer_node_id_.Get();
|
||||
}
|
||||
inline void LivenessResult::_internal_set_peer_node_id(const std::string& value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.peer_node_id_.Set(value, GetArena());
|
||||
}
|
||||
inline std::string* LivenessResult::_internal_mutable_peer_node_id() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
return _impl_.peer_node_id_.Mutable( GetArena());
|
||||
}
|
||||
inline std::string* LivenessResult::release_peer_node_id() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
// @@protoc_insertion_point(field_release:tari.rpc.LivenessResult.peer_node_id)
|
||||
return _impl_.peer_node_id_.Release();
|
||||
}
|
||||
inline void LivenessResult::set_allocated_peer_node_id(std::string* value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.peer_node_id_.SetAllocated(value, GetArena());
|
||||
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
if (_impl_.peer_node_id_.IsDefault()) {
|
||||
_impl_.peer_node_id_.Set("", GetArena());
|
||||
}
|
||||
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
|
||||
// @@protoc_insertion_point(field_set_allocated:tari.rpc.LivenessResult.peer_node_id)
|
||||
}
|
||||
|
||||
// uint64 discover_latency = 2;
|
||||
inline void LivenessResult::clear_discover_latency() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.discover_latency_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t LivenessResult::discover_latency() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.LivenessResult.discover_latency)
|
||||
return _internal_discover_latency();
|
||||
}
|
||||
inline void LivenessResult::set_discover_latency(::uint64_t value) {
|
||||
_internal_set_discover_latency(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.LivenessResult.discover_latency)
|
||||
}
|
||||
inline ::uint64_t LivenessResult::_internal_discover_latency() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.discover_latency_;
|
||||
}
|
||||
inline void LivenessResult::_internal_set_discover_latency(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.discover_latency_ = value;
|
||||
}
|
||||
|
||||
// uint64 ping_latency = 3;
|
||||
inline void LivenessResult::clear_ping_latency() {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.ping_latency_ = ::uint64_t{0u};
|
||||
}
|
||||
inline ::uint64_t LivenessResult::ping_latency() const {
|
||||
// @@protoc_insertion_point(field_get:tari.rpc.LivenessResult.ping_latency)
|
||||
return _internal_ping_latency();
|
||||
}
|
||||
inline void LivenessResult::set_ping_latency(::uint64_t value) {
|
||||
_internal_set_ping_latency(value);
|
||||
// @@protoc_insertion_point(field_set:tari.rpc.LivenessResult.ping_latency)
|
||||
}
|
||||
inline ::uint64_t LivenessResult::_internal_ping_latency() const {
|
||||
PROTOBUF_TSAN_READ(&_impl_._tsan_detect_race);
|
||||
return _impl_.ping_latency_;
|
||||
}
|
||||
inline void LivenessResult::_internal_set_ping_latency(::uint64_t value) {
|
||||
PROTOBUF_TSAN_WRITE(&_impl_._tsan_detect_race);
|
||||
_impl_.ping_latency_ = value;
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
+21
-4
@@ -218,15 +218,17 @@ message NetworkDifficultyResponse {
|
||||
uint64 timestamp = 4;
|
||||
uint64 pow_algo = 5;
|
||||
uint64 sha3x_estimated_hash_rate = 6;
|
||||
uint64 randomx_estimated_hash_rate = 7;
|
||||
uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
uint64 num_coinbases = 8;
|
||||
repeated bytes coinbase_extras = 9;
|
||||
}
|
||||
|
||||
// A generic single value response for a specific height
|
||||
message ValueAtHeightResponse {
|
||||
uint64 value= 1;
|
||||
uint64 height = 2;
|
||||
uint64 circulating_supply = 1;
|
||||
uint64 spendable_supply = 2;
|
||||
uint64 height = 3;
|
||||
}
|
||||
|
||||
// A generic uint value
|
||||
@@ -382,6 +384,7 @@ message GetNewBlockResult{
|
||||
bytes merge_mining_hash =3;
|
||||
bytes tari_unique_id =4;
|
||||
MinerData miner_data = 5;
|
||||
bytes vm_key = 6;
|
||||
}
|
||||
|
||||
// This is the message that is returned for a miner after it asks for a new block.
|
||||
@@ -539,6 +542,20 @@ message GetNetworkStateResponse {
|
||||
// estimate sha3x hash rate
|
||||
uint64 sha3x_estimated_hash_rate = 6;
|
||||
// estimate randomx hash rate
|
||||
uint64 randomx_estimated_hash_rate = 7;
|
||||
uint64 monero_randomx_estimated_hash_rate = 7;
|
||||
uint64 tari_randomx_estimated_hash_rate = 10;
|
||||
// number of connections
|
||||
uint64 num_connections = 8;
|
||||
//liveness results
|
||||
repeated LivenessResult liveness_results = 9;
|
||||
}
|
||||
|
||||
message LivenessResult{
|
||||
// node id
|
||||
bytes peer_node_id = 1;
|
||||
// time to discover
|
||||
uint64 discover_latency = 2;
|
||||
// Dial latency
|
||||
uint64 ping_latency = 3;
|
||||
}
|
||||
|
||||
|
||||
+21
-20
@@ -371,22 +371,22 @@ const char descriptor_table_protodef_block_2eproto[] ABSL_ATTRIBUTE_SECTION_VARI
|
||||
"tal_script_offset\030\017 \001(\014\022\031\n\021validator_nod"
|
||||
"e_mr\030\020 \001(\014\022\033\n\023validator_node_size\030\021 \001(\004\""
|
||||
"1\n\013ProofOfWork\022\020\n\010pow_algo\030\001 \001(\004\022\020\n\010pow_"
|
||||
"data\030\004 \001(\014\"o\n\007PowAlgo\022,\n\010pow_algo\030\001 \001(\0162"
|
||||
"\032.tari.rpc.PowAlgo.PowAlgos\"6\n\010PowAlgos\022"
|
||||
"\025\n\021POW_ALGOS_RANDOMX\020\000\022\023\n\017POW_ALGOS_SHA3"
|
||||
"X\020\001\"U\n\005Block\022%\n\006header\030\001 \001(\0132\025.tari.rpc."
|
||||
"BlockHeader\022%\n\004body\030\002 \001(\0132\027.tari.rpc.Agg"
|
||||
"regateBody\"H\n\017HistoricalBlock\022\025\n\rconfirm"
|
||||
"ations\030\001 \001(\004\022\036\n\005block\030\002 \001(\0132\017.tari.rpc.B"
|
||||
"lock\"\252\001\n\026NewBlockHeaderTemplate\022\017\n\007versi"
|
||||
"on\030\001 \001(\r\022\016\n\006height\030\002 \001(\004\022\021\n\tprev_hash\030\003 "
|
||||
"\001(\014\022\033\n\023total_kernel_offset\030\004 \001(\014\022\"\n\003pow\030"
|
||||
"\005 \001(\0132\025.tari.rpc.ProofOfWork\022\033\n\023total_sc"
|
||||
"ript_offset\030\007 \001(\014\"\207\001\n\020NewBlockTemplate\0220"
|
||||
"\n\006header\030\001 \001(\0132 .tari.rpc.NewBlockHeader"
|
||||
"Template\022%\n\004body\030\002 \001(\0132\027.tari.rpc.Aggreg"
|
||||
"ateBody\022\032\n\022is_mempool_in_sync\030\003 \001(\010b\006pro"
|
||||
"to3"
|
||||
"data\030\004 \001(\014\"\210\001\n\007PowAlgo\022,\n\010pow_algo\030\001 \001(\016"
|
||||
"2\032.tari.rpc.PowAlgo.PowAlgos\"O\n\010PowAlgos"
|
||||
"\022\026\n\022POW_ALGOS_RANDOMXM\020\000\022\023\n\017POW_ALGOS_SH"
|
||||
"A3X\020\001\022\026\n\022POW_ALGOS_RANDOMXT\020\002\"U\n\005Block\022%"
|
||||
"\n\006header\030\001 \001(\0132\025.tari.rpc.BlockHeader\022%\n"
|
||||
"\004body\030\002 \001(\0132\027.tari.rpc.AggregateBody\"H\n\017"
|
||||
"HistoricalBlock\022\025\n\rconfirmations\030\001 \001(\004\022\036"
|
||||
"\n\005block\030\002 \001(\0132\017.tari.rpc.Block\"\252\001\n\026NewBl"
|
||||
"ockHeaderTemplate\022\017\n\007version\030\001 \001(\r\022\016\n\006he"
|
||||
"ight\030\002 \001(\004\022\021\n\tprev_hash\030\003 \001(\014\022\033\n\023total_k"
|
||||
"ernel_offset\030\004 \001(\014\022\"\n\003pow\030\005 \001(\0132\025.tari.r"
|
||||
"pc.ProofOfWork\022\033\n\023total_script_offset\030\007 "
|
||||
"\001(\014\"\207\001\n\020NewBlockTemplate\0220\n\006header\030\001 \001(\013"
|
||||
"2 .tari.rpc.NewBlockHeaderTemplate\022%\n\004bo"
|
||||
"dy\030\002 \001(\0132\027.tari.rpc.AggregateBody\022\032\n\022is_"
|
||||
"mempool_in_sync\030\003 \001(\010b\006proto3"
|
||||
};
|
||||
static const ::_pbi::DescriptorTable* const descriptor_table_block_2eproto_deps[1] =
|
||||
{
|
||||
@@ -396,7 +396,7 @@ static ::absl::once_flag descriptor_table_block_2eproto_once;
|
||||
const ::_pbi::DescriptorTable descriptor_table_block_2eproto = {
|
||||
false,
|
||||
false,
|
||||
1083,
|
||||
1109,
|
||||
descriptor_table_protodef_block_2eproto,
|
||||
"block.proto",
|
||||
&descriptor_table_block_2eproto_once,
|
||||
@@ -432,15 +432,16 @@ const ::google::protobuf::EnumDescriptor* PowAlgo_PowAlgos_descriptor() {
|
||||
return file_level_enum_descriptors_block_2eproto[0];
|
||||
}
|
||||
PROTOBUF_CONSTINIT const uint32_t PowAlgo_PowAlgos_internal_data_[] = {
|
||||
131072u, 0u, };
|
||||
196608u, 0u, };
|
||||
bool PowAlgo_PowAlgos_IsValid(int value) {
|
||||
return 0 <= value && value <= 1;
|
||||
return 0 <= value && value <= 2;
|
||||
}
|
||||
#if (__cplusplus < 201703) && \
|
||||
(!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
|
||||
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::POW_ALGOS_RANDOMX;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::POW_ALGOS_RANDOMXM;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::POW_ALGOS_SHA3X;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::POW_ALGOS_RANDOMXT;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::PowAlgos_MIN;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo::PowAlgos_MAX;
|
||||
constexpr int PowAlgo::PowAlgos_ARRAYSIZE;
|
||||
|
||||
+7
-5
@@ -84,8 +84,9 @@ namespace protobuf {
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
enum PowAlgo_PowAlgos : int {
|
||||
PowAlgo_PowAlgos_POW_ALGOS_RANDOMX = 0,
|
||||
PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM = 0,
|
||||
PowAlgo_PowAlgos_POW_ALGOS_SHA3X = 1,
|
||||
PowAlgo_PowAlgos_POW_ALGOS_RANDOMXT = 2,
|
||||
PowAlgo_PowAlgos_PowAlgo_PowAlgos_INT_MIN_SENTINEL_DO_NOT_USE_ =
|
||||
std::numeric_limits<::int32_t>::min(),
|
||||
PowAlgo_PowAlgos_PowAlgo_PowAlgos_INT_MAX_SENTINEL_DO_NOT_USE_ =
|
||||
@@ -95,8 +96,8 @@ enum PowAlgo_PowAlgos : int {
|
||||
bool PowAlgo_PowAlgos_IsValid(int value);
|
||||
extern const uint32_t PowAlgo_PowAlgos_internal_data_[];
|
||||
constexpr PowAlgo_PowAlgos PowAlgo_PowAlgos_PowAlgos_MIN = static_cast<PowAlgo_PowAlgos>(0);
|
||||
constexpr PowAlgo_PowAlgos PowAlgo_PowAlgos_PowAlgos_MAX = static_cast<PowAlgo_PowAlgos>(1);
|
||||
constexpr int PowAlgo_PowAlgos_PowAlgos_ARRAYSIZE = 1 + 1;
|
||||
constexpr PowAlgo_PowAlgos PowAlgo_PowAlgos_PowAlgos_MAX = static_cast<PowAlgo_PowAlgos>(2);
|
||||
constexpr int PowAlgo_PowAlgos_PowAlgos_ARRAYSIZE = 2 + 1;
|
||||
const ::google::protobuf::EnumDescriptor*
|
||||
PowAlgo_PowAlgos_descriptor();
|
||||
template <typename T>
|
||||
@@ -109,7 +110,7 @@ const std::string& PowAlgo_PowAlgos_Name(T value) {
|
||||
template <>
|
||||
inline const std::string& PowAlgo_PowAlgos_Name(PowAlgo_PowAlgos value) {
|
||||
return ::google::protobuf::internal::NameOfDenseEnum<PowAlgo_PowAlgos_descriptor,
|
||||
0, 1>(
|
||||
0, 2>(
|
||||
static_cast<int>(value));
|
||||
}
|
||||
inline bool PowAlgo_PowAlgos_Parse(absl::string_view name, PowAlgo_PowAlgos* value) {
|
||||
@@ -430,8 +431,9 @@ class PowAlgo final : public ::google::protobuf::Message
|
||||
::google::protobuf::Metadata GetMetadata() const final;
|
||||
// nested types ----------------------------------------------------
|
||||
using PowAlgos = PowAlgo_PowAlgos;
|
||||
static constexpr PowAlgos POW_ALGOS_RANDOMX = PowAlgo_PowAlgos_POW_ALGOS_RANDOMX;
|
||||
static constexpr PowAlgos POW_ALGOS_RANDOMXM = PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM;
|
||||
static constexpr PowAlgos POW_ALGOS_SHA3X = PowAlgo_PowAlgos_POW_ALGOS_SHA3X;
|
||||
static constexpr PowAlgos POW_ALGOS_RANDOMXT = PowAlgo_PowAlgos_POW_ALGOS_RANDOMXT;
|
||||
static inline bool PowAlgos_IsValid(int value) {
|
||||
return PowAlgo_PowAlgos_IsValid(value);
|
||||
}
|
||||
|
||||
+2
-1
@@ -80,8 +80,9 @@ message ProofOfWork {
|
||||
message PowAlgo {
|
||||
// The permitted pow algorithms
|
||||
enum PowAlgos {
|
||||
POW_ALGOS_RANDOMX = 0; // Accessible as `grpc::pow_algo::PowAlgos::Randomx`
|
||||
POW_ALGOS_RANDOMXM = 0; // Accessible as `grpc::pow_algo::PowAlgos::RandomxM`
|
||||
POW_ALGOS_SHA3X = 1; // Accessible as `grpc::pow_algo::PowAlgos::Sha3x`
|
||||
POW_ALGOS_RANDOMXT = 2; // Accessible as `grpc::pow_algo::PowAlgos::RandomxT`
|
||||
}
|
||||
// The pow algo to use
|
||||
PowAlgos pow_algo = 1;
|
||||
|
||||
Vendored
+1
-1
Submodule external/src/cppzmq updated: a371495a91...87ceb2cf17
Vendored
+1
-1
Submodule external/src/curl updated: 06c37f3218...0ab4f7e0e2
Vendored
+1
-1
Submodule external/src/miniupnp updated: 7e28c9f8af...f667d71d6b
@@ -111,8 +111,10 @@ CurlContext::CurlContext(const std::string& address, int port, const std::string
|
||||
(void)ssl_fingerprint;
|
||||
#endif
|
||||
|
||||
const bool is_v6 = (address.find(':') != std::string::npos);
|
||||
|
||||
log::Stream s(buf);
|
||||
s << protocol << address << ':' << port;
|
||||
s << protocol << (is_v6 ? "[" : "") << address << (is_v6 ? "]:" : ":") << port;
|
||||
|
||||
if (!m_req.empty() && (m_req.front() == '/')) {
|
||||
s << m_req.c_str() << '\0';
|
||||
|
||||
@@ -62,6 +62,7 @@ void p2pool_usage()
|
||||
"--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)\n"
|
||||
"--start-mining N Start built-in miner using N threads (any value between 1 and 64)\n"
|
||||
"--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from %d to %d\n"
|
||||
"--nano Connect to p2pool-nano sidechain. Note that it will also change default p2p port from %d to %d\n"
|
||||
"--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)\n"
|
||||
"--rpc-login Specify username[:password] required for Monero RPC server\n"
|
||||
"--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections\n"
|
||||
@@ -88,6 +89,8 @@ void p2pool_usage()
|
||||
p2pool::log::MAX_GLOBAL_LOG_LEVEL,
|
||||
p2pool::DEFAULT_P2P_PORT,
|
||||
p2pool::DEFAULT_P2P_PORT_MINI,
|
||||
p2pool::DEFAULT_P2P_PORT,
|
||||
p2pool::DEFAULT_P2P_PORT_NANO,
|
||||
#ifdef _WIN32
|
||||
"p2pool.exe"
|
||||
#else
|
||||
|
||||
@@ -91,6 +91,9 @@ MergeMiningClientTari::MergeMiningClientTari(p2pool* pool, std::string host, con
|
||||
cArgs.SetInt(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, 1000);
|
||||
cArgs.SetInt(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 10000);
|
||||
|
||||
cArgs.SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, -1);
|
||||
cArgs.SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, -1);
|
||||
|
||||
m_TariNode = new BaseNode::Stub(grpc::CreateCustomChannel(buf, grpc::InsecureChannelCredentials(), cArgs));
|
||||
|
||||
uv_mutex_init_checked(&m_workerLock);
|
||||
@@ -332,7 +335,7 @@ void MergeMiningClientTari::submit_solution(const std::vector<uint8_t>& coinbase
|
||||
}
|
||||
|
||||
ProofOfWork* pow = block.mutable_header()->mutable_pow();
|
||||
pow->set_pow_algo(PowAlgo_PowAlgos_POW_ALGOS_RANDOMX);
|
||||
pow->set_pow_algo(PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM);
|
||||
|
||||
{
|
||||
std::string data;
|
||||
@@ -583,7 +586,7 @@ void MergeMiningClientTari::run()
|
||||
GetNewBlockTemplateWithCoinbasesRequest request{};
|
||||
|
||||
PowAlgo* algo = new PowAlgo();
|
||||
algo->set_pow_algo(PowAlgo_PowAlgos_POW_ALGOS_RANDOMX);
|
||||
algo->set_pow_algo(PowAlgo_PowAlgos_POW_ALGOS_RANDOMXM);
|
||||
|
||||
request.clear_algo();
|
||||
request.set_allocated_algo(algo);
|
||||
|
||||
+5
-1
@@ -47,6 +47,7 @@ LOG_CATEGORY(P2PServer)
|
||||
static constexpr char saved_peer_list_file_name[] = "p2pool_peers.txt";
|
||||
static const char* seed_nodes[] = { "seeds.p2pool.io", "main.p2poolpeers.net", "main.gupax.io", "" };
|
||||
static const char* seed_nodes_mini[] = { "seeds-mini.p2pool.io", "mini.p2poolpeers.net", "mini.gupax.io", "" };
|
||||
static const char* seed_nodes_nano[] = { "seeds-nano.p2pool.io", "nano.p2poolpeers.net", "nano.gupax.io", ""};
|
||||
|
||||
static constexpr int DEFAULT_BACKLOG = 16;
|
||||
static constexpr uint64_t DEFAULT_BAN_TIME = 600;
|
||||
@@ -606,6 +607,9 @@ void P2PServer::load_peer_list()
|
||||
else if (m_pool->side_chain().is_mini()) {
|
||||
load_from_seed_nodes(seed_nodes_mini, DEFAULT_P2P_PORT_MINI);
|
||||
}
|
||||
else if (m_pool->side_chain().is_nano()) {
|
||||
load_from_seed_nodes(seed_nodes_nano, DEFAULT_P2P_PORT_NANO);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally load peers from p2pool_peers.txt
|
||||
@@ -698,7 +702,7 @@ void P2PServer::load_monerod_peer_list()
|
||||
|
||||
#undef ERR_STR
|
||||
|
||||
const int port = m_pool->side_chain().is_mini() ? DEFAULT_P2P_PORT_MINI : DEFAULT_P2P_PORT;
|
||||
const int port = m_pool->side_chain().is_mini() ? DEFAULT_P2P_PORT_MINI : (m_pool->side_chain().is_nano() ? DEFAULT_P2P_PORT_NANO : DEFAULT_P2P_PORT);
|
||||
|
||||
const SizeType n = white_list.Size();
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ static_assert((P2P_BUF_SIZE & (P2P_BUF_SIZE - 1)) == 0, "P2P_BUF_SIZE is not a p
|
||||
static constexpr size_t PEER_LIST_RESPONSE_MAX_PEERS = 16;
|
||||
static constexpr int DEFAULT_P2P_PORT = 37889;
|
||||
static constexpr int DEFAULT_P2P_PORT_MINI = 37888;
|
||||
static constexpr int DEFAULT_P2P_PORT_NANO = 37890;
|
||||
|
||||
static constexpr uint32_t PROTOCOL_VERSION_1_0 = 0x00010000UL;
|
||||
static constexpr uint32_t PROTOCOL_VERSION_1_1 = 0x00010001UL;
|
||||
|
||||
+104
-29
@@ -49,8 +49,6 @@
|
||||
|
||||
LOG_CATEGORY(P2Pool)
|
||||
|
||||
constexpr int BLOCK_HEADERS_REQUIRED = 720;
|
||||
|
||||
constexpr uint64_t SEEDHASH_EPOCH_BLOCKS = 2048;
|
||||
constexpr uint64_t SEEDHASH_EPOCH_LAG = 64;
|
||||
|
||||
@@ -58,6 +56,8 @@ constexpr char FOUND_BLOCKS_FILE[] = "p2pool.blocks";
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
static uint64_t BLOCK_HEADERS_REQUIRED = 720;
|
||||
|
||||
p2pool::p2pool(int argc, char* argv[])
|
||||
: m_stopped(false)
|
||||
, m_updateSeed(true)
|
||||
@@ -78,6 +78,11 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
|
||||
m_params = p;
|
||||
|
||||
// P2Pool-nano requires more Monero blocks for the initial sync
|
||||
if (m_params->m_nano) {
|
||||
BLOCK_HEADERS_REQUIRED = 1440;
|
||||
}
|
||||
|
||||
bkg_jobs_tracker = new BackgroundJobTracker();
|
||||
|
||||
#ifdef WITH_UPNP
|
||||
@@ -175,10 +180,10 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
throw std::exception();
|
||||
}
|
||||
|
||||
m_sideChain = new SideChain(this, type, p->m_mini ? "mini" : nullptr);
|
||||
m_sideChain = new SideChain(this, type, p->m_mini ? "mini" : (p->m_nano ? "nano" : nullptr));
|
||||
|
||||
if (p->m_p2pAddresses.empty()) {
|
||||
const int p2p_port = m_sideChain->is_mini() ? DEFAULT_P2P_PORT_MINI : DEFAULT_P2P_PORT;
|
||||
const int p2p_port = m_sideChain->is_mini() ? DEFAULT_P2P_PORT_MINI : (m_sideChain->is_nano() ? DEFAULT_P2P_PORT_NANO : DEFAULT_P2P_PORT);
|
||||
|
||||
char buf[48] = {};
|
||||
log::Stream s(buf);
|
||||
@@ -1148,7 +1153,7 @@ void p2pool::update_block_template()
|
||||
#endif
|
||||
}
|
||||
|
||||
void p2pool::download_block_headers(uint64_t current_height)
|
||||
void p2pool::download_block_headers1(uint64_t current_height)
|
||||
{
|
||||
const uint64_t seed_height = get_seed_height(current_height);
|
||||
const uint64_t prev_seed_height = (seed_height > SEEDHASH_EPOCH_BLOCKS) ? (seed_height - SEEDHASH_EPOCH_BLOCKS) : 0;
|
||||
@@ -1158,37 +1163,107 @@ void p2pool::download_block_headers(uint64_t current_height)
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
// First download 2 RandomX seeds
|
||||
const uint64_t seed_heights[2] = { prev_seed_height, seed_height };
|
||||
for (uint64_t height : seed_heights) {
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":" << prev_seed_height << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, prev_seed_height, current_height](const char* data, size_t size, double) {
|
||||
ChainMain block;
|
||||
if (parse_block_header(data, size, block)) {
|
||||
// Do it synchronously to make sure stratum and p2p don't start before it's finished
|
||||
m_hasher->set_old_seed(block.id);
|
||||
download_block_headers2(current_height);
|
||||
}
|
||||
else {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << prev_seed_height);
|
||||
download_block_headers1(current_height);
|
||||
}
|
||||
},
|
||||
[this, prev_seed_height, current_height](const char* data, size_t size, double) {
|
||||
if (size > 0) {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << prev_seed_height << ", error " << log::const_buf(data, size));
|
||||
download_block_headers1(current_height);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void p2pool::download_block_headers2(uint64_t current_height)
|
||||
{
|
||||
const uint64_t seed_height = get_seed_height(current_height);
|
||||
|
||||
char buf[log::Stream::BUF_SIZE + 1] = {};
|
||||
log::Stream s(buf);
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":" << seed_height << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, seed_height, current_height](const char* data, size_t size, double) {
|
||||
ChainMain block;
|
||||
if (parse_block_header(data, size, block)) {
|
||||
const uint64_t start_height = (current_height > BLOCK_HEADERS_REQUIRED) ? (current_height - BLOCK_HEADERS_REQUIRED) : 0;
|
||||
download_block_headers3(start_height, current_height);
|
||||
}
|
||||
else {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << seed_height);
|
||||
download_block_headers2(current_height);
|
||||
}
|
||||
},
|
||||
[this, seed_height, current_height](const char* data, size_t size, double) {
|
||||
if (size > 0) {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << seed_height << ", error " << log::const_buf(data, size));
|
||||
download_block_headers2(current_height);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void p2pool::download_block_headers3(uint64_t start_height, uint64_t current_height)
|
||||
{
|
||||
// Workaround the restricted RPC limit
|
||||
constexpr uint64_t RESTRICTED_BLOCK_HEADER_RANGE = 1000;
|
||||
|
||||
if (current_height - start_height > RESTRICTED_BLOCK_HEADER_RANGE + 1) {
|
||||
char buf[log::Stream::BUF_SIZE + 1] = {};
|
||||
log::Stream s(buf);
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
const uint64_t next_height = start_height + RESTRICTED_BLOCK_HEADER_RANGE;
|
||||
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":" << height << "}}\0";
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_headers_range\",\"params\":{\"start_height\":" << start_height << ",\"end_height\":" << next_height << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, prev_seed_height, height](const char* data, size_t size, double)
|
||||
{
|
||||
ChainMain block;
|
||||
if (parse_block_header(data, size, block)) {
|
||||
if (height == prev_seed_height) {
|
||||
// Do it synchronously to make sure stratum and p2p don't start before it's finished
|
||||
m_hasher->set_old_seed(block.id);
|
||||
}
|
||||
[this, start_height, next_height, host, current_height](const char* data, size_t size, double) {
|
||||
if (parse_block_headers_range(data, size) == next_height - start_height + 1) {
|
||||
download_block_headers3(next_height + 1, current_height);
|
||||
}
|
||||
else {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << height);
|
||||
PANIC_STOP();
|
||||
LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << next_height);
|
||||
download_block_headers3(start_height, current_height);
|
||||
}
|
||||
},
|
||||
[height](const char* data, size_t size, double)
|
||||
{
|
||||
[this, start_height, next_height, current_height](const char* data, size_t size, double) {
|
||||
if (size > 0) {
|
||||
LOGERR(1, "fatal error: couldn't download block header for seed height " << height << ", error " << log::const_buf(data, size));
|
||||
PANIC_STOP();
|
||||
LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << next_height << ", error " << log::const_buf(data, size));
|
||||
download_block_headers3(start_height, current_height);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
else {
|
||||
download_block_headers4(start_height, current_height);
|
||||
}
|
||||
}
|
||||
|
||||
const uint64_t start_height = (current_height > BLOCK_HEADERS_REQUIRED) ? (current_height - BLOCK_HEADERS_REQUIRED) : 0;
|
||||
void p2pool::download_block_headers4(uint64_t start_height, uint64_t current_height)
|
||||
{
|
||||
char buf[log::Stream::BUF_SIZE + 1] = {};
|
||||
log::Stream s(buf);
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_headers_range\",\"params\":{\"start_height\":" << start_height << ",\"end_height\":" << current_height - 1 << "}}\0";
|
||||
@@ -1251,14 +1326,14 @@ void p2pool::download_block_headers(uint64_t current_height)
|
||||
}
|
||||
else {
|
||||
LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << current_height - 1);
|
||||
download_block_headers(current_height);
|
||||
download_block_headers4(start_height, current_height);
|
||||
}
|
||||
},
|
||||
[this, start_height, current_height](const char* data, size_t size, double)
|
||||
{
|
||||
if (size > 0) {
|
||||
LOGERR(1, "Couldn't download block headers for heights " << start_height << " - " << current_height - 1 << ", error " << log::const_buf(data, size));
|
||||
download_block_headers(current_height);
|
||||
download_block_headers4(start_height, current_height);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1610,7 +1685,7 @@ void p2pool::parse_get_miner_data_rpc(const char* data, size_t size)
|
||||
|
||||
handle_miner_data(minerData);
|
||||
if (m_serversStarted.load() == 0) {
|
||||
download_block_headers(minerData.height);
|
||||
download_block_headers1(minerData.height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1864,7 +1939,7 @@ void p2pool::cleanup_mainchain_data(uint64_t height)
|
||||
// Expects m_mainchainLock to be already locked here
|
||||
// Deletes everything older than 720 blocks, except for the 3 latest RandomX seed heights
|
||||
|
||||
constexpr uint64_t PRUNE_DISTANCE = BLOCK_HEADERS_REQUIRED;
|
||||
const uint64_t PRUNE_DISTANCE = BLOCK_HEADERS_REQUIRED;
|
||||
const uint64_t seed_height = get_seed_height(height);
|
||||
const std::array<uint64_t, 3> seed_heights{ seed_height, seed_height - SEEDHASH_EPOCH_BLOCKS, seed_height - SEEDHASH_EPOCH_BLOCKS * 2 };
|
||||
|
||||
|
||||
+5
-1
@@ -112,7 +112,11 @@ public:
|
||||
void update_block_template_async(bool is_alternative_block = false);
|
||||
void update_block_template();
|
||||
|
||||
void download_block_headers(uint64_t current_height);
|
||||
// TODO refactor this bullshit later
|
||||
void download_block_headers1(uint64_t current_height);
|
||||
void download_block_headers2(uint64_t current_height);
|
||||
void download_block_headers3(uint64_t start_height, uint64_t current_height);
|
||||
void download_block_headers4(uint64_t start_height, uint64_t current_height);
|
||||
|
||||
bool chainmain_get_by_hash(const hash& id, ChainMain& data) const;
|
||||
|
||||
|
||||
@@ -153,6 +153,11 @@ Params::Params(int argc, char* const argv[])
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--nano") == 0) {
|
||||
m_nano = true;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--no-autodiff") == 0) {
|
||||
m_autoDiff = false;
|
||||
ok = true;
|
||||
@@ -300,6 +305,11 @@ bool Params::valid() const
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_mini && m_nano) {
|
||||
LOGERR(1, "You can't have both --mini and --nano in the command line");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,7 @@ struct Params
|
||||
uint32_t m_maxIncomingPeers = 450;
|
||||
uint32_t m_minerThreads = 0;
|
||||
bool m_mini = false;
|
||||
bool m_nano = false;
|
||||
bool m_autoDiff = true;
|
||||
std::string m_socks5Proxy;
|
||||
bool m_dns = true;
|
||||
|
||||
+17
-1
@@ -57,6 +57,7 @@ namespace p2pool {
|
||||
|
||||
static constexpr uint8_t default_consensus_id[HASH_SIZE] = { 34,175,126,231,181,11,104,146,227,153,218,107,44,108,68,39,178,81,4,212,169,4,142,0,177,110,157,240,68,7,249,24 };
|
||||
static constexpr uint8_t mini_consensus_id[HASH_SIZE] = { 57,130,201,26,149,174,199,250,66,80,189,18,108,216,194,220,136,23,63,24,64,113,221,44,219,86,39,163,53,24,126,196 };
|
||||
static constexpr uint8_t nano_consensus_id[HASH_SIZE] = { 171,248,206,148,210,226,114,99,250,145,221,96,13,216,23,63,104,53,129,168,244,80,141,138,157,250,50,54,37,189,5,89 };
|
||||
|
||||
NetworkType SideChain::s_networkType = NetworkType::Invalid;
|
||||
|
||||
@@ -84,6 +85,11 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
|
||||
|
||||
LOGINFO(1, log::LightCyan() << "network type = " << type);
|
||||
|
||||
if (m_poolName == "nano") {
|
||||
m_targetBlockTime = 30;
|
||||
m_unclePenalty = 10;
|
||||
}
|
||||
|
||||
if (m_pool && !load_config(m_pool->params().m_sidechainConfig)) {
|
||||
PANIC_STOP();
|
||||
}
|
||||
@@ -118,6 +124,7 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
|
||||
|
||||
constexpr char default_config[] = "mainnet\0" "default\0" "\0" "10\0" "100000\0" "2160\0" "20\0";
|
||||
constexpr char mini_config[] = "mainnet\0" "mini\0" "\0" "10\0" "100000\0" "2160\0" "20\0";
|
||||
constexpr char nano_config[] = "mainnet\0" "nano\0" "\0" "30\0" "100000\0" "2160\0" "10\0";
|
||||
|
||||
// Hardcoded default consensus ID
|
||||
if ((s.m_pos == sizeof(default_config) - 1) && (memcmp(buf, default_config, sizeof(default_config) - 1) == 0)) {
|
||||
@@ -127,6 +134,10 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
|
||||
else if ((s.m_pos == sizeof(mini_config) - 1) && (memcmp(buf, mini_config, sizeof(mini_config) - 1) == 0)) {
|
||||
m_consensusId.assign(mini_consensus_id, mini_consensus_id + HASH_SIZE);
|
||||
}
|
||||
// Hardcoded nano consensus ID
|
||||
else if ((s.m_pos == sizeof(nano_config) - 1) && (memcmp(buf, nano_config, sizeof(nano_config) - 1) == 0)) {
|
||||
m_consensusId.assign(nano_consensus_id, nano_consensus_id + HASH_SIZE);
|
||||
}
|
||||
else {
|
||||
#ifdef WITH_RANDOMX
|
||||
const randomx_flags flags = randomx_get_flags();
|
||||
@@ -1062,7 +1073,7 @@ void SideChain::print_status(bool obtain_sidechain_lock) const
|
||||
"\nMonero node = " << m_pool->current_host().m_displayName <<
|
||||
"\nMain chain height = " << m_pool->block_template().height() <<
|
||||
"\nMain chain hashrate = " << log::Hashrate(network_hashrate) <<
|
||||
"\nSide chain ID = " << (is_default() ? "default" : (is_mini() ? "mini" : m_consensusIdDisplayStr.c_str())) <<
|
||||
"\nSide chain ID = " << (is_default() ? "default" : (is_mini() ? "mini" : (is_nano() ? "nano" : m_consensusIdDisplayStr.c_str()))) <<
|
||||
"\nSide chain height = " << tip_height + 1 <<
|
||||
"\nSide chain hashrate = " << log::Hashrate(pool_hashrate) <<
|
||||
(hashrate_est ? "\nYour hashrate (pool-side) = " : "") << (hashrate_est ? log::Hashrate(hashrate_est) : log::Hashrate()) <<
|
||||
@@ -1185,6 +1196,11 @@ bool SideChain::is_mini() const
|
||||
return (memcmp(m_consensusId.data(), mini_consensus_id, HASH_SIZE) == 0);
|
||||
}
|
||||
|
||||
bool SideChain::is_nano() const
|
||||
{
|
||||
return (memcmp(m_consensusId.data(), nano_consensus_id, HASH_SIZE) == 0);
|
||||
}
|
||||
|
||||
uint64_t SideChain::bottom_height(const PoolBlock* tip) const
|
||||
{
|
||||
if (!tip) {
|
||||
|
||||
@@ -79,6 +79,7 @@ public:
|
||||
[[nodiscard]] uint64_t last_updated() const;
|
||||
[[nodiscard]] bool is_default() const;
|
||||
[[nodiscard]] bool is_mini() const;
|
||||
[[nodiscard]] bool is_nano() const;
|
||||
[[nodiscard]] uint64_t bottom_height(const PoolBlock* tip) const;
|
||||
|
||||
[[nodiscard]] const PoolBlock* chainTip() const { return m_chainTip; }
|
||||
|
||||
@@ -891,6 +891,26 @@ void StratumServer::update_hashrate_data(uint64_t hashes, uint64_t timestamp)
|
||||
if (hashes) {
|
||||
m_cumulativeHashes += hashes;
|
||||
++m_totalStratumShares;
|
||||
|
||||
// P2Pool-nano warning
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
// Check the hashrate when enough shares is found
|
||||
if (((m_totalStratumShares & 63) == 0) && m_pool->side_chain().is_nano()) {
|
||||
const HashrateData& head = m_hashrateData[m_hashrateDataHead];
|
||||
const HashrateData& tail = m_hashrateData[m_hashrateDataTail_24h];
|
||||
|
||||
const int64_t dt = static_cast<int64_t>(head.m_timestamp - tail.m_timestamp);
|
||||
|
||||
if (dt > 0) {
|
||||
const uint64_t total_hashes = head.m_cumulativeHashes - tail.m_cumulativeHashes;
|
||||
const uint64_t hashrate = total_hashes / dt;
|
||||
|
||||
if (hashrate > 30000) {
|
||||
LOGINFO(0, log::LightRed() << "Your hashrate is " << log::Hashrate(hashrate) << ". Please switch from P2Pool-nano to P2Pool-mini or P2Pool-main. P2Pool-nano is recommended only for small-scale miners.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // P2POOL_LOG_DISABLE
|
||||
}
|
||||
|
||||
HashrateData* data = m_hashrateData;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
namespace p2pool {
|
||||
|
||||
#define P2POOL_VERSION_MAJOR 4
|
||||
#define P2POOL_VERSION_MINOR 6
|
||||
#define P2POOL_VERSION_MINOR 7
|
||||
#define P2POOL_VERSION_PATCH 0
|
||||
|
||||
constexpr uint32_t P2POOL_VERSION = (P2POOL_VERSION_MAJOR << 16) | (P2POOL_VERSION_MINOR << 8) | P2POOL_VERSION_PATCH;
|
||||
|
||||
@@ -22,8 +22,13 @@ if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
include(cmake/msvc_libs.cmake)
|
||||
endif()
|
||||
|
||||
add_subdirectory(../external/src/RandomX RandomX)
|
||||
set(LIBS ${LIBS} randomx)
|
||||
if (STATIC_LIBS AND WIN32 AND (CMAKE_CXX_COMPILER_ID MATCHES Clang))
|
||||
set(LIBS ${LIBS} "${CMAKE_SOURCE_DIR}/../build/external/src/RandomX/librandomx.a")
|
||||
else()
|
||||
add_subdirectory(../external/src/RandomX RandomX)
|
||||
set(LIBS ${LIBS} randomx)
|
||||
endif()
|
||||
|
||||
add_definitions(-DWITH_RANDOMX)
|
||||
|
||||
add_subdirectory(cmake/ssl)
|
||||
|
||||
Reference in New Issue
Block a user