-
Notifications
You must be signed in to change notification settings - Fork 80
Improving downloader performances #569
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #569 +/- ##
==========================================
- Coverage 81.86% 81.61% -0.25%
==========================================
Files 169 169
Lines 13729 13767 +38
==========================================
- Hits 11239 11236 -3
- Misses 2490 2531 +41
Continue to review full report at Codecov.
|
ca44c57
to
9a74908
Compare
FYI Due to denser preverified hashes it takes about 1 hour to build release on my machine. |
If I'm not mistaken, |
You're right. |
Besides genesis_mainnet is 44300 line with 16 bytes each |
SILK_TRACE << "WorkingChain: trying to extend anchor " << anchor->blockHeight | ||
<< " (chain bundle len = " << anchor->chainLength() | ||
<< ", last link = " << anchor->lastLinkHeight << " )"; | ||
|
||
return {packet, penalties}; // try (again) to extend this anchor | ||
return {std::move(packet), std::move(penalties)}; // try (again) to extend this anchor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::move
doesn't make any difference for packet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to revert the changes to preverified_hashes_mainnet.cpp
in this PR so that we don't ruin our Windows compilation time. Instead, in a separate PR, switch preverified_hashes_mainnet.cpp
to something simple as char[]
(which will hopefully help the MSVC compiler) and re-apply the hashes.
Sorry, I was unaware of this. Since we are already partially supporting MSVC due to the lack of 128-bit integer, in the last commit I tried to mitigate the MSVC compilation problem using the preprocessor so that the MSVC sees only the sparse version of the pre-verified set. I think it is better to void entirely its content but I will let you to decide. Please try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please merge master into this PR ... it's still off by MDBX version and third_party
renamings. A bit of a pain to test it.
I'm afraid the situation has not improved much : I stopped release build at 46 minutes (still stuck at cmd/download_headers.cpp) |
4abfe18
to
282997a
Compare
Done! |
@mriccobene @canepat @yperbasis Somehow I've managed to solve the build problem on MSVC reverting the static collection of headers (which was using a set and literals to convert to a UDT) to an array of scalars Nevertheless I can now build Besides I tested downloader more than a couple of times and got aborted after few seconds.
Interestingly enough I also get some strange output like this one (after a restart)
How is possible the counter of active connections drops to |
The crash is probably due to the bug in the mdbx_cursor_bind, you can see the issue here. However, it happens that the bug occurs only sporadically on the binary compiled with gcc thanks to a special behavior of gcc. In the test case I submitted I managed to turn it into systematic. MSVC probably operates differently and the bug becomes systematic even in the downloader. The "-1 problem" is a known problem, the downloader receives remote peer connection/disconnection events and use them to estimate the number of remote peers (only to show it to the user) but to do this correctly it need at start time ask the sentry for the current number of peers. Considering that this number is not used (it was useful to me in the debugging) I gave priority to the resolution of the performance problem. I will complete it in a next PR Thanks for your proposal in the branch al-preverified-hashes. I will review it. |
@AndreaLanfranchi your proposal in the branch al-preverified-hashes looks fine to me. I propose to squash and merge this PR without changing the pre-verified hashes code only erasing the set (I did the commit). Then I will open a new PR, I will cherry pick from your branch, and we will do a new review focused on that part. |
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
(it will be re-implemented in another PR)
ac9579b
to
d3789e8
Compare
This PR removes some unneeded limitations so the header request rate is improved a lot.
Notes:
this PR uses dense pre-verified hashes, not the sparse one of the main branch. Initial performance tests have shown that this branch behaves like Erigon. Another branch and PR will be created to compare performances with and without dense pre-verified hashes.
the tests of this PR were done with a different version of the db::access_layer, an old version NOT using mdbx_cursor_bind. In a tests spanning three days no errors was raised by mdbx. Differently using the main branch db::access_layer tests breaks frequently with a MDBX_ERROR. I defer to another PR to understand if there is a problem in the downloader, if there is a problem in db::access_layer or in the mdbx implementation.