replace Root with Root_(hash, common) in persistent database#16650
replace Root with Root_(hash, common) in persistent database#16650glyh wants to merge 2 commits intoMinaProtocol:compatiblefrom
Conversation
… need Root_hash can run faster
svv232
left a comment
There was a problem hiding this comment.
I made some grammatical suggestions, but overall looks good! How was this tested dynamically against loading a pre-hard fork db?
| In hard forks, `Root` should be replaced by `(Root_hash, Root_common)`; | ||
| For now, we try to replace `Root` with `(Root_hash, Root_common)` when: | ||
| 1. initializing a new DB; | ||
| 2. trying to moving the root; |
| (* TODO: | ||
| In hard forks, `Root` should be replaced by `(Root_hash, Root_common)`; | ||
| For now, we try to replace `Root` with `(Root_hash, Root_common)` when: | ||
| 1. initializing a new DB; |
| For now, we try to replace `Root` with `(Root_hash, Root_common)` when: | ||
| 1. initializing a new DB; | ||
| 2. trying to moving the root; | ||
| 3. trying to query `root` or `root_hash` |
There was a problem hiding this comment.
Trying to query root or root_hash.
| 2. trying to moving the root; | ||
| 3. trying to query `root` or `root_hash` | ||
| The reason for this is `Root_common` is too big(250MB+), and most of the time | ||
| we just need the hash. Reading the whole Root result in efficiency problems, |
There was a problem hiding this comment.
Capitalize we and use a semi colon instead of a comma.
|
!ci-nightly-me |
|
Hello @svv232 The plan for testing is to have a persistent database that only has George told me to implement something similar to |
ok sure! I was just looking for confirmation that this is indeed backwards compatible. It seems okay to me, but having evidence from dynamic testing is pretty nice. How were you testing this by hand against your local db? I will be convinced to approve if this is indeed the case. I will also be convinced if you show the tool output if you already have it with an old db with just root. |
|
!ci-nightly-me |
|
@svv232 I'm testing this in https://github.com/glyh/mina/tree/persistent_frontier_test_destructive And Using the data from https://storage.googleapis.com/o1labs-ci-test-data/dump_2025_02-13-07-54-53.tar.gz So What I do is:
EDIT: |
|
!ci-build-me |
I assume I should relocated this PR in |
|
Reopen as requested by @dkijania |
|
!ci-build-me |
This is a follow up for #16624
This PR only contains patch to be merged into compatible. It's compatible because we try to replace
Rootwith(Root_hash, Root_common)when:rootorroot_hashThat means attempting to perform transactions on old persistence database, the bottleneck will occur once and not after.
Here's the PR for the testcase.