-
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
ARRR integration. #927
Comments
* ARRR wip. Add dex_fee script with tests. * WIP. * Fix clippy. * WIP. Demo of adding redeem script to the OP_RETURN. * Add full redeem script to OP_RETURN of ARRR swap_payment_outputs. * Fix tests compilation. * WIP SLP OP_RETURN parsing. * WIP adding ZAddrCoin. * WIP implementing ZCoin. HTLC tx fails. * Fix op_return for z_sendmany. HTLC broadcast worked. * WIP zombie_coin_send_htlc_maker_payment success. * WIP implementing HTLC refund. * WIP trying to build transaction using pure Rust with librustzcash. * WIP built and signed z output tx using pure rust, refactor. * Fix WASM and clippy.
* ARRR wip. Add dex_fee script with tests. * WIP. * Fix clippy. * WIP. Demo of adding redeem script to the OP_RETURN. * Add full redeem script to OP_RETURN of ARRR swap_payment_outputs. * Fix tests compilation. * WIP SLP OP_RETURN parsing. * WIP adding ZAddrCoin. * WIP implementing ZCoin. HTLC tx fails. * Fix op_return for z_sendmany. HTLC broadcast worked. * WIP zombie_coin_send_htlc_maker_payment success. * WIP implementing HTLC refund. * WIP trying to build transaction using pure Rust with librustzcash. * WIP built and signed z output tx using pure rust, refactor. * Fix WASM and clippy. * WIP refactoring. * WIP refactoring. * WIP z_send_dex_fee * WIP. * WIP. * WIP. Made the first RICK/ZOMBIE swap. * Put ZCoin under zhtlc feature to avoid bundling Sapling params. * Fix after merge. * Fix WASM tests compilation.
* WIP. Made full order matching and swap test with RICK and FUSD. * WIP. Implementing traits for SlpToken. * WIP. Implemented SLP withdraw. Added BchCoin. * WIP. Avoiding usage of SLP UTXOs for normal BCH. Some tests fail. * WIP. Added UtxoTxBuilder. All tests pass. * Fixes after merge. * WIP. Refactoring tx builder. Code doesn't compile. * WIP. RICK/FUSD trade failed with the "transaction was rejected by network rules" on RICK side. * WIP. Refactored BCH unspents retrieval. * Fix Clippy and WASM. * WIP. Added tx_size arg to get_htlc_spend_fee. * WIP.Properly handle ActualTxFee::FixedPerKb case in get_htlc_spend_fee. * WIP. Remove bitcoin-cash-slp dependency. Build SLP sending script in MM2 entirely. * WIP. Add more checks in parse_slp_script. * WIP. Remove RICK/FUSD from trade_test_electrum_and_eth_coins - will move to docker_tests. * WIP. Moving SLP trading tests to docker_tests. * WIP. Added docker_tests_common and few SLP-related tests. * Fix zhtlc feature compilation. Check that RICK/ZOMBIE trade test pass. * WIP. Researching tx building with Sapling spends. * WIP. Dummy add_sapling_spend that doesn't work yet. * WIP. Sent the shielded spend transaction using pure Rust code. * Sent and refunded dex fee on ZOMBIE chain. * WIP. Added send_outputs and started using it in z_send_dex_fee and z_send_htlc. * Add SendOutputsErr::InsufficientBalance and return it accordingly in send_outputs. * WIP. Making dex fee a shielded output with the public OVK. * WIP. Made dex fee a shielded output with the public OVK. Implemented validation. * WIP. Try using cached commitment tree. * WIP. Adding the DB to cache the Sapling data. * WIP. Refactored send_outputs to use cached Sapling data. * WIP. Refactor to avoid unwraps etc. * Verbose tx format hotfix for tBCH electrum. tBCH and USDF activation examples. * WIP. ZCoin withdraw. * Add separate methods to get BCH/SLP unspents for balance display. Did that to avoid locking the mutex on each balance call. #1034 * Extract recently_spent from SlpTxPreimage to avoid occasional deadlocks. * WIP. Implemented withdraw for ZCoin. * WIP. Building Sapling cache DB for ARRR. * Restore sapling_state_cache_loop. Add ARRRConsensusParams. Sent first HTLC on PIRATE. * Use ARRRConsensusParams to build tx in z_p2sh_spend. * Increase TAKER_FEE_RECV_TIMEOUT to 600. * WIP. Fixing after merging from dev. * Fixes after merge. * Fixes after merge. * Fix WASM. * Fix after merge. * One more fix. * Fixes after merge. * Review fixes.
* WIP. Async refactoring. * Fix Clippy. * Fix tests. * WIP. Removed hardcoded tx fee. * WIP. Temporary privkeys for z orders and swaps. * Move rand6 and secp256k1 from dev dependencies. * Fix WASM. * WIP. Implementing temporary privkeys. * WIP. Implementing temporary privkeys. * Fix Clippy. * WIP. Code doesn't compile. * WIP. Made first RICK/ZOMBIE swap with temp keys. * WIP. Fixing tests compilation. * WIP. Trading tests fail. * WIP. Adding separate keypairs for maker and taker coin. * WIP. Adding separate keypairs for maker and taker coin. Fix WASM. * WIP. Investigating test_update_maker_order failure. * Do not broadcast swap status if one of the coin is privacy one. Hide secrets before broadcasting. * Fix fmt. * Fix WASM. * Do not run check_stats_swap_status for zhtlc feature. * Add m/taker_coin_htlc_pubkey fields to M/TakerSwapData. * Batch of minor review fixes. * Add ValidatePaymentInput for validate_m/taker_payment. * Add ValidatePaymentInput for validate_m/taker_payment. * Use Infura for ETH dex fee validation tests temporary. Geth needs additional configuration to always return old transactions ethereum/go-ethereum#23569 (comment). * Fix fmt. * More review fixes. * Add NegotiationDataV3. * Minor review fixes. * Fixes after merge. Co-authored-by: Artem Vitae <artem@vitae.com>
* Fix tests. * WIP. Adding new tests. Refactoring. * WIP. * WIP. Compilation fails. * Set another peer id as source for orders with temporary p2p privkey. * Fix WASM. * WIP orderbook RPC v2. * WIP. Compilation fails. * WIP. Implementing orderbook V2. * Orderbook v2 WIP. * Update ZOMBIE_CACHE.db * WIP. Added best_orders_tests. Preparing for best_orders_v2 RPC. * WIP. Added best_orders v2 RPC. * Stop using bundled zcash params. Replace zhtlc feature with zhtlc-native-tests. * Fix WASM. * WIP. Adding RPC tasks for Zcoin activation. * WIP. Compilation fails. * WIP. Clippy fails. * WIP. Compilation fails. * WIP. Implemented traits. Tests next. * WIP. Switched tests to RPC tasks Zcoin activation. * Fix WASM. * WIP. GetLightdInfo from mainnet.lightwalletd.com:9067. * WIP. Playing with librustzcash. * WIP. Fetched compact blocks cache db for Zcash testnet. * Ignore try_grpc test. * Cargo.lock updated after merge. * Fix Clippy. * Add get_tradeable_coin_conf. * First batch of review fixes. * Fixes after merging with dev. * Add GetCurrentBlock trait and implement it for activation results. Used to log the current block number upon activation. * Avoid expects on p2p_privkey parsing for ordermatch messages. * Fixes after merging with dev. * Added SerializableSecp256k1Keypair. * Update ZOMBIE_CACHE.db. * Fix after merge. * Review fixes. * Production DEX_FEE_Z_ADDR. * Review fixes. * Fixes after merge. Co-authored-by: Artem Vitae <artem@vitae.com> Co-authored-by: Artem Vitae <email@not.set>
A few notes from comparing legacy and v2 V2 does not appear to have:
min/max volumes can be derived in v2 In v2 V2 |
* 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>
* 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>
@laruh There are a couple of tasks that I would like to give to you for this integration 🙂
|
* WIP. * WIP. History is half-ready. * WIP. Added tx_hex. Trying to figure out how to use integer internal_id. * WIP. Added a separate z_coin_tx_history RPC. * WIP. Added transaction_fee calc. * Created ZOMBIE_TEST_HISTORY_SEED and sent few transactions. Found a big in history building SQL query. * WIP. Refactoring. Fixed SQL query. History works. TODO paging. * WIP. Feature is ready. TODO handle unwrap. * Return error instead of unwrap. History is finished. * Fixes after merge. * Fix first review notes. * Fix second review notes. Co-authored-by: Artem Vitae <artem@vitae.com>
In one of my PRs #1405, I changed the names of some methods including Changelog: link Also I added |
* WIP init_native_client,RpcClient, ZcoinNativeClientInitError added * WIP match added in current_block check * WIP trying trait Client * WIP serialized_block added * WIP remove BlockIDNative, BlockRangeNative * WIP use if let * WIP merge fix * WIP if let added in check_watch_for_tx_existence * WIP client.clone() added * WIP match for get_raw_tx added * WIP * [r2r] trait impl comment removed * WIP * WIP * WIP * WIP * WIP no method named `to_bytes`jubjub * WIP group crate added * WIP * WIP merge fixes * WIP log! added * WIP log * WIP verbose in getblockheader should be boolean * WIP fee 0 for transparent inputs * WIP Deafult added for CompactTxNative * WIP custom structures were removed * WIP z_coin_grpc compact structs * WIP * WIP fix fmt * WIP * WIP empty header * r2r * r2r * r2r ZcoinClientInitError * First review iteration * WIP trait added * WIP reference removed * remove rpc_client, impl additional method * fix errors * WIP LightwalletdImpl and LightwalletdConnection added * r2r native mode support for zcoin * WIP multi lightwalletd servers support * WIP use drop_mutability * WIP added RpcClientInitErr, one cache paths, attempts fixed * WIP propagate the error instead of panic, mutable watch_for_tx removed from check_watch_for_tx() * WIP async_blocking added in create_wallet_db * remove some unnecessary code for multi servers * remove unused code * type OnCompactBlockFn added * rename to check_tx_existence, add return bool, databases init moved to ZCoinBuilder::build * leave Vec of urls for init_light_client * fix clippy
@laruh Regarding dockerization:
|
* WIP changes in get_block_height * WIP scan_blocks * WIP scan_blocks * WIP scan_blocks * WIP impl ZRpcOps works for vector of clients * WIP channel build in lightwalletd_urls iteration * WIP format errors changed * WIP uncover the uri err in lightwalletd_urls * refactor the code * refactor the code * WIP err.into_inner(), tonic::Status removed * save Vec<tonic::Status> for get_block_height * wip * add note * display, early return, GrpcMultiError, remove for_tonic, straight push * use send multi request fn in check_tx_existence * UrlIterError added * added note for refactoring
If there is a connection problem during Zcoin activation, tonic just propagates connection errors and doesn't try to reconnect, if connection is stabilized. |
@laruh As I can see, the error happened during activation process, and it was not the thing to test 🙂 Could you please check that background sync process continues in case of connection problems after successful coin activation? Please also post documentation example of Zcash params file path in request for @smk762. |
Oh, after successful coin activation other processes go fine even if we have connection problems.
I sent an example in dm to smk, and it was added in this pr |
@laruh Great! |
* wip * wip * works but need to polish * use verify_checksum_zcash_params func for both spend and output paths * remove unnecessary code * remove unnecessary code once more * fix review notes * fix review notes * wasm * reimport PathBuf
This an unordered checklist for the Browser/WASM support for ARRR item based on my initial research and code inspection:
This is a preliminary checklist based on a fast code inspection of the current ARRR implementation in mm2. There might be some other items that I missed or some of the above items might need more research to decide the best way for wasm support. |
I highly suggest to not add anything further on the zcash fork. We should even remove it and use the upstream directly. We need to find/implement the fixes on our side, rather than forking projects which requires additional cost for maintanince. If it's not so possible doing that, best thing we can do is asking for a generic layer for storage, so everyone can implement their need using generic traits provided by zcash upstream. |
Note: All zcash params are required to enable coins in native mode. They are too big for browser I think. For Light client sapling-spend and sapling-output params should be enough. {
"method": "task::enable_z_coin::init",
"mmrpc": "2.0",
"params": {
"ticker": "ZOMBIE",
"activation_params": {
"mode": {
"rpc": "Light",
"rpc_data": {
"electrum_servers": [
{
"url": "zombie.dragonhound.info:10033"
}
],
"light_wallet_d_servers": [
"http://zombie.dragonhound.info:443"
]
}
},
"zcash_params_path": "/home/user/TEST_PATH/.zcash-params"
}
},
"userpass": "'$USERPASS'"
} ps: also you can ping me to provide up to date values for |
Thanks @laruh for the hint, added it to the checklist. |
@borngraced it would be good to add notifications / streaming channel implementation to ARRR/zcoin , can you please make them part of your next sprint plans and add them to this checklist #927 (comment) |
LocalTxProver::with_default_location() -> LocalTxProver::new(...)
)The text was updated successfully, but these errors were encountered: