From 9a110fe23b773b88e7fb6e5fd2d51c2fbffea9d5 Mon Sep 17 00:00:00 2001 From: James Piechota Date: Tue, 7 Jan 2025 13:41:39 +0000 Subject: [PATCH] test: use AR_TEST instead of TEST since eunit.hrl sets TEST (!!) --- apps/arweave/include/ar.hrl | 26 +++++++++---------- .../include/ar_blacklist_middleware.hrl | 2 +- apps/arweave/include/ar_config.hrl | 12 ++++----- apps/arweave/include/ar_consensus.hrl | 16 ++++++------ apps/arweave/include/ar_data_discovery.hrl | 4 +-- apps/arweave/include/ar_data_sync.hrl | 12 ++++----- apps/arweave/include/ar_header_sync.hrl | 8 +++--- apps/arweave/include/ar_inflation.hrl | 2 +- apps/arweave/include/ar_pricing.hrl | 24 ++++++++--------- apps/arweave/include/ar_sup.hrl | 2 +- apps/arweave/include/ar_sync_buckets.hrl | 2 +- apps/arweave/include/ar_vdf.hrl | 2 +- apps/arweave/include/ar_wallets.hrl | 2 +- apps/arweave/src/ar.erl | 2 +- apps/arweave/src/ar_block_time_history.erl | 2 +- apps/arweave/src/ar_chunk_storage.erl | 2 +- apps/arweave/src/ar_coordination.erl | 2 +- apps/arweave/src/ar_data_discovery.erl | 2 +- apps/arweave/src/ar_data_sync.erl | 4 +-- apps/arweave/src/ar_difficulty.erl | 2 +- apps/arweave/src/ar_global_sync_record.erl | 2 +- apps/arweave/src/ar_http.erl | 4 +-- apps/arweave/src/ar_inflation.erl | 2 +- apps/arweave/src/ar_join.erl | 2 +- apps/arweave/src/ar_mine_randomx.erl | 6 ++--- apps/arweave/src/ar_mining_server.erl | 4 +-- apps/arweave/src/ar_node_utils.erl | 2 +- apps/arweave/src/ar_node_worker.erl | 6 ++--- apps/arweave/src/ar_p3.erl | 2 +- apps/arweave/src/ar_peers.erl | 6 ++--- apps/arweave/src/ar_poller.erl | 2 +- apps/arweave/src/ar_pricing_transition.erl | 14 +++++----- apps/arweave/src/ar_storage_module.erl | 4 +-- apps/arweave/src/ar_sync_record.erl | 2 +- apps/arweave/src/ar_tx.erl | 4 +-- apps/arweave/src/ar_tx_blacklist.erl | 6 ++--- apps/arweave/src/ar_vdf.erl | 2 +- apps/arweave/src/ar_weave.erl | 2 +- rebar.config | 4 +-- 39 files changed, 103 insertions(+), 103 deletions(-) diff --git a/apps/arweave/include/ar.hrl b/apps/arweave/include/ar.hrl index 91476b59d..030292958 100644 --- a/apps/arweave/include/ar.hrl +++ b/apps/arweave/include/ar.hrl @@ -9,7 +9,7 @@ %% The mainnet name. Does not change at the hard forks. -ifndef(NETWORK_NAME). - -ifdef(TEST). + -ifdef(AR_TEST). -define(NETWORK_NAME, "arweave.localtest"). -else. -define(NETWORK_NAME, "arweave.N.1"). @@ -101,14 +101,14 @@ %% How far into the past or future the block can be in order to be accepted for %% processing. --ifdef(TEST). +-ifdef(AR_TEST). -define(STORE_BLOCKS_BEHIND_CURRENT, 10). -else. -define(STORE_BLOCKS_BEHIND_CURRENT, 50). -endif. %% The maximum lag when fork recovery (chain reorganisation) is performed. --ifdef(TEST). +-ifdef(AR_TEST). -define(CHECKPOINT_DEPTH, 4). -else. -define(CHECKPOINT_DEPTH, 18). @@ -116,14 +116,14 @@ %% The recommended depth of the block to use as an anchor for transactions. %% The corresponding block hash is returned by the GET /tx_anchor endpoint. --ifdef(TEST). +-ifdef(AR_TEST). -define(SUGGESTED_TX_ANCHOR_DEPTH, 5). -else. -define(SUGGESTED_TX_ANCHOR_DEPTH, 6). -endif. %% The number of blocks returned in the /info 'recent' field --ifdef(TEST). +-ifdef(AR_TEST). -define(RECENT_BLOCKS_WITHOUT_TIMESTAMP, 2). -else. -define(RECENT_BLOCKS_WITHOUT_TIMESTAMP, 5). @@ -145,7 +145,7 @@ -define(BLOCK_TX_DATA_SIZE_LIMIT, ?TX_DATA_SIZE_LIMIT). %% The maximum number of transactions (both format=1 and format=2) in a block. --ifdef(TEST). +-ifdef(AR_TEST). -define(BLOCK_TX_COUNT_LIMIT, 10). -else. -define(BLOCK_TX_COUNT_LIMIT, 1000). @@ -169,7 +169,7 @@ %% The maximum allowed size of transaction headers stored in mempool. %% The data field of a format=1 transaction is considered to belong to %% its headers. --ifdef(TEST). +-ifdef(AR_TEST). -define(MEMPOOL_HEADER_SIZE_LIMIT, 50 * 1024 * 1024). -else. -define(MEMPOOL_HEADER_SIZE_LIMIT, 250 * 1024 * 1024). @@ -178,7 +178,7 @@ %% The maximum allowed size of transaction data stored in mempool. %% The format=1 transactions are not counted as their data is considered %% to be part of the header. --ifdef(TEST). +-ifdef(AR_TEST). -define(MEMPOOL_DATA_SIZE_LIMIT, 50 * 1024 * 1024). -else. -define(MEMPOOL_DATA_SIZE_LIMIT, 500 * 1024 * 1024). @@ -209,7 +209,7 @@ -define(BAD_BLOCK_BAN_TIME, 24 * 60 * 60). %% A part of transaction propagation delay independent from the size, in seconds. --ifdef(TEST). +-ifdef(AR_TEST). -define(BASE_TX_PROPAGATION_DELAY, 0). -else. -ifndef(BASE_TX_PROPAGATION_DELAY). @@ -221,7 +221,7 @@ %% estimate the transaction propagation delay. It does not include %% the base delay, the time the transaction spends in the priority %% queue, and the time it takes to propagate the transaction to peers. --ifdef(TEST). +-ifdef(AR_TEST). -define(TX_PROPAGATION_BITS_PER_SECOND, 1000000000). -else. -define(TX_PROPAGATION_BITS_PER_SECOND, 3000000). % 3 mbps @@ -291,7 +291,7 @@ %% The adjustment of difficutly going from SHA-384 to RandomX. -define(RANDOMX_DIFF_ADJUSTMENT, (-14)). --ifdef(TEST). +-ifdef(AR_TEST). -define(RANDOMX_KEY_SWAP_FREQ, (?STORE_BLOCKS_BEHIND_CURRENT + 1)). -define(RANDOMX_MIN_KEY_GEN_AHEAD, 1). -define(RANDOMX_MAX_KEY_GEN_AHEAD, 4). @@ -335,7 +335,7 @@ -define(NOTE_SIZE, 32). %% Disk cache size in MB --ifdef(TEST). +-ifdef(AR_TEST). -define(DISK_CACHE_SIZE, 1). -define(DISK_CACHE_CLEAN_PERCENT_MAX, 20). -else. @@ -344,7 +344,7 @@ -endif. %% The speed in chunks/s of moving the fork 2.5 packing threshold. --ifdef(TEST). +-ifdef(AR_TEST). -define(PACKING_2_5_THRESHOLD_CHUNKS_PER_SECOND, 1). -else. -define(PACKING_2_5_THRESHOLD_CHUNKS_PER_SECOND, 10). diff --git a/apps/arweave/include/ar_blacklist_middleware.hrl b/apps/arweave/include/ar_blacklist_middleware.hrl index 127f173fd..4e438bc1e 100644 --- a/apps/arweave/include/ar_blacklist_middleware.hrl +++ b/apps/arweave/include/ar_blacklist_middleware.hrl @@ -11,7 +11,7 @@ end). ?RPM_BY_PATH(Path, LimitByIP, Config#config.requests_per_minute_limit)() end). --ifdef(TEST). +-ifdef(AR_TEST). -define(RPM_BY_PATH(Path, LimitByIP, DefaultPathLimit), fun() -> case Path of [<<"chunk">> | _] -> diff --git a/apps/arweave/include/ar_config.hrl b/apps/arweave/include/ar_config.hrl index 344e7e579..4b92690c8 100644 --- a/apps/arweave/include/ar_config.hrl +++ b/apps/arweave/include/ar_config.hrl @@ -21,7 +21,7 @@ %% The number of data sync jobs to run. Each job periodically picks a range %% and downloads it from peers. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_SYNC_JOBS, 10). -else. -define(DEFAULT_SYNC_JOBS, 100). @@ -40,14 +40,14 @@ -define(DEFAULT_DISK_POOL_DATA_ROOT_EXPIRATION_TIME_S, 30 * 60). %% The default size limit for unconfirmed and seeded chunks, per data root. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_MAX_DISK_POOL_DATA_ROOT_BUFFER_MB, 50). -else. -define(DEFAULT_MAX_DISK_POOL_DATA_ROOT_BUFFER_MB, 10000). -endif. %% The default total size limit for unconfirmed and seeded chunks. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_MAX_DISK_POOL_BUFFER_MB, 100). -else. -define(DEFAULT_MAX_DISK_POOL_BUFFER_MB, 100000). @@ -86,14 +86,14 @@ max(1, (erlang:system_info(schedulers_online) - 1))). %% Accept a block from the given IP only once in so many milliseconds. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_BLOCK_THROTTLE_BY_IP_INTERVAL_MS, 10). -else. -define(DEFAULT_BLOCK_THROTTLE_BY_IP_INTERVAL_MS, 1000). -endif. %% Accept a block with the given solution hash only once in so many milliseconds. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_BLOCK_THROTTLE_BY_SOLUTION_INTERVAL_MS, 10). -else. -define(DEFAULT_BLOCK_THROTTLE_BY_SOLUTION_INTERVAL_MS, 2000). @@ -120,7 +120,7 @@ -define(DEFAULT_MAX_REPLICA_2_9_ENTROPY_CACHE_SIZE, 33_554_432). % 8_388_608 * 4. %% The number of 2.9 storage modules allowed to prepare the storage at a time. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_REPLICA_2_9_WORKERS, 2). -else. -define(DEFAULT_REPLICA_2_9_WORKERS, 8). diff --git a/apps/arweave/include/ar_consensus.hrl b/apps/arweave/include/ar_consensus.hrl index 01f9b424e..20a14165f 100755 --- a/apps/arweave/include/ar_consensus.hrl +++ b/apps/arweave/include/ar_consensus.hrl @@ -38,7 +38,7 @@ -define(RANDOMX_SCRATCHPAD_SIZE, 2097152). %% The size in bytes of the total RX2 entropy (# of lanes * scratchpad size). --ifdef(TEST). +-ifdef(AR_TEST). %% 24_576 bytes worth of entropy. -define(REPLICA_2_9_ENTROPY_SIZE, (3 * ?COMPOSITE_PACKING_SUB_CHUNK_SIZE)). -else. @@ -72,7 +72,7 @@ %% map to chunks that are as far as possible from each other within a partition. With %% an entropy size of 8_388_608 bytes and a slice size of 8192 bytes, there are 1024 slices per %% entropy, which yields 1024 sectors per partition. --ifdef(TEST). +-ifdef(AR_TEST). %% 2_097_152 / 24_576 = 85.33333333333333 %% (85 + 11) = 96 the nearest multiple of 32 -define(REPLICA_2_9_ENTROPY_COUNT, 96). @@ -89,7 +89,7 @@ %% The size of the mining partition. The weave is broken down into partitions %% of equal size. A miner can search for a solution in each of the partitions %% in parallel, per mining address. --ifdef(TEST). +-ifdef(AR_TEST). -define(PARTITION_SIZE, 2_097_152). % 8 * 256 * 1024 -else. -define(PARTITION_SIZE, 3_600_000_000_000). % 90% of 4 TB. @@ -97,21 +97,21 @@ %% The size of a recall range. The first range is randomly chosen from the given %% mining partition. The second range is chosen from the entire weave. --ifdef(TEST). +-ifdef(AR_TEST). -define(RECALL_RANGE_SIZE, (128 * 1024)). -else. -define(RECALL_RANGE_SIZE, 26_214_400). % == 25 * 1024 * 1024 -endif. %% The size of a recall range before the fork 2.8. --ifdef(TEST). +-ifdef(AR_TEST). -define(LEGACY_RECALL_RANGE_SIZE, (512 * 1024)). -else. -define(LEGACY_RECALL_RANGE_SIZE, 104_857_600). % == 100 * 1024 * 1024 -endif. -ifdef(FORKS_RESET). - -ifdef(TEST). + -ifdef(AR_TEST). -define(STRICT_DATA_SPLIT_THRESHOLD, (262144 * 3)). -else. -define(STRICT_DATA_SPLIT_THRESHOLD, 0). @@ -123,7 +123,7 @@ -endif. -ifdef(FORKS_RESET). - -ifdef(TEST). + -ifdef(AR_TEST). -define(MERKLE_REBASE_SUPPORT_THRESHOLD, (?STRICT_DATA_SPLIT_THRESHOLD * 2)). -else. -define(MERKLE_REBASE_SUPPORT_THRESHOLD, 0). @@ -136,7 +136,7 @@ %% Recall bytes are only picked from the subspace up to the size %% of the weave at the block of the depth defined by this constant. --ifdef(TEST). +-ifdef(AR_TEST). -define(SEARCH_SPACE_UPPER_BOUND_DEPTH, 3). -else. -define(SEARCH_SPACE_UPPER_BOUND_DEPTH, 50). diff --git a/apps/arweave/include/ar_data_discovery.hrl b/apps/arweave/include/ar_data_discovery.hrl index 79cd2bb23..3344eefa0 100644 --- a/apps/arweave/include/ar_data_discovery.hrl +++ b/apps/arweave/include/ar_data_discovery.hrl @@ -2,14 +2,14 @@ %% an interval, we process it bucket by bucket: for every bucket, a few peers who are known to %% to have some data there are asked for the intervals they have and check which of them %% cross the desired interval. --ifdef(TEST). +-ifdef(AR_TEST). -define(NETWORK_DATA_BUCKET_SIZE, 10_000_000). % 10 MB -else. -define(NETWORK_DATA_BUCKET_SIZE, 10_000_000_000). % 10 GB -endif. %% The maximum number of synced intervals shared with peers. --ifdef(TEST). +-ifdef(AR_TEST). -define(MAX_SHARED_SYNCED_INTERVALS_COUNT, 20). -else. -define(MAX_SHARED_SYNCED_INTERVALS_COUNT, 10_000). diff --git a/apps/arweave/include/ar_data_sync.hrl b/apps/arweave/include/ar_data_sync.hrl index 7258d12b1..d92f7ec7d 100644 --- a/apps/arweave/include/ar_data_sync.hrl +++ b/apps/arweave/include/ar_data_sync.hrl @@ -26,14 +26,14 @@ -define(MAX_SERVED_TX_DATA_SIZE, 12 * 1024 * 1024). %% The time to wait until the next full disk pool scan. --ifdef(TEST). +-ifdef(AR_TEST). -define(DISK_POOL_SCAN_DELAY_MS, 2000). -else. -define(DISK_POOL_SCAN_DELAY_MS, 10000). -endif. %% How often to measure the number of chunks in the disk pool index. --ifdef(TEST). +-ifdef(AR_TEST). -define(RECORD_DISK_POOL_CHUNKS_COUNT_FREQUENCY_MS, 1000). -else. -define(RECORD_DISK_POOL_CHUNKS_COUNT_FREQUENCY_MS, 5000). @@ -50,7 +50,7 @@ -define(STORE_STATE_FREQUENCY_MS, 30000). %% The maximum number of chunks currently being downloaded or processed. --ifdef(TEST). +-ifdef(AR_TEST). -define(SYNC_BUFFER_SIZE, 100). -else. -define(SYNC_BUFFER_SIZE, 1000). @@ -59,7 +59,7 @@ %% Defines how long we keep the interval excluded from syncing. %% If we cannot find an interval by peers, we temporarily exclude %% it from the sought ranges to prevent the syncing process from slowing down. --ifdef(TEST). +-ifdef(AR_TEST). -define(EXCLUDE_MISSING_INTERVAL_TIMEOUT_MS, 5000). -else. -define(EXCLUDE_MISSING_INTERVAL_TIMEOUT_MS, 10 * 60 * 1000). @@ -67,7 +67,7 @@ %% Let at least this many chunks stack up, per storage module, then write them on disk in the %% ascending order, to reduce out-of-order disk writes causing fragmentation. --ifdef(TEST). +-ifdef(AR_TEST). -define(STORE_CHUNK_QUEUE_FLUSH_SIZE_THRESHOLD, 2). -else. -define(STORE_CHUNK_QUEUE_FLUSH_SIZE_THRESHOLD, 100). % ~ 25 MB worth of chunks. @@ -75,7 +75,7 @@ %% If a chunk spends longer than this in the store queue, write it on disk without waiting %% for ?STORE_CHUNK_QUEUE_FLUSH_SIZE_THRESHOLD chunks to stack up. --ifdef(TEST). +-ifdef(AR_TEST). -define(STORE_CHUNK_QUEUE_FLUSH_TIME_THRESHOLD, 1000). -else. -define(STORE_CHUNK_QUEUE_FLUSH_TIME_THRESHOLD, 2_000). % 2 seconds. diff --git a/apps/arweave/include/ar_header_sync.hrl b/apps/arweave/include/ar_header_sync.hrl index 5dbbd1fd3..624c9db25 100644 --- a/apps/arweave/include/ar_header_sync.hrl +++ b/apps/arweave/include/ar_header_sync.hrl @@ -1,5 +1,5 @@ %% The frequency of processing items in the queue. --ifdef(TEST). +-ifdef(AR_TEST). -define(PROCESS_ITEM_INTERVAL_MS, 1000). -else. -define(PROCESS_ITEM_INTERVAL_MS, 100). @@ -9,21 +9,21 @@ %% is synced. Also applies to a fresh node without any data waiting for a block index. %% Another case is when the process misses a few blocks (e.g. blocks were sent while the %% supervisor was restarting it after a crash). --ifdef(TEST). +-ifdef(AR_TEST). -define(CHECK_AFTER_SYNCED_INTERVAL_MS, 500). -else. -define(CHECK_AFTER_SYNCED_INTERVAL_MS, 5000). -endif. %% The initial value for the exponential backoff for failing requests. --ifdef(TEST). +-ifdef(AR_TEST). -define(INITIAL_BACKOFF_INTERVAL_S, 1). -else. -define(INITIAL_BACKOFF_INTERVAL_S, 30). -endif. %% The maximum exponential backoff interval for failing requests. --ifdef(TEST). +-ifdef(AR_TEST). -define(MAX_BACKOFF_INTERVAL_S, 2). -else. -define(MAX_BACKOFF_INTERVAL_S, 2 * 60 * 60). diff --git a/apps/arweave/include/ar_inflation.hrl b/apps/arweave/include/ar_inflation.hrl index 5e6565f1a..a8bc6e057 100644 --- a/apps/arweave/include/ar_inflation.hrl +++ b/apps/arweave/include/ar_inflation.hrl @@ -15,7 +15,7 @@ -define(DEFAULT_TOLERANCE_PERCENT, 0.001). %% Height at which the 1.5.0.0 fork takes effect. --ifdef(TEST). +-ifdef(AR_TEST). %% The inflation tests serve as a documentation of how rewards are computed. %% Therefore, we keep the mainnet value in these tests. Other tests have %% FORK 1.6 height set to zero from now on. diff --git a/apps/arweave/include/ar_pricing.hrl b/apps/arweave/include/ar_pricing.hrl index f8296bb53..0cf75ac23 100644 --- a/apps/arweave/include/ar_pricing.hrl +++ b/apps/arweave/include/ar_pricing.hrl @@ -5,7 +5,7 @@ -define(NEW_ACCOUNT_FEE_DATA_SIZE_EQUIVALENT, 20_000_000). %% The target number of replications. --ifdef(TEST). +-ifdef(AR_TEST). -define(N_REPLICATIONS, fun(_MACRO_Height) -> 200 end). -else. -define(N_REPLICATIONS, fun(MACRO_Height) -> @@ -31,7 +31,7 @@ end). %% When a double-signing proof is provided, we reward the prover with the %% ?DOUBLE_SIGNING_PROVER_REWARD_SHARE of the minimum reward among the preceding %% ?DOUBLE_SIGNING_REWARD_SAMPLE_SIZE blocks. --ifdef(TEST). +-ifdef(AR_TEST). -define(DOUBLE_SIGNING_REWARD_SAMPLE_SIZE, 2). -else. -define(DOUBLE_SIGNING_REWARD_SAMPLE_SIZE, 100). @@ -53,7 +53,7 @@ end). -define(FORK_2_6_PRE_TRANSITION_USD_TO_AR_RATE, {1, 10}). %% The number of recent blocks with the reserved (temporarily locked) mining rewards. --ifdef(TEST). +-ifdef(AR_TEST). % testnet value should have same ratio 30:1 to VDF_DIFFICULTY_RETARGET % BUT. For tests we are using old value -define(LOCKED_REWARDS_BLOCKS, 3). @@ -66,7 +66,7 @@ end). %% The number of recent blocks contributing data points to the continuous estimation %% of the average price of storing a gibibyte for a minute. A recent subset of the %% reward history is used for tracking the reserved mining rewards. --ifdef(TEST). +-ifdef(AR_TEST). -define(REWARD_HISTORY_BLOCKS, 3). -else. -ifndef(REWARD_HISTORY_BLOCKS). @@ -75,7 +75,7 @@ end). -endif. %% The REWARD_HISTORY_BLOCKS before 2.8. --ifdef(TEST). +-ifdef(AR_TEST). -define(LEGACY_REWARD_HISTORY_BLOCKS, 3). -else. -ifndef(LEGACY_REWARD_HISTORY_BLOCKS). @@ -84,7 +84,7 @@ end). -endif. %% The prices are re-estimated every so many blocks. --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_ADJUSTMENT_FREQUENCY, 2). -else. -ifndef(PRICE_ADJUSTMENT_FREQUENCY). @@ -108,7 +108,7 @@ end). %% endowment size remains low. Once the endowment is bigger than this constant again, %% we open the latch (and will increase the fees again when/if the endowment is empty). %% The value is redenominated according the denomination used at the time. --ifdef(TEST). +-ifdef(AR_TEST). -define(RESET_KRYDER_PLUS_LATCH_THRESHOLD, 100_000_000_000). -else. -define(RESET_KRYDER_PLUS_LATCH_THRESHOLD, 10_000_000_000_000_000). @@ -117,7 +117,7 @@ end). %% The total supply, in Winston (the sum of genesis balances + the total emission). %% Does NOT include the additional emission which may start in the far future if and when %% the endowment pool runs empty. --ifdef(TEST). +-ifdef(AR_TEST). %% The debug constant is not always actually equal to the sum of genesis balances plust %% the total emission. We just set a relatively low value so that we can reproduce %% autoredenomination in tests. @@ -134,7 +134,7 @@ end). %% Re-denominate AR (multiply by 1000) when the available supply falls below this %% number of units. --ifdef(TEST). +-ifdef(AR_TEST). -define(REDENOMINATION_THRESHOLD, 1350000000000). -else. -define(REDENOMINATION_THRESHOLD, 1000_000_000_000_000_000). @@ -145,7 +145,7 @@ end). %% not allowed in these blocks. The motivation is to protect the legacy libraries' users from %% an attack where a post-redenomination transaction is included in a pre-redenomination %% block, potentially charging the user a thousand times the intended fee or transfer amount. --ifdef(TEST). +-ifdef(AR_TEST). -define(REDENOMINATION_DELAY_BLOCKS, 2). -else. -define(REDENOMINATION_DELAY_BLOCKS, 100). @@ -244,7 +244,7 @@ end). -define(USD_TO_AR_MAX_ADJUSTMENT_DOWN_MULTIPLIER, {995, 1000}). %% Reduce the USD to AR fraction if both the dividend and the devisor become bigger than this. --ifdef(TEST). +-ifdef(AR_TEST). -define(USD_TO_AR_FRACTION_REDUCTION_LIMIT, 100). -else. -define(USD_TO_AR_FRACTION_REDUCTION_LIMIT, 1000000). @@ -253,7 +253,7 @@ end). %% Every transaction fee has to be at least X + X * ?MINING_REWARD_MULTIPLIER %% where X is the amount sent to the endowment pool. %% Used until the transition to the new fee calculation method is complete. --ifdef(TEST). +-ifdef(AR_TEST). -define(MINING_REWARD_MULTIPLIER, {2, 10000}). -else. -define(MINING_REWARD_MULTIPLIER, {2, 10}). diff --git a/apps/arweave/include/ar_sup.hrl b/apps/arweave/include/ar_sup.hrl index 283a0b369..da7c3050b 100644 --- a/apps/arweave/include/ar_sup.hrl +++ b/apps/arweave/include/ar_sup.hrl @@ -1,5 +1,5 @@ %% The number of milliseconds the supervisor gives every process for shutdown. --ifdef(TEST). +-ifdef(AR_TEST). -define(SHUTDOWN_TIMEOUT, 30000). -else. -define(SHUTDOWN_TIMEOUT, 30000). diff --git a/apps/arweave/include/ar_sync_buckets.hrl b/apps/arweave/include/ar_sync_buckets.hrl index dad4dca42..bec4fb686 100644 --- a/apps/arweave/include/ar_sync_buckets.hrl +++ b/apps/arweave/include/ar_sync_buckets.hrl @@ -3,7 +3,7 @@ %% encountered when asking peers about the presence of particular chunks. %% If the serialized buckets do not fit in ?MAX_SYNC_BUCKETS_SIZE, the bucket %% size is doubled until they fit. --ifdef(TEST). +-ifdef(AR_TEST). -define(DEFAULT_SYNC_BUCKET_SIZE, 10000000). -else. -define(DEFAULT_SYNC_BUCKET_SIZE, 10_000_000_000). % 10 GB diff --git a/apps/arweave/include/ar_vdf.hrl b/apps/arweave/include/ar_vdf.hrl index 133974899..207f1c08c 100755 --- a/apps/arweave/include/ar_vdf.hrl +++ b/apps/arweave/include/ar_vdf.hrl @@ -10,7 +10,7 @@ -define(VDF_DIFFICULTY, ?VDF_SHA_1S div ?VDF_CHECKPOINT_COUNT_IN_STEP). -endif. --ifdef(TEST). +-ifdef(AR_TEST). % NOTE. VDF_DIFFICULTY_RETARGET should be > 10 because it's > 10 in mainnet % So VDF difficulty should change slower than difficulty -define(VDF_DIFFICULTY_RETARGET, 20). diff --git a/apps/arweave/include/ar_wallets.hrl b/apps/arweave/include/ar_wallets.hrl index d3519607a..ad7a916d7 100644 --- a/apps/arweave/include/ar_wallets.hrl +++ b/apps/arweave/include/ar_wallets.hrl @@ -1,5 +1,5 @@ %% @doc The maximum number of wallets served via /wallet_list/[/]. --ifdef(TEST). +-ifdef(AR_TEST). -define(WALLET_LIST_CHUNK_SIZE, 2). -else. -define(WALLET_LIST_CHUNK_SIZE, 2500). diff --git a/apps/arweave/src/ar.erl b/apps/arweave/src/ar.erl index dc6d533c1..8a523f08a 100644 --- a/apps/arweave/src/ar.erl +++ b/apps/arweave/src/ar.erl @@ -977,7 +977,7 @@ commandline_parser_test_() -> ) end}. --ifdef(TEST). +-ifdef(AR_TEST). console(Format) -> ?LOG_INFO(io_lib:format(Format, [])). diff --git a/apps/arweave/src/ar_block_time_history.erl b/apps/arweave/src/ar_block_time_history.erl index d79b3e383..7f443ee5f 100644 --- a/apps/arweave/src/ar_block_time_history.erl +++ b/apps/arweave/src/ar_block_time_history.erl @@ -6,7 +6,7 @@ -include_lib("arweave/include/ar.hrl"). --ifdef(TEST). +-ifdef(AR_TEST). -define(BLOCK_TIME_HISTORY_BLOCKS, 3). -else. -ifndef(BLOCK_TIME_HISTORY_BLOCKS). diff --git a/apps/arweave/src/ar_chunk_storage.erl b/apps/arweave/src/ar_chunk_storage.erl index 313524266..765fe94db 100644 --- a/apps/arweave/src/ar_chunk_storage.erl +++ b/apps/arweave/src/ar_chunk_storage.erl @@ -1384,7 +1384,7 @@ chunk_offset_list_to_map([{Offset, Chunk} | ChunkOffsets], Min, Max, Map) -> chunk_offset_list_to_map(ChunkOffsets, min(Min, Offset), max(Max, Offset), maps:put(Offset, Chunk, Map)). --ifdef(TEST). +-ifdef(AR_TEST). try_acquire_replica_2_9_formatting_lock(_StoreID) -> true. -else. diff --git a/apps/arweave/src/ar_coordination.erl b/apps/arweave/src/ar_coordination.erl index f07e5ff13..10f0cf9dc 100644 --- a/apps/arweave/src/ar_coordination.erl +++ b/apps/arweave/src/ar_coordination.erl @@ -27,7 +27,7 @@ -define(START_DELAY, 1000). --ifdef(TEST). +-ifdef(AR_TEST). -define(BATCH_SIZE_LIMIT, 2). -else. -define(BATCH_SIZE_LIMIT, 400). diff --git a/apps/arweave/src/ar_data_discovery.erl b/apps/arweave/src/ar_data_discovery.erl index a383779ad..6d0fa2cdb 100644 --- a/apps/arweave/src/ar_data_discovery.erl +++ b/apps/arweave/src/ar_data_discovery.erl @@ -17,7 +17,7 @@ }). %% The frequency of asking peers about their data. --ifdef(TEST). +-ifdef(AR_TEST). -define(DATA_DISCOVERY_COLLECT_PEERS_FREQUENCY_MS, 2 * 1000). -else. -define(DATA_DISCOVERY_COLLECT_PEERS_FREQUENCY_MS, 4 * 60 * 1000). diff --git a/apps/arweave/src/ar_data_sync.erl b/apps/arweave/src/ar_data_sync.erl index e7a5ab2b5..13ca94655 100644 --- a/apps/arweave/src/ar_data_sync.erl +++ b/apps/arweave/src/ar_data_sync.erl @@ -28,7 +28,7 @@ -include_lib("arweave/include/ar_data_sync.hrl"). -include_lib("arweave/include/ar_sync_buckets.hrl"). --ifdef(TEST). +-ifdef(AR_TEST). -define(COLLECT_SYNC_INTERVALS_FREQUENCY_MS, 5_000). -else. -define(COLLECT_SYNC_INTERVALS_FREQUENCY_MS, 300_000). @@ -492,7 +492,7 @@ is_chunk_cache_full() -> not_initialized end. --ifdef(TEST). +-ifdef(AR_TEST). is_disk_space_sufficient(_StoreID) -> true. -else. diff --git a/apps/arweave/src/ar_difficulty.erl b/apps/arweave/src/ar_difficulty.erl index 8c811487e..63dbbf2e3 100644 --- a/apps/arweave/src/ar_difficulty.erl +++ b/apps/arweave/src/ar_difficulty.erl @@ -120,7 +120,7 @@ sub_diff(Diff, N) -> Divisor = 2 * N * N * MaxDiffSquared, (MaxDiff * Divisor - Dividend * MaxDiff) div Divisor. --ifdef(TEST). +-ifdef(AR_TEST). min_difficulty(_Height) -> 1. switch_to_randomx_fork_diff(_) -> diff --git a/apps/arweave/src/ar_global_sync_record.erl b/apps/arweave/src/ar_global_sync_record.erl index dc18913d5..5678fe991 100644 --- a/apps/arweave/src/ar_global_sync_record.erl +++ b/apps/arweave/src/ar_global_sync_record.erl @@ -11,7 +11,7 @@ -export([init/1, handle_cast/2, handle_call/3, handle_info/2, terminate/2]). %% The frequency in seconds of updating serialized sync buckets. --ifdef(TEST). +-ifdef(AR_TEST). -define(UPDATE_SERIALIZED_SYNC_BUCKETS_FREQUENCY_S, 2). -else. -define(UPDATE_SERIALIZED_SYNC_BUCKETS_FREQUENCY_S, 300). diff --git a/apps/arweave/src/ar_http.erl b/apps/arweave/src/ar_http.erl index 1d1d57ddb..2a2f70c7d 100644 --- a/apps/arweave/src/ar_http.erl +++ b/apps/arweave/src/ar_http.erl @@ -5,7 +5,7 @@ -export([start_link/0, req/1]). --ifdef(TEST). +-ifdef(AR_TEST). -export([block_peer_connections/0, unblock_peer_connections/0]). -endif. @@ -27,7 +27,7 @@ start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). --ifdef(TEST). +-ifdef(AR_TEST). block_peer_connections() -> ets:insert(?MODULE, {block_peer_connections}), ok. diff --git a/apps/arweave/src/ar_inflation.erl b/apps/arweave/src/ar_inflation.erl index 77418f9c1..5bef84620 100644 --- a/apps/arweave/src/ar_inflation.erl +++ b/apps/arweave/src/ar_inflation.erl @@ -14,7 +14,7 @@ %% @doc Calculate the static reward received for mining a given block. %% This reward portion depends only on block height, not the number of transactions. --ifdef(TEST). +-ifdef(AR_TEST). calculate(_Height) -> 10. -else. diff --git a/apps/arweave/src/ar_join.erl b/apps/arweave/src/ar_join.erl index 42744849f..4325839a8 100644 --- a/apps/arweave/src/ar_join.erl +++ b/apps/arweave/src/ar_join.erl @@ -11,7 +11,7 @@ %% The number of block index elements to fetch per request. %% Must not exceed ?MAX_BLOCK_INDEX_RANGE_SIZE defined in ar_http_iface_middleware.erl. --ifdef(TEST). +-ifdef(AR_TEST). -define(REQUEST_BLOCK_INDEX_RANGE_SIZE, 2). -else. -define(REQUEST_BLOCK_INDEX_RANGE_SIZE, 10000). diff --git a/apps/arweave/src/ar_mine_randomx.erl b/apps/arweave/src/ar_mine_randomx.erl index e71ce9648..2f423a1b1 100755 --- a/apps/arweave/src/ar_mine_randomx.erl +++ b/apps/arweave/src/ar_mine_randomx.erl @@ -103,11 +103,11 @@ randomx_reencrypt_chunk(SourcePacking, TargetPacking, randomx_reencrypt_chunk2(SourcePacking, TargetPacking, RandomxState, UnpackKey, PackKey, Chunk, ChunkSize). -%%% TEST implementation +%%% AR_TEST implementation randomx_generate_replica_2_9_entropy({_, {stub_state, _}}, Key) -> %% Make it fast, deterministic, and scoped by Key. %% Note that ?REPLICA_2_9_ENTROPY_SIZE is - %% reduced significantly in the TEST mode. + %% reduced significantly in the AR_TEST mode. SubChunkCount = ?REPLICA_2_9_ENTROPY_SIZE div ?COMPOSITE_PACKING_SUB_CHUNK_SIZE, lists:foldl( fun(N1, Acc) -> @@ -124,7 +124,7 @@ randomx_generate_replica_2_9_entropy({_, {stub_state, _}}, Key) -> lists:seq(1, SubChunkCount) ); -%% Non-TEST implementation +%% Non-AR_TEST implementation randomx_generate_replica_2_9_entropy({rxsquared, RandomxState}, Key) -> {ok, EntropyFused} = ar_rxsquared_nif:rsp_fused_entropy_nif( RandomxState, diff --git a/apps/arweave/src/ar_mining_server.erl b/apps/arweave/src/ar_mining_server.erl index d12efc56f..90f609ca9 100644 --- a/apps/arweave/src/ar_mining_server.erl +++ b/apps/arweave/src/ar_mining_server.erl @@ -37,7 +37,7 @@ packing_difficulty = 0 }). --ifdef(TEST). +-ifdef(AR_TEST). -define(POST_2_8_COMPOSITE_PACKING_DELAY_BLOCKS, 0). -else. -define(POST_2_8_COMPOSITE_PACKING_DELAY_BLOCKS, 10). @@ -105,7 +105,7 @@ is_one_chunk_solution(Solution) -> ) -> Ret :: ok. --ifdef(TEST). +-ifdef(AR_TEST). log_prepare_solution_failure(Solution, stale_step_number, AdditionalLogData) -> ok; log_prepare_solution_failure(Solution, FailureReason, AdditionalLogData) -> diff --git a/apps/arweave/src/ar_node_utils.erl b/apps/arweave/src/ar_node_utils.erl index 19c4036f8..e3566147a 100644 --- a/apps/arweave/src/ar_node_utils.erl +++ b/apps/arweave/src/ar_node_utils.erl @@ -635,7 +635,7 @@ validate_block(merkle_rebase_support_threshold, {NewB, OldB}) -> end end. --ifdef(TEST). +-ifdef(AR_TEST). is_wallet_invalid(#tx{ signature = <<>> }, _Wallets) -> false; is_wallet_invalid(#tx{ owner = Owner, signature_type = SigType }, Wallets) -> diff --git a/apps/arweave/src/ar_node_worker.erl b/apps/arweave/src/ar_node_worker.erl index 6f785d53f..e8d9f314a 100644 --- a/apps/arweave/src/ar_node_worker.erl +++ b/apps/arweave/src/ar_node_worker.erl @@ -23,7 +23,7 @@ -include_lib("arweave/include/ar_mining.hrl"). -include_lib("eunit/include/eunit.hrl"). --ifdef(TEST). +-ifdef(AR_TEST). -define(PROCESS_TASK_QUEUE_FREQUENCY_MS, 10). -else. -define(PROCESS_TASK_QUEUE_FREQUENCY_MS, 200). @@ -31,7 +31,7 @@ -define(FILTER_MEMPOOL_CHUNK_SIZE, 100). --ifdef(TEST). +-ifdef(AR_TEST). -define(BLOCK_INDEX_HEAD_LEN, (?STORE_BLOCKS_BEHIND_CURRENT * 2)). -else. -define(BLOCK_INDEX_HEAD_LEN, 10000). @@ -47,7 +47,7 @@ -endif. %% How frequently (in seconds) to recompute the mining difficulty at the retarget blocks. --ifdef(TEST). +-ifdef(AR_TEST). -define(COMPUTE_MINING_DIFFICULTY_INTERVAL, 1). -else. -define(COMPUTE_MINING_DIFFICULTY_INTERVAL, 10). diff --git a/apps/arweave/src/ar_p3.erl b/apps/arweave/src/ar_p3.erl index 8f0f74705..de8b7323c 100644 --- a/apps/arweave/src/ar_p3.erl +++ b/apps/arweave/src/ar_p3.erl @@ -9,7 +9,7 @@ -export([start_link/0, allow_request/1, reverse_charge/1, get_balance/3, get_rates_json/0]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2]). --ifdef(TEST). +-ifdef(AR_TEST). -define(MAX_BLOCK_SCAN, 4). -else. -define(MAX_BLOCK_SCAN, 200). diff --git a/apps/arweave/src/ar_peers.erl b/apps/arweave/src/ar_peers.erl index d5f7290e5..f672cb819 100644 --- a/apps/arweave/src/ar_peers.erl +++ b/apps/arweave/src/ar_peers.erl @@ -26,14 +26,14 @@ -define(STORE_RESOLVED_DOMAIN_S, 60). %% The frequency in milliseconds of ranking the known peers. --ifdef(TEST). +-ifdef(AR_TEST). -define(RANK_PEERS_FREQUENCY_MS, 2 * 1000). -else. -define(RANK_PEERS_FREQUENCY_MS, 2 * 60 * 1000). -endif. %% The frequency in milliseconds of asking some peers for their peers. --ifdef(TEST). +-ifdef(AR_TEST). -define(GET_MORE_PEERS_FREQUENCY_MS, 5000). -else. -define(GET_MORE_PEERS_FREQUENCY_MS, 240 * 1000). @@ -704,7 +704,7 @@ ping_peers(Peers) -> ar_util:pmap(fun ar_http_iface_client:add_peer/1, Send), ping_peers(Rest). --ifdef(TEST). +-ifdef(AR_TEST). %% Do not filter out loopback IP addresses with custom port in the debug mode %% to allow multiple local VMs to peer with each other. is_loopback_ip({127, _, _, _, Port}) -> diff --git a/apps/arweave/src/ar_poller.erl b/apps/arweave/src/ar_poller.erl index 89e6e26cd..860d8a20d 100644 --- a/apps/arweave/src/ar_poller.erl +++ b/apps/arweave/src/ar_poller.erl @@ -21,7 +21,7 @@ -include_lib("arweave/include/ar_config.hrl"). %% The frequency of choosing the peers to poll. --ifdef(TEST). +-ifdef(AR_TEST). -define(COLLECT_PEERS_FREQUENCY_MS, 2000). -else. -define(COLLECT_PEERS_FREQUENCY_MS, 1000 * 15). diff --git a/apps/arweave/src/ar_pricing_transition.erl b/apps/arweave/src/ar_pricing_transition.erl index c52000ef0..6b3da1b63 100644 --- a/apps/arweave/src/ar_pricing_transition.erl +++ b/apps/arweave/src/ar_pricing_transition.erl @@ -37,7 +37,7 @@ %% The number of blocks which have to pass since the 2.6.8 fork before we %% start mixing in the new fee calculation method. --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_6_8_TRANSITION_START, 2). -else. -ifndef(PRICE_2_6_8_TRANSITION_START). @@ -62,7 +62,7 @@ %% Let A = height - TransitionStart + 1. %% Let B = TransitionStart + ?PRICE_2_6_8_TRANSITION_BLOCKS - (height + 1). %% Then price per GiB-minute = price old * B / (A + B) + price new * A / (A + B). --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_6_8_TRANSITION_BLOCKS, 2). -else. -ifndef(PRICE_2_6_8_TRANSITION_BLOCKS). @@ -81,7 +81,7 @@ %% %% Note: Even though this constant is related to the *2.7.2* fork we count the blocks %% since the *2.6.8* fork for easier comparison with ?PRICE_2_6_8_TRANSITION_START --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_7_2_TRANSITION_START, 4). -else. -ifndef(PRICE_2_7_2_TRANSITION_START). @@ -106,7 +106,7 @@ %% Let A = height - TransitionStart + 1. %% Let B = TransitionStart + ?PRICE_2_7_2_TRANSITION_START - (height + 1). %% Then price per GiB-minute = price cap * B / (A + B) + price new * A / (A + B). --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_7_2_TRANSITION_BLOCKS, 2). -else. -ifndef(PRICE_2_7_2_TRANSITION_BLOCKS). @@ -120,7 +120,7 @@ -endif. -endif. --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_PER_GIB_MINUTE_PRE_TRANSITION, 8162). -else. %% STATIC_2_6_8_FEE_WINSTON / (200 (years) * 365 (days) * 24 * 60) / 20 (replicas) @@ -128,7 +128,7 @@ -define(PRICE_PER_GIB_MINUTE_PRE_TRANSITION, 400). -endif. --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_7_2_PER_GIB_MINUTE_UPPER_BOUND, 30000). -else. -ifndef(PRICE_2_7_2_PER_GIB_MINUTE_UPPER_BOUND). @@ -138,7 +138,7 @@ -endif. -endif. --ifdef(TEST). +-ifdef(AR_TEST). -define(PRICE_2_7_2_PER_GIB_MINUTE_LOWER_BOUND, 0). -else. -ifndef(PRICE_2_7_2_PER_GIB_MINUTE_LOWER_BOUND). diff --git a/apps/arweave/src/ar_storage_module.erl b/apps/arweave/src/ar_storage_module.erl index 03bbebf9d..93c76f402 100644 --- a/apps/arweave/src/ar_storage_module.erl +++ b/apps/arweave/src/ar_storage_module.erl @@ -17,13 +17,13 @@ %% The overlap makes sure a 100 MiB recall range can always be fetched %% from a single storage module. --ifdef(TEST). +-ifdef(AR_TEST). -define(OVERLAP, 262144). -else. -define(OVERLAP, (?LEGACY_RECALL_RANGE_SIZE)). -endif. --ifdef(TEST). +-ifdef(AR_TEST). -define(REPLICA_2_9_OVERLAP, 262144). -else. -define(REPLICA_2_9_OVERLAP, (262144 * 20)). diff --git a/apps/arweave/src/ar_sync_record.erl b/apps/arweave/src/ar_sync_record.erl index 7218968e7..53803430c 100644 --- a/apps/arweave/src/ar_sync_record.erl +++ b/apps/arweave/src/ar_sync_record.erl @@ -22,7 +22,7 @@ -define(WAL_COUNT_KEY, <<"wal">>). %% The frequency of dumping sync records on disk. --ifdef(TEST). +-ifdef(AR_TEST). -define(STORE_SYNC_RECORD_FREQUENCY_MS, 1000). -else. -define(STORE_SYNC_RECORD_FREQUENCY_MS, 60 * 1000). diff --git a/apps/arweave/src/ar_tx.erl b/apps/arweave/src/ar_tx.erl index 576551de2..548830c0f 100644 --- a/apps/arweave/src/ar_tx.erl +++ b/apps/arweave/src/ar_tx.erl @@ -93,7 +93,7 @@ sign_v1(TX, PrivKey, PubKey = {_, Owner}) -> verify(TX, Args) -> verify(TX, Args, verify_signature). --ifdef(TEST). +-ifdef(AR_TEST). verify(#tx{ signature = <<>> }, _Args, _VerifySignature) -> true; verify(TX, Args, VerifySignature) -> @@ -114,7 +114,7 @@ verify_tx_id(ExpectedID, #tx{ format = 2, id = ID } = TX) -> tags_to_list(Tags) -> [[Name, Value] || {Name, Value} <- Tags]. --ifdef(TEST). +-ifdef(AR_TEST). check_last_tx(_WalletList, TX) when TX#tx.owner == <<>> -> true; check_last_tx(WalletList, _TX) when map_size(WalletList) == 0 -> diff --git a/apps/arweave/src/ar_tx_blacklist.erl b/apps/arweave/src/ar_tx_blacklist.erl index 8b82c2279..d69deebc9 100644 --- a/apps/arweave/src/ar_tx_blacklist.erl +++ b/apps/arweave/src/ar_tx_blacklist.erl @@ -19,7 +19,7 @@ -include_lib("arweave/include/ar_config.hrl"). %% The frequency of refreshing the blacklist. --ifdef(TEST). +-ifdef(AR_TEST). -define(REFRESH_BLACKLISTS_FREQUENCY_MS, 2000). -else. -define(REFRESH_BLACKLISTS_FREQUENCY_MS, 10 * 60 * 1000). @@ -31,7 +31,7 @@ %% How long to wait for the response to the previously requested %% header or data removal (takedown) before requesting it for a new tx. --ifdef(TEST). +-ifdef(AR_TEST). -define(REQUEST_TAKEDOWN_DELAY_MS, 1000). -else. -define(REQUEST_TAKEDOWN_DELAY_MS, 30000). @@ -42,7 +42,7 @@ -define(CHECK_PENDING_ITEMS_INTERVAL_MS, 1000). %% The frequency of persisting the server state. --ifdef(TEST). +-ifdef(AR_TEST). -define(STORE_STATE_FREQUENCY_MS, 20000). -else. -define(STORE_STATE_FREQUENCY_MS, 10 * 60 * 1000). diff --git a/apps/arweave/src/ar_vdf.erl b/apps/arweave/src/ar_vdf.erl index 99e8843bf..d45baca5c 100755 --- a/apps/arweave/src/ar_vdf.erl +++ b/apps/arweave/src/ar_vdf.erl @@ -19,7 +19,7 @@ compute(StartStepNumber, PrevOutput, IterationCount) -> ar_vdf_nif:vdf_sha2_nif(SaltBinary, PrevOutput, ?VDF_CHECKPOINT_COUNT_IN_STEP - 1, 0, IterationCount). --ifdef(TEST). +-ifdef(AR_TEST). %% Slow down VDF calculation on tests since it will complete too fast otherwise. compute2(StartStepNumber, PrevOutput, IterationCount) -> {ok, Output, CheckpointBuffer} = compute(StartStepNumber, PrevOutput, IterationCount), diff --git a/apps/arweave/src/ar_weave.erl b/apps/arweave/src/ar_weave.erl index bf2c9b280..f4ebdea17 100644 --- a/apps/arweave/src/ar_weave.erl +++ b/apps/arweave/src/ar_weave.erl @@ -109,7 +109,7 @@ init(WalletList, Diff, GenesisDataSize) -> end, [B2#block{ indep_hash = ar_block:indep_hash(B2) }]. --ifdef(TEST). +-ifdef(AR_TEST). get_initial_block_time_history() -> [{1, 1, 1}]. -else. diff --git a/rebar.config b/rebar.config index 1265a6a07..268b2aa6b 100644 --- a/rebar.config +++ b/rebar.config @@ -434,7 +434,7 @@ {d, 'DEBUG', debug}, {d, 'FORKS_RESET', true}, {d, 'NETWORK_NAME', "arweave.localtest"}, - {d, 'TEST', true}, + {d, 'AR_TEST', true}, %% lower multiplier to allow single-block solutions in tests {d, 'POA1_DIFF_MULTIPLIER', 1}, %% use sha256 instead of randomx to speed up tests @@ -451,7 +451,7 @@ {d, 'DEBUG', debug}, {d, 'FORKS_RESET', true}, {d, 'NETWORK_NAME', "arweave.e2e"}, - {d, 'TEST', true}, + {d, 'AR_TEST', true}, %% The partition upper bound only gets increased when the vdf session changes %% (i.e. every ?NONCE_LIMITER_RESET_FREQUENCY VDF steps), so we need to set %% the reset frequency low enough that the VDF session can change during a