Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aeon upstream 2 test #1

Merged
merged 53 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
7c7eb62
Bump version to 0.12.6
stoffu Aug 28, 2018
ee24f00
disable querying DNS TXT records for now
stoffu Sep 4, 2018
0719997
Add Discord community link to Readme.md
shigutso Sep 17, 2018
e047e17
epee: fix invalid memory write reading an array entry /monero#4438
moneromooo-monero Aug 2, 2018
9e088db
epee: fix stack overflow on crafted input /monero#4438
moneromooo-monero Aug 5, 2018
fd95f8b
wallet2: fix duplicate output making it to the RPC /monero#4438
moneromooo-monero Sep 19, 2018
3e7811a
Merge pull request #59 from shigutso/patch-1
aeonix Sep 27, 2018
7932119
Merge pull request #56 from stoffu/aeon-disable-dnstxt
aeonix Sep 27, 2018
cfe7a70
Merge pull request #60 from stoffu/aeon-bm
aeonix Sep 27, 2018
2988160
Merge pull request #54 from stoffu/aeon-bump-0.12.6
aeonix Sep 27, 2018
8f22162
Update README.md
DeadManWalkingTO Oct 24, 2018
b7b1346
Fix cryptonote_tx_utils.cpp build /monero#4476
DeadManWalkingTO Oct 23, 2018
702438e
Replace some Monero port numbers with Aeon's
stoffu Oct 30, 2018
19e92ff
wallet2: fix transfers between subaddresses hitting the sanity check …
moneromooo-monero Sep 28, 2018
a0fb9f0
Merge pull request #69 from DeadManWalkingTO/patch-1
aeonix Nov 3, 2018
c864477
Merge pull request #70 from DeadManWalkingTO/patch-2
aeonix Nov 3, 2018
1d2be05
Merge pull request #74 from stoffu/aeon-portnum
aeonix Nov 3, 2018
4764dbd
Merge pull request #75 from stoffu/aeon-subsc
aeonix Nov 3, 2018
73ca0ad
wallet2: use std::move on containers where appropriate /monero#3716
moneromooo-monero Apr 15, 2018
2da79c7
rpc: add option to skip coinbase info in get_blocks.bin /monero#3716
moneromooo-monero Apr 15, 2018
3bfc8fa
rpc: sanity check on number of txes in a block /monero#3716
moneromooo-monero Apr 15, 2018
746da5d
replace std::list with std::vector on some hot paths /monero#3716
moneromooo-monero Apr 15, 2018
b6e8aff
rpc: rework to avoid repeated calculations in get_blocks.bin /monero#…
moneromooo-monero Apr 16, 2018
4001874
wallet: don't process miner tx if we're refreshing with no-coinbase /…
moneromooo-monero Apr 17, 2018
60e3cfa
wallet2: simplify/speedup process_blocks /monero#3716
moneromooo-monero Apr 17, 2018
7b7715a
wallet2: parse blocks in the RPC thread, not the processing thread /m…
moneromooo-monero Apr 17, 2018
5862bfd
wallet2: remove useless device locking /monero#3716
moneromooo-monero Apr 18, 2018
ef9d990
wallet2: avoid duplicate parsing of tx extra /monero#3716
moneromooo-monero Apr 18, 2018
95a6e9c
wallet2: avoid re-parsing blocks when refreshing in a loop /monero#3716
moneromooo-monero Apr 18, 2018
31854ff
blockchain: simplify/speedup handle_get_objects /monero#3716
moneromooo-monero Apr 18, 2018
76e398d
wallet2: speedup refresh /monero#3716
moneromooo-monero Apr 21, 2018
cae8bf3
wallet2: remove old blockchain size cache hack /monero#3716
moneromooo-monero Apr 24, 2018
d2be6dc
wallet2: remove unneeded divisions /monero#3716
moneromooo-monero Apr 24, 2018
b02b5e2
threadpool: allow leaf functions to run concurrently /monero#3716
moneromooo-monero Apr 26, 2018
df7f3f7
wallet2: cache ringdb key while refreshing /monero#3716
moneromooo-monero Apr 27, 2018
3a12734
simplewallet: don't confirm missing payment ID when sending to only s…
stoffu Jun 10, 2018
cb83928
cryptonote_config: add get_config to refactor x = testnet ? config::t…
stoffu Jun 11, 2018
38ba3cd
net_node: resolve host for node addresses given via command line flag…
stoffu Jun 11, 2018
f907eb4
Remove old logic saved in comments. /monero#3986
jeandudey Jun 11, 2018
c62824d
db_ldmb: print db version when complaining about incompatibility /mon…
moneromooo-monero Jun 11, 2018
7aa0271
wallet: allow unspendable unmixable outputs to be discarded /monero#3991
stoffu Jun 12, 2018
41a947a
wallet2: use decoded amount when reporting repeated output key /moner…
stoffu Jun 12, 2018
7783c3a
wallet: on first refresh, start off with a quantized height /monero#3998
moneromooo-monero Jun 13, 2018
269a3fa
wallet: include a suggested number of confirmations based on amount /…
moneromooo-monero Jun 2, 2018
17885e6
wallet_rpc_server: fix build - forgot to build rpc version /monero#4065
moneromooo-monero Jun 27, 2018
d4a51e0
blockchain: fix build after waiter::wait prototype change /monero#4066
moneromooo-monero Jun 27, 2018
051e571
epee.string_tools: add conversion between UTF-8 and UTF-16 /monero#3994
stoffu Jun 25, 2018
44bead4
util: add file_locker class /monero#3994
stoffu Jun 21, 2018
a5a4c4e
wallet: prevent the same wallet file from being opened by multiple pr…
stoffu Jun 12, 2018
c1a1d6e
Wallet API: add some missing override keyword /monero#4000
stoffu Jun 13, 2018
462d98b
api/wallet: add missing arg to wallet2::refresh() /monero#4068
stoffu Jun 28, 2018
490f23f
util: fix mistakes made in #3994 /monero#4069
stoffu Jun 28, 2018
1643745
wallet2: fix build for windows (std::max again) /monero#4067
moneromooo-monero Jun 27, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ VOLUME /root/.bitmonero
# monero-wallet-cli
VOLUME /wallet

EXPOSE 18080
EXPOSE 18081
EXPOSE 11180
EXPOSE 11181

ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--confirm-external-bind"]
ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=11180", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=11181", "--non-interactive", "--confirm-external-bind"]
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Aeon

[![Github All Releases](https://img.shields.io/github/downloads/aeonix/aeon/total.svg)](../../releases)
[![GitHub release](https://img.shields.io/github/release/aeonix/aeon/all.svg)](../../releases/latest)
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/aeonix/aeon.svg)](../../releases/latest)
[![GitHub top language](https://img.shields.io/github/languages/top/aeonix/aeon.svg)](../../)
[![GitHub language count](https://img.shields.io/github/languages/count/aeonix/aeon.svg)](../../)
[![GitHub repo size in bytes](https://img.shields.io/github/repo-size/aeonix/aeon.svg)](../../)

[![GitHub last commit](https://img.shields.io/github/last-commit/aeonix/aeon.svg)](../../)
[![Github commits (since latest release)](https://img.shields.io/github/commits-since/aeonix/aeon/latest.svg)](../../)
[![GitHub stars](https://img.shields.io/github/stars/aeonix/aeon.svg)](../../stargazers)
[![GitHub forks](https://img.shields.io/github/forks/aeonix/aeon.svg)](../../network)
[![GitHub issues](https://img.shields.io/github/issues/aeonix/aeon.svg)](../../issues)
[![GitHub closed issues](https://img.shields.io/github/issues-closed/aeonix/aeon.svg)](../../issues)

Copyright (c) 2014-2018, AEON, The Monero Project.
Portions Copyright (c) 2012-2013 The Cryptonote developers.

Expand All @@ -10,6 +24,7 @@ Portions Copyright (c) 2012-2013 The Cryptonote developers.
- Reddit: https://www.reddit.com/r/Aeon
- GitHub: [https://github.com/aeonix/aeon](https://github.com/aeonix/aeon)
- IRC: [#aeon on Freenode](http://webchat.freenode.net/?randomnick=1&channels=%23aeon&prompt=1&uio=d4)
- Discord: https://discord.gg/TM8mEsx

## Vulnerability response

Expand Down Expand Up @@ -79,7 +94,7 @@ Dates are provided in the format YYYY-MM-DD.
| Software upgrade block height | Date | Fork version | Minimum Aeon version | Recommended Aeon version | Details |
| ------------------------------ | -----------| ----------------- | ---------------------- | -------------------------- | ---------------------------------------------------------------------------------- |
| 592000 | 2015-08-04 | v1 (exceptional, version not bumped) | v0.9.0.0 | v0.9.14.0 | blocktime = 240 seconds, CryptoNight-Lite, lower mining priority for ringsize < 3 |
| 963500 | 2018-06-03 | v7 | v0.12.0.0 | v0.12.2.1 | Rebase to Monero's latest codebase with RingCT disabled, CryptoNight-Lite variant 1, limited use of ringsize 1, ban ringsize 2 |
| 963500 | 2018-06-03 | v7 | v0.12.0.0 | v0.12.6.0-aeon | Rebase to Monero's latest codebase with RingCT disabled, CryptoNight-Lite variant 1, limited use of ringsize 1, ban ringsize 2 |

## Compiling Aeon from source

Expand Down Expand Up @@ -142,7 +157,7 @@ invokes cmake commands as needed.
* Change to the root of the source code directory, change to the most recent release tag, and build:

cd aeon
git checkout v0.12.2.1
git checkout v0.12.6.0-aeon
make

*Optional*: If your machine has several cores and enough memory, enable
Expand Down Expand Up @@ -204,7 +219,7 @@ Tested on a Raspberry Pi Zero with a clean install of minimal Raspbian Stretch (
```
git clone https://github.com/aeonix/aeon.git
cd aeon
git checkout tags/v0.12.2.1
git checkout tags/v0.12.6.0-aeon
```
* Build:
```
Expand Down Expand Up @@ -301,9 +316,9 @@ application.

cd aeon

* If you would like a specific [version/tag](https://github.com/aeonix/aeon/tags), do a git checkout for that version. eg. 'v0.12.1.0'. If you dont care about the version and just want binaries from master, skip this step:
* If you would like a specific [version/tag](https://github.com/aeonix/aeon/tags), do a git checkout for that version. eg. 'v0.12.6.0-aeon'. If you dont care about the version and just want binaries from master, skip this step:

git checkout v0.12.1.0
git checkout v0.12.6.0-aeon

* If you are on a 64-bit system, run:

Expand Down Expand Up @@ -566,7 +581,7 @@ TAILS ships with a very restrictive set of firewall rules. Therefore, you need
to add a rule to allow this connection too, in addition to telling torsocks to
allow inbound connections. Full example:

sudo iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 18081 -j ACCEPT
sudo iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 11181 -j ACCEPT
DNS_PUBLIC=tcp torsocks ./aeond --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 \
--data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain

Expand Down
25 changes: 10 additions & 15 deletions contrib/epee/include/file_io_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <boost/filesystem/operations.hpp>
#ifdef WIN32
#include <windows.h>
#include "string_tools.h"
#endif

// On Windows there is a problem with non-ASCII characters in path and file names
Expand Down Expand Up @@ -72,11 +73,9 @@ namespace file_io_utils
bool save_string_to_file(const std::string& path_to_file, const std::string& str)
{
#ifdef WIN32
WCHAR wide_path[1000];
int chars = MultiByteToWideChar(CP_UTF8, 0, path_to_file.c_str(), path_to_file.size() + 1, wide_path, 1000);
if (chars == 0)
return false;
HANDLE file_handle = CreateFileW(wide_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (file_handle == INVALID_HANDLE_VALUE)
return false;
DWORD bytes_written;
Expand Down Expand Up @@ -131,11 +130,9 @@ namespace file_io_utils
bool load_file_to_string(const std::string& path_to_file, std::string& target_str, size_t max_size = 1000000000)
{
#ifdef WIN32
WCHAR wide_path[1000];
int chars = MultiByteToWideChar(CP_UTF8, 0, path_to_file.c_str(), path_to_file.size() + 1, wide_path, 1000);
if (chars == 0)
return false;
HANDLE file_handle = CreateFileW(wide_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (file_handle == INVALID_HANDLE_VALUE)
return false;
DWORD file_size = GetFileSize(file_handle, NULL);
Expand Down Expand Up @@ -202,11 +199,9 @@ namespace file_io_utils
bool get_file_size(const std::string& path_to_file, uint64_t &size)
{
#ifdef WIN32
WCHAR wide_path[1000];
int chars = MultiByteToWideChar(CP_UTF8, 0, path_to_file.c_str(), path_to_file.size() + 1, wide_path, 1000);
if (chars == 0)
return false;
HANDLE file_handle = CreateFileW(wide_path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
std::wstring wide_path;
try { wide_path = string_tools::utf8_to_utf16(path_to_file); } catch (...) { return false; }
HANDLE file_handle = CreateFileW(wide_path.c_str(), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (file_handle == INVALID_HANDLE_VALUE)
return false;
LARGE_INTEGER file_size;
Expand Down
8 changes: 8 additions & 0 deletions contrib/epee/include/storages/portable_storage_from_bin.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace epee
storage_entry load_storage_entry();
void read(section& sec);
void read(std::string& str);
void read(array_entry &ae);
private:
struct recursuion_limitation_guard
{
Expand Down Expand Up @@ -114,6 +115,7 @@ namespace epee
void throwable_buffer_reader::read(t_pod_type& pod_val)
{
RECURSION_LIMITATION();
static_assert(std::is_pod<t_pod_type>::value, "POD type expected");
read(&pod_val, sizeof(pod_val));
}

Expand Down Expand Up @@ -277,5 +279,11 @@ namespace epee
m_ptr+=len;
m_count -= len;
}
inline
void throwable_buffer_reader::read(array_entry &ae)
{
RECURSION_LIMITATION();
CHECK_AND_ASSERT_THROW_MES(false, "Reading array entry is not supported");
}
}
}
13 changes: 8 additions & 5 deletions contrib/epee/include/storages/portable_storage_from_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include "parserse_base_utils.h"
#include "file_io_utils.h"

#define EPEE_JSON_RECURSION_LIMIT_INTERNAL 100

namespace epee
{
using namespace misc_utils::parse;
Expand All @@ -44,8 +46,9 @@ namespace epee
ASSERT_MES_AND_THROW("json parse error");
}*/
template<class t_storage>
inline void run_handler(typename t_storage::hsection current_section, std::string::const_iterator& sec_buf_begin, std::string::const_iterator buf_end, t_storage& stg)
inline void run_handler(typename t_storage::hsection current_section, std::string::const_iterator& sec_buf_begin, std::string::const_iterator buf_end, t_storage& stg, unsigned int recursion)
{
CHECK_AND_ASSERT_THROW_MES(recursion < EPEE_JSON_RECURSION_LIMIT_INTERNAL, "Wrong JSON data: recursion limitation (" << EPEE_JSON_RECURSION_LIMIT_INTERNAL << ") exceeded");

std::string::const_iterator sub_element_start;
std::string name;
Expand Down Expand Up @@ -157,7 +160,7 @@ namespace epee
//sub section here
typename t_storage::hsection new_sec = stg.open_section(name, current_section, true);
CHECK_AND_ASSERT_THROW_MES(new_sec, "Failed to insert new section in json: " << std::string(it, buf_end));
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_wonder_after_value;
}else if(*it == '[')
{//array of something
Expand Down Expand Up @@ -186,7 +189,7 @@ namespace epee
typename t_storage::hsection new_sec = nullptr;
h_array = stg.insert_first_section(name, new_sec, current_section);
CHECK_AND_ASSERT_THROW_MES(h_array&&new_sec, "failed to create new section");
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_array_after_value;
array_md = array_mode_sections;
}else if(*it == '"')
Expand Down Expand Up @@ -260,7 +263,7 @@ namespace epee
typename t_storage::hsection new_sec = NULL;
bool res = stg.insert_next_section(h_array, new_sec);
CHECK_AND_ASSERT_THROW_MES(res&&new_sec, "failed to insert next section");
run_handler(new_sec, it, buf_end, stg);
run_handler(new_sec, it, buf_end, stg, recursion + 1);
state = match_state_array_after_value;
}else CHECK_ISSPACE();
break;
Expand Down Expand Up @@ -362,7 +365,7 @@ namespace epee
std::string::const_iterator sec_buf_begin = buff_json.begin();
try
{
run_handler(nullptr, sec_buf_begin, buff_json.end(), stg);
run_handler(nullptr, sec_buf_begin, buff_json.end(), stg, 0);
return true;
}
catch(const std::exception& ex)
Expand Down
35 changes: 35 additions & 0 deletions contrib/epee/include/string_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,41 @@ POP_WARNINGS
res = str.substr(0, pos);
return res;
}
//----------------------------------------------------------------------------
#ifdef _WIN32
inline std::wstring utf8_to_utf16(const std::string& str)
{
if (str.empty())
return {};
int wstr_size = MultiByteToWideChar(CP_UTF8, 0, &str[0], str.size(), NULL, 0);
if (wstr_size == 0)
{
throw std::runtime_error(std::error_code(GetLastError(), std::system_category()).message());
}
std::wstring wstr(wstr_size, wchar_t{});
if (!MultiByteToWideChar(CP_UTF8, 0, &str[0], str.size(), &wstr[0], wstr_size))
{
throw std::runtime_error(std::error_code(GetLastError(), std::system_category()).message());
}
return wstr;
}
inline std::string utf16_to_utf8(const std::wstring& wstr)
{
if (wstr.empty())
return {};
int str_size = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], wstr.size(), NULL, 0, NULL, NULL);
if (str_size == 0)
{
throw std::runtime_error(std::error_code(GetLastError(), std::system_category()).message());
}
std::string str(str_size, char{});
if (!WideCharToMultiByte(CP_UTF8, 0, &wstr[0], wstr.size(), &str[0], str_size, NULL, NULL))
{
throw std::runtime_error(std::error_code(GetLastError(), std::system_category()).message());
}
return str;
}
#endif
}
}
#endif //_STRING_TOOLS_H_
9 changes: 5 additions & 4 deletions src/blockchain_db/lmdb/db_lmdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1306,20 +1306,21 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
auto get_result = mdb_get(txn, m_properties, &k, &v);
if(get_result == MDB_SUCCESS)
{
if (*(const uint32_t*)v.mv_data > VERSION)
const uint32_t db_version = *(const uint32_t*)v.mv_data;
if (db_version > VERSION)
{
MWARNING("Existing lmdb database was made by a later version. We don't know how it will change yet.");
MWARNING("Existing lmdb database was made by a later version (" << db_version << "). We don't know how it will change yet.");
compatible = false;
}
#if VERSION > 0
else if (*(const uint32_t*)v.mv_data < VERSION)
else if (db_version < VERSION)
{
// Note that there was a schema change within version 0 as well.
// See commit e5d2680094ee15889934fe28901e4e133cda56f2 2015/07/10
// We don't handle the old format previous to that commit.
txn.commit();
m_open = true;
migrate(*(const uint32_t *)v.mv_data);
migrate(db_version);
return;
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/blockchain_utilities/blockchain_import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ int pop_blocks(cryptonote::core& core, int num_blocks)
return num_blocks;
}

int check_flush(cryptonote::core &core, std::list<block_complete_entry> &blocks, bool force)
int check_flush(cryptonote::core &core, std::vector<block_complete_entry> &blocks, bool force)
{
if (blocks.empty())
return 0;
Expand All @@ -176,7 +176,7 @@ int check_flush(cryptonote::core &core, std::list<block_complete_entry> &blocks,
if (!force && new_height % HASH_OF_HASHES_STEP)
return 0;

std::list<crypto::hash> hashes;
std::vector<crypto::hash> hashes;
for (const auto &b: blocks)
{
cryptonote::block block;
Expand Down Expand Up @@ -312,7 +312,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
MINFO("Reading blockchain from bootstrap file...");
std::cout << ENDL;

std::list<block_complete_entry> blocks;
std::vector<block_complete_entry> blocks;

// Skip to start_height before we start adding.
{
Expand Down Expand Up @@ -437,7 +437,7 @@ int import_from_file(cryptonote::core& core, const std::string& import_file_path
{
cryptonote::blobdata block;
cryptonote::block_to_blob(bp.block, block);
std::list<cryptonote::blobdata> txs;
std::vector<cryptonote::blobdata> txs;
for (const auto &tx: bp.txs)
{
txs.push_back(cryptonote::blobdata());
Expand Down
Loading