diff --git a/apps/arweave/e2e/ar_e2e.erl b/apps/arweave/e2e/ar_e2e.erl index 53a5bb04a..183bc1547 100644 --- a/apps/arweave/e2e/ar_e2e.erl +++ b/apps/arweave/e2e/ar_e2e.erl @@ -211,14 +211,21 @@ assert_block({replica_2_9, Address}, MinedBlock) -> assert_syncs_range(Node, StartOffset, EndOffset) -> - ?assert( - ar_util:do_until( - fun() -> has_range(Node, StartOffset, EndOffset) end, - 100, - 60_000 - ), - iolist_to_binary(io_lib:format( - "~s Failed to sync range ~p - ~p", [Node, StartOffset, EndOffset]))). + HasRange = ar_util:do_until( + fun() -> has_range(Node, StartOffset, EndOffset) end, + 100, + 60_000 + ), + case HasRange of + true -> + ok; + false -> + SyncRecord = ar_http_iface_client:get_sync_record(Node, json), + ?assert(false, + iolist_to_binary(io_lib:format( + "~s failed to sync range ~p - ~p. Sync record: ~p", + [Node, StartOffset, EndOffset, SyncRecord]))) + end. assert_does_not_sync_range(Node, StartOffset, EndOffset) -> ar_util:do_until( diff --git a/apps/arweave/e2e/ar_repack_mine_tests.erl b/apps/arweave/e2e/ar_repack_mine_tests.erl index 611634068..103f45c01 100644 --- a/apps/arweave/e2e/ar_repack_mine_tests.erl +++ b/apps/arweave/e2e/ar_repack_mine_tests.erl @@ -34,6 +34,8 @@ repack_mine_test_() -> %% -------------------------------------------------------------------------------------------- test_repack_mine({FromPackingType, ToPackingType}) -> ar_e2e:delayed_print(<<" ~p -> ~p ">>, [FromPackingType, ToPackingType]), + ?LOG_INFO([{event, test_repack_mine}, {module, ?MODULE}, + {from_packing_type, FromPackingType}, {to_packing_type, ToPackingType}]), ValidatorNode = peer1, RepackerNode = peer2, {Blocks, _AddrA, Chunks} = ar_e2e:start_source_node( @@ -85,6 +87,8 @@ test_repack_mine({FromPackingType, ToPackingType}) -> test_repacking_blocked({FromPackingType, ToPackingType}) -> ar_e2e:delayed_print(<<" ~p -> ~p ">>, [FromPackingType, ToPackingType]), + ?LOG_INFO([{event, test_repacking_blocked}, {module, ?MODULE}, + {from_packing_type, FromPackingType}, {to_packing_type, ToPackingType}]), ValidatorNode = peer1, RepackerNode = peer2, {Blocks, _AddrA, Chunks} = ar_e2e:start_source_node( diff --git a/apps/arweave/src/ar_http_iface_client.erl b/apps/arweave/src/ar_http_iface_client.erl index 49895c6bc..121247017 100644 --- a/apps/arweave/src/ar_http_iface_client.erl +++ b/apps/arweave/src/ar_http_iface_client.erl @@ -10,8 +10,9 @@ get_block/3, get_tx/2, get_txs/2, get_tx_from_remote_peer/2, get_tx_data/2, get_wallet_list_chunk/2, get_wallet_list_chunk/3, get_wallet_list/2, add_peer/1, get_info/1, get_info/2, get_peers/1, - get_time/2, get_height/1, get_block_index/3, get_sync_record/1, - get_sync_record/3, get_chunk_binary/3, get_mempool/1, + get_time/2, get_height/1, get_block_index/3, + get_sync_record/1, get_sync_record/2, get_sync_record/3, + get_chunk_binary/3, get_mempool/1, get_sync_buckets/1, get_recent_hash_list/1, get_recent_hash_list_diff/2, get_reward_history/3, get_block_time_history/3, push_nonce_limiter_update/3, @@ -360,7 +361,14 @@ decode_block_index(Bin, json) -> end. get_sync_record(Peer) -> - Headers = [{<<"Content-Type">>, <<"application/etf">>}], + get_sync_record(Peer, binary). + +get_sync_record(Peer, Encoding) -> + ContentType = case Encoding of + binary -> <<"application/etf">>; + json -> <<"application/json">> + end, + Headers = [{<<"Content-Type">>, ContentType}], handle_sync_record_response(ar_http:req(#{ peer => Peer, method => get,