2018-01-07 06:05:16 +01:00
// Copyright (c) 2014-2018, The Monero Project
2014-07-23 15:03:52 +02:00
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
2014-03-03 23:07:58 +01:00
# pragma once
2014-09-05 04:14:36 +02:00
# include <string>
# include <boost/uuid/uuid.hpp>
2014-12-15 23:23:42 +01:00
# define CRYPTONOTE_DNS_TIMEOUT_MS 20000
2014-04-02 18:00:17 +02:00
# define CRYPTONOTE_MAX_BLOCK_NUMBER 500000000
# define CRYPTONOTE_MAX_BLOCK_SIZE 500000000 // block header blob limit, never used!
2014-06-26 22:42:24 +02:00
# define CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE 196608 //size of block (bytes) that is the maximum that miners will produce
2014-04-02 18:00:17 +02:00
# define CRYPTONOTE_MAX_TX_SIZE 1000000000
# define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0
2018-04-30 02:21:23 +02:00
# define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW 30
2016-06-16 00:37:13 +02:00
# define CURRENT_TRANSACTION_VERSION 2
2018-02-28 14:50:21 +01:00
# define CURRENT_BLOCK_MAJOR_VERSION 6
# define CURRENT_BLOCK_MINOR_VERSION 6
2018-03-02 16:31:43 +01:00
# define CURRENT_BLOCK_MAJOR_VERSION_TESTNET 7
# define CURRENT_BLOCK_MINOR_VERSION_TESTNET 7
2018-04-15 19:01:18 +02:00
# define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT_V2 60*10
2015-10-25 17:16:59 +01:00
# define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE 10
2014-03-03 23:07:58 +01:00
2018-04-29 07:08:46 +02:00
# define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 11
2014-03-03 23:07:58 +01:00
// MONEY_SUPPLY - total number coins to be generated
# define MONEY_SUPPLY ((uint64_t)(-1))
2015-11-05 10:58:47 +01:00
# define EMISSION_SPEED_FACTOR_PER_MINUTE (20)
2015-03-05 08:35:04 +01:00
# define FINAL_SUBSIDY_PER_MINUTE ((uint64_t)300000000000) // 3 * pow(10, 11)
2018-03-22 00:09:10 +01:00
# define EMISSION_LINEAR_BASE ((uint64_t)(1) << 58)
# define YEARLY_INFLATION_INVERSE 200 // 0.5% yearly inflation, inverted for integer division
# define EMISSION_SUPPLY_MULTIPLIER 19
# define EMISSION_SUPPLY_DIVISOR 10
# define EMISSION_DIVISOR 2000000
2014-04-02 18:00:17 +02:00
# define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100
2016-01-29 16:09:17 +01:00
# define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 60000 //size of block (bytes) after which reward for block calculated using block size
2015-11-05 10:58:47 +01:00
# define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 20000 //size of block (bytes) after which reward for block calculated using block size - before first fork
2017-03-14 20:28:38 +01:00
# define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 300000 //size of block (bytes) after which reward for block calculated using block size - second change, from v5
2014-04-02 18:00:17 +02:00
# define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600
2018-02-28 14:50:21 +01:00
# define CRYPTONOTE_DISPLAY_DECIMAL_POINT 9
2014-03-03 23:07:58 +01:00
// COIN - number of smallest units in one coin
2018-02-28 14:50:21 +01:00
# define COIN ((uint64_t)1000000000) // pow(10, 9)
2014-11-09 11:53:29 +01:00
2016-09-15 00:54:01 +02:00
# define FEE_PER_KB_OLD ((uint64_t)10000000000) // pow(10, 10)
# define FEE_PER_KB ((uint64_t)2000000000) // 2 * pow(10, 9)
2016-10-28 00:43:44 +02:00
# define DYNAMIC_FEE_PER_KB_BASE_FEE ((uint64_t)2000000000) // 2 * pow(10,9)
# define DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD ((uint64_t)10000000000000) // 10 * pow(10,12)
2017-03-14 20:28:38 +01:00
# define DYNAMIC_FEE_PER_KB_BASE_FEE_V5 ((uint64_t)2000000000 * (uint64_t)CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 / CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5)
2014-03-03 23:07:58 +01:00
# define ORPHANED_BLOCKS_MAX_COUNT 100
2016-01-29 16:09:17 +01:00
# define DIFFICULTY_TARGET_V2 120 // seconds
2018-04-15 19:01:18 +02:00
# define DIFFICULTY_WINDOW_V2 60
2014-03-03 23:07:58 +01:00
# define DIFFICULTY_LAG 15 // !!!
# define DIFFICULTY_CUT 60 // timestamps to cut after sorting
2018-04-15 19:01:18 +02:00
# define DIFFICULTY_BLOCKS_COUNT_V2 (DIFFICULTY_WINDOW_V2 + 1) // added +1 to make N=N
2014-03-03 23:07:58 +01:00
2016-01-29 16:09:17 +01:00
# define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 DIFFICULTY_TARGET_V2 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
2014-04-02 18:00:17 +02:00
# define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS 1
2014-03-03 23:07:58 +01:00
2018-04-15 19:01:18 +02:00
# define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN DIFFICULTY_TARGET_V2 //just alias; used by tests
2014-03-03 23:07:58 +01:00
# define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 10000 //by default, blocks ids count in synchronizing
2017-08-16 22:19:53 +02:00
# define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 100 //by default, blocks count in blocks downloading
2017-08-08 12:05:11 +02:00
# define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 20 //by default, blocks count in blocks downloading
2014-03-03 23:07:58 +01:00
2018-01-31 22:53:34 +01:00
# define CRYPTONOTE_MEMPOOL_TX_LIVETIME (86400*3) //seconds, three days
2014-06-15 09:48:13 +02:00
# define CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME 604800 //seconds, one week
2014-03-03 23:07:58 +01:00
# define COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT 1000
# define P2P_LOCAL_WHITE_PEERLIST_LIMIT 1000
# define P2P_LOCAL_GRAY_PEERLIST_LIMIT 5000
2015-12-15 03:45:52 +01:00
# define P2P_DEFAULT_CONNECTIONS_COUNT 8
2014-03-03 23:07:58 +01:00
# define P2P_DEFAULT_HANDSHAKE_INTERVAL 60 //secondes
# define P2P_DEFAULT_PACKET_MAX_SIZE 50000000 //50000000 bytes maximum packet size
# define P2P_DEFAULT_PEERS_IN_HANDSHAKE 250
# define P2P_DEFAULT_CONNECTION_TIMEOUT 5000 //5 seconds
# define P2P_DEFAULT_PING_CONNECTION_TIMEOUT 2000 //2 seconds
2014-04-07 17:02:15 +02:00
# define P2P_DEFAULT_INVOKE_TIMEOUT 60*2*1000 //2 minutes
2014-03-03 23:07:58 +01:00
# define P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT 5000 //5 seconds
# define P2P_DEFAULT_WHITELIST_CONNECTIONS_PERCENT 70
2017-02-09 01:11:58 +01:00
# define P2P_DEFAULT_ANCHOR_CONNECTIONS_COUNT 2
2014-03-03 23:07:58 +01:00
2015-11-23 18:34:55 +01:00
# define P2P_FAILED_ADDR_FORGET_SECONDS (60*60) //1 hour
# define P2P_IP_BLOCKTIME (60*60*24) //24 hour
# define P2P_IP_FAILS_BEFORE_BLOCK 10
# define P2P_IDLE_CONNECTION_KILL_INTERVAL (5*60) //5 minutes
2016-10-26 21:00:08 +02:00
# define P2P_SUPPORT_FLAG_FLUFFY_BLOCKS 0x01
# define P2P_SUPPORT_FLAGS P2P_SUPPORT_FLAG_FLUFFY_BLOCKS
2014-08-23 22:43:13 +02:00
# define ALLOW_DEBUG_COMMANDS
2014-03-03 23:07:58 +01:00
2018-02-28 01:23:57 +01:00
# define CRYPTONOTE_NAME "loki"
2014-03-03 23:07:58 +01:00
# define CRYPTONOTE_POOLDATA_FILENAME "poolstate.bin"
2017-01-28 15:55:14 +01:00
# define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb"
# define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"
2014-03-03 23:07:58 +01:00
# define P2P_NET_DATA_FILENAME "p2pstate.bin"
# define MINER_CONFIG_FILE_NAME "miner_conf.json"
2014-04-30 22:50:06 +02:00
# define THREAD_STACK_SIZE 5 * 1024 * 1024
2014-03-03 23:07:58 +01:00
2016-10-28 00:43:44 +02:00
# define HF_VERSION_DYNAMIC_FEE 4
2018-04-09 01:32:12 +02:00
# define HF_VERSION_MIN_MIXIN_9 7
2017-03-14 20:28:38 +01:00
# define HF_VERSION_ENFORCE_RCT 6
2017-03-04 00:31:38 +01:00
# define PER_KB_FEE_QUANTIZATION_DECIMALS 8
2016-10-28 00:43:44 +02:00
2017-09-13 22:03:04 +02:00
# define HASH_OF_HASHES_STEP 256
2018-01-29 22:20:24 +01:00
# define DEFAULT_TXPOOL_MAX_SIZE 648000000ull // 3 days at 300000, in bytes
2017-09-13 22:03:04 +02:00
2014-09-05 04:14:36 +02:00
// New constants are intended to go here
namespace config
{
uint64_t const DEFAULT_FEE_ATOMIC_XMR_PER_KB = 500 ; // Just a placeholder! Change me!
uint8_t const FEE_CALCULATION_MAX_RETRIES = 10 ;
2016-10-12 03:04:26 +02:00
uint64_t const DEFAULT_DUST_THRESHOLD = ( ( uint64_t ) 2000000000 ) ; // 2 * pow(10, 9)
2015-10-06 17:20:23 +02:00
uint64_t const BASE_REWARD_CLAMP_THRESHOLD = ( ( uint64_t ) 100000000 ) ; // pow(10, 8)
2014-09-05 04:14:36 +02:00
std : : string const P2P_REMOTE_DEBUG_TRUSTED_PUB_KEY = " 0000000000000000000000000000000000000000000000000000000000000000 " ;
2018-02-28 22:00:51 +01:00
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 114 ;
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 115 ;
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 116 ;
2018-04-30 07:05:24 +02:00
uint16_t const P2P_DEFAULT_PORT = 1808 ;
uint16_t const RPC_DEFAULT_PORT = 1801 ;
uint16_t const ZMQ_RPC_DEFAULT_PORT = 1802 ;
2014-09-05 04:14:36 +02:00
boost : : uuids : : uuid const NETWORK_ID = { {
2018-03-05 00:04:29 +01:00
0x12 , 0x31 , 0xF1 , 0x71 , 0x61 , 0x04 , 0x41 , 0x61 , 0x17 , 0x31 , 0x00 , 0x82 , 0x16 , 0xA1 , 0xA1 , 0x10
2014-09-05 04:14:36 +02:00
} } ; // Bender's nightmare
2018-05-01 06:33:33 +02:00
std : : string const GENESIS_TX = " 021e01ff000380808d93f5d77102c522355aea5acfa998fc85af583af1b5336c120d299cea567564eb1ffca7cf308080b4ccd4dfc603029c5478dba78c486806bd1557e4f31a16a8896643d4868e9179680f48ac04f58f808088fccdbcc3230279b9fbf3c7b3215622a1a91d2f90556ea1e80593e0fa3e16fdbb648d396b39c2210184a2744f9674c42cd42cb2ac146748c0cfa35c849e69831e5ee467633709880c00 " ;
2018-04-29 11:20:03 +02:00
uint32_t const GENESIS_NONCE = 1022201 ;
2014-09-05 04:14:36 +02:00
2018-04-29 07:09:36 +02:00
std : : string const GOVERNANCE_WALLET_ADDRESS = " LCFxT37LAogDn1jLQKf4y7aAqfi21DjovX9qyijaLYQSdrxY1U5VGcnMJMjWrD9RhjeK5Lym67wZ73uh9AujXLQ1RKmXEyL " ;
2018-03-05 00:04:29 +01:00
2014-09-05 04:14:36 +02:00
namespace testnet
{
2018-02-28 22:00:51 +01:00
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 156 ;
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 157 ;
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 158 ;
2018-03-05 00:04:29 +01:00
uint16_t const P2P_DEFAULT_PORT = 38150 ;
uint16_t const RPC_DEFAULT_PORT = 38151 ;
uint16_t const ZMQ_RPC_DEFAULT_PORT = 38152 ;
2014-09-05 04:14:36 +02:00
boost : : uuids : : uuid const NETWORK_ID = { {
2018-04-13 04:00:23 +02:00
0x44 , 0xb3 , 0xe9 , 0xef , 0x80 , 0xc0 , 0x08 , 0x19 , 0xb4 , 0x2c , 0x83 , 0xec , 0xef , 0x59 , 0x24 , 0xfd
2014-09-05 04:14:36 +02:00
} } ; // Bender's daydream
2018-03-22 00:09:34 +01:00
std : : string const GENESIS_TX = " 023c01ff000380808d93f5d77102f56d7e3964e698b1f191c712f44b117c18730b7ade87a283d62f320d67b6d13a8080b4ccd4dfc603028a90618702a3467272fdf91f846af7781e51a0ef15e0d2758a492a61052924ed808088fccdbcc32302ee870fafbc9773a3e7a38ff3d4757234cca81caa7672a16b78ffacf3916079752101bdc9cab7a702c1636778ec61cef1c037cceaf1e3d2146fea6ecacd872d29587e00 " ;
2014-09-05 04:14:36 +02:00
uint32_t const GENESIS_NONCE = 10001 ;
2018-02-28 15:53:59 +01:00
2018-03-05 00:04:29 +01:00
std : : string const GOVERNANCE_WALLET_ADDRESS = " T6U5dnmhyw1XsDryZUZL4hAwkNDYahFLEbhyfipTJ2ZZLV1Epm5zHTf6SQzxre9V8R9zjSPN6WWiT9adBQYt7Wut2xjon6dgT " ;
2014-09-05 04:14:36 +02:00
}
2018-02-16 12:04:04 +01:00
namespace stagenet
{
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 24 ;
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX = 25 ;
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX = 36 ;
2018-04-17 09:09:26 +02:00
uint16_t const P2P_DEFAULT_PORT = 38153 ;
uint16_t const RPC_DEFAULT_PORT = 38154 ;
uint16_t const ZMQ_RPC_DEFAULT_PORT = 38155 ;
2018-02-16 12:04:04 +01:00
boost : : uuids : : uuid const NETWORK_ID = { {
2018-04-30 07:05:24 +02:00
0xbb , 0x37 , 0x9B , 0x22 , 0x0A , 0x66 , 0x69 , 0x1E , 0x09 , 0xB2 , 0x97 , 0x8A , 0xCC , 0xA1 , 0xDF , 0x9C
} } ; // Beep Boop
2018-04-30 06:20:52 +02:00
std : : string const GENESIS_TX = " 021e01ff000380808d93f5d771027e4490431900c66a6532917ad9e6a1de634a209b708f653097e7b48efc1238c68080b4ccd4dfc60302ba19a224e6474371f9161b2e6271a36d060cbdc2e479ad78f1be64c56576fa07808088fccdbcc32302bccf9c13ba1b5bb02638de6e557acdd46bf48953e42cf98a12d2ad2900cc316121018fc6728d9e3c062d3afae3b2317998d2abee1e12f51271ba1c0d3cdd236b81d200 " ;
2018-02-16 12:04:04 +01:00
uint32_t const GENESIS_NONCE = 10002 ;
2018-04-09 01:32:12 +02:00
2018-04-30 05:23:53 +02:00
std : : string const GOVERNANCE_WALLET_ADDRESS = " 59f7FCwYMiwMnFr8HwsnfJ2hK3DYB1tryhjsfmXqEBJojKyqKeNWoaDaZaauoZPiZHUYp2wJuy5s9H96qy4q9xUVCXXHmTU " ;
2018-02-16 12:04:04 +01:00
}
}
namespace cryptonote
{
enum network_type : uint8_t
{
MAINNET = 0 ,
TESTNET ,
STAGENET ,
2018-03-19 00:36:20 +01:00
FAKECHAIN ,
UNDEFINED = 255
2018-02-16 12:04:04 +01:00
} ;
2018-03-06 03:24:39 +01:00
}