36 #include <boost/uuid/uuid.hpp>
38 #define CRYPTONOTE_DNS_TIMEOUT_MS 20000
40 #define CRYPTONOTE_MAX_BLOCK_NUMBER 500000000
41 #define CRYPTONOTE_GETBLOCKTEMPLATE_MAX_BLOCK_SIZE 196608
42 #define CRYPTONOTE_MAX_TX_SIZE 1000000
43 #define CRYPTONOTE_MAX_TX_PER_BLOCK 0x10000000
44 #define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0
45 #define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW 18
46 #define ETN_MINED_MONEY_UNLOCK_WINDOW_V8 5
47 #define CURRENT_TRANSACTION_VERSION 2
48 #define CURRENT_BLOCK_MAJOR_VERSION 1
49 #define CURRENT_BLOCK_MINOR_VERSION 0
50 #define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT 60*60*2
51 #define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE 10
52 #define ETN_DEFAULT_TX_SPENDABLE_AGE_V8 5
54 #define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 60
57 #define MONEY_SUPPLY ((uint64_t)(2100000000000))
58 #define EMISSION_SPEED_FACTOR_PER_MINUTE (20)
59 #define EMISSION_SPEED_FACTOR_PER_MINUTE_V8 (22)
61 #define FINAL_SUBSIDY_PER_MINUTE ((uint64_t) 25 * COIN)
63 #define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100
64 #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 60000
65 #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 20000
66 #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 150000
67 #define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V8 300000
68 #define CRYPTONOTE_LONG_TERM_BLOCK_WEIGHT_WINDOW_SIZE 100000
69 #define CRYPTONOTE_SHORT_TERM_BLOCK_WEIGHT_SURGE_FACTOR 50
70 #define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600
71 #define CRYPTONOTE_DISPLAY_DECIMAL_POINT 2
73 #define COIN ((uint64_t)100)
75 #define FEE_PER_KB ((uint64_t)1)
76 #define FEE_PER_KB_V6 ((uint64_t)10)
78 #define FEE_PER_BYTE ((uint64_t)30)
81 #define DEFAULT_RINGSIZE (DEFAULT_MIX + 1)
83 #define DYNAMIC_FEE_PER_KB_BASE_FEE ((uint64_t)2000000000)
84 #define DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD ((uint64_t)10000000000000)
85 #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)
86 #define DYNAMIC_FEE_REFERENCE_TRANSACTION_WEIGHT ((uint64_t)3000)
88 #define ORPHANED_BLOCKS_MAX_COUNT 100
90 #define DIFFICULTY_TARGET 60
91 #define DIFFICULTY_TARGET_V6 120
92 #define DIFFICULTY_WINDOW 720
93 #define DIFFICULTY_WINDOW_V6 360
94 #define DIFFICULTY_LAG 15
95 #define DIFFICULTY_CUT 60
96 #define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG
97 #define DIFFICULTY_BLOCKS_COUNT_V6 DIFFICULTY_WINDOW_V6 + DIFFICULTY_LAG
100 #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS 1
101 #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS DIFFICULTY_TARGET * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
102 #define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V6 DIFFICULTY_TARGET_V6 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
105 #define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN DIFFICULTY_TARGET
106 #define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN_V6 DIFFICULTY_TARGET_V6
109 #define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 10000
110 #define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 100
111 #define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 20
113 #define CRYPTONOTE_MEMPOOL_TX_LIVETIME 86400
114 #define CRYPTONOTE_MEMPOOL_TX_LIVETIME_V6 (86400*3)
115 #define CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME 604800
117 #define COMMAND_RPC_GET_BLOCKS_FAST_MAX_COUNT 1000
119 #define P2P_LOCAL_WHITE_PEERLIST_LIMIT 1000
120 #define P2P_LOCAL_GRAY_PEERLIST_LIMIT 5000
122 #define P2P_DEFAULT_CONNECTIONS_COUNT 8
123 #define P2P_DEFAULT_HANDSHAKE_INTERVAL 60
124 #define P2P_DEFAULT_PACKET_MAX_SIZE 50000000
125 #define P2P_DEFAULT_PEERS_IN_HANDSHAKE 250
126 #define P2P_DEFAULT_CONNECTION_TIMEOUT 5000
127 #define P2P_DEFAULT_SOCKS_CONNECT_TIMEOUT 45
128 #define P2P_DEFAULT_PING_CONNECTION_TIMEOUT 2000
129 #define P2P_DEFAULT_INVOKE_TIMEOUT 60*2*1000
130 #define P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT 5000
131 #define P2P_DEFAULT_WHITELIST_CONNECTIONS_PERCENT 70
132 #define P2P_DEFAULT_ANCHOR_CONNECTIONS_COUNT 2
133 #define P2P_DEFAULT_SYNC_SEARCH_CONNECTIONS_COUNT 2
134 #define P2P_DEFAULT_LIMIT_RATE_UP 2048
135 #define P2P_DEFAULT_LIMIT_RATE_DOWN 8192
137 #define P2P_FAILED_ADDR_FORGET_SECONDS (60*60)
138 #define P2P_IP_BLOCKTIME (60*60*24)
139 #define P2P_IP_FAILS_BEFORE_BLOCK 10
140 #define P2P_IDLE_CONNECTION_KILL_INTERVAL (5*60)
142 #define P2P_SUPPORT_FLAG_FLUFFY_BLOCKS 0x01
143 #define P2P_SUPPORT_FLAGS P2P_SUPPORT_FLAG_FLUFFY_BLOCKS
145 #define ALLOW_DEBUG_COMMANDS
147 #define CRYPTONOTE_NAME "electroneum"
148 #define CRYPTONOTE_POOLDATA_FILENAME "poolstate.bin"
149 #define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb"
150 #define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"
151 #define P2P_NET_DATA_FILENAME "p2pstate.bin"
152 #define MINER_CONFIG_FILE_NAME "miner_conf.json"
154 #define THREAD_STACK_SIZE 5 * 1024 * 1024
156 #define CURRENT_HARDFORK_VERSION 8
157 #define HF_VERSION_FORBID_DUST_OUTPUTS 2
158 #define HF_VERSION_FORBID_INVALID_PUBKEYS 4
159 #define HF_VERSION_ENFORCE_0_DECOY_TXS 6
160 #define HF_VERSION_ENFORCE_0_DECOY_TXS_END 100
161 #define HF_VERSION_DYNAMIC_FEE 100
162 #define HF_VERSION_MIN_MIXIN_2 2
163 #define HF_VERSION_MIN_MIXIN_4 100
164 #define HF_VERSION_MIN_MIXIN_6 100
165 #define HF_VERSION_MIN_MIXIN_10 100
166 #define HF_VERSION_MAX_RING_11 100
167 #define HF_VERSION_ENABLE_RCT 100
168 #define HF_VERSION_ENFORCE_RCT 100
169 #define HF_VERSION_PER_BYTE_FEE 100
170 #define HF_VERSION_SMALLER_BP 100
171 #define HF_VERSION_LONG_TERM_BLOCK_WEIGHT 100
172 #define HF_VERSION_ORDERED_TX_INPUTS 100
173 #define HF_VERSION_ALLOW_BULLETPROOF 100
174 #define HF_VERSION_FORBIT_BORROMEAN_RANGE_PROOFS HF_VERSION_ALLOW_BULLETPROOF + 1
177 #define PER_KB_FEE_QUANTIZATION_DECIMALS 2
179 #define DEFAULT_TXPOOL_MAX_WEIGHT 648000000ull
181 #define BULLETPROOF_MAX_OUTPUTS 16
183 #define CRYPTONOTE_PRUNING_STRIPE_SIZE 4096
184 #define CRYPTONOTE_PRUNING_LOG_STRIPES 3
185 #define CRYPTONOTE_PRUNING_TIP_BLOCKS 5500
204 0x04, 0xF8, 0x23, 0xE1, 0x66, 0xC2, 0xE3, 0xA4, 0xEA, 0x5D, 0xD1, 0x2C, 0x85, 0x8E, 0xC8, 0x39
206 std::string
const GENESIS_TX =
"011201ff00011e026bc5c7db8a664f652d78adb587ac4d759c6757258b64ef9cba3c0354e64fb2e42101abca6a39c561d0897be183eb0143990eba201aa7d2c652ab0555d28bb4b70728";
218 0x04, 0xF8, 0x23, 0xE1, 0x66, 0xC2, 0xE3, 0xA4, 0xEA, 0x5D, 0xD1, 0x2C, 0x85, 0x8E, 0xC8, 0x41
220 std::string
const GENESIS_TX =
"011201ff000180bcf5dace2102a7957ab8394540efaa5bc93d747d6c56d8bf87b1c955574963dfbcf62ab13b5c210120d88af73976c98be9819df7e85bc21167d3194e242afd50601e398243c354b6";
233 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x12
235 std::string
const GENESIS_TX =
"013c01ff0001ffffffffffff0302df5d56da0c7d643ddd1ce61901c7bdc5fb1738bfe39fbe69c28a3a7032729c0f2101168d0c4ca86fb55a4cf6a36d31431be1c53a3bd7411bb24e8832410289fa6f3b";
303 default:
throw std::runtime_error(
"Invalid network type");
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:232
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:236
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:228
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:231
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:226
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:227
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:229
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:230
std::string const GENESIS_TX
Definition: cryptonote_config.h:235
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:216
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:215
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:217
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:221
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:213
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:214
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:211
std::string const GENESIS_TX
Definition: cryptonote_config.h:220
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:212
Definition: cryptonote_config.h:190
std::string const GENESIS_TX
Definition: cryptonote_config.h:206
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:198
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:201
uint64_t const DEFAULT_DUST_THRESHOLD
Definition: cryptonote_config.h:193
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:203
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:207
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:202
uint8_t const FEE_CALCULATION_MAX_RETRIES
Definition: cryptonote_config.h:192
uint64_t const DEFAULT_FEE_ATOMIC_ETN_PER_KB
Definition: cryptonote_config.h:191
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:197
uint64_t const BASE_REWARD_CLAMP_THRESHOLD
Definition: cryptonote_config.h:194
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:200
std::string const P2P_REMOTE_DEBUG_TRUSTED_PUB_KEY
Definition: cryptonote_config.h:195
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:199
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:226
network_type
Definition: cryptonote_config.h:243
@ UNDEFINED
Definition: cryptonote_config.h:248
@ FAKECHAIN
Definition: cryptonote_config.h:247
@ TESTNET
Definition: cryptonote_config.h:245
@ MAINNET
Definition: cryptonote_config.h:244
@ STAGENET
Definition: cryptonote_config.h:246
const config_t & get_config(network_type nettype)
Definition: cryptonote_config.h:262
Definition: cryptonote_config.h:251
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:258
std::string const GENESIS_TX
Definition: cryptonote_config.h:259
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:257
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:260
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:254
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:256
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:253
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:252
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:255