Skip to content

Conversation

@nabijaczleweli
Copy link

@nabijaczleweli nabijaczleweli commented Dec 8, 2025

I found a new technique that let me filter for these better. From my POV this exhausts the bounty.

  • refactor(swap): replace only base64 dependency with workspace's data-encoding

  • refactor(bitcoin-wallet): replace only rust_decimal_macros dependency with Decimal::from_parts() we use universally

  • refactor(swap-env): replace terminal_size with functionality already part of console

  • refactor(rendezvous-node): replace atty with console, which we already use

  • refactor(swap-fs): replace directories-next (=> dirs-sys-next, redox_users) with dirs which is already in our dependency tree

    Validated on Linux and MacOS:

    $ cargo run
     Compiling tttt v0.1.0 (/home/nabijaczleweli/uwu/tttt)
      Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s
       Running `target/debug/tttt`
    [src/main.rs:66:5] old::system_config_dir() = "/home/nabijaczleweli/.config/xmr-btc-swap"
    [src/main.rs:67:5] new::system_config_dir() = "/home/nabijaczleweli/.config/xmr-btc-swap"
    [src/main.rs:68:5] old::system_data_dir() = "/home/nabijaczleweli/.local/share/xmr-btc-swap"
    [src/main.rs:69:5] new::system_data_dir() = "/home/nabijaczleweli/.local/share/xmr-btc-swap"
    [src/main.rs:70:5] old::system_data_dir_eigenwallet(false) = "/home/nabijaczleweli/.local/share/eigenwallet"
    [src/main.rs:71:5] new::system_data_dir_eigenwallet(false) = "/home/nabijaczleweli/.local/share/eigenwallet"
    [src/main.rs:72:5] old::system_data_dir_eigenwallet(true) = "/home/nabijaczleweli/.local/share/eigenwallet-testnet"
    [src/main.rs:73:5] new::system_data_dir_eigenwallet(true) = "/home/nabijaczleweli/.local/share/eigenwallet-testnet"
    
    b
  • fix(swap-fs): fix documentation for swap-fs

Ref: #775

@nabijaczleweli
Copy link
Author

nabijaczleweli commented Dec 8, 2025

FTR, the technique is:

$ for p in '' dev-; do for f in Cargo.toml  */Cargo.toml; do toml2json < $f | jq '.["'$p'dependencies"] | keys_unsorted | .[]'; done; done | sort | uniq -c | sort -n
      1 "asynchronous-codec"
      1 "axum"
      1 "bdk_chain"
      1 "bdk_core"
      1 "bitcoin-harness"
      1 "comfy-table"
      1 "compose_spec"
      1 "crossbeam"
      1 "cuprate-epee-encoding"
      1 "cxx"
      1 "derive_builder"
      1 "dfx-swiss-sdk"
      1 "dirs"
      1 "http-body-util"
      1 "hyper"
      1 "hyper-util"
      1 "jsonrpc_client"
      1 "mockito"
      1 "monero-epee-bin-serde"
      1 "monero-oxide-rpc"
      1 "monero-rpc"
      1 "monero-seed"
      1 "monero-simple-request-rpc"
      1 "once_cell"
      1 "pem"
      1 "quickcheck"
      1 "quickcheck_macros"
      1 "regex"
      1 "rustyline"
      1 "safelog"
      1 "serde_with"
      1 "serde_yaml"
      1 "shell-words"
      1 "sigma_fun"
      1 "swap-db"
      1 "tauri-plugin-clipboard-manager"
      1 "tauri-plugin-dialog"
      1 "tauri-plugin-opener"
      1 "tauri-plugin-process"
      1 "tauri-plugin-shell"
      1 "tauri-plugin-store"
      1 "tauri-plugin-updater"
      1 "tokio-rustls"
      1 "tokio-test"
      1 "tokio-tungstenite"
      1 "tor-cell"
      1 "tor-proto"
      1 "tower-http"
      1 "tracing-appender"
      1 "unsigned-varint"
      1 "void"
      1 "zeroize"
      1 "zip"
      2 "bdk"
      2 "bdk_electrum"
      2 "bmrng"
      2 "clap"
      2 "config"
      2 "console"
      2 "dialoguer"
      2 "electrum-pool"
      2 "moka"
      2 "monero-harness"
      2 "monero-rpc-pool"
      2 "rand_chacha"
      2 "semver"
      2 "serde_cbor"
      2 "sha2"
      2 "strum"
      2 "swap"
      2 "swap-controller-api"
      2 "swap-fs"
      2 "tauri"
      2 "tempfile"
      2 "throttle"
      2 "time"
      2 "tokio-util"
      2 "toml"
      2 "tor-hsservice"
      2 "tracing-ext"
      3 "bdk_wallet"
      3 "chrono"
      3 "curve25519-dalek"
      3 "jsonrpsee"
      3 "libp2p-tor"
      3 "sqlx"
      3 "structopt"
      3 "swap-feed"
      3 "swap-proptest"
      3 "testcontainers"
      4 "data-encoding"
      4 "ecdsa_fun"
      4 "monero-sys"
      4 "rustls"
      4 "swap-core"
      4 "swap-machine"
      4 "swap-p2p"
      5 "arti-client"
      5 "async-trait"
      5 "bitcoin-wallet"
      5 "proptest"
      5 "tor-rtcompat"
      5 "typeshare"
      6 "backoff"
      6 "rand"
      6 "uuid"
      7 "reqwest"
      7 "rust_decimal"
      7 "swap-env"
      7 "url"
      9 "serde_json"
      9 "swap-serde"
     10 "futures"
     10 "libp2p"
     10 "tracing-subscriber"
     11 "thiserror"
     14 "bitcoin"
     14 "monero"
     15 "serde"
     18 "tokio"
     18 "tracing"
     20 "anyhow"

