Compare commits

...

21 Commits

Author SHA1 Message Date
Riccardo Spagni
c29890c2c0 Merge pull request #3493
32bd639b update block hashes for checkpoints.dat (Riccardo Spagni)
2018-03-24 17:56:14 +02:00
Riccardo Spagni
32bd639b4b update block hashes for checkpoints.dat 2018-03-24 08:48:23 +02:00
Riccardo Spagni
202b6519a3 Merge pull request #3486
1834127c rpc: make get_output_distribution a non-restricted RPC (moneromooo-monero)
2018-03-23 21:15:23 +02:00
Riccardo Spagni
4396ff8501 Merge pull request #3474
eaa8bfe7 wallet2: set from_height of GET_OUTPUT_DISTRIBUTION correctly The previous expression (stoffu)
0a619f78 wallet2: enable the mitigation only after the fork height (stoffu)
2018-03-22 18:24:11 +02:00
Riccardo Spagni
68118645e6 Merge pull request #3472
5f664793 p2p: correct port number for seed nodes (stoffu)
2018-03-22 18:23:41 +02:00
Riccardo Spagni
8ce0cfc73a Merge pull request #3469
0098ed33 wallet2: fix for loading settings of key reuse mitigation (stoffu)
2018-03-22 18:23:13 +02:00
Riccardo Spagni
d27f86041c Merge pull request #3467
1d79c14d Revert bb19386b (Howard Chu)
522be96f Fix generating version.cpp (Howard Chu)
2018-03-22 18:22:56 +02:00
Riccardo Spagni
5e7dbe01b0 Merge pull request #3465
e520cc06 change wording in hard fork description section (Gingeropolous)
2018-03-22 18:22:29 +02:00
Riccardo Spagni
fb21032a7d Merge pull request #3462
57300491 wallet: catch exceptions dealing with ringdb and warn (moneromooo-monero)
2018-03-22 18:22:07 +02:00
stoffu
eaa8bfe7c0 wallet2: set from_height of GET_OUTPUT_DISTRIBUTION correctly
The previous expression

    req_t.from_height = X ? Y >= Z : 0;

forces the parameter to take the value of either 0 or 1.
2018-03-22 20:02:25 +09:00
stoffu
0a619f789b wallet2: enable the mitigation only after the fork height 2018-03-22 20:02:14 +09:00
stoffu
5f6647934b p2p: correct port number for seed nodes 2018-03-22 14:56:35 +09:00
stoffu
0098ed338c wallet2: fix for loading settings of key reuse mitigation 2018-03-22 12:10:46 +09:00
Howard Chu
1d79c14dbb Revert bb19386b
The requirement for CMake 3.2.0 was introduced erroneously
in commit e29282d208 and is no
longer present
2018-03-21 17:16:06 +00:00
Howard Chu
522be96fe4 Fix generating version.cpp
Also removes BYPRODUCT dependency on CMake 3.2
2018-03-21 16:33:52 +00:00
Gingeropolous
e520cc06a9 change wording in hard fork description section
changed wording in hard fork section because reasons. Added prospective slot of next hardfork to communicate that more are coming because it never stops.

its everywhere and all at the same time.
2018-03-21 16:27:21 +00:00
moneromooo-monero
5730049178 wallet: catch exceptions dealing with ringdb and warn 2018-03-21 14:29:49 +00:00
Riccardo Spagni
c31780678e Merge pull request #3441
d4d1afd6 core: fix use of uninitialised data (moneromooo-monero)
2018-03-19 12:51:01 +02:00
Riccardo Spagni
c1e16fdffa Merge pull request #3432
bb07d8d7 README: add instructions for cloning / submodules (anonimal)
2018-03-19 12:49:43 +02:00
moneromooo-monero
d4d1afd688 core: fix use of uninitialised data 2018-03-18 23:39:22 +00:00
anonimal
bb07d8d7f7 README: add instructions for cloning / submodules 2018-03-18 17:14:07 +00:00
9 changed files with 90 additions and 37 deletions

View File

@@ -86,9 +86,9 @@ See [LICENSE](LICENSE).
If you want to help out, see [CONTRIBUTING](CONTRIBUTING.md) for a set of guidelines.
## Scheduled mandatory software upgrades
## Scheduled software upgrades
Monero uses a fixed-schedule mandatory software upgrade (hard fork) mechanism to implement new features. This means that users of Monero (end users and service providers) need to run current versions and upgrade their software on a regular schedule. Mandatory software upgrades occur during the months of March and September. The required software for these upgrades will be available prior to the scheduled date. Please check the repository prior to this date for the proper Monero software version. Below is the historical schedule and the projected schedule for the next upgrade.
Monero uses a fixed-schedule software upgrade (hard fork) mechanism to implement new features. This means that users of Monero (end users and service providers) should run current versions and upgrade their software on a regular schedule. Software upgrades occur during the months of April and October. The required software for these upgrades will be available prior to the scheduled date. Please check the repository prior to this date for the proper Monero software version. Below is the historical schedule and the projected schedule for the next upgrade.
Dates are provided in the format YYYY-MM-DD.
@@ -100,12 +100,13 @@ Dates are provided in the format YYYY-MM-DD.
| 1288616 | 2017-04-15 | v5 | v0.10.3.0 | v0.10.3.1 | Adjusted minimum blocksize and fee algorithm |
| 1400000 | 2017-09-16 | v6 | v0.11.0.0 | v0.11.0.0 | Allow only RingCT transactions, allow only >= ringsize 5 |
| 1546000 | 2018-04-06 | v7 | v0.12.0.0 | v0.12.0.0 | Cryptonight variant 1, ringsize >= 7, sorted inputs
| XXXXXXX | 2018-10-XX | XX | XXXXXXXXX | XXXXXXXXX | X
X's indicate that these details have not been determined as of commit date.
## Release staging schedule and protocol
Approximately three months prior to a scheduled mandatory software upgrade, a branch from Master will be created with the new release version tag. Pull requests that address bugs should then be made to both Master and the new release branch. Pull requests that require extensive review and testing (generally, optimizations and new features) should *not* be made to the release branch.
Approximately three months prior to a scheduled software upgrade, a branch from Master will be created with the new release version tag. Pull requests that address bugs should then be made to both Master and the new release branch. Pull requests that require extensive review and testing (generally, optimizations and new features) should *not* be made to the release branch.
## Installing Monero from a package
@@ -166,7 +167,7 @@ library archives (`.a`).
| Dep | Min. version | Vendored | Debian/Ubuntu pkg | Arch pkg | Fedora | Optional | Purpose |
| ------------ | ------------- | -------- | ------------------ | ------------ | ----------------- | -------- | -------------- |
| GCC | 4.7.3 | NO | `build-essential` | `base-devel` | `gcc` | NO | |
| CMake | 3.2.0 | NO | `cmake` | `cmake` | `cmake` | NO | |
| CMake | 3.0.0 | NO | `cmake` | `cmake` | `cmake` | NO | |
| pkg-config | any | NO | `pkg-config` | `base-devel` | `pkgconf` | NO | |
| Boost | 1.58 | NO | `libboost-all-dev` | `boost` | `boost-devel` | NO | C++ libraries |
| OpenSSL | basically any | NO | `libssl-dev` | `openssl` | `openssl-devel` | NO | sha256 sum |
@@ -187,6 +188,16 @@ library archives (`.a`).
[^] On Debian/Ubuntu `libgtest-dev` only includes sources and headers. You must
build the library binary manually. This can be done with the following command ```sudo apt-get install libgtest-dev && cd /usr/src/gtest && sudo cmake . && sudo make && sudo mv libg* /usr/lib/ ```
### Cloning the repository
Clone recursively to pull-in needed submodule(s):
`$ git clone --recursive https://github.com/monero-project/monero`
If you already have a repo cloned, initialize and update:
`$ cd monero && git submodule init && git submodule update`
### Build instructions
Monero uses the CMake build system and a top-level [Makefile](Makefile) that

View File

@@ -37,14 +37,16 @@ if ("$Format:$" STREQUAL "")
write_static_version_header("release")
elseif (GIT_FOUND OR Git_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
add_custom_target(genversion ALL
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/version.cpp"
COMMAND "${CMAKE_COMMAND}"
"-D" "GIT=${GIT_EXECUTABLE}"
"-D" "TO=${CMAKE_BINARY_DIR}/version.cpp"
"-P" "cmake/GenVersion.cmake"
BYPRODUCTS "${CMAKE_BINARY_DIR}/version.cpp"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
else()
message(STATUS "WARNING: Git was not found!")
write_static_version_header("unknown")
endif ()
add_custom_target(genversion ALL
DEPENDS "${CMAKE_BINARY_DIR}/version.cpp")

View File

@@ -200,6 +200,7 @@ namespace cryptonote
MAINNET = 0,
TESTNET,
STAGENET,
FAKECHAIN
FAKECHAIN,
UNDEFINED = 255
};
}

View File

@@ -4365,7 +4365,7 @@ void Blockchain::cancel()
}
#if defined(PER_BLOCK_CHECKPOINT)
static const char expected_block_hashes_hash[] = "4b553162ee4e7af3c53666506591489c68560b9175e6e941dc96c89f96f0e35c";
static const char expected_block_hashes_hash[] = "1d3df1a177bd6f752d87c0d7b960e502605742721afb39953265f1e0f7f9b01f";
void Blockchain::load_compiled_in_block_hashes()
{
const bool testnet = m_nettype == TESTNET;

View File

@@ -171,7 +171,8 @@ namespace cryptonote
m_last_json_checkpoints_update(0),
m_disable_dns_checkpoints(false),
m_threadpool(tools::threadpool::getInstance()),
m_update_download(0)
m_update_download(0),
m_nettype(UNDEFINED)
{
m_checkpoints_updating.clear();
set_cryptonote_protocol(pprotocol);

View File

@@ -397,8 +397,8 @@ namespace nodetool
full_addrs.insert("163.172.182.165:18080");
full_addrs.insert("161.67.132.39:18080");
full_addrs.insert("198.74.231.92:18080");
full_addrs.insert("195.154.123.123:28080");
full_addrs.insert("212.83.172.165:28080");
full_addrs.insert("195.154.123.123:18080");
full_addrs.insert("212.83.172.165:18080");
}
return full_addrs;
}
@@ -490,7 +490,7 @@ namespace nodetool
if (result.size())
{
for (const auto& addr_string : result)
full_addrs.insert(addr_string + ":18080");
full_addrs.insert(addr_string + ":" + std::to_string(m_nettype == cryptonote::TESTNET ? ::config::testnet::P2P_DEFAULT_PORT : m_nettype == cryptonote::STAGENET ? ::config::stagenet::P2P_DEFAULT_PORT : ::config::P2P_DEFAULT_PORT));
}
++i;
}

View File

@@ -3101,6 +3101,9 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
if (!m_trusted_daemon)
message_writer() << (boost::format(tr("Warning: using an untrusted daemon at %s, privacy will be lessened")) % m_wallet->get_daemon_address()).str();
if (m_wallet->get_ring_database().empty())
fail_msg_writer() << tr("Failed to initialize ring database: privacy enhancing features will be inactive");
m_wallet->callback(this);
return true;

View File

@@ -2669,6 +2669,9 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_
m_confirm_backlog_threshold = 0;
m_confirm_export_overwrite = true;
m_auto_low_priority = true;
m_segregate_pre_fork_outputs = true;
m_key_reuse_mitigation2 = true;
m_segregation_height = 0;
m_key_on_device = false;
}
else if(json.IsObject())
@@ -2785,6 +2788,12 @@ bool wallet2::load_keys(const std::string& keys_file_name, const epee::wipeable_
(boost::format("%s wallet cannot be opened as %s wallet")
% (field_nettype == 0 ? "Mainnet" : field_nettype == 1 ? "Testnet" : "Stagenet")
% (m_nettype == MAINNET ? "mainnet" : m_nettype == TESTNET ? "testnet" : "stagenet")).str());
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, segregate_pre_fork_outputs, int, Int, false, true);
m_segregate_pre_fork_outputs = field_segregate_pre_fork_outputs;
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, key_reuse_mitigation2, int, Int, false, true);
m_key_reuse_mitigation2 = field_key_reuse_mitigation2;
GET_FIELD_FROM_JSON_RETURN_ON_ERROR(json, segregation_height, int, Uint, false, 0);
m_segregation_height = field_segregation_height;
}
else
{
@@ -5467,29 +5476,43 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions(std::vector<crypto
}
}
void wallet2::set_ring_database(const std::string &filename)
bool wallet2::set_ring_database(const std::string &filename)
{
m_ring_database = filename;
MINFO("ringdb path set to " << filename);
m_ringdb.reset();
cryptonote::block b;
generate_genesis(b);
if (!m_ring_database.empty())
m_ringdb.reset(new tools::ringdb(m_ring_database, epee::string_tools::pod_to_hex(get_block_hash(b))));
{
try
{
cryptonote::block b;
generate_genesis(b);
m_ringdb.reset(new tools::ringdb(m_ring_database, epee::string_tools::pod_to_hex(get_block_hash(b))));
}
catch (const std::exception &e)
{
MERROR("Failed to initialize ringdb: " << e.what());
m_ring_database = "";
return false;
}
}
return true;
}
bool wallet2::add_rings(const crypto::chacha_key &key, const cryptonote::transaction_prefix &tx)
{
if (!m_ringdb)
return true;
return m_ringdb->add_rings(key, tx);
try { return m_ringdb->add_rings(key, tx); }
catch (const std::exception &e) { return false; }
}
bool wallet2::add_rings(const cryptonote::transaction_prefix &tx)
{
crypto::chacha_key key;
generate_chacha_key_from_secret_keys(key);
return add_rings(key, tx);
try { return add_rings(key, tx); }
catch (const std::exception &e) { return false; }
}
bool wallet2::remove_rings(const cryptonote::transaction_prefix &tx)
@@ -5498,14 +5521,16 @@ bool wallet2::remove_rings(const cryptonote::transaction_prefix &tx)
return true;
crypto::chacha_key key;
generate_chacha_key_from_secret_keys(key);
return m_ringdb->remove_rings(key, tx);
try { return m_ringdb->remove_rings(key, tx); }
catch (const std::exception &e) { return false; }
}
bool wallet2::get_ring(const crypto::chacha_key &key, const crypto::key_image &key_image, std::vector<uint64_t> &outs)
{
if (!m_ringdb)
return true;
return m_ringdb->get_ring(key, key_image, outs);
try { return m_ringdb->get_ring(key, key_image, outs); }
catch (const std::exception &e) { return false; }
}
bool wallet2::get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs)
@@ -5536,7 +5561,8 @@ bool wallet2::get_ring(const crypto::key_image &key_image, std::vector<uint64_t>
crypto::chacha_key key;
generate_chacha_key_from_secret_keys(key);
return get_ring(key, key_image, outs);
try { return get_ring(key, key_image, outs); }
catch (const std::exception &e) { return false; }
}
bool wallet2::set_ring(const crypto::key_image &key_image, const std::vector<uint64_t> &outs, bool relative)
@@ -5547,7 +5573,8 @@ bool wallet2::set_ring(const crypto::key_image &key_image, const std::vector<uin
crypto::chacha_key key;
generate_chacha_key_from_secret_keys(key);
return m_ringdb->set_ring(key, key_image, outs, relative);
try { return m_ringdb->set_ring(key, key_image, outs, relative); }
catch (const std::exception &e) { return false; }
}
bool wallet2::find_and_save_rings(bool force)
@@ -5615,33 +5642,40 @@ bool wallet2::blackball_output(const crypto::public_key &output)
{
if (!m_ringdb)
return true;
return m_ringdb->blackball(output);
try { return m_ringdb->blackball(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::set_blackballed_outputs(const std::vector<crypto::public_key> &outputs, bool add)
{
if (!m_ringdb)
return true;
bool ret = true;
if (!add)
ret &= m_ringdb->clear_blackballs();
for (const auto &output: outputs)
ret &= m_ringdb->blackball(output);
return ret;
try
{
bool ret = true;
if (!add)
ret &= m_ringdb->clear_blackballs();
for (const auto &output: outputs)
ret &= m_ringdb->blackball(output);
return ret;
}
catch (const std::exception &e) { return false; }
}
bool wallet2::unblackball_output(const crypto::public_key &output)
{
if (!m_ringdb)
return true;
return m_ringdb->unblackball(output);
try { return m_ringdb->unblackball(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::is_output_blackballed(const crypto::public_key &output) const
{
if (!m_ringdb)
return true;
return m_ringdb->blackballed(output);
try { return m_ringdb->blackballed(output); }
catch (const std::exception &e) { return false; }
}
bool wallet2::tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs, uint64_t global_index, const crypto::public_key& output_public_key, const rct::key& mask, uint64_t real_index, bool unlocked) const
@@ -5785,6 +5819,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
boost::optional<std::string> result = m_node_rpc_proxy.get_height(height);
throw_on_rpc_response_error(result, "get_info");
bool is_shortly_after_segregation_fork = height >= segregation_fork_height && height < segregation_fork_height + SEGREGATION_FORK_VICINITY;
bool is_after_segregation_fork = height >= segregation_fork_height;
// get histogram for the amounts we need
cryptonote::COMMAND_RPC_GET_OUTPUT_HISTOGRAM::request req_t = AUTO_VAL_INIT(req_t);
@@ -5805,7 +5840,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
// if we want to segregate fake outs pre or post fork, get distribution
std::unordered_map<uint64_t, std::pair<uint64_t, uint64_t>> segregation_limit;
if (m_segregate_pre_fork_outputs || m_key_reuse_mitigation2)
if (is_after_segregation_fork && (m_segregate_pre_fork_outputs || m_key_reuse_mitigation2))
{
cryptonote::COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::request req_t = AUTO_VAL_INIT(req_t);
cryptonote::COMMAND_RPC_GET_OUTPUT_DISTRIBUTION::response resp_t = AUTO_VAL_INIT(resp_t);
@@ -5814,7 +5849,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
std::sort(req_t.amounts.begin(), req_t.amounts.end());
auto end = std::unique(req_t.amounts.begin(), req_t.amounts.end());
req_t.amounts.resize(std::distance(req_t.amounts.begin(), end));
req_t.from_height = segregation_fork_height >= RECENT_OUTPUT_ZONE ? height >= (segregation_fork_height ? segregation_fork_height : height) - RECENT_OUTPUT_BLOCKS : 0;
req_t.from_height = std::max<uint64_t>(segregation_fork_height, RECENT_OUTPUT_BLOCKS) - RECENT_OUTPUT_BLOCKS;
req_t.cumulative = true;
m_daemon_rpc_mutex.lock();
bool r = net_utils::invoke_http_json_rpc("/json_rpc", "get_output_distribution", req_t, resp_t, m_http_client, rpc_timeout);
@@ -5872,7 +5907,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
float pre_fork_num_out_ratio = 0.0f;
float post_fork_num_out_ratio = 0.0f;
if (m_segregate_pre_fork_outputs && output_is_pre_fork)
if (is_after_segregation_fork && m_segregate_pre_fork_outputs && output_is_pre_fork)
{
num_outs = segregation_limit[amount].first;
num_recent_outs = segregation_limit[amount].second;
@@ -5892,7 +5927,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
break;
}
}
if (m_key_reuse_mitigation2)
if (is_after_segregation_fork && m_key_reuse_mitigation2)
{
if (output_is_pre_fork)
{
@@ -6107,7 +6142,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
uint64_t num_outs = 0;
const uint64_t amount = td.is_rct() ? 0 : td.amount();
const bool output_is_pre_fork = td.m_block_height < segregation_fork_height;
if (m_segregate_pre_fork_outputs && output_is_pre_fork)
if (is_after_segregation_fork && m_segregate_pre_fork_outputs && output_is_pre_fork)
num_outs = segregation_limit[amount].first;
else for (const auto &he: resp_t.histogram)
{

View File

@@ -1061,7 +1061,7 @@ namespace tools
return epee::net_utils::invoke_http_json_rpc(uri, method_name, req, res, m_http_client, timeout, http_method, req_id);
}
void set_ring_database(const std::string &filename);
bool set_ring_database(const std::string &filename);
const std::string get_ring_database() const { return m_ring_database; }
bool get_ring(const crypto::key_image &key_image, std::vector<uint64_t> &outs);
bool get_rings(const crypto::hash &txid, std::vector<std::pair<crypto::key_image, std::vector<uint64_t>>> &outs);