Skip to content

Commit

Permalink
Merge pull request #2858 from Taraxa-project/cornus_testnet
Browse files Browse the repository at this point in the history
cornus hf
  • Loading branch information
rattrap authored Sep 30, 2024
2 parents 42560c0 + 69ec027 commit 9db9cc3
Show file tree
Hide file tree
Showing 233 changed files with 2,632 additions and 1,632 deletions.
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.20)

# Set current version of the project
set(TARAXA_MAJOR_VERSION 1)
set(TARAXA_MINOR_VERSION 11)
set(TARAXA_PATCH_VERSION 4)
set(TARAXA_MINOR_VERSION 12)
set(TARAXA_PATCH_VERSION 0)
set(TARAXA_VERSION ${TARAXA_MAJOR_VERSION}.${TARAXA_MINOR_VERSION}.${TARAXA_PATCH_VERSION})

# Any time a change in the network protocol is introduced this version should be increased
set(TARAXA_NET_VERSION 3)
set(TARAXA_NET_VERSION 4)
# Major version is modified when DAG blocks, pbft blocks and any basic building blocks of our blockchain is modified
# in the db
set(TARAXA_DB_MAJOR_VERSION 1)
Expand All @@ -32,7 +32,8 @@ add_compile_options(-Wall
-Wextra-semi
-Wnull-dereference
-Wno-unknown-pragmas
-Wno-overlength-strings)
-Wno-overlength-strings
-Wno-switch)
# Set the position independent code property on all targets
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand Down Expand Up @@ -217,9 +218,6 @@ find_package(MPFR)
set(JSONCPP_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_JSONCPP})
include(ProjectJSONRPCCPP)

# rocksdb build
include(${PROJECT_SOURCE_DIR}/CMakeModules/rocksdb.cmake)

# Add sub-directories cmakes
add_subdirectory(submodules)
add_subdirectory(libraries)
Expand Down
32 changes: 0 additions & 32 deletions CMakeModules/rocksdb.cmake

This file was deleted.

3 changes: 3 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def requirements(self):
self.requires("cryptopp/8.9.0")
self.requires("gtest/1.14.0")
self.requires("lz4/1.9.4")
self.requires("rocksdb/9.2.1")
self.requires("prometheus-cpp/1.1.0")
self.requires("jsoncpp/1.9.5")

Expand Down Expand Up @@ -60,6 +61,8 @@ def configure(self):
self.options["gtest"].build_gmock = False
# this links cppcheck to prce library
self.options["cppcheck"].have_rules = False
self.options["rocksdb"].use_rtti = True
self.options["rocksdb"].with_lz4 = True
# mpir is required by cppcheck and it causing gmp confict
self.options["mpir"].enable_gmpcompat = False

Expand Down
11 changes: 5 additions & 6 deletions for_devs/local-net
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3

import click
import subprocess
import threading
Expand Down Expand Up @@ -313,7 +312,7 @@ def faucet_worker(tps):
time.sleep(10)
web3 = Web3(Web3.HTTPProvider('http://127.0.0.1:7017'))
nonce = web3.eth.get_transaction_count(
Web3.to_checksum_address(faucet_public_address))
Web3.toChecksumAddress(faucet_public_address))

consensus_nodes = list(consensus_nodes_public_addresses.keys())

Expand All @@ -323,10 +322,10 @@ def faucet_worker(tps):
0, len(consensus_nodes)-1)]]
tx = {
'nonce': nonce,
'to': Web3.to_checksum_address(to),
'value': web3.to_wei(100000000, 'gwei'),
'to': Web3.toChecksumAddress(to),
'value': web3.toWei(100000000, 'gwei'),
'gas': 21000,
'gasPrice': web3.to_wei(1, 'gwei'),
'gasPrice': web3.toWei(1, 'gwei'),
'chainId': int(chain_id)
}
nonce = nonce + 1
Expand All @@ -338,7 +337,7 @@ def faucet_worker(tps):
try:
tx_hash = web3.eth.send_raw_transaction(signed_tx.rawTransaction)
log_format(
'faucet', f'{t} Dripped to {to}, tx_hash: {web3.to_hex(tx_hash)}')
'faucet', f'{t} Dripped to {to}, tx_hash: {web3.toHex(tx_hash)}')
except Exception as e:
log_format('faucet', f'{t} Failed to drip to {to}. Error: {str(e)}')
pass
Expand Down
2 changes: 1 addition & 1 deletion libraries/aleth/libdevcore/Base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#include <string>

#include "FixedHash.h"
#include "Common.h"

namespace dev {
std::string toBase64(bytesConstRef _in);
Expand Down
1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "Common.h"

#include "Exceptions.h"
#include "Log.h"

#if defined(_WIN32)
Expand Down
1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#pragma warning(push)
#pragma GCC diagnostic push
Expand Down
4 changes: 3 additions & 1 deletion libraries/aleth/libdevcore/CommonData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

#include "CommonData.h"

#include <random>
#include <libdevcore/Common.h>

#include <boost/throw_exception.hpp>

#include "Exceptions.h"

Expand Down
2 changes: 0 additions & 2 deletions libraries/aleth/libdevcore/CommonIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <boost/filesystem.hpp>
#include <chrono>
#include <iosfwd>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <string>
Expand Down
1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/CommonJS.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <string>

#include "CommonData.h"
#include "CommonIO.h"
#include "FixedHash.h"

namespace dev {
Expand Down
9 changes: 0 additions & 9 deletions libraries/aleth/libdevcore/Guards.cpp

This file was deleted.

1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/Guards.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#pragma once

#include <atomic>
#include <condition_variable>
#include <mutex>
#pragma warning(push)
Expand Down
1 change: 0 additions & 1 deletion libraries/aleth/libdevcore/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <string>
#include <vector>

#include "CommonIO.h"
#include "FixedHash.h"
#include "Terminal.h"

Expand Down
8 changes: 8 additions & 0 deletions libraries/aleth/libdevcore/RLP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
// Copyright 2013-2019 Aleth Authors.
// Licensed under the GNU General Public License, Version 3.
#include "RLP.h"

#include <libdevcore/Exceptions.h>
#include <libdevcore/vector_ref.h>

#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/info_tuple.hpp>
#include <sstream>

using namespace std;
using namespace dev;

Expand Down
2 changes: 0 additions & 2 deletions libraries/aleth/libdevcore/RLP.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#pragma once

#include <array>
#include <exception>
#include <iomanip>
#include <iosfwd>
#include <type_traits>
#include <vector>
Expand Down
2 changes: 2 additions & 0 deletions libraries/aleth/libdevcore/SHA3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#include <ethash/keccak.hpp>

#include "ethash/hash_types.hpp"

namespace dev {

bool sha3(bytesConstRef _input, bytesRef o_output) noexcept {
Expand Down
2 changes: 1 addition & 1 deletion libraries/aleth/libdevcrypto/AES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <cryptopp/modes.h>
#include <cryptopp/pwdbased.h>
#include <cryptopp/sha.h>
#include <libdevcore/CommonData.h>

using namespace dev;
using namespace dev::crypto;

bytes dev::aesDecrypt(bytesConstRef _ivCipher, std::string const& _password, unsigned _rounds, bytesConstRef _salt) {
bytes pw = asBytes(_password);
Expand Down
2 changes: 1 addition & 1 deletion libraries/aleth/libdevcrypto/AES.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#pragma once

#include "Common.h"
#include <libdevcore/Common.h>

namespace dev {

Expand Down
3 changes: 0 additions & 3 deletions libraries/aleth/libdevcrypto/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <cryptopp/aes.h>
#include <cryptopp/modes.h>
#include <cryptopp/pwdbased.h>
#include <cryptopp/sha.h>
#include <libdevcore/Guards.h> // <boost/thread> conflicts with <thread>
#include <libdevcore/SHA3.h>
#include <secp256k1.h>
Expand All @@ -17,7 +15,6 @@

#include "AES.h"
#include "CryptoPP.h"
#include "Exceptions.h"
using namespace std;
using namespace dev;
using namespace dev::crypto;
Expand Down
2 changes: 0 additions & 2 deletions libraries/aleth/libdevcrypto/CryptoPP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
#include <cryptopp/eccrypto.h>
#include <cryptopp/oids.h>
#include <cryptopp/osrng.h>
#include <libdevcore/Assertions.h>
#include <libdevcore/Guards.h> // <boost/thread> conflicts with <thread>
#include <libdevcore/SHA3.h>

static_assert(CRYPTOPP_VERSION >= 565, "Wrong Crypto++ version");

Expand Down
6 changes: 0 additions & 6 deletions libraries/aleth/libp2p/All.h

This file was deleted.

1 change: 1 addition & 0 deletions libraries/aleth/libp2p/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <regex>

#include "Network.h"
#include "libdevcore/CommonIO.h"

namespace dev {
namespace p2p {
Expand Down
3 changes: 2 additions & 1 deletion libraries/aleth/libp2p/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/steady_timer.hpp>
#include <chrono>

namespace ba = boost::asio;
namespace bi = boost::asio::ip;
namespace bi = ba::ip;

namespace dev {

Expand Down
9 changes: 0 additions & 9 deletions libraries/aleth/libp2p/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,15 @@

#include "Host.h"

#include <libdevcore/Assertions.h>
#include <libdevcore/Common.h>
#include <libdevcore/CommonIO.h>
#include <libdevcore/Exceptions.h>

#include <boost/algorithm/string.hpp>
#include <chrono>
#include <fstream>
#include <memory>
#include <mutex>
#include <set>
#include <thread>

#include "Capability.h"
#include "Common.h"
#include "RLPxHandshake.h"
#include "Session.h"
#include "UPnP.h"

using namespace std;
using namespace dev;
Expand Down
7 changes: 1 addition & 6 deletions libraries/aleth/libp2p/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@

#pragma once

#include <libdevcore/CommonIO.h>
#include <libdevcore/Guards.h>
#include <libdevcrypto/Common.h>

#include <chrono>
#include <filesystem>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <thread>
#include <utility>
#include <vector>

Expand All @@ -26,9 +24,6 @@
#include "Session.h"
#include "taraxa.hpp"

namespace io = boost::asio;
namespace bi = io::ip;

namespace std {
template <>
struct hash<pair<dev::p2p::NodeID, string>> {
Expand Down
4 changes: 1 addition & 3 deletions libraries/aleth/libp2p/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@
// Copyright 2014-2019 Aleth Authors.
// Licensed under the GNU General Public License, Version 3.

#include <sys/types.h>
#ifndef _WIN32
#include <ifaddrs.h>
#endif

#include <libdevcore/Assertions.h>
#include <libdevcore/Common.h>
#include <libdevcore/CommonIO.h>
#include <libdevcore/Exceptions.h>

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>

#include "Common.h"
Expand Down
7 changes: 0 additions & 7 deletions libraries/aleth/libp2p/Network.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@
#include <libdevcore/Guards.h>
#include <libdevcore/RLP.h>

#include <array>
#include <deque>
#include <memory>
#include <vector>

#include "Common.h"
namespace ba = boost::asio;
namespace bi = ba::ip;

namespace dev {
namespace p2p {
Expand Down
Loading

0 comments on commit 9db9cc3

Please sign in to comment.