Skip to content

Commit

Permalink
Merge pull request #567 from sumoprojects/dev
Browse files Browse the repository at this point in the history
[Merge] Dev to master branch (Nov 11, 2019)
  • Loading branch information
sumoprojects authored Nov 11, 2019
2 parents 6c3f419 + 9d973c2 commit 71849a4
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 43 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ depends:
cd contrib/depends && $(MAKE) HOST=$(target) && cd ../.. && mkdir -p build/$(target)/release
cd build/$(target)/release && cmake -DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/contrib/depends/$(target)/share/toolchain.cmake ../../.. && $(MAKE)
depends-backcompat:
cd contrib/depends && $(MAKE) HOST=$(target) && cd ../.. && mkdir -p build/$(target)/release
cd build/$(target)/release && cmake -DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/contrib/depends/$(target)/share/toolchain.cmake -DBACKCOMPAT=ON ../../.. && $(MAKE)
cmake-debug:
mkdir -p $(builddir)/debug
cd $(builddir)/debug && cmake -D CMAKE_BUILD_TYPE=Debug $(topdir)
Expand Down
20 changes: 10 additions & 10 deletions src/blockchain_utilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,32 @@ See also each utility's "--help" option.

### Export an existing blockchain database

`$ monero-blockchain-export`
`$ sumo-blockchain-export`

This loads the existing blockchain and exports it to `$MONERO_DATA_DIR/export/blockchain.raw`

### Import the exported file

`$ monero-blockchain-import`
`$ sumo-blockchain-import`

This imports blocks from `$MONERO_DATA_DIR/export/blockchain.raw` (exported using the
`monero-blockchain-export` tool as described above) into the current database.
`sumo-blockchain-export` tool as described above) into the current database.

Defaults: `--batch on`, `--batch size 20000`, `--verify on`
Defaults: `--batch on`, `--batch size 100`, `--verify on`

Batch size refers to number of blocks and can be adjusted for performance based on available RAM.

Verification should only be turned off if importing from a trusted blockchain.

If you encounter an error like "resizing not supported in batch mode", you can just re-run
the `monero-blockchain-import` command again, and it will restart from where it left off.
the `sumo-blockchain-import` command again, and it will restart from where it left off.

```bash
## use default settings to import blockchain.raw into database
$ monero-blockchain-import
$ sumo-blockchain-import

## fast import with large batch size, database mode "fastest", verification off
$ monero-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off
$ sumo-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off

```

Expand Down Expand Up @@ -80,9 +80,9 @@ LMDB flags (more than one may be specified):
## Examples:

```bash
$ monero-blockchain-import --database lmdb#fastest
$ sumo-blockchain-import --database lmdb#fastest

$ monero-blockchain-import --database lmdb#nosync
$ sumo-blockchain-import --database lmdb#nosync

$ monero-blockchain-import --database lmdb#nosync,nometasync
$ sumo-blockchain-import --database lmdb#nosync,nometasync
```
4 changes: 3 additions & 1 deletion src/cryptonote_core/tx_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ namespace cryptonote
// from v7, limit a tx to 50% of the minimum block weight
if (version >= 7)
return get_min_block_weight(version) / 2 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
else
else if (version >= 6) // after rebased
return get_min_block_weight(version) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
else // sumokoin tx limit
return TRANSACTION_WEIGHT_LIMIT;
}

// This class is meant to create a batch when none currently exists.
Expand Down
2 changes: 1 addition & 1 deletion src/cryptonote_core/tx_sanity_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ bool tx_sanity_check(Blockchain &blockchain, const cryptonote::blobdata &tx_blob
if (n_available < 10000)
return true;

if (rct_indices.size() < n_indices * 8 / 10)
if (nettype == MAINNET && rct_indices.size() < n_indices * 6 / 10)
{
MERROR("amount of unique indices is too low (amount of rct indices is " << rct_indices.size() << ", out of total " << n_indices << "indices.");
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/rpc_command_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ bool t_rpc_command_executor::print_coinbase_tx_sum(uint64_t height, uint64_t cou
}

tools::msg_writer() << "Sum of coinbase transactions between block heights ["
<< height << ", " << (height + count) << ") is "
<< height << ", " << (height + count) << "] is "
<< cryptonote::print_money(res.emission_amount + res.fee_amount) << " "
<< "consisting of " << cryptonote::print_money(res.emission_amount)
<< " in emissions, and " << cryptonote::print_money(res.fee_amount) << " in fees";
Expand Down
6 changes: 3 additions & 3 deletions src/debug_utilities/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ target_link_libraries(cn_deserialize

set_property(TARGET cn_deserialize
PROPERTY
OUTPUT_NAME "monero-utils-deserialize")
OUTPUT_NAME "sumo-utils-deserialize")


set(object_sizes_sources
Expand All @@ -67,7 +67,7 @@ target_link_libraries(object_sizes

set_property(TARGET object_sizes
PROPERTY
OUTPUT_NAME "monero-utils-object-sizes")
OUTPUT_NAME "sumo-utils-object-sizes")


set(dns_checks_sources
Expand All @@ -89,5 +89,5 @@ target_link_libraries(dns_checks

set_property(TARGET dns_checks
PROPERTY
OUTPUT_NAME "monero-utils-dns-checks")
OUTPUT_NAME "sumo-utils-dns-checks")

2 changes: 1 addition & 1 deletion src/debug_utilities/cn_deserialize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main(int argc, char* argv[])

if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL;
std::cout << "Sumokoin '" << SUMOKOIN_RELEASE_NAME << "' (v" << SUMOKOIN_VERSION_FULL << ")" << ENDL << ENDL;
std::cout << desc_options << std::endl;
return 1;
}
Expand Down
14 changes: 7 additions & 7 deletions src/debug_utilities/dns_checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,28 @@ int main(int argc, char* argv[])

if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL;
std::cout << "Sumokoin '" << SUMOKOIN_RELEASE_NAME << "' (v" << SUMOKOIN_VERSION_FULL << ")" << ENDL << ENDL;
std::cout << desc_options << std::endl;
return 1;
}

mlog_configure("", true);
mlog_set_categories("+" MONERO_DEFAULT_LOG_CATEGORY ":INFO");

lookup(LOOKUP_A, {"seeds.moneroseeds.se", "seeds.moneroseeds.ae.org", "seeds.moneroseeds.ch", "seeds.moneroseeds.li"});
lookup(LOOKUP_A, {"seeds.sumoseeds.bid", "seeds.sumoseeds.win", "seeds.sumoseeds.stream", "seeds.sumoseeds.download"});

lookup(LOOKUP_TXT, {"updates.moneropulse.org", "updates.moneropulse.net", "updates.moneropulse.co", "updates.moneropulse.se"});
lookup(LOOKUP_TXT, {"updates.sumopulse.stream", "updates.sumopulse.download", "updates.sumopulse.win", "updates.sumopulse.bid"});

lookup(LOOKUP_TXT, {"checkpoints.moneropulse.org", "checkpoints.moneropulse.net", "checkpoints.moneropulse.co", "checkpoints.moneropulse.se"});
lookup(LOOKUP_TXT, {"checkpoints.sumopulse.stream", "checkpoints.sumopulse.download", "checkpoints.sumopulse.win", "checkpoints.sumopulse.bid"});

// those are in the code, but don't seem to actually exist
#if 0
lookup(LOOKUP_TXT, {"testpoints.moneropulse.org", "testpoints.moneropulse.net", "testpoints.moneropulse.co", "testpoints.moneropulse.se");
lookup(LOOKUP_TXT, {"testpoints.sumopulse.stream", "testpoints.sumopulse.download", "testpoints.sumopulse.win", "testpoints.sumopulse.bid");

lookup(LOOKUP_TXT, {"stagenetpoints.moneropulse.org", "stagenetpoints.moneropulse.net", "stagenetpoints.moneropulse.co", "stagenetpoints.moneropulse.se"});
lookup(LOOKUP_TXT, {"stagenetpoints.sumopulse.stream", "stagenetpoints.sumopulse.download", "stagenetpoints.sumopulse.win", "stagenetpoints.sumopulse.bid"});
#endif

lookup(LOOKUP_TXT, {"segheights.moneropulse.org", "segheights.moneropulse.net", "segheights.moneropulse.co", "segheights.moneropulse.se"});
lookup(LOOKUP_TXT, {"segheights.sumopulse.stream", "segheights.sumopulse.download", "segheights.sumopulse.win", "segheights.sumopulse.bid"});

return 0;
CATCH_ENTRY_L0("main", 1);
Expand Down
22 changes: 11 additions & 11 deletions src/p2p/net_node.inl
Original file line number Diff line number Diff line change
Expand Up @@ -599,32 +599,32 @@ namespace nodetool
std::set<std::string> full_addrs;
if (nettype == cryptonote::TESTNET)
{
full_addrs.insert("192.99.32.219:29733");
full_addrs.insert("144.217.164.165:29733");
full_addrs.insert("217.182.76.94:29733");
full_addrs.insert("139.99.40.69:29733");
full_addrs.insert("46.105.92.108:29733");
full_addrs.insert("139.99.40.69:19733");

}
else if (nettype == cryptonote::STAGENET)
{
full_addrs.insert("192.99.32.219:39733");
full_addrs.insert("144.217.164.165:39733");
full_addrs.insert("217.182.76.94:39733");
full_addrs.insert("139.99.40.69:39733");
full_addrs.insert("46.105.92.108:39733");
full_addrs.insert("139.99.40.69:19733");
}
else
{
full_addrs.insert("144.217.164.165:19733"); // Canada
full_addrs.insert("217.182.76.94:19733"); // Poland
full_addrs.insert("46.105.92.108:19733"); // France
full_addrs.insert("139.99.193.21:19733"); // Sydney
full_addrs.insert("139.99.40.69:19733"); // Singapore
full_addrs.insert("133.18.53.223:19733"); // Japan
full_addrs.insert("157.230.187.169:19733"); // NY - explorer
full_addrs.insert("157.245.14.220:19733"); // NY - Morioka 1.1
full_addrs.insert("134.209.109.190:19733"); // SINGAPORE - Morioka 1.1
full_addrs.insert("192.99.32.219:19733");
full_addrs.insert("144.217.164.165:19733");
full_addrs.insert("133.18.53.223:19733");
full_addrs.insert("217.182.76.94:19733");
full_addrs.insert("46.105.92.108:19733");
full_addrs.insert("139.99.193.21:19733");
full_addrs.insert("139.99.40.69:19733");
full_addrs.insert("157.245.14.220:19733"); // NY
full_addrs.insert("134.209.109.190:19733"); // SINGAPORE
}
return full_addrs;
}
Expand Down
6 changes: 3 additions & 3 deletions src/simplewallet/simplewallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ namespace
PAUSE_READLINE();
std::cout << prompt;
if (yesno)
std::cout << " (Y/Yes/N/No)";
std::cout << "(Y/Yes/N/No)";
std::cout << ": " << std::flush;

std::string buf;
Expand Down Expand Up @@ -3805,7 +3805,7 @@ bool simple_wallet::ask_wallet_create_if_needed()
if (!m_restoring)
{
message_writer(console_color_yellow, true) << tr("No wallet found with that name. Confirm creation of new wallet named: ");
message_writer(console_color_green, true) << wallet_path << tr("\n");
message_writer(console_color_green, true) << wallet_path;
confirm_creation = input_line("", true);
if(std::cin.eof())
{
Expand Down Expand Up @@ -8896,7 +8896,7 @@ bool simple_wallet::check_inactivity()
if (!m_locked && !m_in_command)
{
const uint32_t seconds = m_wallet->inactivity_lock_timeout();
if (seconds > 0 && time(NULL) - m_last_activity_time > seconds)
if (seconds > 0 && (uint32_t)(time(NULL) - m_last_activity_time) > seconds)
{
m_locked = true;
m_cmd_binder.cancel_input();
Expand Down
2 changes: 1 addition & 1 deletion src/version.cpp.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define DEF_SUMOKOIN_VERSION_TAG "@VERSIONTAG@"
#define DEF_SUMOKOIN_VERSION "0.6.0.0"
#define DEF_SUMOKOIN_VERSION "0.6.0.1"
#define DEF_SUMOKOIN_RELEASE_NAME "Sendai"
#define DEF_SUMOKOIN_VERSION_FULL DEF_SUMOKOIN_VERSION "-" DEF_SUMOKOIN_VERSION_TAG
#define DEF_SUMOKOIN_VERSION_IS_RELEASE @VERSION_IS_RELEASE@
Expand Down
14 changes: 10 additions & 4 deletions src/wallet/wallet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ using namespace cryptonote;
#define DEFAULT_MIN_OUTPUT_COUNT 5
#define DEFAULT_MIN_OUTPUT_VALUE (2*COIN)

#define DEFAULT_INACTIVITY_LOCK_TIMEOUT 90 // a minute and a half
#define DEFAULT_INACTIVITY_LOCK_TIMEOUT 180 // three minutes
#define IGNORE_LONG_PAYMENT_ID_FROM_BLOCK_VERSION 9

static const std::string MULTISIG_SIGNATURE_MAGIC = "SigMultisigPkV1";
Expand Down Expand Up @@ -257,7 +257,7 @@ struct options {
const command_line::arg_descriptor<bool> untrusted_daemon = {"untrusted-daemon", tools::wallet2::tr("Disable commands which rely on a trusted daemon"), false};
const command_line::arg_descriptor<std::string> password = {"password", tools::wallet2::tr("Wallet password (escape/quote as needed)"), "", true};
const command_line::arg_descriptor<std::string> password_file = {"password-file", tools::wallet2::tr("Wallet password file"), "", true};
const command_line::arg_descriptor<int> daemon_port = {"daemon-port", tools::wallet2::tr("Use daemon instance at port <arg> instead of 18081"), 0};
const command_line::arg_descriptor<int> daemon_port = {"daemon-port", tools::wallet2::tr("Use daemon instance at port <arg> instead of 19734"), 0};
const command_line::arg_descriptor<std::string> daemon_login = {"daemon-login", tools::wallet2::tr("Specify username[:password] for daemon RPC client"), "", true};
const command_line::arg_descriptor<std::string> daemon_ssl = {"daemon-ssl", tools::wallet2::tr("Enable SSL on daemon RPC connections: enabled|disabled|autodetect"), "autodetect"};
const command_line::arg_descriptor<std::string> daemon_ssl_private_key = {"daemon-ssl-private-key", tools::wallet2::tr("Path to a PEM format private key"), ""};
Expand Down Expand Up @@ -9377,7 +9377,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
uint64_t needed_fee, available_for_fee = 0;
uint64_t upper_transaction_weight_limit = get_upper_transaction_weight_limit();
const bool use_per_byte_fee = use_fork_rules(HF_VERSION_PER_BYTE_FEE, 0);
const bool use_rct = use_fork_rules(4, 0);
const bool use_rct = use_fork_rules(1, 0);
const bool bulletproof = use_fork_rules(get_bulletproof_fork(), 0);
const rct::RCTConfig rct_config {
bulletproof ? rct::RangeProofPaddedBulletproof : rct::RangeProofBorromean,
Expand Down Expand Up @@ -10362,7 +10362,13 @@ uint64_t wallet2::get_upper_transaction_weight_limit()
{
if (m_upper_transaction_weight_limit > 0)
return m_upper_transaction_weight_limit;
return TRANSACTION_WEIGHT_LIMIT;
uint64_t full_reward_zone = CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE;
if (use_fork_rules(7, 0)) // after BP
return full_reward_zone / 2 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
else if (use_fork_rules(6, 0)) // after rebased
return full_reward_zone - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
else // sumokoin limit
return TRANSACTION_WEIGHT_LIMIT;
}
//----------------------------------------------------------------------------------------------------
std::vector<size_t> wallet2::select_available_outputs(const std::function<bool(const transfer_details &td)> &f) const
Expand Down

0 comments on commit 71849a4

Please sign in to comment.