-
Notifications
You must be signed in to change notification settings - Fork 278
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
Use nurkel
for the tree instead of urkel
.
#804
base: master
Are you sure you want to change the base?
Conversation
9f44f2c
to
6dc5054
Compare
Nice! Does https://github.com/nodech/liburkel-test generates the images above? I could at least test on Mac with SPV. |
No, liburkel-test generates random tree (and some specific edge cases) and compares that tree files match byte by byte (urkel.js, liburkel, nurkel). Unfortunately, SPV does not have a tree so it wont test the tree. As for the graphs, they were generated from the log files of the hsd. Specifically These were then parsed accumulated in separate file for gnuplot: https://gist.github.com/nodech/da78e501b29cd05afc620648a721d97c |
This is very promising and I had no trouble getting Bob to sync with nurkel, awesome work @nodech :D Even switching between urkel and nurkel with the same tree data worked fine. Some stats from my machine up to block 150k (with checkpoint at 100k): Bob saw a 2x speed sync that reduced time from 20 hours to 10 hours 🤯 Some observations
As for compacting 161k blocks (approx with ± 200 blocks diff):
I'd like to run these tests again in a proper environment and syncing from a local node to rule out network weirdness and on a dedicated machine. But ^ gives a rough idea on what we can expect. |
Great results!
As far as I get https://github.com/nodech/liburkel-test wouldn't work in SPV mode. Can I still run |
https://github.com/nodech/liburkel-test - is not related to HSD at all. It is specific to the urkel/nurkel/liburkel integration test.
SPV mode in hsd does not have tree (as having 24 GB tree would not make sense with SPV), so whether SPV node has this update or not, there will be no difference. |
Found a bug: ❯ hsd-cli rpc getnameproof theshake
proof.toJSON is not a function Think nurkel's |
@nodech thanks, now it's explicit enough for me to understand what's going on. I hoped for an SPV speedup, but there won't be any. Then I wanted to contribute and compare time required to sync a "real life" full node with https://github.com/nodech/nurkel in comparison with https://github.com/handshake-org/urkel. My results are incomplete, but anyway I'll better post them than nothing. Initially I hoped for a quick sync, like @rithvikvibhu showed 20 hours, but in my case I got not much in 20 hours and I couldn't keep my laptop always on connected to the same wi-fi network, so I stopped the experiment. I started two Environment
Problems
Commandsurkel (6b47c3a): nurkel (8c7dd0d): ResultsP.S.: I may retry or proceed with the experiment later. Let me know if you have any suggestions/recommendations, e.g. regarding running both |
nurkel
is a node bindings for theliburkel
.It has not been tested in action so far, but I have run some tests with it, so if you are willing to experiment/test/run you are welcome.
There's also liburkel-urkel-nurkel integration suite here: https://github.com/nodech/liburkel-test, unfortunately not well documented.
Todo
nurkel_finalize
queue (linked list) fornapi
env_cleanup_hook
. Currently, clean up hooks will crash, as async operations are no longer permitted. So unclosed tree will crash on node.js exit.Benchmarks
The benchmarks are pretty promising for the actual sync.
First the most important - How much time difference does it make while syncing the node. These are the sync times until the block height (NOTE: Data is a single run):
Graph below shows PER BLOCK TIME differences between the two, both are recorded using single run so they should be less "bumpy" on multiple runs:
This will be DRAFT until it receives some feedback and has been tested out in the wild. I will try to rebase it on master as often as possible.