From e594c3ad9daa606130ef5f758939e741b9bb463a Mon Sep 17 00:00:00 2001 From: null_radix Date: Tue, 25 Feb 2014 20:03:51 -0500 Subject: [PATCH 01/14] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3c7622f6..30f1e07e5 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Gav Wood, 2014. ## Building -See https://github.com/ethereum/cpp-ethereum/wiki/Building and https://github.com/ethereum/cpp-ethereum/wiki/Compatibility-Info-and-Build-Tips . +See [Build Instructions](https://github.com/ethereum/cpp-ethereum/wiki/Build-Instructions) and [Compatibility Info and Build Tips](https://github.com/ethereum/cpp-ethereum/wiki/Compatibility-Info-and-Build-Tips). ## Yet To Do @@ -18,4 +18,4 @@ See LICENSE ## Contributing -Please read CodingStandards.txt thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formating guidelines as describled in CodingStandards.txt. +Please read [CodingStandards.txt](https://github.com/ethereum/cpp-ethereum/blob/master/CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formating guidelines as describled in [CodingStandards.txt](https://github.com/ethereum/cpp-ethereum/blob/master/CodingStandards.txt). From 084ada2a1117761c21527631705ea45516a81241 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Thu, 27 Feb 2014 12:28:28 +0100 Subject: [PATCH 02/14] Relative links in the README.md If I'm not on `master` branch it doesn't make sense to link `CodingStandards.txt` from another branch. + add links for `LICENSE` and `TODO` --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 30f1e07e5..8cc662f7d 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,12 @@ See [Build Instructions](https://github.com/ethereum/cpp-ethereum/wiki/Build-Ins ## Yet To Do -See TODO +See [TODO](TODO) ## License -See LICENSE +See [LICENSE](LICENSE) ## Contributing -Please read [CodingStandards.txt](https://github.com/ethereum/cpp-ethereum/blob/master/CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formating guidelines as describled in [CodingStandards.txt](https://github.com/ethereum/cpp-ethereum/blob/master/CodingStandards.txt). +Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formating guidelines as describled in [CodingStandards.txt](CodingStandards.txt). From 21098d7f2ae426d74e3a141a4477b2c8f8badedb Mon Sep 17 00:00:00 2001 From: MelissaCole Date: Fri, 28 Feb 2014 14:02:55 -0500 Subject: [PATCH 03/14] Update README.md Correcting minor spelling errors ("formatting" and "guidelines") --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cc662f7d..cc227afe3 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ See [LICENSE](LICENSE) ## Contributing -Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formating guidelines as describled in [CodingStandards.txt](CodingStandards.txt). +Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formatting guidelines as described in [CodingStandards.txt](CodingStandards.txt). From d0dafb7981434e428cdec12153fc5c50147ebdfc Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 1 Mar 2014 16:40:35 +0000 Subject: [PATCH 04/14] Use secure http. --- alethzero/MainWin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 475c6cffd..fd82e6806 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -122,7 +122,7 @@ Main::Main(QWidget *parent) : { m_servers = QString::fromUtf8(_r->readAll()).split("\n", QString::SkipEmptyParts); }); - QNetworkRequest r(QUrl("http://www.ethereum.org/servers.poc3.txt")); + QNetworkRequest r(QUrl("https://www.ethereum.org/servers.poc3.txt")); r.setHeader(QNetworkRequest::UserAgentHeader, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1712.0 Safari/537.36"); m_webCtrl.get(r); srand(time(0)); From 0726a096684258a063bacb8bedb45ab662009848 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 1 Mar 2014 16:41:30 +0000 Subject: [PATCH 05/14] Version bump. --- libethereum/Common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/Common.h b/libethereum/Common.h index 608ebc7e5..2308116cf 100644 --- a/libethereum/Common.h +++ b/libethereum/Common.h @@ -24,7 +24,7 @@ #pragma once // define version -#define ETH_VERSION 0.3.9 +#define ETH_VERSION 0.3.10 // way to many uint to size_t warnings in 32 bit build #ifdef _M_IX86 From 451fdb395a7e19723dd952972375d09a58a2f441 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Sun, 2 Mar 2014 18:24:49 +0000 Subject: [PATCH 06/14] Drop https requirement for VS2013 for now. --- alethzero/MainWin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index fd82e6806..dd5a406d3 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -122,7 +122,11 @@ Main::Main(QWidget *parent) : { m_servers = QString::fromUtf8(_r->readAll()).split("\n", QString::SkipEmptyParts); }); +#ifdef _MSC_VER + QNetworkRequest r(QUrl("http://www.ethereum.org/servers.poc3.txt")); +#else QNetworkRequest r(QUrl("https://www.ethereum.org/servers.poc3.txt")); +#endif r.setHeader(QNetworkRequest::UserAgentHeader, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1712.0 Safari/537.36"); m_webCtrl.get(r); srand(time(0)); From 10777b5bb63f8f540503f29bb96221b804e44fa8 Mon Sep 17 00:00:00 2001 From: Ivan Borzenkov Date: Mon, 3 Mar 2014 20:36:48 +0400 Subject: [PATCH 07/14] correct deb package --- debian/control | 6 +++--- debian/rules | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index a54315c18..81e4c3b30 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: cpp-ethereum Section: science Priority: extra Maintainer: Ethereum (Ethereum Project) -Build-Depends: debhelper (>= 8.0.0), cmake, libgmp-dev, libcryptoppeth-dev, libboost-filesystem1.53-dev, libboost-mpi1.53-dev, libboost1.53-dev, libleveldb-dev, libminiupnpc-dev, qtbase5-dev, qt5-default +Build-Depends: debhelper (>= 8.0.0), cmake, libgmp-dev, libcryptoppeth-dev, libboost-filesystem-dev, libboost-mpi-dev, libboost-dev, libleveldb-dev, libminiupnpc-dev, qtbase5-dev, qt5-default Standards-Version: 3.9.4 Homepage: http://ethereum.org #Vcs-Git: git://git.debian.org/collab-maint/cpp-ethereum.git @@ -11,14 +11,14 @@ Homepage: http://ethereum.org Package: libethereum Section: libdevel Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libgmp, libcryptoppeth, libboost-filesystem1.53.0, libboost-mpi1.53.0, libleveldb, libminiupnpc, secp256k1eth +Depends: ${shlibs:Depends}, ${misc:Depends} Description: The future of computational social contracts. A long description of libethereum. Package: libethereum-dev Section: libdevel Architecture: any -Depends: libethereum (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, libgmp, libcryptoppeth, libboost-filesystem1.53.0, libboost-mpi1.53.0, libleveldb, libminiupnpc +Depends: libethereum (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Description: The future of computational social contracts. Dev Files. A long description of libethereum. Dev Files. diff --git a/debian/rules b/debian/rules index 5ffe813ee..611e815c1 100755 --- a/debian/rules +++ b/debian/rules @@ -31,6 +31,6 @@ override_dh_auto_install: # Move the libs over to the non-dev package. mkdir -p $(CURDIR)/debian/libethereum/usr mv $(CURDIR)/debian/libethereum-dev/usr/lib $(CURDIR)/debian/libethereum/usr/lib - mkdir -p $(CURDIR)/debian/alephzero/usr/bin + mkdir -p $(CURDIR)/debian/alethzero/usr/bin mv $(CURDIR)/debian/libethereum-dev/usr/bin/alethzero $(CURDIR)/debian/alethzero/usr/lib From d89b3460bdc1f7fcb256a1d337d3e1bdff60e0ef Mon Sep 17 00:00:00 2001 From: Ivan Borzenkov Date: Mon, 3 Mar 2014 21:00:36 +0400 Subject: [PATCH 08/14] fix path, add thread --- debian/control | 2 +- debian/rules | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 81e4c3b30..853dc3e99 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: cpp-ethereum Section: science Priority: extra Maintainer: Ethereum (Ethereum Project) -Build-Depends: debhelper (>= 8.0.0), cmake, libgmp-dev, libcryptoppeth-dev, libboost-filesystem-dev, libboost-mpi-dev, libboost-dev, libleveldb-dev, libminiupnpc-dev, qtbase5-dev, qt5-default +Build-Depends: debhelper (>= 8.0.0), cmake, libgmp-dev, libboost-thread-dev, libcryptoppeth-dev, libboost-filesystem-dev, libboost-mpi-dev, libboost-dev, libleveldb-dev, libminiupnpc-dev, qtbase5-dev, qt5-default Standards-Version: 3.9.4 Homepage: http://ethereum.org #Vcs-Git: git://git.debian.org/collab-maint/cpp-ethereum.git diff --git a/debian/rules b/debian/rules index 611e815c1..83f79d114 100755 --- a/debian/rules +++ b/debian/rules @@ -32,5 +32,5 @@ override_dh_auto_install: mkdir -p $(CURDIR)/debian/libethereum/usr mv $(CURDIR)/debian/libethereum-dev/usr/lib $(CURDIR)/debian/libethereum/usr/lib mkdir -p $(CURDIR)/debian/alethzero/usr/bin - mv $(CURDIR)/debian/libethereum-dev/usr/bin/alethzero $(CURDIR)/debian/alethzero/usr/lib + mv $(CURDIR)/debian/libethereum-dev/usr/bin/alethzero $(CURDIR)/debian/alethzero/usr/bin From b827c8ac8bc2d34e278a560a0a9298e70ade35f7 Mon Sep 17 00:00:00 2001 From: Ivan Borzenkov Date: Mon, 3 Mar 2014 21:43:09 +0400 Subject: [PATCH 09/14] qt5default --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 853dc3e99..b6c99a864 100644 --- a/debian/control +++ b/debian/control @@ -24,6 +24,6 @@ Description: The future of computational social contracts. Dev Files. Package: alethzero Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libethereum (= ${binary:Version}), qtbase5 +Depends: ${shlibs:Depends}, ${misc:Depends}, libethereum (= ${binary:Version}) Description: The Qt-based Ethereum GUI. A long description of alethzero. From e0c67d7c7c26bbc56f5a9210b3d480efef4f3800 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Tue, 4 Mar 2014 12:09:31 +0000 Subject: [PATCH 10/14] The std::string in InstructionInfo triggers a bug in Visual Studio 2013 where it fails to initialise the strings in c_instructionInfo. Using char const* fixes the problem, and is sufficient as the map is constructed from string literals anyway. I also moved the maps out of the header so we only get one copy, rather than multiple static copies for each referencing module. --- libethereum/Instruction.cpp | 110 +++++++++++++++++++++++++++++++++++ libethereum/Instruction.h | 113 +----------------------------------- 2 files changed, 113 insertions(+), 110 deletions(-) diff --git a/libethereum/Instruction.cpp b/libethereum/Instruction.cpp index 660747cfe..b37303738 100644 --- a/libethereum/Instruction.cpp +++ b/libethereum/Instruction.cpp @@ -26,6 +26,116 @@ using namespace std; using namespace eth; +const std::map eth::c_instructionInfo = +{ + { Instruction::STOP, { "STOP", 0, 0, 0 } }, + { Instruction::ADD, { "ADD", 0, 2, 1 } }, + { Instruction::SUB, { "SUB", 0, 2, 1 } }, + { Instruction::MUL, { "MUL", 0, 2, 1 } }, + { Instruction::DIV, { "DIV", 0, 2, 1 } }, + { Instruction::SDIV, { "SDIV", 0, 2, 1 } }, + { Instruction::MOD, { "MOD", 0, 2, 1 } }, + { Instruction::SMOD, { "SMOD", 0, 2, 1 } }, + { Instruction::EXP, { "EXP", 0, 2, 1 } }, + { Instruction::NEG, { "NEG", 0, 1, 1 } }, + { Instruction::LT, { "LT", 0, 2, 1 } }, + { Instruction::LE, { "LE", 0, 2, 1 } }, + { Instruction::GT, { "GT", 0, 2, 1 } }, + { Instruction::GE, { "GE", 0, 2, 1 } }, + { Instruction::EQ, { "EQ", 0, 2, 1 } }, + { Instruction::NOT, { "NOT", 0, 1, 1 } }, + { Instruction::MYADDRESS, { "MYADDRESS", 0, 0, 1 } }, + { Instruction::TXSENDER, { "TXSENDER", 0, 0, 1 } }, + { Instruction::TXVALUE, { "TXVALUE", 0, 0, 1 } }, + { Instruction::TXDATAN, { "TXDATAN", 0, 0, 1 } }, + { Instruction::TXDATA, { "TXDATA", 0, 1, 1 } }, + { Instruction::BLK_PREVHASH, { "BLK_PREVHASH", 0, 0, 1 } }, + { Instruction::BLK_COINBASE, { "BLK_COINBASE", 0, 0, 1 } }, + { Instruction::BLK_TIMESTAMP, { "BLK_TIMESTAMP", 0, 0, 1 } }, + { Instruction::BLK_NUMBER, { "BLK_NUMBER", 0, 0, 1 } }, + { Instruction::BLK_DIFFICULTY, { "BLK_DIFFICULTY", 0, 0, 1 } }, + { Instruction::BLK_NONCE, { "BLK_NONCE", 0, 0, 1 } }, + { Instruction::BASEFEE, { "BASEFEE", 0, 0, 1 } }, + { Instruction::SHA256, { "SHA256", 0, -1, 1 } }, + { Instruction::RIPEMD160, { "RIPEMD160", 0, -1, 1 } }, + { Instruction::ECMUL, { "ECMUL", 0, 3, 1 } }, + { Instruction::ECADD, { "ECADD", 0, 4, 1 } }, + { Instruction::ECSIGN, { "ECSIGN", 0, 2, 1 } }, + { Instruction::ECRECOVER, { "ECRECOVER", 0, 4, 1 } }, + { Instruction::ECVALID, { "ECVALID", 0, 2, 1 } }, + { Instruction::SHA3, { "SHA3", 0, -1, 1 } }, + { Instruction::PUSH, { "PUSH", 1, 0, 1 } }, + { Instruction::POP, { "POP", 0, 1, 0 } }, + { Instruction::DUP, { "DUP", 0, 1, 2 } }, + { Instruction::SWAP, { "SWAP", 0, 2, 2 } }, + { Instruction::MLOAD, { "MLOAD", 0, 1, 1 } }, + { Instruction::MSTORE, { "MSTORE", 0, 2, 0 } }, + { Instruction::SLOAD, { "SLOAD", 0, 1, 1 } }, + { Instruction::SSTORE, { "SSTORE", 0, 2, 0 } }, + { Instruction::JMP, { "JMP", 0, 1, 0 } }, + { Instruction::JMPI, { "JMPI", 0, 2, 0 } }, + { Instruction::IND, { "IND", 0, 0, 1 } }, + { Instruction::EXTRO, { "EXTRO", 0, 2, 1 } }, + { Instruction::BALANCE, { "BALANCE", 0, 1, 1 } }, + { Instruction::MKTX, { "MKTX", 0, -3, 0 } }, + { Instruction::SUICIDE, { "SUICIDE", 0, 1, 0} } +}; + +const std::map eth::c_instructions = +{ + { "STOP", Instruction::STOP }, + { "ADD", Instruction::ADD }, + { "SUB", Instruction::SUB }, + { "MUL", Instruction::MUL }, + { "DIV", Instruction::DIV }, + { "SDIV", Instruction::SDIV }, + { "MOD", Instruction::MOD }, + { "SMOD", Instruction::SMOD }, + { "EXP", Instruction::EXP }, + { "NEG", Instruction::NEG }, + { "LT", Instruction::LT }, + { "LE", Instruction::LE }, + { "GT", Instruction::GT }, + { "GE", Instruction::GE }, + { "EQ", Instruction::EQ }, + { "NOT", Instruction::NOT }, + { "MYADDRESS", Instruction::MYADDRESS }, + { "TXSENDER", Instruction::TXSENDER }, + { "TXVALUE", Instruction::TXVALUE }, + { "TXDATAN", Instruction::TXDATAN }, + { "TXDATA", Instruction::TXDATA }, + { "BLK_PREVHASH", Instruction::BLK_PREVHASH }, + { "BLK_COINBASE", Instruction::BLK_COINBASE }, + { "BLK_TIMESTAMP", Instruction::BLK_TIMESTAMP }, + { "BLK_NUMBER", Instruction::BLK_NUMBER }, + { "BLK_DIFFICULTY", Instruction::BLK_DIFFICULTY }, + { "BLK_NONCE", Instruction::BLK_NONCE }, + { "BASEFEE", Instruction::BASEFEE }, + { "SHA256", Instruction::SHA256 }, + { "RIPEMD160", Instruction::RIPEMD160 }, + { "ECMUL", Instruction::ECMUL }, + { "ECADD", Instruction::ECADD }, + { "ECSIGN", Instruction::ECSIGN }, + { "ECRECOVER", Instruction::ECRECOVER }, + { "ECVALID", Instruction::ECVALID }, + { "SHA3", Instruction::SHA3 }, + { "PUSH", Instruction::PUSH }, + { "POP", Instruction::POP }, + { "DUP", Instruction::DUP }, + { "SWAP", Instruction::SWAP }, + { "MLOAD", Instruction::MLOAD }, + { "MSTORE", Instruction::MSTORE }, + { "SLOAD", Instruction::SLOAD }, + { "SSTORE", Instruction::SSTORE }, + { "JMP", Instruction::JMP }, + { "JMPI", Instruction::JMPI }, + { "IND", Instruction::IND }, + { "EXTRO", Instruction::EXTRO }, + { "BALANCE", Instruction::BALANCE }, + { "MKTX", Instruction::MKTX }, + { "SUICIDE", Instruction::SUICIDE } +}; + static string readQuoted(char const*& o_d, char const* _e) { string ret; diff --git a/libethereum/Instruction.h b/libethereum/Instruction.h index 1c17e61a6..268795266 100644 --- a/libethereum/Instruction.h +++ b/libethereum/Instruction.h @@ -86,121 +86,14 @@ enum class Instruction: uint8_t struct InstructionInfo { - std::string name; + char const* name; int additional; int args; int ret; }; -static const std::map c_instructionInfo = -{ - { Instruction::STOP, { "STOP", 0, 0, 0 } }, - { Instruction::ADD, { "ADD", 0, 2, 1 } }, - { Instruction::SUB, { "SUB", 0, 2, 1 } }, - { Instruction::MUL, { "MUL", 0, 2, 1 } }, - { Instruction::DIV, { "DIV", 0, 2, 1 } }, - { Instruction::SDIV, { "SDIV", 0, 2, 1 } }, - { Instruction::MOD, { "MOD", 0, 2, 1 } }, - { Instruction::SMOD, { "SMOD", 0, 2, 1 } }, - { Instruction::EXP, { "EXP", 0, 2, 1 } }, - { Instruction::NEG, { "NEG", 0, 1, 1 } }, - { Instruction::LT, { "LT", 0, 2, 1 } }, - { Instruction::LE, { "LE", 0, 2, 1 } }, - { Instruction::GT, { "GT", 0, 2, 1 } }, - { Instruction::GE, { "GE", 0, 2, 1 } }, - { Instruction::EQ, { "EQ", 0, 2, 1 } }, - { Instruction::NOT, { "NOT", 0, 1, 1 } }, - { Instruction::MYADDRESS, { "MYADDRESS", 0, 0, 1 } }, - { Instruction::TXSENDER, { "TXSENDER", 0, 0, 1 } }, - { Instruction::TXVALUE, { "TXVALUE", 0, 0, 1 } }, - { Instruction::TXDATAN, { "TXDATAN", 0, 0, 1 } }, - { Instruction::TXDATA, { "TXDATA", 0, 1, 1 } }, - { Instruction::BLK_PREVHASH, { "BLK_PREVHASH", 0, 0, 1 } }, - { Instruction::BLK_COINBASE, { "BLK_COINBASE", 0, 0, 1 } }, - { Instruction::BLK_TIMESTAMP, { "BLK_TIMESTAMP", 0, 0, 1 } }, - { Instruction::BLK_NUMBER, { "BLK_NUMBER", 0, 0, 1 } }, - { Instruction::BLK_DIFFICULTY, { "BLK_DIFFICULTY", 0, 0, 1 } }, - { Instruction::BLK_NONCE, { "BLK_NONCE", 0, 0, 1 } }, - { Instruction::BASEFEE, { "BASEFEE", 0, 0, 1 } }, - { Instruction::SHA256, { "SHA256", 0, -1, 1 } }, - { Instruction::RIPEMD160, { "RIPEMD160", 0, -1, 1 } }, - { Instruction::ECMUL, { "ECMUL", 0, 3, 1 } }, - { Instruction::ECADD, { "ECADD", 0, 4, 1 } }, - { Instruction::ECSIGN, { "ECSIGN", 0, 2, 1 } }, - { Instruction::ECRECOVER, { "ECRECOVER", 0, 4, 1 } }, - { Instruction::ECVALID, { "ECVALID", 0, 2, 1 } }, - { Instruction::SHA3, { "SHA3", 0, -1, 1 } }, - { Instruction::PUSH, { "PUSH", 1, 0, 1 } }, - { Instruction::POP, { "POP", 0, 1, 0 } }, - { Instruction::DUP, { "DUP", 0, 1, 2 } }, - { Instruction::SWAP, { "SWAP", 0, 2, 2 } }, - { Instruction::MLOAD, { "MLOAD", 0, 1, 1 } }, - { Instruction::MSTORE, { "MSTORE", 0, 2, 0 } }, - { Instruction::SLOAD, { "SLOAD", 0, 1, 1 } }, - { Instruction::SSTORE, { "SSTORE", 0, 2, 0 } }, - { Instruction::JMP, { "JMP", 0, 1, 0 } }, - { Instruction::JMPI, { "JMPI", 0, 2, 0 } }, - { Instruction::IND, { "IND", 0, 0, 1 } }, - { Instruction::EXTRO, { "EXTRO", 0, 2, 1 } }, - { Instruction::BALANCE, { "BALANCE", 0, 1, 1 } }, - { Instruction::MKTX, { "MKTX", 0, -3, 0 } }, - { Instruction::SUICIDE, { "SUICIDE", 0, 1, 0} } -}; - -static const std::map c_instructions = -{ - { "STOP", Instruction::STOP }, - { "ADD", Instruction::ADD }, - { "SUB", Instruction::SUB }, - { "MUL", Instruction::MUL }, - { "DIV", Instruction::DIV }, - { "SDIV", Instruction::SDIV }, - { "MOD", Instruction::MOD }, - { "SMOD", Instruction::SMOD }, - { "EXP", Instruction::EXP }, - { "NEG", Instruction::NEG }, - { "LT", Instruction::LT }, - { "LE", Instruction::LE }, - { "GT", Instruction::GT }, - { "GE", Instruction::GE }, - { "EQ", Instruction::EQ }, - { "NOT", Instruction::NOT }, - { "MYADDRESS", Instruction::MYADDRESS }, - { "TXSENDER", Instruction::TXSENDER }, - { "TXVALUE", Instruction::TXVALUE }, - { "TXDATAN", Instruction::TXDATAN }, - { "TXDATA", Instruction::TXDATA }, - { "BLK_PREVHASH", Instruction::BLK_PREVHASH }, - { "BLK_COINBASE", Instruction::BLK_COINBASE }, - { "BLK_TIMESTAMP", Instruction::BLK_TIMESTAMP }, - { "BLK_NUMBER", Instruction::BLK_NUMBER }, - { "BLK_DIFFICULTY", Instruction::BLK_DIFFICULTY }, - { "BLK_NONCE", Instruction::BLK_NONCE }, - { "BASEFEE", Instruction::BASEFEE }, - { "SHA256", Instruction::SHA256 }, - { "RIPEMD160", Instruction::RIPEMD160 }, - { "ECMUL", Instruction::ECMUL }, - { "ECADD", Instruction::ECADD }, - { "ECSIGN", Instruction::ECSIGN }, - { "ECRECOVER", Instruction::ECRECOVER }, - { "ECVALID", Instruction::ECVALID }, - { "SHA3", Instruction::SHA3 }, - { "PUSH", Instruction::PUSH }, - { "POP", Instruction::POP }, - { "DUP", Instruction::DUP }, - { "SWAP", Instruction::SWAP }, - { "MLOAD", Instruction::MLOAD }, - { "MSTORE", Instruction::MSTORE }, - { "SLOAD", Instruction::SLOAD }, - { "SSTORE", Instruction::SSTORE }, - { "JMP", Instruction::JMP }, - { "JMPI", Instruction::JMPI }, - { "IND", Instruction::IND }, - { "EXTRO", Instruction::EXTRO }, - { "BALANCE", Instruction::BALANCE }, - { "MKTX", Instruction::MKTX }, - { "SUICIDE", Instruction::SUICIDE } -}; +extern const std::map c_instructionInfo; +extern const std::map c_instructions; u256s assemble(std::string const& _code, bool _quiet = false); std::string disassemble(u256s const& _mem); From ad0c353b08012177460aff0dcfe0498a5588d6b8 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 12 Mar 2014 12:29:48 -0700 Subject: [PATCH 11/14] README. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9f1276342..defd5fb00 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,6 @@ See [LICENSE](LICENSE) ### Contributing +All development goes in develop branch - please don't submit pull requests to master. + Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making alterations to the code base. Please do *NOT* use an editor that automatically reformats whitespace away from astylerc or the formatting guidelines as described in [CodingStandards.txt](CodingStandards.txt). From 59c9da7f003752fa28efff71a6b1cd0091bdf999 Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Fri, 21 Mar 2014 11:20:47 +0000 Subject: [PATCH 12/14] Workarounds for https://github.com/ethereum/cpp-ethereum/issues/128 and https://github.com/ethereum/cpp-ethereum/issues/129 --- libethereum/PeerNetwork.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libethereum/PeerNetwork.cpp b/libethereum/PeerNetwork.cpp index a4e3c6317..02be9bc2c 100644 --- a/libethereum/PeerNetwork.cpp +++ b/libethereum/PeerNetwork.cpp @@ -316,7 +316,9 @@ bool PeerSession::interpret(RLP const& _r) else clogS(NetMessageDetail) << "Known parent " << bi.parentHash << " of block " << h; } - if (used) // we received some - check if there's any more + // TJH: This check stops us downloading a forked chain when we already have the + // beginning of the fork. + //if (used) // we received some - check if there's any more { RLPStream s; prep(s).appendList(3); @@ -1021,7 +1023,11 @@ bool PeerServer::sync(BlockChain& _bc, TransactionQueue& _tq, Overlay& _o) if (it == m_incomingBlocks.begin()) break; } - if (!n && accepted) + // TJH: If we don't keep trying we'll leave lots of usable blocks + // in m_unknownParents until an incoming block arrives. Should + // probably replace with a better algorithm. + // if (!n && accepted) + if (accepted) { for (auto i: m_unknownParentBlocks) m_incomingBlocks.push_back(i); From 635da4f6b13b19330059dab730480e5996326172 Mon Sep 17 00:00:00 2001 From: Heavy Player Date: Wed, 9 Apr 2014 20:07:40 +0200 Subject: [PATCH 13/14] Remove merge-conflict in README --- README.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6666fb12d..617d50ce6 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,7 @@ Contributors, builders and testers include Eric Lombrozo (cross-compilation), Ti ### Building -<<<<<<< HEAD See [Build Instructions](https://github.com/ethereum/cpp-ethereum/wiki/Build-Instructions) and [Compatibility Info and Build Tips](https://github.com/ethereum/cpp-ethereum/wiki/Compatibility-Info-and-Build-Tips). -======= -See https://github.com/ethereum/cpp-ethereum/wiki/Build-Instructions and https://github.com/ethereum/cpp-ethereum/wiki/Compatibility-Info-and-Build-Tips . ->>>>>>> release-poc-4 ### Testing @@ -20,11 +16,8 @@ To run the tests, make sure you clone the tests repository from github.com/ether ### Yet To Do -<<<<<<< HEAD -See [TODO](TODO) -======= -See https://github.com/ethereum/cpp-ethereum/wiki/TODO ->>>>>>> release-poc-4 +See [TODO](https://github.com/ethereum/cpp-ethereum/wiki/TODO) + ### License From 6b2827b5d1e12a5ec83d383d4247b46602417f0b Mon Sep 17 00:00:00 2001 From: foobar Date: Wed, 30 Apr 2014 15:10:29 -0400 Subject: [PATCH 14/14] Initial Dockerfile --- docker/Dockerfile | 20 ++++++++++++++++++++ docker/README.md | 17 +++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/README.md diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..1bd690cbb --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:14.04 + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update +RUN apt-get upgrade -y + +RUN apt-get install -qy wget +RUN apt-get install -qy build-essential g++-4.8 automake libtool unzip git cmake +RUN apt-get install -qy libncurses5-dev libgmp-dev libgmp3-dev libboost-all-dev libleveldb-dev yasm libminiupnpc-dev +RUN apt-get install -qy qtbase5-dev qt5-default qtdeclarative5-dev libqt5webkit5-dev + +RUN mkdir /cryptopp562 +RUN cd /cryptopp562 && wget http://www.cryptopp.com/cryptopp562.zip && unzip cryptopp562.zip +RUN cd /cryptopp562 && make -j $(cat /proc/cpuinfo | grep processor | wc -l) && make install + +RUN git clone --depth=1 https://github.com/ethereum/cpp-ethereum +RUN mkdir cpp-ethereum/build +RUN cd cpp-ethereum/build && cmake .. -DCMAKE_BUILD_TYPE=Release && make -j $(cat /proc/cpuinfo | grep processor | wc -l) && make install + +ENTRYPOINT ["/usr/local/bin/eth"] diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..634ba56da --- /dev/null +++ b/docker/README.md @@ -0,0 +1,17 @@ +# Dockerfile for cpp-ethereum +Dockerfile to build a bleeding edge cpp-ethereum docker image from source + + docker build -t cppeth < Dockerfile + +Run a simple peer server + + docker run -i cppeth -m off -o peer -x 256 + +GUI is compiled but not exposed. You can mount /cpp-ethereum/build to access binaries: + + cid = $(docker run -i -v /cpp-ethereum/build cppeth -m off -o peer -x 256) + docker inspect $cid # <-- Find volume path in JSON output + +You may also modify the Docker image to run the GUI and expose a +ssh/VNC server in order to tunnel an X11 or VNC session. +