Skip to content
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

[r2r] Implement ARRR swap in light mode. #1302

Merged
merged 67 commits into from Jun 14, 2022
Merged

[r2r] Implement ARRR swap in light mode. #1302

merged 67 commits into from Jun 14, 2022

Conversation

artemii235
Copy link
Member

#927

Please note that there are few TODOs for the next iteration.
Also, native client doesn't work now and tx history is not available.

Artem Vitae added 4 commits June 7, 2022 14:21
@artemii235 artemii235 changed the title [wip] Implement ARRR swap in light mode. [r2r] Implement ARRR swap in light mode. Jun 7, 2022
@artemii235
Copy link
Member Author

@sergeyboyko0791 @ozkanonur @shamardy Thanks for your notes! It’s ready for the next review iteration.

shamardy
shamardy previously approved these changes Jun 8, 2022
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Artem Vitae added 2 commits June 9, 2022 17:39
# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins_activation/src/z_coin_activation.rs
#	mm2src/db_common/src/sqlite.rs
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd review iteration

mm2src/mm2_main/src/mm2_tests/z_coin_tests.rs Outdated Show resolved Hide resolved
mm2src/coins/z_coin/z_rpc.rs Outdated Show resolved Hide resolved
mm2src/coins/z_coin.rs Show resolved Hide resolved
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second review iteration :)
It mainly consists of questions

mm2src/coins_activation/src/z_coin_activation.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/maker_swap.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/maker_swap.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/maker_swap.rs Outdated Show resolved Hide resolved
mm2src/mm2_main/src/lp_swap/taker_swap.rs Outdated Show resolved Hide resolved
@artemii235 artemii235 changed the title [r2r] Implement ARRR swap in light mode. [wip] Implement ARRR swap in light mode. Jun 10, 2022
@artemii235 artemii235 changed the title [wip] Implement ARRR swap in light mode. [r2r] Implement ARRR swap in light mode. Jun 13, 2022
Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last review iteration.
Only a couple of suggestions

Comment on lines 870 to 871
let maker_coin_htlc_key_pair = self.maker_coin.derive_htlc_key_pair(self.uuid.as_bytes());
let taker_coin_htlc_key_pair = self.taker_coin.derive_htlc_key_pair(self.uuid.as_bytes());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't self.unique_swap_data() be used here instead of self.uuid.as_bytes()?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will change.

mm2src/mm2_main/src/lp_swap/taker_swap.rs Outdated Show resolved Hide resolved
onur-ozkan
onur-ozkan previously approved these changes Jun 14, 2022
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🔥

I shared a suggestion, but it's not a blocker for this PR. Looks good to me!

mm2src/coins/z_coin/z_rpc.rs Show resolved Hide resolved
@artemii235 artemii235 changed the title [r2r] Implement ARRR swap in light mode. [wip] Implement ARRR swap in light mode. Jun 14, 2022
@artemii235 artemii235 changed the title [wip] Implement ARRR swap in light mode. [r2r] Implement ARRR swap in light mode. Jun 14, 2022
@artemii235
Copy link
Member Author

@sergeyboyko0791 Last review notes fixed :)

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🔥
Thank you for the fixes!

@artemii235 artemii235 merged commit 3be0c04 into dev Jun 14, 2022
@artemii235 artemii235 deleted the arrr-light-mode-swap branch June 14, 2022 13:16
laruh pushed a commit that referenced this pull request Jun 16, 2022
* WIP. Fetched ZOMBIE compact blocks cache.

* WIP building wallet DB for ZOMBIE.

* WIP. Balance is shown incorrectly.

* WIP. Got correct balance for ZOMBIE address from lightwalletd.

* WIP.

* Sent shielded transaction using light mode.

* WIP.

* ZcoinLightClient WIP.

* WIP. Compilation fails. Saving dev state.

* WIP. Deleted some unneeded code.

* Cherry-pick from arrr-light-mode-experiments.

* WIP.

* WIP. Minor changes.

* WIP.

* WIP Zcoin light mode activation.

* WIP Activated ZOMBIE in light mode. Got correct balance.

* WIP. Working on withdraw.

* WIP. Optimized SQLite. Added withdraw ZOMBIE test.

* WIP. Got valid transaction from withdraw in light mode and broadcast it.

* WIP. Implementing light wallet sync state handling using channels.

* WIP. More refactoring.

* WIP.

* WIP.

* WIP. Compilation fails.

* WIP. Temporary Clippy fixes. Withdraw works.

* Fix WASM.

* WIP. Implementing state sync.

* WIP. Added SaplingSyncStateConnector.

* WIP. Added SaplingSyncRespawnHandle, SaplingSyncRespawnGuard, refactored SaplingSyncConnector.

* WIP. Did the first RICK/ZOMBIE light mode swap.

* WIP. Error handling.

* WIP. Error handling. Removed unused code.

* WIP. Trying AES.

* WIP. Deriving HTLC privkeys. Compilation fails.

* Finished HTLC privkeys derivation refactoring.

* WIP. Checking lightwalletd response when tx does not exist.

* Add watch_for_tx existence check in sync loop. Add ticker to activation response.

* Fix WASM.

* Fixes after merge.

* Change HTLC private keys derivation algo for Zcoin.

* Refactor to fix clippy::too_many_arguments.

* Fix tests.

* Replace block_in_place with async_blocking if required.

* Update tonic, remove some deps duplicates.

* WIP.

* Refactor tests a bit, ignore long-running ones.

* Disable blocks_cache_path for wasm32 arch.

* Fix tests compilation.

* More info about sync progress in init_z_coin_status.

* A bit more refactoring.

* Leave notes on how the light wallet state sync works.

* Last minor changes.

* Cargo.lock updated.

* Fix review notes.

* Fixes after merge.

* One more fix (udeps).

* Fix after merge.

* WIP. Fixing review notes.

* Use unique_swap_data() in try_spend_taker_payment.

* Fix review notes.

Co-authored-by: Artem Vitae <artem@vitae.com>
Co-authored-by: Artem Vitae <email@not.set>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants