-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Giving out snapshot through Warp protocol #4710
Conversation
a9b66c8
to
93fa294
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4710 +/- ##
===========================================
+ Coverage 59.51% 60.79% +1.28%
===========================================
Files 342 347 +5
Lines 27026 27298 +272
Branches 2838 2865 +27
===========================================
+ Hits 16084 16597 +513
+ Misses 9981 9705 -276
- Partials 961 996 +35 |
Applied clang-format in the separate commit |
e804a24
to
1574135
Compare
… produces too many messages from BlockHeader class during blocks import
libethereum/WarpPeerCapability.cpp
Outdated
auto const networkId = _r[1].toInt<u256>(RLP::VeryStrict); | ||
auto const totalDifficulty = _r[2].toInt<u256>(RLP::VeryStrict); | ||
auto const latestHash = _r[3].toHash<h256>(RLP::VeryStrict); | ||
auto const genesisHash = _r[4].toHash<h256>(RLP::VeryStrict); |
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.
Is it a good idea to check genesisHash
against _chainGenesisHash
given to init()
? (Likewise for networkId
?)
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.
Yes, I do that in the snapshot downloading PRs.
In this PR it doesn't make much difference, because it's a server part, and downloading peer checks it anyway.
I will add it later, anyway
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.
OK.
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.
Looks good to me.
Snapshot files won't ever change and the node will give out the same snapshot all the time.
Further improvements could support periodic generation of our own snapshots.