Skip to content

Commit

Permalink
Merge pull request #2568 from Taraxa-project/update-dependecies
Browse files Browse the repository at this point in the history
Update dependecies
  • Loading branch information
MatusKysel authored Sep 27, 2023
2 parents 98cc37e + 030bb48 commit dae755b
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 57 deletions.
5 changes: 4 additions & 1 deletion CMakeModules/cppcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ else ()
--error-exitcode=1
--enable=all
--suppress=missingInclude
--suppress=missingIncludeSystem
# find_if - useless here
--suppress=useStlAlgorithm:${PROJECT_SOURCE_DIR}/*/pbft_sync_packet_handler.cpp
--suppress=noExplicitConstructor
Expand All @@ -36,8 +37,10 @@ else ()
--suppress=unmatchedSuppression:${PROJECT_SOURCE_DIR}/*/Common.h
--suppress=cstyleCast:${PROJECT_SOURCE_DIR}/*/vector_ref.h
--suppress=cstyleCast:${PROJECT_SOURCE_DIR}/*/Common.h
#not an issue here
# not an issue here
--suppress=virtualCallInConstructor:${PROJECT_SOURCE_DIR}/*/final_chain.cpp
# just a warning
--suppress=duplInheritedMember:${PROJECT_SOURCE_DIR}/*/FixedHash.h
# Only show found errors
"--quiet"

Expand Down
8 changes: 4 additions & 4 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ class TaraxaConan(ConanFile):
generators = "cmake"

def requirements(self):
self.requires("boost/1.81.0")
self.requires("cppcheck/2.10")
self.requires("openssl/1.1.1t")
self.requires("boost/1.83.0")
self.requires("cppcheck/2.12")
self.requires("openssl/3.0.10")
self.requires("cryptopp/8.7.0")
self.requires("gtest/1.13.0")
self.requires("gtest/1.14.0")
self.requires("lz4/1.9.4")
self.requires("rocksdb/6.29.5")
self.requires("prometheus-cpp/1.1.0")
Expand Down
10 changes: 0 additions & 10 deletions libraries/aleth/libdevcore/Address.cpp

This file was deleted.

9 changes: 1 addition & 8 deletions libraries/aleth/libdevcore/Address.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,5 @@ using Addresses = h160s;
using AddressSet = std::unordered_set<h160>;

/// The zero address.
extern Address const ZeroAddress;

/// The last address.
extern Address const MaxAddress;

/// The SYSTEM address.
extern Address const SystemAddress;

Address const ZeroAddress;
} // namespace dev
1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ using strings = std::vector<std::string>;

// Null/Invalid values for convenience.
extern bytes const NullBytes;
u256 constexpr Invalid256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff_cppui256;

/// Interprets @a _u as a two's complement signed number and returns the
/// resulting s256.
Expand Down
5 changes: 3 additions & 2 deletions libraries/cli/include/cli/tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ Json::Value getGenesis(Config::ChainIdType chain_id);
void generateWallet(const std::string& wallet);

// Override existing config and wallet files
Json::Value overrideConfig(Json::Value& config, std::string& data_dir, std::vector<std::string> boot_nodes,
std::vector<std::string> log_channels, std::vector<std::string> log_configurations,
Json::Value overrideConfig(Json::Value& config, std::string& data_dir, const std::vector<std::string>& boot_nodes,
const std::vector<std::string>& log_channels,
const std::vector<std::string>& log_configurations,
const std::vector<std::string>& boot_nodes_append,
const std::vector<std::string>& log_channels_append);
Json::Value overrideWallet(Json::Value& wallet, const std::string& node_key, const std::string& vrf_key);
Expand Down
14 changes: 4 additions & 10 deletions libraries/cli/src/tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Json::Value getGenesis(Config::ChainIdType chain_id) {
return genesis;
}

Json::Value overrideConfig(Json::Value& conf, std::string& data_dir, vector<string> boot_nodes,
vector<string> log_channels, vector<string> log_configurations,
Json::Value overrideConfig(Json::Value& conf, std::string& data_dir, const vector<string>& boot_nodes,
const vector<string>& log_channels, const vector<string>& log_configurations,
const vector<string>& boot_nodes_append, const vector<string>& log_channels_append) {
if (data_dir.empty()) {
if (conf["data_path"].asString().empty()) {
Expand All @@ -88,10 +88,7 @@ Json::Value overrideConfig(Json::Value& conf, std::string& data_dir, vector<stri
conf["network"]["boot_nodes"] = Json::Value(Json::arrayValue);
}
if (boot_nodes_append.size() > 0) {
boot_nodes = boot_nodes_append;
}
if (boot_nodes.size() > 0) {
for (auto const& b : boot_nodes) {
for (auto const& b : boot_nodes_append) {
vector<string> result;
boost::split(result, b, boost::is_any_of(":/"));
if (result.size() != 3) throw invalid_argument("Boot node in boot_nodes not specified correctly");
Expand Down Expand Up @@ -130,10 +127,7 @@ Json::Value overrideConfig(Json::Value& conf, std::string& data_dir, vector<stri
}
}
if (log_channels_append.size() > 0) {
log_channels = log_channels_append;
}
if (log_channels.size() > 0) {
for (auto const& l : log_channels) {
for (auto const& l : log_channels_append) {
vector<string> result;
boost::split(result, l, boost::is_any_of(":"));
if (result.size() != 2) throw invalid_argument("Log channel in log_channels not specified correctly");
Expand Down
2 changes: 1 addition & 1 deletion libraries/config/include/config/config_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "common/util.hpp"

namespace taraxa {
std::string getConfigErr(std::vector<std::string> path);
std::string getConfigErr(const std::vector<std::string> &path);

Json::Value getConfigData(Json::Value root, const std::vector<std::string> &path, bool optional = false);

Expand Down
2 changes: 1 addition & 1 deletion libraries/config/src/config_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace taraxa {

std::string getConfigErr(std::vector<std::string> path) {
std::string getConfigErr(const std::vector<std::string> &path) {
std::string res = "Error in processing configuration file on param: ";
for (size_t i = 0; i < path.size(); i++) res += path[i] + ".";
res += " ";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class FinalChainImpl final : public FinalChain {
const bool kLightNode = false;
const uint64_t kLightNodeHistory = 0;
const uint32_t kMaxLevelsPerPeriod;
const uint32_t kRewardsDistributionInterval = 100;
rewards::Stats rewards_;

// It is not prepared to use more then 1 thread. Examine it if you want to change threads count
Expand Down
29 changes: 13 additions & 16 deletions libraries/core_libs/network/rpc/eth/LogFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,26 @@ std::vector<LogBloom> LogFilter::bloomPossibilities() const {

bool LogFilter::matches(LogBloom b) const {
if (!addresses_.empty()) {
auto ok = false;
for (const auto& i : addresses_) {
if (b.containsBloom<3>(sha3(i))) {
ok = true;
break;
}
}
if (!ok) {
if (std::none_of(addresses_.cbegin(), addresses_.cend(), [&b](const auto& i) {
if (b.containsBloom<3>(sha3(i))) {
return true;
}
return false;
})) {
return false;
}
}
for (const auto& t : topics_) {
if (t.empty()) {
continue;
}
auto ok = false;
for (const auto& i : t) {
if (b.containsBloom<3>(sha3(i))) {
ok = true;
break;
}
}
if (!ok) {

if (std::none_of(t.cbegin(), t.cend(), [&b](const auto& i) {
if (b.containsBloom<3>(sha3(i))) {
return true;
}
return false;
})) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void DagBlockPacketHandler::sendBlock(dev::p2p::NodeID const &peer_id, taraxa::D

taraxa::bytes trx_bytes;
for (uint32_t i = index; i < index + trx_count_to_send; i++) {
auto &trx_data = trxs[i]->rlp();
auto trx_data = trxs[i]->rlp();
s << trxs[i]->getHash();
trx_bytes.insert(trx_bytes.end(), std::begin(trx_data), std::end(trx_data));
}
Expand Down
4 changes: 3 additions & 1 deletion libraries/core_libs/storage/src/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,9 @@ void DbStorage::addPbftMgrFieldToBatch(PbftMgrField field, uint32_t value, Batch
bool DbStorage::getPbftMgrStatus(PbftMgrStatus field) {
auto status = lookup(toSlice(field), Columns::pbft_mgr_status);
if (!status.empty()) {
return *(bool*)&status[0];
bool value;
memcpy(&value, status.data(), sizeof(bool));
return value;
}
return false;
}
Expand Down

0 comments on commit dae755b

Please sign in to comment.