-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(zcoin): allow ARRR to sync using a start date #1922
Conversation
…s optimization Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
@borngraced please fix wasm clippy warnings and merge to latest dev to pass the adex-cli tests. |
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.
Thanks a lot for the fast PR @borngraced! First review iteration, I believe there will be 2 more review iterations after this :)
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
… calculate_starting_height_from_date and WalletDbShared init Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
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.
Thanks for the fixes! Next review iteration!
Can you please add a test to test zcoin initialization using date, height or default behaviour. All zcoin tests using light client are ignored, you can try default behaviour for this test and remove the ignore flag
fn activate_pirate_light() { |
}, | ||
} | ||
}, | ||
ZcoinRpcMode::Native => zcoin_builder.protocol_info.check_point_block.clone(), |
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.
Native should be the same as light client as discussed.
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 can be done in another PR as we agreed. Please don't forget to open an issue for it.
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Yes, @naezith and I concluded on using the earliest date incase bad |
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.
LGTM, thanks!
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.
@Alrighttt @ca333 @DeckerSU To help with security review, I marked the places where I think it's required. You can ofcourse check the whole PR for other things :)
pub(crate) async fn get_earliest_block(&self) -> Result<u32, ZcashClientError> { | ||
Ok(query_single_row( | ||
&self.db.lock().unwrap(), | ||
"SELECT MIN(height) from compactblocks", | ||
[], | ||
|row| row.get::<_, Option<u32>>(0), | ||
)? | ||
.flatten() | ||
.unwrap_or(0)) | ||
} |
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.
sec-review
run: | | ||
Invoke-WebRequest -Uri https://github.com/KomodoPlatform/komodo/raw/d456be35acd1f8584e1e4f971aea27bd0644d5c5/zcutil/wget64.exe -OutFile \wget64.exe | ||
Invoke-WebRequest -Uri https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.bat -OutFile \cmd.bat && \cmd.bat | ||
cargo test --test 'mm2_tests_main' --no-fail-fast |
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.
sec-review
run: | | ||
wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.sh | bash | ||
cargo test --test 'mm2_tests_main' --no-fail-fast |
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.
sec-review
Signed-off-by: borngraced <samuelonoja970@gmail.com>
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.
secure code reviewed
@borngraced can you please resolve the git conflicts in this PR? |
# Conflicts: # mm2src/coins/utxo/utxo_builder/utxo_coin_builder.rs # mm2src/coins/z_coin.rs # mm2src/coins/z_coin/storage/walletdb/mod.rs # mm2src/mm2_main/tests/integration_tests_common/mod.rs # mm2src/mm2_main/tests/mm2_tests/z_coin_tests.rs # mm2src/mm2_test_helpers/src/for_tests.rs
Signed-off-by: borngraced <samuelonoja970@gmail.com>
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.
Good job!
As we are going to prepare our code base for missing_docs
lint in CI, its necessary to add doc comments for all pub
items, bcz lint will deny pub items without them.
For the current PR please do it at least for items, which were added or changed.
Signed-off-by: borngraced <samuelonoja970@gmail.com>
Signed-off-by: borngraced <samuelonoja970@gmail.com>
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.
Thank you for your work!
I have just a note for the future. Perhaps you have already discussed this in conversations above, if so, what decision did you make?
async fn get_block_height(&mut self) -> Result<u64, MmError<UpdateBlocksCacheErr>>; | ||
|
||
/// Asynchronously retrieve the tree state for a specific block height from the Zcoin network. | ||
#[cfg(not(target_arch = "wasm32"))] | ||
async fn get_tree_state(&mut self, height: u64) -> Result<TreeState, MmError<UpdateBlocksCacheErr>>; |
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.
NativeClient
doesnt support grpc client (i mean you return TreeState here, which is protobuf message), but as get_tree_state
is in todo (in NativeClient) and we are going to use this functionality on LightRpcClient
for now, I think its fine.
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.
plan to implement a get_tree_state
, LightdInfo
rpc methods for native client.
Improve ARRR synchronization based on a user-selected date. This feature will enable users to specify a specific date as the starting point for synchronization as a substitute for the checkpoint block from config or syncing from the first block.
Tasks
LightWalletSyncParams.date
, 'earliestand
height` param for synchronising blocks based on user-selected date, earliest or height for light client#1900