Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 910f2dc

Browse files
committed
Merge remote-tracking branch 'origin/master' into release/0.14
# Conflicts: # .bumpversion.cfg # CMakeLists.txt
2 parents 808ce96 + ef14e93 commit 910f2dc

File tree

20 files changed

+45
-58
lines changed

20 files changed

+45
-58
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set(PROJECT_VERSION 0.14.0rc0)
4747

4848
cable_set_build_type(DEFAULT Release CONFIGURATION_TYPES Release RelWithDebInfo Debug)
4949

50-
# link_directories interprate relative paths with respect to CMAKE_CURRENT_SOURCE_DIR
50+
# link_directories interprets relative paths with respect to CMAKE_CURRENT_SOURCE_DIR
5151
cmake_policy(SET CMP0015 NEW)
5252

5353
# let cmake autolink dependencies on windows

cmake/EthCompilerSettings.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
3737
# disable conversion from 'type1' to 'type2', possible loss of data (4244)
3838
# disable forcing value to bool 'true' or 'false' (performance warning) (4800)
3939
# declare Windows XP requirement
40-
# undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions
41-
# define miniupnp static library
40+
# undefine windows.h MAX & MIN macros because they cause conflicts with std::min & std::max functions
4241
add_compile_options(/MP /EHsc /GL /wd4068 /wd4996 /wd4503 /wd4267 /wd4180 /wd4290 /wd4244 /wd4800 -D_WIN32_WINNT=0x0501 /DNOMINMAX)
4342
# disable empty object file warning
4443
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG /ignore:4221")

ethminer/MinerAux.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class MinerCLI
9292
Stratum
9393
};
9494

95-
MinerCLI() {m_endpoints.reserve(k_max_endpoints);}
95+
MinerCLI() {m_endpoints.resize(k_max_endpoints);}
9696

9797
static void signalHandler(int sig)
9898
{
@@ -378,7 +378,7 @@ class MinerCLI
378378
}
379379
if ((m_mode != OperationMode::None) && (m_mode != mode))
380380
{
381-
cerr << "Mixed stratum and getwork enpoints not supported." << endl;
381+
cerr << "Mixed stratum and getwork endpoints not supported." << endl;
382382
BOOST_THROW_EXCEPTION(BadArgument());
383383
}
384384
m_mode = mode;
@@ -650,7 +650,7 @@ class MinerCLI
650650
return false;
651651
if (m_legacyParameters && m_newParameters)
652652
{
653-
cerr << "Deprecated parameters and the -P parameter are imcompatible. Please migrate to using the -P parameter." << endl;
653+
cerr << "Deprecated parameters and the -P parameter are incompatible. Please migrate to using the -P parameter." << endl;
654654
BOOST_THROW_EXCEPTION(BadArgument());
655655
}
656656
return true;
@@ -765,7 +765,7 @@ class MinerCLI
765765
<< " 1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for hashrate reporting to work with nanopool)" << endl
766766
<< " 2: EthereumStratum/1.0.0: nicehash" << endl
767767
<< " -RH, --report-hashrate Report current hashrate to pool (please only enable on pools supporting this)" << endl
768-
<< " -HWMON [<n>], Displays gpu temp, fan percent and power usage. Note: In linux, the program uses sysfs, which may require running with root priviledges." << endl
768+
<< " -HWMON [<n>], Displays gpu temp, fan percent and power usage. Note: In linux, the program uses sysfs, which may require running with root privileges." << endl
769769
<< " 0: Displays only temp and fan percent (default)" << endl
770770
<< " 1: Also displays power usage" << endl
771771
<< " --exit Stops the miner whenever an error is encountered" << endl
@@ -821,7 +821,7 @@ class MinerCLI
821821
<< " sync - Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the results from the device." << endl
822822
<< " --cuda-devices <0 1 ..n> Select which CUDA GPUs to mine on. Default is to use all" << endl
823823
<< " --cuda-parallel-hash <1 2 ..8> Define how many hashes to calculate in a kernel, can be scaled to achieve better performance. Default=4" << endl
824-
<< " --cuda-noeval bypass host software re-evalution of GPU solutions." << endl
824+
<< " --cuda-noeval bypass host software re-evaluation of GPU solutions." << endl
825825
<< " This will trim some milliseconds off the time it takes to send a result to the pool." << endl
826826
<< " Use at your own risk! If GPU generates errored results they WILL be forwarded to the pool" << endl
827827
<< " Not recommended at high overclock." << endl

ethminer/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void help()
4747
<< " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 5). Set to 9 for switch time logging." << endl
4848
<< " -V,--version Show the version and exit." << endl
4949
<< " -h,--help Show this help message and exit." << endl
50-
<< " Envionment variables:" << endl
50+
<< " Environment variables:" << endl
5151
<< " NO_COLOR - set to any value to disable color output. Unset to re-enable color output." << endl
5252
;
5353
exit(0);
@@ -75,7 +75,7 @@ int main(int argc, char** argv)
7575
{
7676
g_useColor = false;
7777
// Set output mode to handle virtual terminal sequences
78-
// Only works on Windows 10, but most user should use it anyways
78+
// Only works on Windows 10, but most users should use it anyway
7979
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
8080
if (hOut != INVALID_HANDLE_VALUE)
8181
{

libdevcore/CommonData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ inline unsigned bytesRequired(T _i)
162162
return i;
163163
}
164164

165-
/// Sets enviromental variable.
165+
/// Sets environment variable.
166166
///
167167
/// Portable wrapper for setenv / _putenv C library functions.
168168
bool setenv(const char name[], const char value[], bool override = false);

libdevcore/Worker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Worker
6262

6363
std::string m_name;
6464

65-
mutable Mutex x_work; ///< Lock for the network existance.
65+
mutable Mutex x_work; ///< Lock for the network existence.
6666
std::unique_ptr<std::thread> m_work; ///< The network thread.
6767
std::atomic<WorkerState> m_state = {WorkerState::Starting};
6868
};

libethash-cuda/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
find_package(CUDA REQUIRED)
22

3-
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--disable-warnings;--ptxas-options=-v;-use_fast_math;-lineinfo)
3+
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};--ptxas-options=-v;-use_fast_math;-lineinfo)
4+
5+
if (NOT MSVC)
6+
list(APPEND CUDA_NVCC_FLAGS "--disable-warnings")
7+
endif()
48

59
list(APPEND CUDA_NVCC_FLAGS_RELEASE -O3)
610
list(APPEND CUDA_NVCC_FLAGS_DEBUG -G)

