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

BitTorrent client #785

Merged
merged 21 commits into from
Oct 10, 2022
Merged

BitTorrent client #785

merged 21 commits into from
Oct 10, 2022

Conversation

canepat
Copy link
Member

@canepat canepat commented Oct 9, 2022

This PR introduces a simple BitTorrent client based on libtorrent library. It is necessary for downloading and seeding snapshot files used for the Snapshot Sync functionality.

Main changes are:

  • add new third-party library libtorrent
  • use torrent-rasterbar target in CMake build scripts
  • adjust CMake build scripts to include Boost::headers target required by libtorrent
  • add BitTorrentClient class with unit tests

Additional changes are required by the usage of BOOST_ASIO_NO_DEPRECATED in libtorrent:

  • replace boost::asio::io_context::post with boost::asio::post
  • replace boost::asio::io_context::work with boost::asio::executor_work_guard
  • replace boost::asio::ip::address::from_string with boost::asio::ip::make_address

@canepat canepat added the snapshots Framework for BitTorrent-based snapshots label Oct 9, 2022
@canepat canepat requested a review from mriccobene October 9, 2022 15:22
@codecov
Copy link

codecov bot commented Oct 9, 2022

Codecov Report

Merging #785 (93d9429) into master (d72e0cc) will increase coverage by 0.05%.
The diff coverage is 73.00%.

@@            Coverage Diff             @@
##           master     #785      +/-   ##
==========================================
+ Coverage   74.97%   75.02%   +0.05%     
==========================================
  Files         196      197       +1     
  Lines       14180    14379     +199     
  Branches     2225     2285      +60     
==========================================
+ Hits        10631    10788     +157     
- Misses       2607     2618      +11     
- Partials      942      973      +31     
Impacted Files Coverage Δ
node/silkworm/snapshot/bittorrent.cpp 72.86% <72.86%> (ø)
node/silkworm/rpc/completion_end_point.cpp 88.37% <100.00%> (-2.33%) ⬇️
node/silkworm/rpc/server/server_context_pool.cpp 60.16% <0.00%> (-0.82%) ⬇️
core/silkworm/execution/evm.cpp 93.84% <0.00%> (-0.25%) ⬇️
core/silkworm/types/transaction.cpp 82.10% <0.00%> (+0.31%) ⬆️
core/silkworm/trie/hash_builder.cpp 98.60% <0.00%> (+0.46%) ⬆️
core/silkworm/types/block.cpp 87.50% <0.00%> (+0.50%) ⬆️
core/silkworm/state/in_memory_state.cpp 92.70% <0.00%> (+0.52%) ⬆️
core/silkworm/consensus/blockchain.cpp 88.70% <0.00%> (+0.80%) ⬆️
... and 4 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@canepat canepat marked this pull request as ready for review October 10, 2022 14:47
@canepat canepat merged commit b709e6f into master Oct 10, 2022
@canepat canepat deleted the bittorrent branch October 10, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshots Framework for BitTorrent-based snapshots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants