-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Store orphan blocks in serialized form #3516
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
|
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/da0fecffa788a0a74121d554d3d76936ab96b39e for binaries and test log. |
|
ACK on code changes |
|
I have a branch (serorphans) which is a merge of #3514 with this; it should provide some stronger memory usage guarantees, as it also limits the maximum number of orphans in memory. |
|
My client appears to be stuck at block 202978 on the mainnet chain Oh... and it's already syncing again :) (still lots and lots of orphans though, if you're interested in the debug.log, it's here http://download.visucore.com/bitcoin/debug-3516.log.bz2) |
|
No, receiving orphans is very expected and one of the reason why I'm working on headers-first. The problem is that any peer that announces some blocks, we ask for it, and if it's something whose parent we don't know, we ask for the parents - starting a pretty much full sync process from this peer, even if we were already syncing from another before. The problem is just that if you're syncing from two peers at once, some ranges of blocks are bound to be downloaded in incorrect order. It's certainly possible to improve this, and try to prevent starting a second sync from another peer if another is ongoing, but this sounds hard to do right and guarantee to deal well with all weird edge cases that can arise. |
|
Indeed. The amount of received orphans shouldn't be affected by these changes. So all the orphans are good for testing, in this case. |
|
I did a succesful full sync with this patch. |
|
ACK (reviewed changes and compiled/sanity tested on OSX). |
Store orphan blocks in serialized form
Apparently (on 64-bit systems), an average CBlock takes up about 8 times as much space as its serialized form. This results in high memory usage for all orphan blocks that are kept. Change this to retain them in serialized form instead.
Tested by doing a (partial) sync under valgrind, which involved processing orphans.