Commit Graph

1008 Commits

Author SHA1 Message Date
Byron Hambly
a19501a002
Revert "Monero wallet refresh fix (#1487)"
This reverts commit d8dacbdee9.
2024-03-26 09:06:31 +02:00
binarybaron
d8dacbdee9
Monero wallet refresh fix (#1487)
* Upgrade monero-wallet-rpc to `v0.18.3.1`

* Give feedback to user about state of monero refresh and retry if fails

This commit changes the following behaviour in the refresh functionality of the monero wallet
- Allows for multiple retries because in some cases users have experienced an issue where the wallet rpc returns `no connection to daemon` even though the daemon is available. I'm not 100% sure why this happens but retrying often fixes the issue
- Attempt to print the current sync height while the wallet is syncing. This only works to some degree because the `monero-wallet-rpc` stops responding (or takes a long time to respond) while it's refreshing
- The `monero-wallet-rpc` is started with the `--no-initial-sync` flag which ensures that as soon as it's started, it's ready to respond to requests
---------

Co-authored-by: Byron Hambly <bhambly@blockstream.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
2024-03-25 15:08:54 +01:00
Ian McKenzie
eb15f477fa
Verify hashes of monero cli on download (#1572)
* Bump Monero CLI for macos aarch64 to match other platforms

* Check hash on download of monero cli

* change panic to bail

---------

Co-authored-by: Byron Hambly <bhambly@blockstream.com>
2024-03-22 11:18:40 +02:00
Ian McKenzie
140dc6dc04
Upgrade to vergen 8.3, move to git describe --dirty --tags for semver (#1543)
* Upgrade to vergen 8.3, move to git describe --dirty --tags for semver

* Add newline to build.rs
2024-02-04 08:43:59 +02:00
Byron Hambly
dcf9f24b77
build(deps): bump pem to 3.0
replaces #1415

also fixes the `seed_from_pem_fails_for_long_seed` unit test, which was
"passing" but not actually testing what it meant to.
2023-10-23 11:21:04 +02:00
pokkst
5182b4f53a
Update lock timeout to 10 min 2023-09-29 08:08:25 -05:00
binarybaron
3467523849 Dynamically choose monero daemon to connect to 2023-09-07 19:10:23 +02:00
binarybaron
2e1909685d
Revert "Refresh monero monitoring wallet at startup to ensure daemon is is av…" 2023-09-01 17:36:00 +02:00
binarybaron
844ebc7de3 Refresh monero monitoring wallet at startup to ensure daemon is is available 2023-08-31 00:47:18 +02:00
bors[bot]
d0a35ab21b
Merge #1428
1428: Fix issue where Windows cannot open ASB wallet to create lock XMR transaction r=delta1 a=pokkst

It seems on Windows that opening an already opened wallet results in an error/crash. This does not seem to be the case for Linux and macOS. Removing this line fixed the issue on Windows, and had no regressions on macOS/Linux from my testing.

Co-authored-by: pokkst <pokkst@protonmail.com>
2023-08-14 11:38:10 +00:00
binarybaron
2e181dac9c Immediately sync bitcoin tx status upon subscribing 2023-08-13 14:33:49 +02:00
pokkst
d7d87d96ac
Maybe fix issue on Windows where the wallet cannot open during XMR locking phase
(cherry picked from commit 879cb8bc0131b8a059466ca00ae9f7842c4ac018)
2023-08-08 18:25:30 -05:00
Byron Hambly
5e192acac2
feat(asb): allow asb to register with mulitple rendezvous nodes 2023-08-04 15:04:58 +02:00
Byron Hambly
acdba8474b
build(deps): update rust-toolchain to 1.67 and bump uuid to 1.4
some of the dependency updates are requiring a higher version of the
rust toolchain. bump to 1.67 and fix new clippy lints.

also fix dprint to 0.39.1 because 0.40 has breaking changes.
2023-07-31 11:49:28 +02:00
Byron Hambly
00cfce57c7
chore: fix dprint config and run fmt 2023-03-15 14:19:57 +02:00
Byron Hambly
43f06f0705
build(deps): bump base64 to 0.21
closes #1271
2023-01-11 19:52:14 +02:00
Byron Hambly
4ca1f8da5e
ci: update msrv and github actions toolchains 2023-01-10 14:57:09 +02:00
Byron Hambly
9346cb7baf
fix: add debug log for opening monero wallet error 2023-01-10 13:49:32 +02:00
Byron Hambly
f39e1de964
feat(swap): merge cancel/refund commands into one command 2023-01-08 12:53:56 +02:00
binarybaron
b6201192c2 Allow asb to set a bitcoin address that is controlled by the asb itself to redeem/punish Bitcoin to 2022-12-31 00:52:53 +01:00
binarybaron
39895a176f
Merge branch 'master' into monero-unlocked-balance 2022-12-28 18:41:35 +01:00
Byron Hambly
98296d8fa6
feat(asb): allow config overrides from env vars
- upgrades config crate to 0.13.2 #1087
- adds environment source for config overrides
2022-12-05 11:27:47 +02:00
Byron Hambly
55e7d3f425
Merge branch 'master' into monero-unlocked-balance 2022-12-03 20:57:16 +02:00
Byron Hambly
08426d8171
fixup! fix(asb): use unlocked monero balance for quotes 2022-11-29 14:18:42 +02:00
bors[bot]
e5e7de757e
Merge #1225
1225: fix(cli, asb): print update warning correctly formatted r=delta1 a=binarybaron



Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
2022-11-25 13:45:12 +00:00
binarybaron
52871c9fc8 Print update warning correctly formatted 2022-11-25 13:58:58 +01:00
Byron Hambly
cd3ba4905a
feat: add wallet database migration from older bdk
- upgrades to bdk 0.24 #1198
- adds a regression test for opening older wallets #1183
- adds a migration for older wallets that encounter the ChecksumMismatch
  error #1182
2022-11-23 12:23:21 +02:00
binarybaron
4f89b3d768 Add monero-wallet-rpc DOWNLOAD_URL for M1, M2 Mac 2022-11-12 15:31:53 +01:00
binarybaron
f09b237e15
Immediately fetch transaction status upon subscription
Immediately fetch transaction status upon subscription instead of waiting 1 minute

(cherry picked from commit 5662f7fe81)
2022-11-07 09:56:27 +02:00
Byron Hambly
3d12631d69
feat: upgrade monero images to v0.18.1.2 2022-11-07 09:53:50 +02:00
Byron Hambly
f224c49584
fix(asb): use unlocked monero balance for quotes 2022-11-07 09:52:58 +02:00
Byron Hambly
fb42ca13cc
chore: clippy fix 2022-10-19 15:02:46 +02:00
Byron Hambly
2c2fb7f350
deps(build): upgrade ecdsa_fun and sigma_fun
- #1139
- #1140
2022-09-13 14:19:58 +02:00
Byron Hambly
6e7e39eea4
build(deps): upgrade bdk, ecdsa_fun, sigma_fun, sha2, bitcoin-harness, serde
- bdk to 0.22.0 #1126
- ecdsa_fun to 7c3d592 #1127
- sigma_fun to 7c3d592 #1128
- sha2 to 0.10.2 #948
- serde to 1.0.144 #1115
- bitcoin-harness to bff9a64

Revert "ci: specify previous dprint version until fixed"
This reverts commit 11eb1737ce.
2022-09-12 12:03:24 +02:00
Byron Hambly
bf23eee0cb
docs: add gpg key readme and delta1.asc 2022-08-11 13:05:21 +02:00
Byron Hambly
249e97826f
feat: check swap cli wallet rpc version and remove if not fluorine fermi
- swap cli will check its wallet rpc version and delete the binary if
  its version does not match on "Fluorine Fermi". it will then download
  the newer version.
- adds download progress for wallet rpc
2022-08-10 21:35:22 +02:00
Byron Hambly
0a7a27327e
feat: upgrade to monero 0.18 2022-08-10 21:22:11 +02:00
bors[bot]
0d794a13d0
Merge #1008
1008: Upgrade libp2p and stabilized the version r=delta1 a=lescuer97

This is an upgrade for libp2p, I did a previous PR but got mixed up with rebases

Co-authored-by: leonardo <leoescuer@protonmail.com>
Co-authored-by: Leonardo Escuer <47948594+lescuer97@users.noreply.github.com>
Co-authored-by: Byron Hambly <bhambly@blockstream.com>
2022-08-10 12:10:57 +00:00
Byron Hambly
4b09ffd4df
refactor: check for latest release
DRYs up the code for checking latest release from github.
2022-08-08 13:35:40 +02:00
Byron Hambly
493324ce1b
Merge remote-tracking branch 'upstream/master' into latest_version_check 2022-08-08 11:43:11 +02:00
Byron Hambly
7838442947
fix: review comments from binarybaron 2022-08-04 15:01:22 +02:00
Byron Hambly
dc68344b62
chore: formatting in select! macro 2022-08-04 14:29:23 +02:00
Byron Hambly
ec169916d6
Merge branch 'master' into libp2p_upgrade 2022-08-03 22:07:24 +02:00
bors[bot]
a9d9250af1
Merge #1088
1088: feat: add debugging info for failed to fetch transaction r=delta1 a=delta1

Add the jsonrpc error message and data to tracing calls to try debug #1061 "monero-wallet-rpc failed to fetch transaction"

Co-authored-by: Byron Hambly <bhambly@blockstream.com>
2022-08-03 13:10:10 +00:00
Byron Hambly
7e4af68cba
feat: add debugging info for failed to fetch transaction
Add the jsonrpc error message and data to tracing calls to try debug #1061
"monero-wallet-rpc failed to fetch transaction"
2022-08-03 14:07:16 +02:00
bors[bot]
cb7a7f58b2
Merge #1086
1086: fix btc for xmr calculation error r=delta1 a=delta1

The calculation overflow fix in #1068 did not account for XMR < 1 which
resulted in truncation when dividing by the PICO_OFFSET.

This commit uses `Decimal` to do the calculation at fixed precision and
adds a number of test values to verify the calculation.

Closes #1084

Co-authored-by: Byron Hambly <bhambly@blockstream.com>
2022-08-03 11:57:08 +00:00
Byron Hambly
86d57453cf
fix: fix btc for xmr calculation error
The calculation overflow fix in #1068 did not account for XMR < 1 which
resulted in truncation when dividing by the PICO_OFFSET.

This commit uses `Decimal` to do the calculation at fixed precision and
adds a number of test values to verify the calculation.

Closes #1084
2022-08-03 12:30:51 +02:00
Byron Hambly
dc706c584a
feat(swap): show min deposit required for min_quantity 2022-08-01 10:28:38 +02:00
Byron Hambly
39e34a608b
fix: fix potential overflow in max_bitcoin_for_price
In testing, ASB panicked in `max_bitcoin_for_price` when the Monero
balance x Bitcoin price was enough to overflow `u64`.

This commit changes the function to do the piconero offset division
first, and then to use `checked_mul` to return None if the calculation
would overflow. This required changing the function return
signature to an `Option`. Additional tests for the function were also added.

MONERO_FEE was changed from 0.000030 to 0.000016, which is still
double the current median transaction fee listed at
https://www.monero.how/monero-transaction-fees as of 2022-07-28.
2022-07-28 15:03:32 +02:00
Byron Hambly
8eff499a63
fix: change logs to UTC due to bug in time crate
On Linux and macOS, no program output was being observed.
This is referenced in the [LocalTime] docs for `tracing-subscriber`,
which links to this [unsoundness issue] in the time crate.

Rather than introducing a possible vector for undefined behaviour and
segfaults, I have just changed the logging to use UTC time instead.

When running the ASB as a systemd service, one would generally use the
`--disable-timestamps` flag anyway as systemd adds its own timestamps
which can be local to the server.

If the situation with `tracing-subscriber` and the time crate is fixed
then this can be updated.

This commit also updates the `tracing-subscriber` and `tracing-appender`
dependencies, closing #987.

[LocalTime]: https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/time/struct.LocalTime.html
[unsoundness issue]: https://github.com/time-rs/time/issues/293#issuecomment-748151025
2022-07-26 14:16:41 +02:00