Skip to content

Commit

Permalink
Update upstream (monero-project#10)
Browse files Browse the repository at this point in the history
* wallet: fix default mixin (4 -> 6)

* cryptonote_tx_util: make destinations properly shuffled

* simplewallet: warn about key reuse on startup

* wallet: warn if not using the default ring size

* wallet2: move segregation height to v7

since people seem to really want to use things the wrong way.

* wallet2: fix misc issues when the ringdb can't be initialized

* rpc: allow getting pruned blocks from gettransactions

and get them pruned in find_and_save_rings, since it does not need
the pruned data in the first place.

Also set decode_to_json to false where missing, we don't need this
either.

* wallet2: request transactions in slices when scanning for known rings

This avoid massive memory consumption for huge wallets

* Fix sub-address tx scan.

When additional keys was needed, the TX scan failed because the
derivation data was always recomputed with the main tx_key and not
the corresponding additional one.

Moreover this patch avoid perf decreasing when not using HW device.

* Use 'boost' mutex instead of 'std' mutex

* common: make this build with unbound 1.4.20

Common on currently used distros

* wallet2: store subaddress lookahead settings

* tx_pool: fix loading with colliding key images

A key image may be present more than once if all but one of the
txes spending that key image are coming from blocks. When loading
a txpool from storage, we must load the one that's not from a
block first to avoid rejection

* blockchain_blackball: fix build with CLANG 5

It doesn't like the explicit NULL dereference (which is fine, honest)

* rpc: add missing perf timer for get_output_distribution

* util: log stack trace on crash

* add top height to get_output_distribution, and cache it for rct

This should cache the vast majority of calls for long running wallets

* wallet2: increase rpc timeout for get_output_distribution

* daemon: add a version command

* simplewallet: add version command

* device: add a one off override keyword where appropriate

* daemon: read config file before reading any other args

* WalletManagerImpl: reuse existing connection to daemon instead of reconnectivng every time

* simplewallet: fix help message of sign_transfer

* Build: remove in-tree miniupnpc

Will be replaced by a submodule.

* wallet2: add missing parameters to get_output_histogram

* speedup get_output_histogram for all amounts when min_count > 0

This skips the vast majority of "dust" output amounts with just
one instance on the chain. Clocks in at 0.15% of the original
time on testnet.

* import_multisig_info: fix sanity check crash in detach_blockchain

* Only log an error if fork version is higher AND is not known.

* Build: add miniupnp submodule

Though we only need miniupnpc, rebasing and maintaining a miniupnpc-only
repo is unrealistic.

* CMake: update new location of in-tree miniupnpc

* Build: update CMake and p2p for in-tree miniupnp

* Build: remove UPnP definition from snap

* slow-hash: fix memory leak for Windows /karbowanec#41

* mlog: fix setting no logs

* epee: Drop deprecated Boost.Thread header

In file included from src/cryptonote_basic/hardfork.cpp:33:
In file included from src/blockchain_db/blockchain_db.h:42:
In file included from src/cryptonote_basic/hardfork.h:31:
contrib/epee/include/syncobj.h:37:10: fatal error: 'boost/thread/v2/thread.hpp' file not found
#include <boost/thread/v2/thread.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/rpc/daemon_handler.cpp:29:
In file included from src/rpc/daemon_handler.h:36:
In file included from src/p2p/net_node.h:41:
In file included from contrib/epee/include/net/levin_server_cp2.h:32:
In file included from contrib/epee/include/net/abstract_tcp_server2.h:324:
contrib/epee/include/net/abstract_tcp_server2.inl:44:10: fatal error: 'boost/thread/v2/thread.hpp' file not found
#include <boost/thread/v2/thread.hpp> // TODO
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

contrib/epee/include/math_helper.h: In member function 'bool epee::math_helper::average<val, default_base>::set_base()':
contrib/epee/include/syncobj.h:227:56: error: 'sleep_for' is not a member of 'boost::this_thread'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^
contrib/epee/include/syncobj.h:227:56: note: in definition of macro 'CRITICAL_REGION_LOCAL'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^~~~~~~~~
contrib/epee/include/syncobj.h:227:56: note: suggested alternative: 'sleep'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^
contrib/epee/include/syncobj.h:227:56: note: in definition of macro 'CRITICAL_REGION_LOCAL'
 #define  CRITICAL_REGION_LOCAL(x) {boost::this_thread::sleep_for(boost::chrono::milliseconds(epee::debug::g_test_dbg_lock_sleep()));}   epee::critical_region_t<decltype(x)>   critical_region_var(x)
                                                        ^~~~~~~~~

* [RELEASE] Fix broken interactive daemon 'limit' commands plus RPC calls

* Adding required library (dependency of boost::this_thread::sleep_for)

* cryptonote_protocol_handler.inl: fix return type mismatches (int vs bool)

* cryptonote_protocol_handler.inl: remove span read just now that failed to pass some basic tests

* README.md: mention building deps with -fPIC for static builds
  • Loading branch information
m2049r authored Apr 30, 2018
1 parent a75a431 commit fb95df4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ invokes cmake commands as needed.

make release-static

Dependencies need to be built with -fPIC. Static libraries usually aren't, so you may have to build them yourself with -fPIC. Refer to their documentation for how to build them.

* **Optional**: build documentation in `doc/html` (omit `HAVE_DOT=YES` if `graphviz` is not installed):

HAVE_DOT=YES doxygen Doxyfile
Expand Down
19 changes: 11 additions & 8 deletions src/cryptonote_protocol/cryptonote_protocol_handler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ namespace cryptonote
relay_transactions(arg, context);
}

return true;
return 1;
}
//------------------------------------------------------------------------------------------------------------------------
template<class t_core>
Expand Down Expand Up @@ -1008,13 +1008,15 @@ skip:
if (blocks.empty())
{
MERROR("Next span has no blocks");
m_block_queue.remove_spans(span_connection_id, start_height);
break;
}

block new_block;
if (!parse_and_validate_block_from_blob(blocks.front().block, new_block))
{
MERROR("Failed to parse block, but it should already have been parsed");
m_block_queue.remove_spans(span_connection_id, start_height);
break;
}
bool parent_known = m_core.have_block(new_block.prev_id);
Expand All @@ -1031,6 +1033,7 @@ skip:
// this can happen if a connection was sicced onto a late span, if it did not have those blocks,
// since we don't know that at the sic time
LOG_ERROR_CCONTEXT("Got block with unknown parent which was not requested - querying block hashes");
m_block_queue.remove_spans(span_connection_id, start_height);
context.m_needed_objects.clear();
context.m_last_response_height = 0;
goto skip;
Expand Down Expand Up @@ -1064,7 +1067,7 @@ skip:
if (tvc.size() != block_entry.txs.size())
{
LOG_ERROR_CCONTEXT("Internal error: tvc.size() != block_entry.txs.size()");
return true;
return 1;
}
std::list<blobdata>::const_iterator it = block_entry.txs.begin();
for (size_t i = 0; i < tvc.size(); ++i, ++it)
Expand All @@ -1075,7 +1078,7 @@ skip:
LOG_ERROR_CCONTEXT("transaction verification failed on NOTIFY_RESPONSE_GET_OBJECTS, tx_id = "
<< epee::string_tools::pod_to_hex(get_blob_hash(*it)) << ", dropping connection");
drop_connection(context, false, true);
return true;
return 1;
}))
LOG_ERROR_CCONTEXT("span connection id not found");

Expand Down Expand Up @@ -1104,7 +1107,7 @@ skip:
if (!m_p2p->for_connection(span_connection_id, [&](cryptonote_connection_context& context, nodetool::peerid_type peer_id, uint32_t f)->bool{
LOG_PRINT_CCONTEXT_L1("Block verification failed, dropping connection");
drop_connection(context, true, true);
return true;
return 1;
}))
LOG_ERROR_CCONTEXT("span connection id not found");

Expand All @@ -1123,7 +1126,7 @@ skip:
if (!m_p2p->for_connection(span_connection_id, [&](cryptonote_connection_context& context, nodetool::peerid_type peer_id, uint32_t f)->bool{
LOG_PRINT_CCONTEXT_L1("Block received at sync phase was marked as orphaned, dropping connection");
drop_connection(context, true, true);
return true;
return 1;
}))
LOG_ERROR_CCONTEXT("span connection id not found");

Expand Down Expand Up @@ -1363,13 +1366,13 @@ skip:
MDEBUG(context << " we have the next span, and it is scheduled, resuming");
++context.m_callback_request_count;
m_p2p->request_callback(context);
return 1;
return true;
}

for (size_t n = 0; n < 50; ++n)
{
if (m_stopping)
return 1;
return true;
boost::this_thread::sleep_for(boost::chrono::milliseconds(100));
}
}
Expand Down Expand Up @@ -1693,7 +1696,7 @@ skip:
m_p2p->relay_notify_to_list(NOTIFY_NEW_FLUFFY_BLOCK::ID, fluffyBlob, fluffyConnections);
m_p2p->relay_notify_to_list(NOTIFY_NEW_BLOCK::ID, fullBlob, fullConnections);

return 1;
return true;
}
//------------------------------------------------------------------------------------------------------------------------
template<class t_core>
Expand Down

0 comments on commit fb95df4

Please sign in to comment.