Add intervening v5 fork for increased min block size

Minimum mixin 4 and enforced ringct is moved from v5 to v6.
v5 is now used for an increased minimum block size (from 60000
to 300000) to cater for larger typical/minimum transaction size.

The fee algorithm is also changed to decrease the base per kB
fee, and add a cheap tier for those transactions which we do
not care if they get delayed (or even included in a block).
This commit is contained in:
moneromooo-monero
2017-03-14 19:28:38 +00:00
parent 1dfed893e0
commit 3396a9f2af
10 changed files with 112 additions and 76 deletions

View File

@@ -59,8 +59,6 @@ namespace cryptonote
// codebase. As it stands, it is at best nontrivial to test
// whether or not changing these parameters (or adding new)
// will work correctly.
size_t const TRANSACTION_SIZE_LIMIT_V1 = (((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);
size_t const TRANSACTION_SIZE_LIMIT_V2 = (((CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 * 125) / 100) - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);
time_t const MIN_RELAY_TIME = (60 * 5); // only start re-relaying transactions after that many seconds
time_t const MAX_RELAY_TIME = (60 * 60 * 4); // at most that many seconds between resends
float const ACCEPT_THRESHOLD = 1.0f;
@@ -78,6 +76,11 @@ namespace cryptonote
{
return amount * ACCEPT_THRESHOLD;
}
uint64_t get_transaction_size_limit(uint8_t version)
{
return get_min_block_size(version) * 125 / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;
}
}
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
@@ -149,7 +152,7 @@ namespace cryptonote
return false;
}
size_t tx_size_limit = (version < 2 ? TRANSACTION_SIZE_LIMIT_V1 : TRANSACTION_SIZE_LIMIT_V2);
size_t tx_size_limit = get_transaction_size_limit(version);
if (!kept_by_block && blob_size >= tx_size_limit)
{
LOG_PRINT_L1("transaction is too big: " << blob_size << " bytes, maximum size: " << tx_size_limit);
@@ -641,15 +644,6 @@ namespace cryptonote
continue;
}
#if 1
// If we've exceeded the penalty free size,
// stop including more tx
if (total_size > median_size)
{
LOG_PRINT_L2(" would exceed median block size");
break;
}
#else
// If we're getting lower coinbase tx,
// stop including more tx
uint64_t block_reward;
@@ -666,7 +660,6 @@ namespace cryptonote
sorted_it++;
continue;
}
#endif
// Skip transactions that are not ready to be
// included into the blockchain or that are
@@ -705,7 +698,7 @@ namespace cryptonote
{
CRITICAL_REGION_LOCAL(m_transactions_lock);
size_t n_removed = 0;
size_t tx_size_limit = (version < 2 ? TRANSACTION_SIZE_LIMIT_V1 : TRANSACTION_SIZE_LIMIT_V2);
size_t tx_size_limit = get_transaction_size_limit(version);
for (auto it = m_transactions.begin(); it != m_transactions.end(); ) {
if (it->second.blob_size >= tx_size_limit) {
LOG_PRINT_L1("Transaction " << get_transaction_hash(it->second.tx) << " is too big (" << it->second.blob_size << " bytes), removing it from pool");