Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
coranos committed May 26, 2023
1 parent feec434 commit d5d14d9
Show file tree
Hide file tree
Showing 104 changed files with 3,267 additions and 3,089 deletions.
39 changes: 0 additions & 39 deletions nano/core_test/throttle.cpp

This file was deleted.

4 changes: 2 additions & 2 deletions nano/core_test/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,8 @@ TEST (wallet, send_race)
nano::keypair key2;
for (auto i (1); i < 60; ++i)
{
ASSERT_NE (nullptr, system.wallet (0)->send_action (nano::dev::genesis_key.pub, key2.pub, nano::MBAN_ratio));
ASSERT_EQ (nano::dev::constants.genesis_amount - nano::MBAN_ratio * i, system.nodes[0]->balance (nano::dev::genesis_key.pub));
ASSERT_NE (nullptr, system.wallet (0)->send_action (nano::dev::genesis_key.pub, key2.pub, nano::Gxrb_ratio));
ASSERT_EQ (nano::dev::constants.genesis_amount - nano::Gxrb_ratio * i, system.nodes[0]->balance (nano::dev::genesis_key.pub));
}
}

Expand Down
111 changes: 56 additions & 55 deletions nano/core_test/websocket.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions nano/crypto_lib/random_pool.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <nano/crypto_lib/random_pool.hpp>

#include <cryptopp/misc.h>
#include <cryptopp/osrng.h>
#include <crypto/cryptopp/misc.h>
#include <crypto/cryptopp/osrng.h>

