Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

WIP - Download snapshot through Parity's warp protocol #4227

Closed
wants to merge 5 commits into from

Conversation

gumb0
Copy link
Member

@gumb0 gumb0 commented Jul 6, 2017

This is still in PoC-stage, downloads only from single peer, needs improvements in many minor details and tests.

It's better to start this pinning to one of Parity's boot nodes:

./eth --download-snapshot snapshot_dir -v 9 --peerset required:016b20125f447a3b203a3cae953b2ede8ffe51290c071e7599294be84317635730c397b8ff74404d6be412d539ee5bb5c3c700618723d3b53958c92bd33eaa82@159.203.210.80:30303 --pin --no-discovery

(other bootnodes for main net are here: https://github.com/paritytech/parity/blob/master/ethcore/res/ethereum/foundation.json#L182 )

@gumb0 gumb0 changed the title WIP Download snapshot through Parity's warp protocol WIP - Download snapshot through Parity's warp protocol Jul 6, 2017
m_latestHash = _r[3].toHash<h256>();
m_genesisHash = _r[4].toHash<h256>();
m_snapshotHash = _r[5].toHash<h256>();
m_snapshotNumber = _r[6].toInt<u256>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the index goes "out of bounds"?

disable("Invalid genesis hash");
return false;
}
if (find(_protocolVersions.begin(), _protocolVersions.end(), m_protocolVersion) == _protocolVersions.end())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's a little less efficient on the average case, but _procotolVersions.count(m_protocolVersion) is much better readable and less error-prone.

@gumb0 gumb0 force-pushed the snapshot-download branch from ab5b2b5 to 534b663 Compare July 6, 2017 15:22
@codecov-io
Copy link

codecov-io commented Jul 6, 2017

Codecov Report

Merging #4227 into develop will decrease coverage by 3.02%.
The diff coverage is 7.36%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4227      +/-   ##
===========================================
- Coverage    69.78%   66.76%   -3.03%     
===========================================
  Files          308      308              
  Lines        23345    23520     +175     
===========================================
- Hits         16292    15703     -589     
- Misses        7053     7817     +764
Impacted Files Coverage Δ
libethereum/Client.h 68.42% <ø> (ø) ⬆️
libwebthree/WebThree.h 23.07% <ø> (-4.2%) ⬇️
libethereum/CommonNet.h 0% <ø> (ø) ⬆️
test/unittests/libweb3jsonrpc/Client.cpp 98.07% <ø> (ø) ⬆️
libethashseal/EthashClient.h 0% <ø> (ø) ⬆️
libethereum/WarpHostCapability.h 0% <0%> (ø)
libethereum/WarpPeerCapability.h 0% <0%> (ø)
libethereum/SnapshotDownloader.h 0% <0%> (ø)
libethereum/ClientTest.cpp 1.75% <0%> (ø) ⬆️
libethereum/EthereumPeer.cpp 38.75% <0%> (-0.38%) ⬇️
... and 197 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a73343...8f02fb9. Read the comment docs.

@gumb0 gumb0 mentioned this pull request Aug 8, 2017
@gumb0
Copy link
Member Author

gumb0 commented Jan 31, 2018

Closing in favor of approach of #4622

@gumb0 gumb0 closed this Jan 31, 2018
@gumb0 gumb0 deleted the snapshot-download branch January 31, 2018 14:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants