Merklize accounts internal state#4999
Conversation
|
@mvines I think this is the only place where SPV and verifying accounts loaded from snapshots overlap. Should be good to go on cutting someone loose on the latter |
3a5e8d5 to
f9e7c6d
Compare
Codecov Report
@@ Coverage Diff @@
## master #4999 +/- ##
========================================
- Coverage 76.9% 72.5% -4.4%
========================================
Files 200 197 -3
Lines 37494 39023 +1529
========================================
- Hits 28834 28312 -522
- Misses 8660 10711 +2051 |
Codecov Report
@@ Coverage Diff @@
## master #4999 +/- ##
=========================================
- Coverage 78.2% 61.3% -16.9%
=========================================
Files 196 197 +1
Lines 35789 45635 +9846
=========================================
+ Hits 27993 27995 +2
- Misses 7796 17640 +9844 |
2a8ded9 to
977842b
Compare
|
Speed difference? |
|
@sakridge |
|
@t-nelson I don't think there exists a micro-bench for this at the moment. |
|
@sakridge Yeah saw that. Adding one now. |
|
@sakridge I used the "test" crate, as was already in place for some benches under runtime. t-nelson@22fc268#diff-7348e822a67e92dad03464ab694a595eR61. No problem to write up something more thorough if it's insufficient It's takes about twice as long Hash of concatenated account hashes (old): Merklized account hashes (new): |
|
@t-nelson Yea I ran it on the benchmark I referenced, it is about 15% reduction in performance just from this. That's pretty huge. Can we make this any faster? |
|
Assuming we don't need the actual account hash later (they appear to be discarded now), I think I might be able to tweak it to pass the serialization of the account state directly to the Merkle Tree ctor. This would eliminate N hashing operations on something that is doing ~3N now |
|
@sakridge is the above bench something we want in tree? I can PR it separately if so I'll look into reducing hashing operations later today |
|
@sakridge ~20% improvement with the proposed reduction of hashes Without proposal: With proposal: |
|
@t-nelson yea we should add the bench to the tree. separate PR is great. |
|
@t-nelson, what's going on with this PR? |
|
@garious I need to reduce negative effects on perf |
977842b to
7f5019b
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
|
Superseded by #5573 |
Problem
We need a way to generate proofs of account state changes
Summary of Changes
Replace hash of concatenated accounts state hashes with a Merkle root