Commit graph

3179 commits

Author SHA1 Message Date
Binarybaron
f7529b8b5c amend: Add changelog entry for --trace flag 2025-05-31 13:16:19 +02:00
Mohan
a33ebfbb3a
feat(asb): add trace flag for stdout (#366)
* fix(asb): include trace option in raw arguments

* feat(asb): Add --trace flag
2025-05-31 13:09:46 +02:00
Mohan
274c630aba
fix(swap): tx_lock_spending_fee was estimated to be zero if utxos less than dust limit (#363)
* fix(swap): tx_lock_spending_fee was estimated to be zero if we had less funds than dust limit

* fix
2025-05-28 17:43:27 +02:00
Mohan
091ba57547
feat(wallet): Use mempool histogram for fee estimation (#358)
* feat(wallet): Use mempool.space as a secondary fee estimation source

* fix: warn if mempool client cannot be instantiated

* make clippy happy

* nitpick: rename clippy_check to clippy in justfile

* rename `estimate_fee_rate_from_mempool` to `estimate_fee_rate_from_histogram` for clarity

* dprint fmt

* make clippy happy

* change teacing level back to debug!

* change log levels

* refactors

* refactor: estimate_fee and min_relay_fee

* serde camel case

Co-authored-by: Byron Hambly <byron@hambly.dev>

* refactors

* Add comments, use Weight struct where possible

* fmt, fix testrs

* dont fallback to bitcoin::MAX, fail instead

* make mempool space optional

* fmt

* refactor: use estimate_fee(...) in max_giveable(...)

* refactor max_giveable(...)

* refactor max_giveeable to return fee as well, remove safety margin for fee

* fix compile

* fmtr

* fix(integration test): Use pre-calculated cancel / punish fees for assert_alice_punished

* fix(integration test): Use real fees for asserts

* sync wallet before transaction_fee call

* split send_to_address into sweep_balance_to_address_dynamic_fee

---------

Co-authored-by: Byron Hambly <byron@hambly.dev>
2025-05-27 15:41:24 +02:00
b-enedict
854b14939e
feat(gui): Feedback quick fixes (#331)
* refactor(gui): Simplify FeedbackDialog component and enhance feedback submission process

- Consolidated state management for feedback input using a custom hook.
- Improved user interface for feedback submission by including clearer instructions
- Removed redundant code and improved overall component structure for better maintainability.

* refactor(gui): Enhance FeedbackDialog layout and add mail link

* feat(gui): Add error handling in feedback submission

* feat(docs): Add brand identity to docs

* feat(docs): Add Send Feedback page

* feat(tauri): build base for log export feature

* feat(tauri): update save_txt_files to use HashMap for file content

* feat(gui): Implement log export functionality

* fix(gui): adjust feedback dialog link to show docs page with instructions for mail feedback

* fix(gui): minor style adjustments to export logs button

* feat(gui, tauri): enhance log export functionality to include zip file naming

* fix(docs): clarify docs section about exporting logs

* feat(gui): initialize selected swap in SwapSelectDropDown with most recent swap

* fix(gui): parse logs correctly for saving to log file

* fix(gui): ensure to use the most recent swap info by using a specialized hook

* fmr

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-05-27 12:55:20 +02:00
Mohan
60d2ee9f7e
docs(dev): switch test instructions to nextest (#361) 2025-05-27 11:05:49 +02:00
Binarybaron
0515f4e6ec fix(dprint): Ignore .git folder 2025-05-26 21:05:28 +02:00
Binarybaron
96b61d33c6 fix(monero wallet): Properly delete temporary monitoring wallet 2025-05-26 21:04:52 +02:00
Binarybaron
80ea9a60a9 fix(monero wallet): Check if wallet already exists by JsonRpcError Error Code 2025-05-26 19:02:17 +02:00
Mohan
e1a053a6fc
feat(cli): remove monitoring wallet on startup (#360) 2025-05-26 18:49:10 +02:00
Mohan
e316567e03
fix(gui): update feedback GitHub issue link (#359) 2025-05-25 23:47:45 +02:00
Mohan
2133e33ca1
feat(asb, cli): Add safety margin to chosen Bitcoin fee for pre-signed transactions (#355) 2025-05-24 22:25:05 +02:00
unstoppableswap-botty
24a011d411
Release version 1.1.2 (#354)
* Prepare release 1.1.2

* amend: Add changelog for increase in allowed Bitcoin fee

---------

Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-05-24 20:47:02 +02:00
Mohan
7f72779680
Increase Bitcoin lock tx fee limit (#349) 2025-05-23 01:08:03 +02:00
Mohan
65f6761c5e
docs: add PR title examples (#350) 2025-05-23 00:53:48 +02:00
Mohan
8d0af2f8b7
refactor(cli): Remove obsolete RPC server (#346) 2025-05-21 18:43:02 +02:00
Mohan
7ef8b1c643
Update docs for external bitcoin address (#341)
* docs: document external address option

* amend: dprint fmt
2025-05-21 09:44:08 +02:00
Mohan
c2fea91390
Fix use of TempDir::keep (#336) 2025-05-21 09:07:27 +02:00
unstoppableswap-botty
840edc3d9e
Prepare release 1.1.1 (#338)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-20 15:11:34 +02:00
Mohan
96eba3f224
docs: add repo overview (#337) 2025-05-20 14:59:37 +02:00
Mohan
0e25cb86f0
fix(swap): Add retry logic for Bitcoin wallet sync (#333) 2025-05-20 14:21:39 +02:00
Raphael
2e2759a318
Add justfile (#335) 2025-05-20 14:18:33 +02:00
Raphael
c4fb2cbd48
feat: log enviroment info (#332) 2025-05-20 12:57:57 +02:00
unstoppableswap-botty
01bac41625
Prepare release 1.1.0 (#329) 2025-05-19 14:52:27 +02:00
Mohan
e66881d6eb
fix: Issues with 1.1.0-rc (#328)
* bump(rust): Toolchain to 1.82

* bump(tauri): Bump some Tauri peer-dependencies

* fix(gui): Prefer maker with known version, bump MIN_ASB_VERSION to 1.1.0-rc.3

* amend: CHANGELOG.md
2025-05-19 12:43:27 +02:00
unstoppableswap-botty
0c4de7e4cd
Prepare release 1.1.0-rc.3 (#327)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-19 01:20:54 +02:00
Binarybaron
2b285f482a revert: delete rc.1, rc.2 releases 2025-05-19 01:18:22 +02:00
Binarybaron
8d048fe420 amend: add comma after new package.json entry 2025-05-19 01:17:33 +02:00
unstoppableswap-botty
4f3447eaad
Prepare release 1.1.0-rc.2 (#326) 2025-05-19 00:33:12 +02:00
Binarybaron
5752676629 fix(ci): Extract gen-bindings-verbose from gen-bindings 2025-05-19 00:11:21 +02:00
unstoppableswap-botty
008260a839
Prepare release 1.1.0-rc.1 (#325)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-18 23:02:19 +02:00
Binarybaron
cc8f6f4b70 amend: CHANGELOG.md 2025-05-18 22:59:45 +02:00
Raphael
3f4cbddf23
upgrade(swap): Concurrent syncing, bdk upgrade, refactors (#180)
* upgrade sqlx to 0.8, add bdk_wallet and bdk_electrum

The new dependencies are part of the bdk upgrade and
include the improved wallet code.
They, too, depend on sqlite3.
However, they use a newer version than we currently use via sqlx.
This necessitated the sqlx upgrade.
This entailed trivial changes (use Pool directly instead of pool.acquire()).
We might have to fix the CI as well, I kept getting compile
errors from the macro until I ran swap/sqlx_dev_setup.sh.

* move old wallet code to extra module

* fix fee estimation for old client

* bump bitcoin crate, add new wallet constructor

* remove unused old Client, move code around for better readibility

* make Wallet generic over Persister (database) and move more code around for readibility

* add script history, start reimplementing client methods

* update some imports

* cargo fmt

* Add comments, fix fee estimation, address generation and status_of_script

* redo state update and wallet sync

* fix bitcoin address validation and more imports, use Amount everywhere

* fix tx cancel, lock, punish, redeem, refund

* fix bitcoin::Address de-/serialisation

* fix more address validation

* fix more address parsing and validation, also some more imports

* cargo fmt

* fix wallet initialization, start wallet migration

* fail test instead of ignoring it

* perform full scan on creation, load from db if it exists

* add more wallet info, fix wallet initialization

* fix: default to null in config

* migrate from old wallet if needed

* change something

* fix some tests

* temporarily patch bdk_wallet and bdk_electrum

* fix more tests

* fix missing rustls

* asb: only start tor client if register_hidden_service=true in the config

* fix: use p2wsh_signature_hash instead of p2wpkh_signature_hash

* fix some bitcoin address parsing and fee rate parsing

* dprint fmt

* add bitcoin-harness to this project and update to the new bitcoin version

* fix max_givible again

* create electrum client separately from wallet, clean up some code

* add comment

* ignore .env.development

* log config file path on ./asb config

* feat(monero-sys): Initial commit. Regtest integration test. Wrapper around basic Wallet functions, depends on monero#9464

* Revert "feat(monero-sys): Initial commit. Regtest integration test. Wrapper around basic Wallet functions, depends on monero#9464"

This reverts commit 14a5b4c348a109d2524657ffeba306422458ea44.

* upgrade to rust toolchain 1.81

* Use new bdk update for code from master

* fix

* remove

* fix: add empty .gitmodules file to fix Docker build

* fix: clean up submodule references

* fix: properly declare monero submodule with ignore flag

* fix(wallet, bdk): only reveal new address if absolutely necessary

* fix: private keys not loaded into bdk wallet

* refactor: sync wallet progress log

* dprint fmt

* refactor: move bitcoin-harness to outside repo

* refactor: remove redundant log message

* Display sync progress

* Remove redundant arg to  swap/tests/harness/mod.rs function

* fix: call rustls::crypto:💍:default_provider()

* dprint fmt

* refactor: remove debug code

* refactor: move old bdk wallet export to own function, clear log messages

* remove old migr for testnets (checksum mismatch), remove balance and stringified last revealed addresses from migration export

* use revalidate_network function, remove redundant drop

* Display progress of background tasks, TauriBackgroundProgressHandle struct

* fix: almost satisfy clippy

* fix: gen-bindings error

* feat: add BackgroundRefund background type

* feat: use builder pattern for constructing Bitcoin wallet

* dprint ftm

* sync electrum in seperate thread

* do not allow user to start sync while sync is in progress

* remove redundant log message

* display random buffer in AlertWithLinearProgress progress

* fix: use TauriContextStatusEvent.Available), dont show syncing wallet spinner if not syncing

* differentiate between TestWalletBuilder and WalletBuilder

* satisfy clippy

* remove custom BackgroundRefund event, move into background process architecture

* refactor

* dprint fmt

* progress: get unit tests compiling

* fix: bitcoin unit tests specify const values like sync_interval

* fix: get unit tests passing

* make clippy happy

* feat: display full sync progress, fix unit test import issues

* dprint fmt

* make clippy happy, use u32 for target_block and not usize

* always spawn tor for asb

* refactor: remove gen_background_progress_id and just use Uuid::new_v4()

* refactor(hooks.ts): clarify comment on useConservativeBitcoinSyncProgress

* fix typo

* refactor: do not let WalletBuilder take entire env struct

* dprint fmt

* refactor: remove default feature from workspace patch of bdk

* first try for concurrent syncing

* refactor: concurrent syncing

* fix(wallet.rs): Safely convert FeeRate from btc / kb to sats / kwu

* feat(wallet.rs): persist published Bitcoin transactions without requiring re-scan

This allows us to compute an updated Bitcoin balance without requiring a re-scan

* refactor(wallet.rs): use just 5 concurrent sync requests

* refactor: display snackbar error when Wallet refresh fails

* fix: add missing space

* dprint fmt

* refactor: fancy traits for the CumulativeProgress struct, allow limiting amount of callback calls

* make clippy happy

* dprint fmt

* refactor: clearly differntiate between SyncMutex and TokioMutex, use traits for converting to Arc<Mutex<_>>, move sync_ext into own moid

* fix: skip syncing if no spks in wallet

* fix: update bdk.sh to test migration from old wallet (pre 1.0.0 bdk) to new bdk

* fix: increase bitcoin_lock_confirmed_timeout in RegTest env to 5 minutes

* refactor: avoid usize where possible, create persistence only after full scan, transmit assumed_total for full scan to tauri, add some icons to progress displays

* make clippy happy

* fix(ci): change rust toolchain 1.81

* fix(cross compilation arm): use ring instead of aws-lc-rs

* fmt

* ignore failing rendezvous tests

* fix printing_status_change_doesnt_spam_on_same_status

* fix: given_bitcoin_address_network_mismatch_then_error test

* ignore list_sellers_should_report_all_registered_asbs_with_a_quote test

* feat: add tor icon

* refactor(wallet.rs): reorder struct by abstraction level

* refactor(bitcoin wallet): chunk size for syncing

* fix(integration tests): decrease sync interval to 3s

* fix(integration tests): parse_rpc_err method to take new bdk error, not old one

* add changelog entry

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
Co-authored-by: Mohan <86064887+binarybaron@users.noreply.github.com>
2025-05-18 22:54:03 +02:00
unstoppableswap-botty
0f2c406915
Prepare release 1.0.0-rc.21 (#318)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-15 19:39:53 +02:00
Binarybaron
8ec58dcb1e fix(gui): Fetch alerts only once 2025-05-15 18:26:23 +02:00
Mohan
23abb13315
feat(docs): Add darkness.su rendezvous point to docs 2025-05-15 17:09:49 +02:00
Mohan
7d111e18fe
fix(ci): Set yarn network-timeout to 10 minutes to avoid spurious network failures (#317) 2025-05-14 21:28:15 +02:00
Mohan
b7424ffaf5
feat(ci): Limit ci.yml to one concurrent running job per git branch (#316) 2025-05-14 21:20:50 +02:00
unstoppableswap-botty
75f48e35af
Prepare release 1.0.0-rc.20 (#315)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-05-14 21:07:29 +02:00
Mohan
9da5e432b3
feat(swap): Upgrade monero-wallet-rpc to v0.18.4.0 (#314) 2025-05-14 21:03:17 +02:00
b-enedict
31e68b2671
feat(gui): Add a Introduction for new users (#287)
* feat(gui): add IntroductionModal component

* feat(gui): add interactivity to IntroductionModal

* feat(gui): create SlideTemplate component for IntroductionModal Slides

* feat(gui): add generic slides to IntroductionModal with images and content

* feat(gui): add Slide with SwapStatusAlert to IntroductionModal

* feat(gui): show the introduction only on the first app start

* feat(gui): make external links functional

* fix(gui): update github link to link to active repo

* feat(gui): replace old images with new mockups and update Slide05 content

* feat(gui): add CardSelectionGroup and CardSelectionOption components for improved card selection UI

* feat(gui): add FiatPricePreference slide to IntroductionModal

* feat(gui): save user preference regarding fiat prices

I set the initial store configuration for fetching fiat prices to false to avoid any calls to coingecko without user consent

* refactor(gui): remove old Slide05 component for improved codebase maintenance

* fix(gui): add UnstoppableSwap logo to FiatPricePreference slide

* refactor(gui): update image imports and improve slide content for introduction modal

* fix(gui): introduce ExternalLink component and update Slide05 to use it for external navigation

* fix(gui): replace webp images for introduction with svg mockups for improved quality

* fix(gui): change order of introduction slides, to asking for fiat price preference at the end

* refactor(gui): implement CardSelectionContext for managing card selection state

* refactor: texts in intro modakl

* fix(gui): update currency fetching SVG for improved design and clarity

* feat(gui): added changelog entry for introduction

---------

Co-authored-by: Binarybaron <binarybaron@protonmail.com>
2025-05-07 12:44:29 +02:00
unstoppableswap-botty
66313ad91f
Prepare release 1.0.0-rc.19 (#305)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-04-28 17:03:18 +02:00
Mohan
01f1e6f218
fix(gui): Feedback submit payload 2025-04-28 16:58:51 +02:00
unstoppableswap-botty
3cf2337bfb
Prepare release 1.0.0-rc.18 (#304) 2025-04-28 15:52:48 +02:00
Mohan
53a994e6dc
feat(gui): Display developer responses to feedback (#302) 2025-04-28 13:12:43 +02:00
Raphael
f1e5cdfbfe
fix(swap): Monero wallet thread safety (#281)
* add comment to ConfirmationListener

* swap: always wrap monero::Wallet in tokio::sync::Mutex

Before, monero::Wallet wrapped a Mutex<Client>, and locked
the mutex on each operation. This meant releasing the
lock in between operations, even though we rely on the
operations being executed in order.

To remedy this race condition, we wrap monero::Wallet itself
in a mutex, requiring any caller to hold the lock for the duration
of the operation, including any suboperations.

* work on: releasing the lock while waiting for confirmations

Due to the newly introduced thread safety, we are currently holding
lock to the monero wallet while waiting for confirmations
-- since this takes a lot of time, it starves all other tasks
that do anything with the monero wallet.

In this commit I start implementing a change that enables us to release
the lock to the wallet while waiting for confirmations and only acquire it
when necessary.

This breaks with the current system of passing just a generic client
which implements the MoneroWalletRpc trait (which we use to pass a dummy
client for testing).

This commit is the first step towards a small refactor to that system.

* always pass Wallet instead of a MoneroWalletRpc client

By always passing Arc<Mutex<Wallet>> instead of MoneroWalletRpc clients
directly we can allow the wait_for_confirmations functions to lock the
Mutex and access the client when they need to, while releasing the lock
when waiting for the next tick. This stops the current starving of other
tasks waiting for the lock.

Since we use a dummy client for testing, this required adding a generic
parameter to the Wallet. However, since we specify a default type,
this doesn't actually require generic handling anywhere.

* add warning comment to monero::wallet::Wallet::from_dummy

* add timeout when waiting for monero lock during quote

This commit adds a timeout after 60 seconds when trying to acquire
the lock on the monero wallet while making a quote.
Should a timout occur, we return an error.
This makes sure that we get _some_ return value and that
starvation is noticed.

* fix lints, don't keep lock during loop body in wait_for_confirmations

* always immediately drop lock in wait_for_transfer

* fix clippy lints

* open wallet instead of failing when we can't create from keys

When we fail to create a monero wallet from keys, we will now try
to open it instead. I also renamed the method to be more consistent
with Wallet::open_or_create.

These changes are mostly taken from #260.

* improve documentation on monero::Wallet

* use Wallet::open instead of Wallet::Client::open

* use create_from_keys_and_sweep in bob's redeem_xmr

This commit deduplicates logic by using
create_from_keys_and_sweep_to in bob's redeem_xmr
and also adds the create_from_keys_and_sweep_to
method while making create_from_keys_and_sweep a
wrapper around it.

* add error context and improve logging

* fix deadlock in wait_for_confirmation_with, add timout to test
2025-04-24 15:34:01 +02:00
Raphael
e8084d65ec
feat(gui): Review logs before sending feedback (#301)
* add review buttons that open the attached logs before submitting feedback
* add redact switches to redact transaction id's from attached logs
2025-04-23 15:09:19 +02:00
Raphael
3fa31ba139
feat(gui): Tor toggle (#300)
* re-add tor info box, show switch for toggling tor

* add use_tor to TauriSettings, only initialize tor client when it's true

* add warning log message when not using tor client

* change the label text of the switch, fail to align switch with SettingsBox icons

* move Tor settings to SettingsBox
2025-04-22 16:36:09 +02:00
unstoppableswap-botty
ffe103cb49
Prepare release 1.0.0-rc.17 (#297)
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
2025-04-18 02:06:09 +02:00
Mohan
75f37a987b
fix(gui): Accept integrated Monero addresses 2025-04-18 02:01:25 +02:00