libethash-cuda/CUDAMiner.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ bool CUDAMiner::cuda_init(
348348
cudalog << "Set Device to current";
349349
if(dagSize128 != m_dag_size || !m_dag)
350350
{
351-
//Check whether the current device has sufficient memory everytime we recreate the dag
351+
//Check whether the current device has sufficient memory every time we recreate the dag
352352
if (device_props.totalGlobalMem < dagSize)
353353
{
354354
cudalog << "CUDA device " << string(device_props.name) << " has insufficient GPU memory." << device_props.totalGlobalMem << " bytes of memory found < " << dagSize << " bytes of memory required";
@@ -360,7 +360,7 @@ bool CUDAMiner::cuda_init(
360360
CUDA_SAFE_CALL(cudaSetDeviceFlags(s_scheduleFlag));
361361
CUDA_SAFE_CALL(cudaDeviceSetCacheConfig(cudaFuncCachePreferL1));
362362
//We need to reset the light and the Dag for the following code to reallocate
363-
//since cudaDeviceReset() free's all previous allocated memory
363+
//since cudaDeviceReset() frees all previous allocated memory
364364
m_light[m_device_num] = nullptr;
365365
m_dag = nullptr;
366366
}
@@ -384,7 +384,7 @@ bool CUDAMiner::cuda_init(
384384
if(dagSize128 != m_dag_size || !dag)
385385
{
386386
// create mining buffers
387-
cudalog << "Generating mining buffers"; //TODO whats up with this?
387+
cudalog << "Generating mining buffers";
388388
for (unsigned i = 0; i != s_numStreams; ++i)
389389
{
390390
CUDA_SAFE_CALL(cudaMallocHost(&m_search_buf[i], sizeof(search_results)));

libethash-cuda/dagger_shuffled.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ __device__ __forceinline__ bool compute_hash(
6565
uint2 shuffle[4];
6666
uint32_t thread_mix = fnv_reduce(mix[p]);
6767

68-
// update mix accross threads
68+
// update mix across threads
6969
shuffle[0].x = __shfl_sync(0xFFFFFFFF,thread_mix, 0, THREADS_PER_HASH);
7070
shuffle[0].y = __shfl_sync(0xFFFFFFFF,thread_mix, 1, THREADS_PER_HASH);
7171
shuffle[1].x = __shfl_sync(0xFFFFFFFF,thread_mix, 2, THREADS_PER_HASH);

libethcore/Farm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class Farm: public FarmFace
324324
{
325325
p.ms += cp.ms;
326326
p.hashes += cp.hashes;
327-
for (unsigned int i = 0; i < cp.minersHashes.size(); i++)
327+
for (unsigned int i = 0; i < cp.minersHashes.size() && i < p.minersHashes.size(); i++)
328328
{
329329
p.minersHashes.at(i) += cp.minersHashes.at(i);
330330
}

libhwmon/wraphelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void *wrap_dlsym(void *h, const char *sym) {
1212
return (void *)GetProcAddress((HINSTANCE)h, sym);
1313
}
1414
int wrap_dlclose(void *h) {
15-
/* FreeLibrary returns nonzero on success */
15+
/* FreeLibrary returns non-zero on success */
1616
return (!FreeLibrary((HINSTANCE)h));
1717
}
1818
#else

libhwmon/wrapnvml.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ int wrap_nvml_get_fanpcnt(wrap_nvml_handle *nvmlh,
111111
int gpuindex, unsigned int *fanpcnt);
112112

113113
/*
114-
* Query the current GPU power usage in millwatts from the CUDA device ID
114+
* Query the current GPU power usage in milliwatts from the CUDA device ID
115115
*
116116
* This feature is only available on recent GPU generations and may be
117117
* limited in some cases only to Tesla series GPUs.

libpoolprotocols/PoolClient.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef POOL_CLIENT_H_
2-
#define POOL_CLIENT_H_
3-
41
#pragma once
52

63
#include <boost/asio/ip/address.hpp>
@@ -45,7 +42,7 @@ namespace dev
4542

4643
private:
4744
// Normally we'd replace the following with a single URI variable
48-
// But URI attributes are read only, and to support legacy arameters
45+
// But URI attributes are read only, and to support legacy parameters
4946
// we need to update these connection attributes individually.
5047
string m_host;
5148
unsigned short m_port = 0;
@@ -99,6 +96,3 @@ namespace dev
9996
};
10097
}
10198
}
102-
103-
#endif
104-

libpoolprotocols/PoolManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ void PoolManager::tryReconnect()
198198
cnote << "Retrying in " << i << "... \r";
199199
}
200200

201-
// We do not need awesome logic here, we jst have one connection anyways
201+
// We do not need awesome logic here, we just have one connection anyway
202202
if (m_connections.size() == 1) {
203203
p_client->connect();
204204
return;

libpoolprotocols/PoolManager.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef POOL_MANAGER_H_
2-
#define POOL_MANAGER_H_
3-
41
#pragma once
52

63
#include <iostream>
@@ -51,6 +48,3 @@ namespace dev
5148
};
5249
}
5350
}
54-
55-
#endif
56-

libpoolprotocols/PoolURI.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <map>
22
#include <boost/optional/optional_io.hpp>
33
#include <boost/algorithm/string.hpp>
4+
#include <network/uri/detail/decode.hpp>
45
#include <libpoolprotocols/PoolURI.h>
56

67
using namespace dev;
@@ -47,20 +48,23 @@ bool URI::KnownScheme()
4748
ProtocolFamily URI::ProtoFamily() const
4849
{
4950
std::string s(*m_uri.scheme());
51+
s = network::detail::decode(s);
5052
boost::trim(s);
5153
return s_schemes[s].family;
5254
}
5355

5456
unsigned URI::ProtoVersion() const
5557
{
5658
std::string s(*m_uri.scheme());
59+
s = network::detail::decode(s);
5760
boost::trim(s);
5861
return s_schemes[s].version;
5962
}
6063

6164
SecureLevel URI::ProtoSecureLevel() const
6265
{
6366
std::string s(*m_uri.scheme());
67+
s = network::detail::decode(s);
6468
boost::trim(s);
6569
return s_schemes[s].secure;
6670
}
@@ -78,13 +82,15 @@ std::string URI::KnownSchemes(ProtocolFamily family)
7882
std::string URI::Scheme() const
7983
{
8084
std::string s(*m_uri.scheme());
85+
s = network::detail::decode(s);
8186
boost::trim(s);
8287
return s;
8388
}
8489

8590
std::string URI::Host() const
8691
{
8792
std::string s(*m_uri.host());
93+
s = network::detail::decode(s);
8894
boost::trim(s);
8995
if (s == "--")
9096
return "";
@@ -94,6 +100,7 @@ std::string URI::Host() const
94100
unsigned short URI::Port() const
95101
{
96102
std::string s(*m_uri.port());
103+
s = network::detail::decode(s);
97104
boost::trim(s);
98105
if (s == "--")
99106
return 0;
@@ -103,6 +110,7 @@ unsigned short URI::Port() const
103110
std::string URI::User() const
104111
{
105112
std::string s(*m_uri.user_info());
113+
s = network::detail::decode(s);
106114
boost::trim(s);
107115
if (s == "--")
108116
return "";
@@ -115,6 +123,7 @@ std::string URI::User() const
115123
std::string URI::Pswd() const
116124
{
117125
std::string s(*m_uri.user_info());
126+
s = network::detail::decode(s);
118127
boost::trim(s);
119128
if (s == "--")
120129
return "";

libpoolprotocols/PoolURI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#pragma once
22

3-
#include <network/uri.hpp>
43
#include <string>
4+
#include <network/uri.hpp>
55

6-
// A simple URI parser specifically for mining pool enpoints
6+
// A simple URI parser specifically for mining pool endpoints
77
namespace dev
88
{
99

libpoolprotocols/getwork/EthGetworkClient.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#ifndef ETH_GETWORK_CLIENT_H_
2-
#define ETH_GETWORK_CLIENT_H_
3-
41
#pragma once
52

63
#include <jsonrpccpp/client/connectors/httpclient.h>
@@ -38,6 +35,3 @@ class EthGetworkClient : public PoolClient, Worker
3835
JsonrpcGetwork *p_client;
3936
WorkPackage m_prevWorkPackage;
4037
};
41-
42-
#endif
43-

libpoolprotocols/stratum/EthStratumClient.cpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ EthStratumClient::EthStratumClient(int const & worktimeout, string const & email
4848

4949
m_submit_hashrate = submitHashrate;
5050
m_submit_hashrate_id = h256::random().hex();
51-
52-
// This timer is set to never expire. This is intentional since
53-
// boost asio does not support events, this timer will
54-
// serve an equivalent role when cancelled.
55-
m_hashrate_event.expires_at(boost::posix_time::pos_infin);
56-
m_hashrate_event.async_wait(boost::bind(&EthStratumClient::hashrate_event_handler, this, boost::asio::placeholders::error));
5751
}
5852

5953
EthStratumClient::~EthStratumClient()
@@ -271,7 +265,7 @@ void EthStratumClient::connect_handler(const boost::system::error_code& ec, tcp:
271265
cwarn << "* Root certs are either not installed or not found";
272266
cwarn << "* Pool uses a self-signed certificate";
273267
cwarn << "Possible fixes:";
274-
cwarn << "* Make sure the file '/etc/ssl/certs/ca-certificates.crt' exists and is accessable";
268+
cwarn << "* Make sure the file '/etc/ssl/certs/ca-certificates.crt' exists and is accessible";
275269
cwarn << "* Export the correct path via 'export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt' to the correct file";
276270
cwarn << " On most systems you can install the 'ca-certificates' package";
277271
cwarn << " You can also get the latest file here: https://curl.haxx.se/docs/caextract.html";
@@ -599,9 +593,7 @@ void EthStratumClient::processReponse(Json::Value& responseObject)
599593

600594
void EthStratumClient::hashrate_event_handler(const boost::system::error_code& ec)
601595
{
602-
(void)ec;
603-
604-
if (!m_submit_hashrate || m_linkdown) {
596+
if (ec || m_linkdown) {
605597
return;
606598
}
607599

@@ -616,8 +608,6 @@ void EthStratumClient::hashrate_event_handler(const boost::system::error_code& e
616608
else
617609
async_write(*m_socket, m_requestBuffer,
618610
boost::bind(&EthStratumClient::handleHashrateResponse, this, boost::asio::placeholders::error));
619-
m_hashrate_event.expires_at(boost::posix_time::pos_infin);
620-
m_hashrate_event.async_wait(boost::bind(&EthStratumClient::hashrate_event_handler, this, boost::asio::placeholders::error));
621611
}
622612

623613
void EthStratumClient::work_timeout_handler(const boost::system::error_code& ec) {
@@ -635,11 +625,14 @@ void EthStratumClient::response_timeout_handler(const boost::system::error_code&
635625
}
636626

637627
void EthStratumClient::submitHashrate(string const & rate) {
638-
// Called by the pool manager thread.
639-
// We cancel the timer that will serve as event
640-
// to the stratum client.
628+
if (!m_submit_hashrate || m_linkdown) {
629+
return;
630+
}
631+
641632
m_rate = rate;
642633
m_hashrate_event.cancel();
634+
m_hashrate_event.expires_from_now(boost::posix_time::milliseconds(100));
635+
m_hashrate_event.async_wait(boost::bind(&EthStratumClient::hashrate_event_handler, this, boost::asio::placeholders::error));
643636
}
644637

645638
void EthStratumClient::submitSolution(Solution solution) {

0 commit comments

Comments
 (0)