From 15afbdd2827345a08e1b35b1a05a99634fe43a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 29 May 2015 16:36:36 +0200 Subject: [PATCH 1/3] Workaround for incorrect mixed type big int comparison. Fixes ethereum/cpp-ethereum#1977. --- libdevcore/Common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libdevcore/Common.h b/libdevcore/Common.h index ae98861c1..346bb53cf 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -85,6 +85,20 @@ using u160s = std::vector; using u256Set = std::set; using u160Set = std::set; +// Workaround for mixed type big int comparison bug introduced in boost 1.58 +// https://svn.boost.org/trac/boost/ticket/11328 +#define ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(_OP) \ + template auto operator _OP (_T const& a, _U const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return (bigint)a _OP b; } \ + template auto operator _OP (_U const& a, _T const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return a _OP (bigint)b; } + +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(==) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(!=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>) + + extern const u256 UndefinedU256; // Map types. From 70a49b1f3532f65c539d21790094aa6a7c61e868 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 29 May 2015 16:44:25 +0200 Subject: [PATCH 2/3] Increase win32 executable stack size to 32MB --- cmake/EthCompilerSettings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index dcf2e19b8..eb8588ceb 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -44,7 +44,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification # warning LNK4099: pdb was not found with lib # stack size 16MB - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:16777216") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:33554432") # windows likes static if (NOT ETH_STATIC) From 152e3b83fec33bc5b66bb26f6fcaa39967d8e9d4 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 1 Jun 2015 08:51:50 +0200 Subject: [PATCH 3/3] disabled v61 protocol --- alethzero/MainWin.cpp | 2 +- libethereum/EthereumHost.cpp | 1 + libethereum/EthereumPeer.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 3a67fc3ae..6a11736a4 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1899,7 +1899,7 @@ void Main::on_net_triggered() { web3()->setIdealPeerCount(ui->idealPeers->value()); web3()->setNetworkPreferences(netPrefs(), ui->dropPeers->isChecked()); - ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256(u256(42))); + ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256()); web3()->startNetwork(); ui->downloadView->setDownloadMan(ethereum()->downloadMan()); ui->enode->setText(QString::fromStdString(web3()->enode())); diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index cbf96a011..a50c1c706 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -241,6 +241,7 @@ void EthereumHost::onPeerStatus(EthereumPeer* _peer) _peer->disable("Peer banned for previous bad behaviour."); else { + _peer->m_protocolVersion = EthereumHost::c_oldProtocolVersion; //force V60 for now if (_peer->m_protocolVersion != protocolVersion()) estimatePeerHashes(_peer); else if (_peer->m_latestBlockNumber > m_chain.number()) diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index a1c22e449..aa979e4b8 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -40,6 +40,7 @@ EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, Cap m_hashSub(host()->hashDownloadMan()), m_peerCapabilityVersion(_cap.second) { + m_peerCapabilityVersion = EthereumHost::c_oldProtocolVersion; m_syncHashNumber = host()->chain().number() + 1; requestStatus(); }