-
Notifications
You must be signed in to change notification settings - Fork 17
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
refactor: root chunk_id
should be equal to app_hash
#301
Conversation
chunk_id
should be equal to app_hash
@@ -346,15 +340,14 @@ impl GroveDb { | |||
// state_sync_info: Consumed StateSyncInfo | |||
// app_hash: Snapshot's AppHash | |||
// tx: Transaction for the state sync | |||
// Returns the first set of global chunk ids that can be fetched from sources (+ | |||
// the StateSyncInfo transferring ownership back to the caller) | |||
// Returns the StateSyncInfo transferring ownership back to the caller) | |||
pub fn start_snapshot_syncing<'db>( | |||
&'db self, | |||
mut state_sync_info: MultiStateSyncInfo<'db>, |
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.
perhaps could be a &mut without that ownership return trick
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.
this PR doesn't contain changes of #300
if global_chunk_id == app_hash { | ||
let array_of_zeros: [u8; 32] = [0; 32]; | ||
let root_chunk_prefix_key: crate::SubtreePrefix = array_of_zeros; | ||
return Ok((root_chunk_prefix_key, vec![])); | ||
} | ||
|
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.
In rust you shouldn't have special numbers, meaning that [0;32] shouldn't have a special signicance, instead you should use enums or Options
Issue being fixed or feature implemented
What was done?
app_hash
instead ofnull_hash
(This facilitates Tenderdash in state sync init phase)appy_chunk
to accept separately parameters and not in tuple (better clarity)How Has This Been Tested?
Updated tutorial
replication
Breaking Changes
Checklist:
For repository code-owners and collaborators only