You'd think you can substitute void for std Infallible but this is part of the libp2p API and our version of libp2p uses Void and only later versions switch to Infallible. once_cell is as in #805.

@binarybaron
Copy link

LGTM but we also need to test this on Windows.

@binarybaron
Copy link

(the Mac OS emulator on Linux is impressive)

@nabijaczleweli
Copy link
Author

In addition to OSX-KVM on Debian you will no doubt also notice that the display server is Windows as well.

This is the first time I've even considered Win32 as a target here 💀

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.47s
     Running `target\debug\nieuw.exe`
[src\main.rs:71:1] old::system_config_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap\\config"
[src\main.rs:72:1] new::system_config_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap"
[src\main.rs:73:1] old::system_data_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap\\data"
[src\main.rs:74:1] new::system_data_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap"
[src\main.rs:75:1] old::system_data_dir_eigenwallet(false).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet\\data"
[src\main.rs:76:1] new::system_data_dir_eigenwallet(false).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet"
[src\main.rs:77:1] old::system_data_dir_eigenwallet(true).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet-testnet\\data"
[src\main.rs:78:1] new::system_data_dir_eigenwallet(true).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet-testnet"

@binarybaron
Copy link

I'm planning to merge this after #818.

I re-introduced hex as dependency because it is used in monero-oxide which means we already have it in the tree.

@binarybaron
Copy link

In addition to OSX-KVM on Debian you will no doubt also notice that the display server is Windows as well.

This is the first time I've even considered Win32 as a target here 💀

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.47s
     Running `target\debug\nieuw.exe`
[src\main.rs:71:1] old::system_config_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap\\config"
[src\main.rs:72:1] new::system_config_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap"
[src\main.rs:73:1] old::system_data_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap\\data"
[src\main.rs:74:1] new::system_data_dir().unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\xmr-btc-swap"
[src\main.rs:75:1] old::system_data_dir_eigenwallet(false).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet\\data"
[src\main.rs:76:1] new::system_data_dir_eigenwallet(false).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet"
[src\main.rs:77:1] old::system_data_dir_eigenwallet(true).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet-testnet\\data"
[src\main.rs:78:1] new::system_data_dir_eigenwallet(true).unwrap() = "D:\\Users\\nabijaczleweli\\AppData\\Roaming\\eigenwallet-testnet"

thanks for taking the time to test it : )

LGTM! Can be merged after conflicts are resolved.

… with Decimal::from_parts() we use universally
…users) with dirs which is already in our dependency tree

Validated on Linux and MacOS:
  $ cargo run
     Compiling tttt v0.1.0 (/home/nabijaczleweli/uwu/tttt)
      Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.38s
       Running `target/debug/tttt`
  [src/main.rs:66:5] old::system_config_dir() = "/home/nabijaczleweli/.config/xmr-btc-swap"
  [src/main.rs:67:5] new::system_config_dir() = "/home/nabijaczleweli/.config/xmr-btc-swap"
  [src/main.rs:68:5] old::system_data_dir() = "/home/nabijaczleweli/.local/share/xmr-btc-swap"
  [src/main.rs:69:5] new::system_data_dir() = "/home/nabijaczleweli/.local/share/xmr-btc-swap"
  [src/main.rs:70:5] old::system_data_dir_eigenwallet(false) = "/home/nabijaczleweli/.local/share/eigenwallet"
  [src/main.rs:71:5] new::system_data_dir_eigenwallet(false) = "/home/nabijaczleweli/.local/share/eigenwallet"
  [src/main.rs:72:5] old::system_data_dir_eigenwallet(true) = "/home/nabijaczleweli/.local/share/eigenwallet-testnet"
  [src/main.rs:73:5] new::system_data_dir_eigenwallet(true) = "/home/nabijaczleweli/.local/share/eigenwallet-testnet"
@nabijaczleweli
Copy link
Author

Rebased

@binarybaron
Copy link

Thanks!

Bounty of 0.1 XMR paid out to @nabijaczleweli.

@binarybaron binarybaron merged commit 65a939a into eigenwallet:master Dec 15, 2025
@binarybaron
Copy link

There are a few people in the Matrix chat (#unstoppableswap-core:matrix.org) whose wallet have disappeared after the release of this code. This is probably because something changed the data directory. We need to revert it.

nabijaczleweli added a commit to nabijaczleweli/core that referenced this pull request Dec 23, 2025
…, redox_users) with dirs which is already in our dependency tree"

This reverts commit 9c72c2b.

Ref: eigenwallet#815 (comment)
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.

2 participants