Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show I2P peer addresses #18845

Merged
merged 2 commits into from
Jun 1, 2023
Merged

Show I2P peer addresses #18845

merged 2 commits into from
Jun 1, 2023

Conversation

glassez
Copy link
Member

@glassez glassez commented Apr 12, 2023

No description provided.

@glassez glassez added GUI GUI-related issues/changes Core labels Apr 12, 2023
@glassez glassez added this to the 4.6.0 milestone Apr 12, 2023
@glassez glassez requested a review from a team April 12, 2023 17:58
@Vort
Copy link
Contributor

Vort commented Apr 12, 2023

Addresses are now displayed correctly:
i2p_qbt_dl

@Vort
Copy link
Contributor

Vort commented Apr 12, 2023

I made one more test - downloaded torrent with large amount of peers in mixed mode.
Some time after download finished, crash start to appear:

libtorrent::assert_fail assert.cpp:362
libtorrent::lcrypto::hasher256::update hasher.cpp:216
libtorrent::lcrypto::hasher256::hasher256 hasher.cpp:181
libtorrent::bt_peer_connection::get_specific_peer_info bt_peer_connection.cpp:496
libtorrent::peer_connection::get_peer_info peer_connection.cpp:4613
libtorrent::torrent::get_peer_info torrent.cpp:7267
libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}::operator()() const torrent_handle.cpp:162
boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}>::operator()() bind_handler.hpp:60
boost_asio_handler_invoke_helpers::invoke<boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}>, boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}> >(boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}>&, boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}>&) handler_invoke_helpers.hpp:51
boost::asio::detail::executor_op<boost::asio::detail::binder0<libtorrent::torrent_handle::sync_call<void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&>(void (libtorrent::torrent::*)(std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*), std::__1::vector<libtorrent::peer_info, std::__1::allocator<libtorrent::peer_info> >*&) const::{lambda()#1}>, std::__1::allocator<void>, boost::asio::detail::win_iocp_operation>::do_complete(void*, boost::asio::detail::win_iocp_operation*, boost::system::error_code const&, unsigned long long) executor_op.hpp:70
boost::asio::detail::win_iocp_operation::complete win_iocp_operation.hpp:47
boost::asio::detail::win_iocp_io_context::do_one win_iocp_io_context.ipp:473
boost::asio::detail::win_iocp_io_context::run win_iocp_io_context.ipp:204
boost::asio::io_context::run io_context.ipp:63
libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0::operator()() const session.cpp:344
std::__1::__invoke[abi:v15007]<libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>(libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0&&) invoke.h:394
std::__1::__thread_execute[abi:v15007]<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>(std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0>&, std::__1::__tuple_indices<>) thread:284
std::__1::__thread_proxy[abi:v15007]<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, libtorrent::session::start(libtorrent::flags::bitfield_flag<unsigned char, libtorrent::session_flags_tag, void>, libtorrent::session_params&&, boost::asio::io_context*)::$_0> >(void*) thread:295
ucrtbase!_crt_at_quick_exit 0x000007fef5c5be1d
KERNEL32!BaseThreadInitThunk 0x00000000770f55dd
ntdll!RtlUserThreadStart 0x0000000077352b1d

Assertion is failed at this line:
https://github.com/arvidn/libtorrent/blob/96d055bf5e9622ab4e0376d27a6b422c19c31443/src/hasher.cpp#L216

Do not know if it happens because of bug in libtorrent or in qBittorrent.

@glassez
Copy link
Member Author

glassez commented Apr 13, 2023

Do not know if it happens because of bug in libtorrent or in qBittorrent.

I doubt qBittorrent could affect it. It should be reported to libtorrent instead.
The review of related code also showed me the inefficiency of obtaining peer information, in particular, that the hash of the i2p address of the same peer is calculated anew each time.

@Vort

This comment was marked as off-topic.

@glassez

This comment was marked as off-topic.

@Vort

This comment was marked as off-topic.

@glassez

This comment was marked as off-topic.

@Vort
Copy link
Contributor

Vort commented Apr 13, 2023

I doubt qBittorrent could affect it. It should be reported to libtorrent instead.

You are right:
arvidn/libtorrent#7387

xavier2k6
xavier2k6 previously approved these changes Apr 20, 2023
@jiigen
Copy link

jiigen commented May 8, 2023

@glassez Lately noticed a regression in I2P beta support. It connects to the tracker finds the peers but get stuck on metadata downloading. At first i thought was related to recent DDOS against i2p but then tested with libtorrent client_test and it works as before.

@Vort
Copy link
Contributor

Vort commented May 8, 2023

Did you tested metadata download right after client is launched?
There is some problem with SAM in i2pd, which makes connection attempts take longer if client if online for some time (maybe because of large amount of already established streams [connections] - do not know for sure yet).

Also it makes not much sense to test client with 3 hops while overload (attack) is active.
It is better to switch to 1 hop for testing - it will make things easier.

@jiigen
Copy link

jiigen commented May 8, 2023

Did you tested metadata download right after client is launched? There is some problem with SAM in i2pd, which makes connection attempts take longer if client if online for some time (maybe because of large amount of already established streams [connections] - do not know for sure yet).

Also it makes not much sense to test client with 3 hops while overload (attack) is active. It is better to switch to 1 hop for testing - it will make things easier.

client_test with same tunnel lenght and same torrent starts normally that's why i thought about a problem with qbittorrent and not libtorrent nor the network overload.

@Vort
Copy link
Contributor

Vort commented May 8, 2023

I noticed similar problem.
It looks like tracker for some reason need to be contacted twice: for metadata download and for file download.
Not sure if we are talking about the same problem or about different problems.

@jiigen
Copy link

jiigen commented May 8, 2023

I noticed similar problem. It looks like tracker for some reason need to be contacted twice: for metadata download and for file download. Not sure if we are talking about the same problem or about different problems.

Download doesn't start at all for me...

@Vort
Copy link
Contributor

Vort commented May 8, 2023

Download doesn't start at all for me...

Merge went wrong maybe? I tested this one Vort@de83ba1 + changes to make 1 hop length.

And I see the same problem as I saw before:
Metadata download finishes succesfully, then second tracker request hangs (I know that it will succeed eventually, after ~1 hour with 1 hop).
If I restart client, then second tracker request passes succesfully too and download starts.

Now I think that maybe it's a name resolution queue which may make hang, but that's another story.

@jiigen
Copy link

jiigen commented May 8, 2023

@Vort I tested with deluge too (using ltconfig plugin for libtorrent i2p settings) and it works as well..

@glassez
Copy link
Member Author

glassez commented May 11, 2023

It looks like tracker for some reason need to be contacted twice: for metadata download and for file download.

This may be due to the specifics of received metadata processing. Since libtorrent does not allow the application to perform some preprocessing of the received metadata and configure some torrent parameters in an appropriate way at that point (this mainly applies to file names and save paths), we have to delete the torrent from libtorrent session and then add it again using the already received metadata, doing all the necessary preprocessing in the same way as when adding a torrent file.

xavier2k6
xavier2k6 previously approved these changes May 26, 2023
@xavier2k6
Copy link
Member

Appveyor libtorrent version being used needs to be updated though....

@glassez glassez merged commit 160af4f into qbittorrent:master Jun 1, 2023
17 of 18 checks passed
@glassez glassez deleted the i2p-address branch June 1, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core GUI GUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants