From 7f4176a787124d5120b5072acbba8b4947e470c6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 11 Jun 2014 11:31:56 +0100 Subject: [PATCH] Protocol 20 changes. Added my new address to the premine. --- alethzero/MainWin.cpp | 11 +++++++---- eth/main.cpp | 8 ++++---- libethcore/CommonEth.cpp | 2 +- libethereum/BlockChain.cpp | 5 +---- libethsupport/Common.cpp | 8 ++++++-- libethsupport/Common.h | 5 ++--- lllc/main.cpp | 2 +- neth/main.cpp | 8 ++++---- walleth/MainWin.cpp | 6 +++--- 9 files changed, 29 insertions(+), 26 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index ccc7191d5..57dc090b3 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -184,7 +184,7 @@ Main::Main(QWidget *parent) : #if ETH_DEBUG m_servers.append("192.168.0.10:30301"); #else - int pocnumber = QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1).toInt(); + int pocnumber = QString(eth::EthVersion).section('.', 1, 1).toInt(); if (pocnumber == 4) m_servers.push_back("54.72.31.55:30303"); else if (pocnumber == 5) @@ -202,7 +202,10 @@ Main::Main(QWidget *parent) : } #endif - cerr << "State root: " << BlockChain::genesis().stateRoot << endl << "Block Hash: " << sha3(BlockChain::createGenesisBlock()) << endl << "Block RLP: " << RLP(BlockChain::createGenesisBlock()) << endl << "Block Hex: " << toHex(BlockChain::createGenesisBlock()) << endl; + cerr << "State root: " << BlockChain::genesis().stateRoot << endl; + cerr << "Block Hash: " << sha3(BlockChain::createGenesisBlock()) << endl; + cerr << "Block RLP: " << RLP(BlockChain::createGenesisBlock()) << endl; + cerr << "Block Hex: " << toHex(BlockChain::createGenesisBlock()) << endl; cerr << "Network protocol version: " << eth::c_protocolVersion << endl; ui->configDock->close(); @@ -382,7 +385,7 @@ Address Main::fromString(QString const& _a) const void Main::on_about_triggered() { - QMessageBox::about(this, "About AlethZero PoC-" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1), QString("AlethZero/v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) "\n" ETH_QUOTED(ETH_COMMIT_HASH)) + (ETH_CLEAN_REPO ? "\nCLEAN" : "\n+ LOCAL CHANGES") + "\n\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Eric Lombrozo, Marko Simovic, Alex Leverington, Tim Hughes and several others."); + QMessageBox::about(this, "About AlethZero PoC-" + QString(eth::EthVersion).section('.', 1, 1), QString("AlethZero/v") + eth::EthVersion + "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) "\n" ETH_QUOTED(ETH_COMMIT_HASH) + (ETH_CLEAN_REPO ? "\nCLEAN" : "\n+ LOCAL CHANGES") + "\n\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Eric Lombrozo, Marko Simovic, Alex Leverington, Tim Hughes and several others."); } void Main::on_paranoia_triggered() @@ -1058,7 +1061,7 @@ void Main::on_net_triggered() { ui->port->setEnabled(!ui->net->isChecked()); ui->clientName->setEnabled(!ui->net->isChecked()); - string n = "AlethZero/v" ETH_QUOTED(ETH_VERSION); + string n = string("AlethZero/v") + eth::EthVersion; if (ui->clientName->text().size()) n += "/" + ui->clientName->text().toStdString(); n += "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM); diff --git a/eth/main.cpp b/eth/main.cpp index 3339a2e27..b8ce5967c 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -111,13 +111,13 @@ string credits(bool _interactive = false) { std::ostringstream cout; cout - << "Ethereum (++) " << ETH_QUOTED(ETH_VERSION) << endl + << "Ethereum (++) " << eth::EthVersion << endl << " Code by Gav Wood, (c) 2013, 2014." << endl << " Based on a design by Vitalik Buterin." << endl << endl; if (_interactive) { - string vs = toString(ETH_QUOTED(ETH_VERSION)); + string vs = eth::EthVersion; vs = vs.substr(vs.find_first_of('.') + 1)[0]; int pocnumber = stoi(vs); string m_servers; @@ -135,7 +135,7 @@ string credits(bool _interactive = false) void version() { - cout << "eth version " << ETH_QUOTED(ETH_VERSION) << endl; + cout << "eth version " << eth::EthVersion << endl; cout << "Build: " << ETH_QUOTED(ETH_BUILD_PLATFORM) << "/" << ETH_QUOTED(ETH_BUILD_TYPE) << endl; exit(0); } @@ -278,7 +278,7 @@ int main(int argc, char** argv) if (!clientName.empty()) clientName += "/"; - Client c("Ethereum(++)/" + clientName + "v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath); + Client c("Ethereum(++)/" + clientName + "v" + eth::EthVersion + "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath); cout << credits(); cout << "Address: " << endl << toHex(us.address().asArray()) << endl; diff --git a/libethcore/CommonEth.cpp b/libethcore/CommonEth.cpp index 34c77392e..c5ea5ff99 100644 --- a/libethcore/CommonEth.cpp +++ b/libethcore/CommonEth.cpp @@ -28,7 +28,7 @@ using namespace eth; //#define ETH_ADDRESS_DEBUG 1 -const unsigned eth::c_protocolVersion = 19; +const unsigned eth::c_protocolVersion = 20; static const vector> g_units = { diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 27f1b337e..809f3a90a 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -70,10 +70,9 @@ std::map const& eth::genesisState() { static std::map s_ret; if (s_ret.empty()) - { // Initialise. for (auto i: vector({ - "8a40bfaa73256b60764c1bf40675a99083efb075", + "51ba59315b3a95761d0863b05ccc7a7f54703d99", "e6716f9544a56c530d868e4bfbacb172315bdead", "1e12515ce3e0f817a4ddef9ca55788a1d66bd2df", "1a26338f0d905e295fccb71fa9ea849ffa12aaf4", @@ -83,8 +82,6 @@ std::map const& eth::genesisState() "e4157b34ea9615cfbde6b4fda419828124b70c78" })) s_ret[Address(fromHex(i))] = AddressState(0, u256(1) << 200, h256(), EmptySHA3); - - } return s_ret; } diff --git a/libethsupport/Common.cpp b/libethsupport/Common.cpp index b137a8b38..c47a9fbe9 100644 --- a/libethsupport/Common.cpp +++ b/libethsupport/Common.cpp @@ -24,5 +24,9 @@ using namespace std; using namespace eth; -#pragma GCC diagnostic ignored "-Wunused-variable" -namespace { char dummy; }; +namespace eth +{ + +char const* EthVersion = "0.5.11"; + +} diff --git a/libethsupport/Common.h b/libethsupport/Common.h index 9077d245d..c06ede0c0 100644 --- a/libethsupport/Common.h +++ b/libethsupport/Common.h @@ -23,9 +23,6 @@ #pragma once -// define version -#define ETH_VERSION 0.5.10 - // way to many uint to size_t warnings in 32 bit build #ifdef _M_IX86 #pragma warning(disable:4244) @@ -52,6 +49,8 @@ using byte = uint8_t; namespace eth { +extern char const* EthVersion; + // Binary data types. using bytes = std::vector; using bytesRef = vector_ref; diff --git a/lllc/main.cpp b/lllc/main.cpp index be4ea8c01..020d137bb 100644 --- a/lllc/main.cpp +++ b/lllc/main.cpp @@ -46,7 +46,7 @@ void help() void version() { - cout << "LLLC, the Lovely Little Language Compiler " << ETH_QUOTED(ETH_VERSION) << endl; + cout << "LLLC, the Lovely Little Language Compiler " << eth::EthVersion << endl; cout << " By Gav Wood, (c) 2014." << endl; cout << "Build: " << ETH_QUOTED(ETH_BUILD_PLATFORM) << "/" << ETH_QUOTED(ETH_BUILD_TYPE) << endl; exit(0); diff --git a/neth/main.cpp b/neth/main.cpp index dce147812..583a9a82c 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -121,11 +121,11 @@ string credits() { std::ostringstream ccout; ccout - << "NEthereum (++) " << ETH_QUOTED(ETH_VERSION) << endl + << "NEthereum (++) " << eth::EthVersion << endl << " Code by Gav Wood & , (c) 2013, 2014." << endl << " Based on a design by Vitalik Buterin." << endl << endl; - string vs = toString(ETH_QUOTED(ETH_VERSION)); + string vs = toString(eth::EthVersion); vs = vs.substr(vs.find_first_of('.') + 1)[0]; int pocnumber = stoi(vs); string m_servers; @@ -142,7 +142,7 @@ string credits() void version() { - cout << "neth version " << ETH_QUOTED(ETH_VERSION) << endl; + cout << "neth version " << eth::EthVersion << endl; cout << "Build: " << ETH_QUOTED(ETH_BUILD_PLATFORM) << "/" << ETH_QUOTED(ETH_BUILD_TYPE) << endl; exit(0); } @@ -412,7 +412,7 @@ int main(int argc, char** argv) if (!clientName.empty()) clientName += "/"; - Client c("NEthereum(++)/" + clientName + "v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath); + Client c("NEthereum(++)/" + clientName + "v" + eth::EthVersion + "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM), coinbase, dbPath); cout << credits(); std::ostringstream ccout; diff --git a/walleth/MainWin.cpp b/walleth/MainWin.cpp index be4acf40c..6500822dd 100644 --- a/walleth/MainWin.cpp +++ b/walleth/MainWin.cpp @@ -115,7 +115,7 @@ Main::Main(QWidget *parent) : on_net_triggered(true); } }); - QNetworkRequest r(QUrl("http://www.ethereum.org/servers.poc" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1) + ".txt")); + QNetworkRequest r(QUrl("http://www.ethereum.org/servers.poc" + QString(eth::EthVersion).section('.', 1, 1) + ".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)); @@ -140,7 +140,7 @@ void Main::timerEvent(QTimerEvent *) void Main::on_about_triggered() { - QMessageBox::about(this, "About Walleth PoC-" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1), "Walleth/v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) " - " ETH_QUOTED(ETH_COMMIT_HASH) "\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Tim Hughes, Eric Lombrozo, Marko Simovic, Alex Leverington and several others."); + QMessageBox::about(this, "About Walleth PoC-" + QString(eth::EthVersion).section('.', 1, 1), QString("Walleth/v") + eth::EthVersion + "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) " - " ETH_QUOTED(ETH_COMMIT_HASH) "\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Tim Hughes, Eric Lombrozo, Marko Simovic, Alex Leverington and several others."); } void Main::writeSettings() @@ -232,7 +232,7 @@ void Main::refresh() void Main::on_net_triggered(bool _auto) { - string n = "Walleth/v" ETH_QUOTED(ETH_VERSION); + string n = string("Walleth/v") + eth::EthVersion; if (m_clientName.size()) n += "/" + m_clientName.toStdString(); n += "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM);