This repository was archived by the owner on Aug 23, 2026. It is now read-only.
feat(p2p): prioritize last seen makers - #1841
Open
binarybaron wants to merge 1024 commits into
Open
binarybaron wants to merge 1024 commits into
binarybaron wants to merge 1024 commits into
Conversation
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
…with libstd/libstd/data-encoding) (#786) * cleanup(swap-proptest): remove tokio dependency * cleanup(electrum-pool): remove serde_json dependency * cleanup(monero-rpc): remove curve25519-dalek rand tracing hex-literal tokio dependencies * cleanup(src-tauri): remove monero-rpc-pool anyhow uuid libp2p dependencies * cleanup(swap-machine): remove tracing dependencies * cleanup(swap-machine): remove swap-env tokio uuid dependencies * cleanup(mon): remove futures dependencies * cleanup(swap): remove bdk_core big-bytes data-encoding ed25519-dalek hex sha2 sigma_fun rand_chacha atty comfy-table dialoguer conquer-once dfx-swiss-sdk monero-rpc void tokio-tungstenite async-compression tower tower-http serde_cbor tokio-tar zip serde_cbor serial_test dependencies * cleanup(libp2p-rendezvous-node): remove backoff dependencies * cleanup(swap-asb): remove tracing_subscriber dependencies * cleanup(monero-sys): remove swap_serde testcontainers dependencies * cleanup(monero-rpc-pool): remove regex url uuid tower webpki-roots monero-rpc tokio-test dependencies * refactor(swap): replace get_port dependency get_port::get_port() loops through every port in 1024..=65545, binds there, and returns true if the bind worked(!!!!!): https://docs.rs/get-port/3.0.0/src/get_port/lib.rs.html This is ludicrous. Just bind to 0 and use that. * refactor(swap-p2p): downgrade async-trait to optional+features.test-support in main dependencies * refactor(swap-machine): replace conquer_once with libstd * refactor(monero-rpc): replace hex with data-encoding which we already have in the deptree * refactor(swap-serde): replace hex (last user) with data-encoding which we already have in the deptree
- Split layout with horizontal divider between peer info and offer details - Add MoneroSatsMarkup component to display markup percentage separately - Fix exchange rate unit notation (XMR/BTC) - Make address/peer_id expand to fill available space - Add tooltips to all chips with simple, neutral phrasing - Center avatar and text vertically
* fix(swap): add bitcoin_wallet to tracing config Fixes: commit 4ae47e5 ("refactor: swap-core / swap-machine (#530)") * Extract swap/src/bitcoin/wallet.rs and relevant parts of swap-core/src/bitcoin to bitcoin-wallet. Lift tracing-ext to crate cargo build -p bitcoin-wallet -p swap-core cargo test -p bitcoin-wallet -p swap-core -p swap-machine work at this point (the tests fail exactly as much as before) Ref: #725 * Propagate bitcoin_wallet through swap * Propagate monero_wallet through swap-asb * refactor(swap,asb): use bitcoin_wallet as bitcoin; -> bitcoin_wallet * type TauriHandle = Option<...>;
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* bump: yarn to 4.12.0, npmMinimalAgeGate: 7d * add instructions to src-gui/README.md for corepack * fix carg.lock
* feat(monero-sys): reserve proofs * minor stuff * more accurate comments
* feat(protocol): Reserve proof * wrap reserve proof with address * use new ReserveProofWithAddress in event_loop
* fix(ci/cd): Use proper command substitution for getting the binary paths * ref(ci/cd): Use 'ls' instead of 'find' for getting binary paths * Update DMG file naming pattern in workflow * fix(gui): Clear dialog shown after successful Monero transfer * do not close on backdrop click --------- Co-authored-by: Mohan <86064887+binarybaron@users.noreply.github.com> Co-authored-by: Binarybaron <binarybaron@protonmail.com>
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* prune(tauri): auri_plugin_shell * amend * amend
* Upgrade toolchain to rustc 1.89.0 * Switch from curve25519-dalek-ng to curve25519-dalek in most places except the DLEQ proof system * Remove CliCommand::BuyXmr everywhere * New monero-wallet-ng with confirmations / scanner subscriptions and transaction verification * monero-wallet-ng: examples (could be pruned) * monero-wallet: split into wallets, listener, lib modules * monero-sys: remove Wallets::wait_until_confirmed(...) in favour of monero-wallet-ng * swap(alice): replace monero-sys in favour monero-wallet-ng of wait_until_confirmed * swap(bob): rename XmrLockProofReceived -> XmrLockTransactionCandidate, add new XmrLockTransactionSeen, extract helpers into common.rs, use monero-wallet-ng helpers, add new TransferProofMaybeWithTxKey * gui: add BobStateName.XmrLockTransactionSeen to guards * helpers: state3.infallible_recv_transfer_proof(...), infallible_wait_for_xmr_lock_confirmation(...), never go into XmrLockTransactionSeen directly * fmt * monero-wallet-ng: remove examples * progress * nitpick: remove _ng suffix * fix underflow in absolute_confirmations_into_relative, use GuaranteedScanner * rename .wait_for_incoming_transfer_ng to .wait_for_incoming_transfer * replace map_err with context * document some more behaviour * clarify naiveness of scanner * add changelog entry * prune: remove old WatchRequest everywhere * bump rust toolchain to 1.90 and move shared deps into workspace * bob: add intermediate WaitingForCancelTimelockExpiration state * bob: do not explicitly check for tx lock timelock status before watching for tx redeem * bob: use env_config.monero_finality_confirmations, dont try to redeem indefinitely upon cooperative redeem * add monero_wallet_ng to tracing * monero-wallet-ng: reset backoff upon success, instrument span into tokio tasks * add VerifyingXmrLockTx and VerifyingXmrLockTx tauri state * bob: check for tx_redeem and timelock state concurrently during pre-requisite check before sending enc sig * fix(monero-wallet-ng): correctly instrument span * monero-wallet-ng: use normal Scanner instead of GuaranteedScanner * storeListener.ts: do init tasks in parallel * nitpick: remove dead code in background.ts * add PreflightEncSig and InflightEncSig tauri events * fix closure calls * final nitpciks * fix setup-build-environment/action.yml * fix typo * zeroize to match monero-oxide version * last nitpicks * scan blocks in batches * nitpick * add happy_path_alice_does_not_send_transfer_proof integration test
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* 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"
* fix(swap-fs): fix documentation for swap-fs
* feat(asb): authenticate the RPC server with a cookie token The ASB JSON-RPC server generates a random token on startup, writes it to a .cookie file in the data directory, and requires it as an HTTP Bearer token. asb-controller reads the cookie via --cookie and attaches the header; a new `cookie` subcommand prints the token. The orchestrator mounts the asb-data volume into the controller and passes --cookie. * feat(asb): persist the RPC cookie token across restarts Reuse the existing .cookie token when present so clients keep working across ASB restarts; only generate a new token when the file is missing or empty, and propagate genuine read errors. * feat(asb): hashed-password auth for the RPC server Replace the cookie-file scheme with a hashed password: the ASB verifies the presented Bearer password against a salt:hmac HMAC-SHA256 verifier read from --rpc-auth-file (mandatory when the RPC server is enabled). asb-controller prompts for the password on startup and verifies before granting access. The orchestrator gains a gen-rpc-auth command to produce the keyfile and mounts it into the asb container. --------- Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
… publishing (#1100) * feat(swap): check if Monero redeem is already present on chain before publishing * feat(asb): check if Monero refund is already present on chain before publishing * refactor(monero-wallet): wrap transaction status query in Wallets::is_transaction_present * docs: add changelog entry for Monero redeem/refund on-chain check --------- Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
…1099) The ASB verifies a Bearer password against a salt:hmac HMAC-SHA256 verifier read from --rpc-auth-file (mandatory when the RPC server is enabled). asb-controller prompts for the password on startup and verifies before granting access. The orchestrator gains a gen-rpc-auth command to produce the keyfile and mounts it into the asb container. Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
…iew (#1104) Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Source-built images (asb, asb-controller, rendezvous-node) failed to build when the default bridge network has no working DNS resolver, timing out while fetching the rust toolchain from static.rust-lang.org. Emit network: host on the build block so these containers resolve DNS via the host. Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* orchestrator: bump cAdvisor v0.49.1 -> v0.55.1 (fix container metric labels on Docker 29) PR #1096 added `--disable_metrics=disk` (cadvisor#3860) but left the image at v0.49.1, whose Docker client speaks API 1.41 — rejected by Docker 29 (min 1.44). The docker factory never registers, so container CPU/memory series carry no `name`/`container_label_*` and the per-container Grafana panels are blank fleet-wide. The flag alone can't help: the API rejection precedes any disk logic. Bumps CADVISOR_IMAGE to v0.55.1 (multi-arch index digest), whose client negotiates >=1.44. `--disable_metrics=disk` stays as the overlayfs guard. Side effect: `container_fs_*` is dropped — host-fs panels should use node_exporter. https://claude.ai/code/session_015Ga3VckuHd7zguMVvvETnM * orchestrator: trim cadvisor doc comment to match other image constants https://claude.ai/code/session_015Ga3VckuHd7zguMVvvETnM --------- Co-authored-by: Claude <noreply@anthropic.com>
* orchestrator: scrape bitcoind and electrs metrics When metrics shipping is enabled, the prometheus-agent now additionally scrapes bitcoind and electrs: - bitcoind: add a `bitcoin-exporter` service (jvstein/bitcoin-prometheus-exporter, pinned by digest). bitcoind gets a static `-rpcauth` credential so the exporter can authenticate over RPC. `-rpcauth` (unlike `-rpcpassword`) does not suppress the `.cookie` file, so electrs keeps authenticating via the cookie unchanged. - electrs: enable its built-in Prometheus endpoint via `--monitoring-addr` and expose it on the docker network. Both endpoints are added as scrape jobs in the generated prometheus.yml. All of this is gated behind METRICS_REMOTE_WRITE_URL being set, matching the existing cadvisor/prometheus-agent behaviour. https://claude.ai/code/session_01EnEK8ffRBeLUZYSf9fAst5 * orchestrator: trim verbose comments https://claude.ai/code/session_01EnEK8ffRBeLUZYSf9fAst5 * chore: trim comments * orchestrator: remove gluetun (WireGuard VPN) support --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* feat(monero): lazy daemon RPC client + health-check gating before swaps Constructing the direct monero-oxide RPC client used to perform a blocking JSON-RPC round-trip to the node (batch-support probe). A timeout there aborted the entire context/wallet initialization, even though nothing at init acts on the probe result. Establish the RPC client lazily instead: store it as `None` at construction and connect on first use in `rpc_client()` (cached, re-established after a node change). A temporarily unreachable node no longer blocks initialization. Add `Wallets::rpc_health_check()` and gate swaps on it: - Bob health-checks the daemon at the start of the swap state machine, emitting a `CheckingMoneroNodeConnectivity` progress event and retrying for up to 45s. - Alice responds with a zero quote when the RPC health check fails. - Alice health-checks the RPC before handing out a swap-setup wallet snapshot. Also release the swap lock if `buy_xmr` fails before the swap task is spawned, fixing a pre-existing leak where an early error left the lock held. * revert(swap): drop buy_xmr swap-lock release-on-error wrapping --------- Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Co-authored-by: UnstoppableSwap Botty <help@unstoppableswap.net>
* chore(orchestrator): don't make promtail depend on asb promtail mounts the asb-data volume read-only and tails /asb-data/logs/*.log. The named volume exists independently of the asb service, and the read-only mount means promtail can never create the logs folder, so the depends_on was only coupling startup order unnecessarily. Drop it (keep docker-socket-proxy). * chore(orchestrator): drop unnecessary depends_on couplings - prometheus-agent no longer depends_on cadvisor: a scraper retries its targets, so depending on one (cadvisor) meant a cadvisor failure would stop prometheus from starting and drop every metric, not just cadvisor's. - cloudflared no longer depends_on asb: the tunnel retries its origin, so the dependency only coupled startup order. --------- Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
Emit the serialized redeem transaction hex in the PublishingMoneroRedeem and XmrRedeemPublished progress events, and surface it in the GUI via a "Show raw transaction" link that opens a dialog with the hex and a link to xmrchain.net/rawtx for manual publishing. Also re-publish the redeem transaction periodically while waiting for it to confirm, in case the daemon forgets about it before it is mined. Co-authored-by: binarybaron <user@mbp-von-user.speedport.ip>
* feat(bitcoin-wallet): speedup electrum * feat(gui): reset electrum server list * refactor(electrum-pool): tune retries, drop unused join_all - Reduce min_retries default 10 -> 5 - Remove unused join_all balancer method (all callers use join_quorum) - Pin explicit quorum in join_quorum tests so they're independent of default - Drop unsubstantiated "self-authenticating" claim from get_tx docs Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * add changelog --------- Co-authored-by: binarybaron <user@MacBook-Pro-von-user.local> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Peers restored from the database were added to the swarm with normal Tor dial priority, competing on equal footing with peers we have a fresh reachability signal for. Introduce a new `Low` priority and use it for these peers so they no longer crowd out higher-priority dials. The priority tracker now keeps the highest priority ever set for a peer (`set_peer_priority` only raises, never lowers), so the order of calls no longer matters: - restored-from-DB peers start at `Low` - if rediscovered via rendezvous they are bumped to `Normal` - rendezvous points are bumped to `High` The dial limiter gains a `Low` queue that is strictly subordinate: low dials only start while neither the high nor the normal queue has a dial waiting, so a backlog of higher-priority dials always goes first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127Y9if6yWjWpm6RmhnGcp6
Further rate-limit the low-priority tier (database-restored peers) by spacing consecutive dial starts at least 3 seconds apart instead of 2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0127Y9if6yWjWpm6RmhnGcp6
binarybaron
force-pushed
the
claude/peer-priority-swarm-adl1b3
branch
from
June 18, 2026 13:33
add68bd to
7005120
Compare
binarybaron
force-pushed
the
claude/peer-priority-swarm-adl1b3
branch
from
June 18, 2026 13:58
7005120 to
9eb7d5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.