Title: Remove block validations in order to speed up initial sync from known client Post by: CuriousCarl on January 25, 2015, 05:21:31 PM I only connect to a known host so I trust everything that comes from it. What can I remove in order to speed up the initial sync with the blockchain? I have already commented out a few things in CheckBlock (main.cpp). My version looks like this now: Code: bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) What other changes can I do to speed it up? Title: Re: Remove block validations in order to speed up initial sync from known client Post by: Sukrim on January 25, 2015, 05:45:58 PM You could manually add a very recent checkpoint...
I don't think the initial checking is THAT problematic though, just let it run overnight and be done with it. Afaik there are also different levels of verification that you could try to set. Title: Re: Remove block validations in order to speed up initial sync from known client Post by: CuriousCarl on January 25, 2015, 06:00:31 PM Interesting. How to you set those verification levels?
Title: Re: Remove block validations in order to speed up initial sync from known client Post by: Sukrim on January 25, 2015, 06:14:09 PM https://en.bitcoin.it/wiki/Running_Bitcoin
Quote -checklevel=<n> How thorough the block verification is (0-4, default: 3) Title: Re: Remove block validations in order to speed up initial sync from known client Post by: gmaxwell on January 25, 2015, 06:24:45 PM This is inadvisable. It doesn't speed things up that much, and it removes the syncup as a check on the correct behavior of your hosts (you may be surprised at how many systems suffer from hardware problems which are exposed by Bitcoin).
Title: Re: Remove block validations in order to speed up initial sync from known client Post by: Sukrim on January 25, 2015, 06:48:29 PM Yes, there is a reason why these checks are in place and as rigorous as they are!
Title: Re: Remove block validations in order to speed up initial sync from known client Post by: Pieter Wuille on January 26, 2015, 05:51:05 AM -checklevel only changes the level of consistency checks done at startup, it doesn't affect actual validation during network synchronization or otherwise.
If you're syncing from a known node which you fully trust, just copy its $DATADIR/blocks and $DATADIR/chainstate directories to the new system. Title: Re: Remove block validations in order to speed up initial sync from known client Post by: elbandi on January 26, 2015, 09:43:01 AM gethash() is called repeatedly, maybe th result can be cached. like in bitcoinj:
https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/core/Block.java#L534 Title: Re: Remove block validations in order to speed up initial sync from known client Post by: DeathAndTaxes on January 27, 2015, 05:57:28 PM What other changes can I do to speed it up? Remove all transaction validation as well. ECDSA signature validation is especially CPU heavy. However I wonder if this is an xy problem. If this is just for an initial sync (i.e. one time) then it is far easier to transfer the blockchain as Pieter pointed out and run the stock client. However if you intend to remain connected to the trusted node(s) (and no other untrusted nodes) then you might as well be running an SPV client/codebase to reduce the resource requirements on the target machine continually. In essence the bitcoind on the remote computer is asking as an border router for your custom application/code. |