-
Notifications
You must be signed in to change notification settings - Fork 2.2k
WIP - Download snapshot through Parity's warp protocol #4227
Conversation
m_latestHash = _r[3].toHash<h256>(); | ||
m_genesisHash = _r[4].toHash<h256>(); | ||
m_snapshotHash = _r[5].toHash<h256>(); | ||
m_snapshotNumber = _r[6].toInt<u256>(); |
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.
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()) |
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 know it's a little less efficient on the average case, but _procotolVersions.count(m_protocolVersion)
is much better readable and less error-prone.
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
534b663
to
504d6a8
Compare
504d6a8
to
8f02fb9
Compare
Closing in favor of approach of #4622 |
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:
(other bootnodes for main net are here: https://github.com/paritytech/parity/blob/master/ethcore/res/ethereum/foundation.json#L182 )