-
Notifications
You must be signed in to change notification settings - Fork 685
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
Profile and optimize new VM.validate_header() #910
Comments
If 1.4s is the time to run only one test, it might be the cache generation for the PoW check. I would want to see the average time over a bunch of runs. |
This is some profiling data I gathered from importing ropsten blocks around 107178. Header validation (mainly pow checking) consumes a significant amount of time, but doesn't seem to be a huge deal on that range of blocks. It'd be interesting to do the same on recent blocks, with higher TD. If anybody has a fully synced light DB, this is the code I used to profile just the header importing: https://gist.github.com/gsalgado/e8e6d3e28ad7fa3db84040be551b6bce
|
I heard a rumor that geth doesn't check the PoW on every header. Would be worth checking out how they do that safely. |
Indeed it doesn't; I describe their approach in #330 (comment). Filed #932 for it |
So, as shown by the profiling data above, doing PoW validation makes light sync much slower, but it's mainly because of pyethash.hashimoto_light, which I imagine won't be easy to optimize, so I think our best bet is #932 |
Should we:
I'm currently pro 1 |
I guess we could do both. 2 is already on its way (#1010) |
With #1010 merged, this issue seems done enough to close. |
That method takes 1.4s to complete when I call it passing the DAO fork header (1920000). If it takes as long to validate any header, that will be a huge problem for the light client and fast-sync
Need to profile it and optimize. Unless, of course, it's only when validating the DAO fork header that it takes that long
The text was updated successfully, but these errors were encountered: