35#include <boost/uuid/uuid.hpp>
37#define CRYPTONOTE_DNS_TIMEOUT_MS 20000
39#define CRYPTONOTE_MAX_BLOCK_NUMBER 500000000
40#define CRYPTONOTE_MAX_TX_SIZE 1000000
41#define CRYPTONOTE_MAX_TX_PER_BLOCK 0x10000000
42#define CRYPTONOTE_PUBLIC_ADDRESS_TEXTBLOB_VER 0
43#define CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW 60
44#define CURRENT_TRANSACTION_VERSION 2
45#define CURRENT_BLOCK_MAJOR_VERSION 1
46#define CURRENT_BLOCK_MINOR_VERSION 0
47#define CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT 60*60*2
48#define CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE 10
50#define BLOCKCHAIN_TIMESTAMP_CHECK_WINDOW 60
53#define MONEY_SUPPLY ((uint64_t)(-1))
54#define EMISSION_SPEED_FACTOR_PER_MINUTE (20)
55#define FINAL_SUBSIDY_PER_MINUTE ((uint64_t)300000000000)
57#define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100
58#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2 60000
59#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 20000
60#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 300000
61#define CRYPTONOTE_LONG_TERM_BLOCK_WEIGHT_WINDOW_SIZE 100000
62#define CRYPTONOTE_SHORT_TERM_BLOCK_WEIGHT_SURGE_FACTOR 50
63#define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600
64#define CRYPTONOTE_DISPLAY_DECIMAL_POINT 12
66#define COIN ((uint64_t)1000000000000)
68#define FEE_PER_KB_OLD ((uint64_t)10000000000)
69#define FEE_PER_KB ((uint64_t)2000000000)
70#define FEE_PER_BYTE ((uint64_t)300000)
71#define DYNAMIC_FEE_PER_KB_BASE_FEE ((uint64_t)2000000000)
72#define DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD ((uint64_t)10000000000000)
73#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)
74#define DYNAMIC_FEE_REFERENCE_TRANSACTION_WEIGHT ((uint64_t)3000)
76#define ORPHANED_BLOCKS_MAX_COUNT 100
79#define DIFFICULTY_TARGET_V2 120
80#define DIFFICULTY_TARGET_V1 60
81#define DIFFICULTY_WINDOW 720
82#define DIFFICULTY_LAG 15
83#define DIFFICULTY_CUT 60
84#define DIFFICULTY_BLOCKS_COUNT DIFFICULTY_WINDOW + DIFFICULTY_LAG
87#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1 DIFFICULTY_TARGET_V1 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
88#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V2 DIFFICULTY_TARGET_V2 * CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS
89#define CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_BLOCKS 1
92#define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN DIFFICULTY_TARGET_V1
95#define BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT 10000
96#define BLOCKS_IDS_SYNCHRONIZING_MAX_COUNT 25000
97#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT_PRE_V4 100
98#define BLOCKS_SYNCHRONIZING_DEFAULT_COUNT 20
99#define BLOCKS_SYNCHRONIZING_MAX_COUNT 2048
101#define CRYPTONOTE_MEMPOOL_TX_LIVETIME (86400*3)
102#define CRYPTONOTE_MEMPOOL_TX_FROM_ALT_BLOCK_LIVETIME 604800
105#define CRYPTONOTE_DANDELIONPP_STEMS 2
106#define CRYPTONOTE_DANDELIONPP_FLUFF_PROBABILITY 20
107#define CRYPTONOTE_DANDELIONPP_MIN_EPOCH 10
108#define CRYPTONOTE_DANDELIONPP_EPOCH_RANGE 30
109#define CRYPTONOTE_DANDELIONPP_FLUSH_AVERAGE 5
110#define CRYPTONOTE_DANDELIONPP_EMBARGO_AVERAGE 39
113#define CRYPTONOTE_NOISE_MIN_EPOCH 5
114#define CRYPTONOTE_NOISE_EPOCH_RANGE 30
115#define CRYPTONOTE_NOISE_MIN_DELAY 10
116#define CRYPTONOTE_NOISE_DELAY_RANGE 5
117#define CRYPTONOTE_NOISE_BYTES 3*1024
118#define CRYPTONOTE_NOISE_CHANNELS 2
122#define CRYPTONOTE_FORWARD_DELAY_BASE (CRYPTONOTE_NOISE_MIN_DELAY + CRYPTONOTE_NOISE_DELAY_RANGE)
123#define CRYPTONOTE_FORWARD_DELAY_AVERAGE (CRYPTONOTE_FORWARD_DELAY_BASE + (CRYPTONOTE_FORWARD_DELAY_BASE / 2))
125#define CRYPTONOTE_MAX_FRAGMENTS 20
127#define COMMAND_RPC_GET_BLOCKS_FAST_MAX_BLOCK_COUNT 1000
128#define COMMAND_RPC_GET_BLOCKS_FAST_MAX_TX_COUNT 20000
129#define MAX_RPC_CONTENT_LENGTH 1048576
131#define P2P_LOCAL_WHITE_PEERLIST_LIMIT 1000
132#define P2P_LOCAL_GRAY_PEERLIST_LIMIT 5000
134#define P2P_DEFAULT_CONNECTIONS_COUNT 12
135#define P2P_DEFAULT_HANDSHAKE_INTERVAL 60
136#define P2P_DEFAULT_PACKET_MAX_SIZE 50000000
137#define P2P_DEFAULT_PEERS_IN_HANDSHAKE 250
138#define P2P_MAX_PEERS_IN_HANDSHAKE 250
139#define P2P_DEFAULT_CONNECTION_TIMEOUT 5000
140#define P2P_DEFAULT_SOCKS_CONNECT_TIMEOUT 45
141#define P2P_DEFAULT_PING_CONNECTION_TIMEOUT 2000
142#define P2P_DEFAULT_INVOKE_TIMEOUT 60*2*1000
143#define P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT 5000
144#define P2P_DEFAULT_WHITELIST_CONNECTIONS_PERCENT 70
145#define P2P_DEFAULT_ANCHOR_CONNECTIONS_COUNT 2
146#define P2P_DEFAULT_SYNC_SEARCH_CONNECTIONS_COUNT 2
147#define P2P_DEFAULT_LIMIT_RATE_UP 2048
148#define P2P_DEFAULT_LIMIT_RATE_DOWN 8192
150#define P2P_FAILED_ADDR_FORGET_SECONDS (60*60)
151#define P2P_IP_BLOCKTIME (60*60*24)
152#define P2P_IP_FAILS_BEFORE_BLOCK 10
153#define P2P_IDLE_CONNECTION_KILL_INTERVAL (5*60)
155#define P2P_SUPPORT_FLAG_FLUFFY_BLOCKS 0x01
156#define P2P_SUPPORT_FLAGS P2P_SUPPORT_FLAG_FLUFFY_BLOCKS
158#define RPC_IP_FAILS_BEFORE_BLOCK 3
160#define CRYPTONOTE_NAME "bitmonero"
161#define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb"
162#define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"
163#define P2P_NET_DATA_FILENAME "p2pstate.bin"
164#define RPC_PAYMENTS_DATA_FILENAME "rpcpayments.bin"
165#define MINER_CONFIG_FILE_NAME "miner_conf.json"
167#define THREAD_STACK_SIZE 5 * 1024 * 1024
169#define HF_VERSION_DYNAMIC_FEE 4
170#define HF_VERSION_MIN_MIXIN_4 6
171#define HF_VERSION_MIN_MIXIN_6 7
172#define HF_VERSION_MIN_MIXIN_10 8
173#define HF_VERSION_MIN_MIXIN_15 15
174#define HF_VERSION_ENFORCE_RCT 6
175#define HF_VERSION_PER_BYTE_FEE 8
176#define HF_VERSION_SMALLER_BP 10
177#define HF_VERSION_LONG_TERM_BLOCK_WEIGHT 10
178#define HF_VERSION_MIN_2_OUTPUTS 12
179#define HF_VERSION_MIN_V2_COINBASE_TX 12
180#define HF_VERSION_SAME_MIXIN 12
181#define HF_VERSION_REJECT_SIGS_IN_COINBASE 12
182#define HF_VERSION_ENFORCE_MIN_AGE 12
183#define HF_VERSION_EFFECTIVE_SHORT_TERM_MEDIAN_IN_PENALTY 12
184#define HF_VERSION_EXACT_COINBASE 13
185#define HF_VERSION_CLSAG 13
186#define HF_VERSION_DETERMINISTIC_UNLOCK_TIME 13
187#define HF_VERSION_BULLETPROOF_PLUS 15
188#define HF_VERSION_VIEW_TAGS 15
189#define HF_VERSION_2021_SCALING 15
191#define PER_KB_FEE_QUANTIZATION_DECIMALS 8
192#define CRYPTONOTE_SCALING_2021_FEE_ROUNDING_PLACES 2
194#define HASH_OF_HASHES_STEP 512
196#define DEFAULT_TXPOOL_MAX_WEIGHT 648000000ull
198#define BULLETPROOF_MAX_OUTPUTS 16
199#define BULLETPROOF_PLUS_MAX_OUTPUTS 16
201#define CRYPTONOTE_PRUNING_STRIPE_SIZE 4096
202#define CRYPTONOTE_PRUNING_LOG_STRIPES 3
203#define CRYPTONOTE_PRUNING_TIP_BLOCKS 5500
205#define RPC_CREDITS_PER_HASH_SCALE ((float)(1<<24))
207#define DNS_BLOCKLIST_LIFETIME (86400 * 8)
224 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10
226 std::string
const GENESIS_TX =
"013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121017767aafcde9be00dcfd098715ebcf7f410daebc582fda69d24a28e9d0bc890d1";
240 const unsigned char HASH_KEY_MULTISIG[] = {
'M',
'u',
'l',
't' ,
'i',
's',
'i',
'g', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
264 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11
266 std::string
const GENESIS_TX =
"013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121017767aafcde9be00dcfd098715ebcf7f410daebc582fda69d24a28e9d0bc890d1";
279 0x12 ,0x30, 0xF1, 0x71 , 0x61, 0x04 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x12
281 std::string
const GENESIS_TX =
"013c01ff0001ffffffffffff0302df5d56da0c7d643ddd1ce61901c7bdc5fb1738bfe39fbe69c28a3a7032729c0f2101168d0c4ca86fb55a4cf6a36d31431be1c53a3bd7411bb24e8832410289fa6f3b";
349 default:
throw std::runtime_error(
"Invalid network type");
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:278
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:282
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:274
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:277
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:272
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:273
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:275
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:276
std::string const GENESIS_TX
Definition: cryptonote_config.h:281
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:262
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:261
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:263
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:267
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:259
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:260
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:257
std::string const GENESIS_TX
Definition: cryptonote_config.h:266
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:258
Definition: cryptonote_config.h:211
const unsigned char HASH_KEY_RPC_PAYMENT_NONCE
Definition: cryptonote_config.h:238
const constexpr char HASH_KEY_MULTISIG_TX_PRIVKEYS_SEED[]
Definition: cryptonote_config.h:249
const unsigned char HASH_KEY_TXPROOF_V2[]
Definition: cryptonote_config.h:243
const unsigned char HASH_KEY_WALLET_CACHE
Definition: cryptonote_config.h:237
std::string const GENESIS_TX
Definition: cryptonote_config.h:226
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:218
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:221
uint64_t const DEFAULT_DUST_THRESHOLD
Definition: cryptonote_config.h:214
const constexpr char HASH_KEY_MULTISIG_TX_PRIVKEYS[]
Definition: cryptonote_config.h:250
const unsigned char HASH_KEY_MULTISIG_KEY_AGGREGATION[]
Definition: cryptonote_config.h:241
const unsigned char HASH_KEY_WALLET
Definition: cryptonote_config.h:236
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:223
const unsigned char HASH_KEY_CLSAG_ROUND_MULTISIG[]
Definition: cryptonote_config.h:242
const unsigned char HASH_KEY_CLSAG_AGG_0[]
Definition: cryptonote_config.h:245
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:227
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:222
const unsigned char HASH_KEY_ENCRYPTED_PAYMENT_ID
Definition: cryptonote_config.h:235
uint8_t const FEE_CALCULATION_MAX_RETRIES
Definition: cryptonote_config.h:213
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:217
const unsigned char HASH_KEY_MM_SLOT
Definition: cryptonote_config.h:248
const unsigned char HASH_KEY_CLSAG_ROUND[]
Definition: cryptonote_config.h:244
const char HASH_KEY_SUBADDRESS[]
Definition: cryptonote_config.h:234
uint64_t const BASE_REWARD_CLAMP_THRESHOLD
Definition: cryptonote_config.h:215
const char HASH_KEY_MESSAGE_SIGNING[]
Definition: cryptonote_config.h:247
const char HASH_KEY_RINGDB[]
Definition: cryptonote_config.h:233
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:220
const char HASH_KEY_BULLETPROOF_PLUS_EXPONENT[]
Definition: cryptonote_config.h:231
uint64_t const DEFAULT_FEE_ATOMIC_XMR_PER_KB
Definition: cryptonote_config.h:212
const char HASH_KEY_BULLETPROOF_EXPONENT[]
Definition: cryptonote_config.h:230
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:219
const uint32_t MULTISIG_MAX_SIGNERS
Definition: cryptonote_config.h:253
const char HASH_KEY_BULLETPROOF_PLUS_TRANSCRIPT[]
Definition: cryptonote_config.h:232
const unsigned char HASH_KEY_CLSAG_AGG_1[]
Definition: cryptonote_config.h:246
const unsigned char HASH_KEY_MEMORY
Definition: cryptonote_config.h:239
const unsigned char HASH_KEY_MULTISIG[]
Definition: cryptonote_config.h:240
Holds cryptonote related classes and helpers.
Definition: blockchain_db.cpp:45
network_type
Definition: cryptonote_config.h:289
@ UNDEFINED
Definition: cryptonote_config.h:294
@ FAKECHAIN
Definition: cryptonote_config.h:293
@ TESTNET
Definition: cryptonote_config.h:291
@ MAINNET
Definition: cryptonote_config.h:290
@ STAGENET
Definition: cryptonote_config.h:292
const config_t & get_config(network_type nettype)
Definition: cryptonote_config.h:308
unsigned short uint16_t
Definition: stdint.h:125
unsigned int uint32_t
Definition: stdint.h:126
unsigned char uint8_t
Definition: stdint.h:124
unsigned __int64 uint64_t
Definition: stdint.h:136
Definition: cryptonote_config.h:297
boost::uuids::uuid const NETWORK_ID
Definition: cryptonote_config.h:304
std::string const GENESIS_TX
Definition: cryptonote_config.h:305
uint16_t const ZMQ_RPC_DEFAULT_PORT
Definition: cryptonote_config.h:303
uint32_t const GENESIS_NONCE
Definition: cryptonote_config.h:306
uint64_t const CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:300
uint16_t const RPC_DEFAULT_PORT
Definition: cryptonote_config.h:302
uint64_t const CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:299
uint64_t const CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX
Definition: cryptonote_config.h:298
uint16_t const P2P_DEFAULT_PORT
Definition: cryptonote_config.h:301