void nano::random_pool::generate_block (unsigned char * output, size_t size)
{
Expand Down
16 changes: 0 additions & 16 deletions nano/crypto_lib/random_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ class random_pool
static uint64_t generate_word64 (uint64_t min, uint64_t max);
static unsigned char generate_byte ();

/** Fills variable with random data */
template <class T>
static void generate (T & out)
{
generate_block (reinterpret_cast<uint8_t *> (&out), sizeof (T));
}
/** Returns variable with random data */
template <class T>
static T generate ()
{
T t;
generate (t);
return t;
}

public:
random_pool () = delete;
random_pool (random_pool const &) = delete;
random_pool & operator= (random_pool const &) = delete;
Expand Down
2 changes: 1 addition & 1 deletion nano/crypto_lib/random_pool_shuffle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <nano/crypto_lib/random_pool.hpp>

#include <cryptopp/osrng.h>
#include <crypto/cryptopp/osrng.h>

namespace nano
{
Expand Down
2 changes: 1 addition & 1 deletion nano/ipc_flatbuffers_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mark_as_advanced(
FLATBUFFERS_PACKAGE_DEBIAN
FLATBUFFERS_PACKAGE_REDHAT
FLATBUFFERS_STATIC_FLATC)
add_subdirectory(../../submodules/flatbuffers
add_subdirectory(../../flatbuffers
${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build EXCLUDE_FROM_ALL)

# Generate Flatbuffers files into the ipc_flatbuffers_lib library, which will be
Expand Down
3 changes: 2 additions & 1 deletion nano/ipc_flatbuffers_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ target_link_libraries(
Boost::log
Boost::program_options
Boost::system
Boost::thread)
Boost::thread
Boost::boost)
24 changes: 4 additions & 20 deletions nano/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ add_library(
config.hpp
config.cpp
configbase.hpp
convert.cpp
convert.hpp
diagnosticsconfig.hpp
diagnosticsconfig.cpp
epoch.hpp
Expand Down Expand Up @@ -57,7 +59,6 @@ add_library(
processing_queue.hpp
rate_limiting.hpp
rate_limiting.cpp
relaxed_atomic.hpp
rep_weights.hpp
rep_weights.cpp
rocksdbconfig.hpp
Expand All @@ -67,15 +68,9 @@ add_library(
rpcconfig.cpp
signal_manager.hpp
signal_manager.cpp
stacktrace.hpp
stacktrace.cpp
stats.hpp
stats.cpp
stats_enums.hpp
stats_enums.cpp
stream.hpp
thread_roles.hpp
thread_roles.cpp
threading.hpp
threading.cpp
timer.hpp
Expand All @@ -91,11 +86,6 @@ add_library(
work.hpp
work.cpp)

include_directories(${CMAKE_SOURCE_DIR}/submodules)
include_directories(${CMAKE_SOURCE_DIR}/submodules/cpptoml/include)
include_directories(
${CMAKE_SOURCE_DIR}/submodules/nano-pow-server/deps/cpptoml/include)

target_link_libraries(
nano_lib
ed25519
Expand All @@ -105,14 +95,8 @@ target_link_libraries(
ipc_flatbuffers_lib
${CRYPTOPP_LIBRARY}
${CMAKE_DL_LIBS}
Boost::asio
Boost::circular_buffer
Boost::dll
Boost::log_setup
Boost::log
Boost::multiprecision
Boost::program_options
Boost::stacktrace)
Boost::boost
Boost::program_options)

if(NANO_STACKTRACE_BACKTRACE)
target_link_libraries(nano_lib backtrace)
Expand Down
4 changes: 2 additions & 2 deletions nano/lib/blockbuilders.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <nano/lib/blockbuilders.hpp>

#include <unordered_map>
#include <crypto/cryptopp/osrng.h>

#include <cryptopp/osrng.h>
#include <unordered_map>

namespace
{
Expand Down
12 changes: 6 additions & 6 deletions nano/lib/blocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
#include <nano/lib/threading.hpp>
#include <nano/secure/common.hpp>

#include <crypto/cryptopp/words.h>

#include <boost/endian/conversion.hpp>
#include <boost/property_tree/json_parser.hpp>

#include <bitset>

#include <cryptopp/words.h>

/** Compare blocks, first by type, then content. This is an optimization over dynamic_cast, which is very slow on some platforms. */
namespace
{
Expand Down Expand Up @@ -1763,7 +1763,7 @@ std::string nano::state_subtype (nano::block_details const details_a)
}
}

nano::block_sideband::block_sideband (nano::account const & account_a, nano::block_hash const & successor_a, nano::amount const & balance_a, uint64_t const height_a, nano::seconds_t const timestamp_a, nano::block_details const & details_a, nano::epoch const source_epoch_a) :
nano::block_sideband::block_sideband (nano::account const & account_a, nano::block_hash const & successor_a, nano::amount const & balance_a, uint64_t const height_a, uint64_t const timestamp_a, nano::block_details const & details_a, nano::epoch const source_epoch_a) :
successor (successor_a),
account (account_a),
balance (balance_a),
Expand All @@ -1774,7 +1774,7 @@ nano::block_sideband::block_sideband (nano::account const & account_a, nano::blo
{
}

nano::block_sideband::block_sideband (nano::account const & account_a, nano::block_hash const & successor_a, nano::amount const & balance_a, uint64_t const height_a, nano::seconds_t const timestamp_a, nano::epoch const epoch_a, bool const is_send, bool const is_receive, bool const is_epoch, nano::epoch const source_epoch_a) :
nano::block_sideband::block_sideband (nano::account const & account_a, nano::block_hash const & successor_a, nano::amount const & balance_a, uint64_t const height_a, uint64_t const timestamp_a, nano::epoch const epoch_a, bool const is_send, bool const is_receive, bool const is_epoch, nano::epoch const source_epoch_a) :
successor (successor_a),
account (account_a),
balance (balance_a),
Expand Down Expand Up @@ -1880,7 +1880,7 @@ std::shared_ptr<nano::block> nano::block_uniquer::unique (std::shared_ptr<nano::
if (result != nullptr)
{
nano::uint256_union key (block_a->full_hash ());
nano::lock_guard<nano::mutex> lock{ mutex };
nano::lock_guard<nano::mutex> lock (mutex);
auto & existing (blocks[key]);
if (auto block_l = existing.lock ())
{
Expand Down Expand Up @@ -1917,7 +1917,7 @@ std::shared_ptr<nano::block> nano::block_uniquer::unique (std::shared_ptr<nano::

size_t nano::block_uniquer::size ()
{
nano::lock_guard<nano::mutex> lock{ mutex };
nano::lock_guard<nano::mutex> lock (mutex);
return blocks.size ();
}

Expand Down
8 changes: 2 additions & 6 deletions nano/lib/blocks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <nano/lib/numbers.hpp>
#include <nano/lib/optional_ptr.hpp>
#include <nano/lib/stream.hpp>
#include <nano/lib/timer.hpp>
#include <nano/lib/utility.hpp>
#include <nano/lib/work.hpp>

Expand Down Expand Up @@ -59,8 +58,8 @@ class block_sideband final
{
public:
block_sideband () = default;
block_sideband (nano::account const &, nano::block_hash const &, nano::amount const &, uint64_t const, nano::seconds_t const local_timestamp, nano::block_details const &, nano::epoch const source_epoch_a);
block_sideband (nano::account const &, nano::block_hash const &, nano::amount const &, uint64_t const, nano::seconds_t const local_timestamp, nano::epoch const epoch_a, bool const is_send, bool const is_receive, bool const is_epoch, nano::epoch const source_epoch_a);
block_sideband (nano::account const &, nano::block_hash const &, nano::amount const &, uint64_t const, uint64_t const, nano::block_details const &, nano::epoch const source_epoch_a);
block_sideband (nano::account const &, nano::block_hash const &, nano::amount const &, uint64_t const, uint64_t const, nano::epoch const epoch_a, bool const is_send, bool const is_receive, bool const is_epoch, nano::epoch const source_epoch_a);
void serialize (nano::stream &, nano::block_type) const;
bool deserialize (nano::stream &, nano::block_type);
static size_t size (nano::block_type);
Expand Down Expand Up @@ -129,9 +128,6 @@ class block
private:
nano::block_hash generate_hash () const;
};

using block_list_t = std::vector<std::shared_ptr<nano::block>>;

class send_hashables
{
public:
Expand Down
Loading

0 comments on commit d5d14d9

Please sign in to comment.