244 Commits

Author SHA1 Message Date
j-berman
daded36823 wallet: identify spends in pool when scanning
- Make sure to mark identified spends in the pool as spends. The
wallet might not know these have been spent if it wasn't the wallet
that relayed the tx to the daemon, or the wallet was cleared via
rescan_bc.
- Make sure to add spends to m_unconfirmed_txs if not present.
- Make sure to process the entire pool again if refreshing for
the first time. The wallet fetches pool and blocks at the same
time. The wallet scans blocks first, then pool. If the wallet
identifies received outputs in the chain, then it may have spent
those received outputs in the pool. So we make sure to re-process
the entire pool again after scanning the chain for the first time.
- Multisig wallets that know about spent key images can now detect
spend txs in the pool. Update tests for that.
2025-09-15 14:14:50 -07:00
jeffro256
57c40b8993 functional_tests: fix piecemeal export in cold_signing, part 2
Do not mark output import as done if exception is thrown for output being past last imported output.
2025-08-26 15:38:25 -05:00
jeffro256
22433f8414 functional_tests: fix piecemeal export in cold_signing
The `while` loop condition was incorrect, which could lead to incomplete imports.
Also, setting `start` to an *undone* output speeds up the test by 16s on my machine.
2025-08-22 13:21:32 -05:00
jeffro256
78b8c83fdf functional_tests: check transfers list consistency in cold_signing 2025-08-21 11:34:58 -05:00
tobtoht
4e93cdc941 Merge pull request #9883
7b28be0 functional_tests: test PR #9863 (jeffro256)
2025-08-21 16:31:19 +00:00
tobtoht
6dc7b1f8fb Merge pull request #9921
90256c8 error out if functional tests are disabled (Crypto City)
2025-08-21 16:19:30 +00:00
tobtoht
08438b60c1 Merge pull request #9838
2f2a8c4 wallet: Improve Fee Priority Code for Clarity (tzadiko)
2025-07-10 12:45:39 +00:00
tzadiko
2f2a8c46bb wallet: Improve Fee Priority Code for Clarity 2025-07-09 20:08:42 -05:00
jeffro256
6d06de74b2 wallet: refactor subaddress expansion & add to transfer test 2025-07-07 22:16:11 +00:00
benevanoff
6f36037116 wallet: create set_subaddress_lookahead wallet rpc endpoint 2025-07-07 22:15:04 +00:00
Crypto City
90256c8208 error out if functional tests are disabled 2025-05-08 17:08:32 +00:00
jeffro256
7b28be0ef3 functional_tests: test PR #9863 2025-04-01 13:56:44 -05:00
iamamyth
cb91dcee36 tests: Speed up p2p reorg test
Use a fixed, 240s deadline for the daemons to reach agreement and poll
with a suitable frequency (.25s), rather than polling up to 100 times at
roughly 10s intervals.
2025-03-24 11:18:57 -07:00
tobtoht
44523cafff Merge pull request #9135
c069c04ed blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
2025-03-10 16:16:18 +00:00
jeffro256
c069c04ede blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:02:37 -05:00
tobtoht
257db6dff2 Merge pull request #9765
ec74ff4a3 Set response limits on http server connections (Lee *!* Clagett)
2025-02-14 07:33:45 +00:00
Lee *!* Clagett
ec74ff4a3d Set response limits on http server connections 2025-02-13 23:55:17 -05:00
tobtoht
28e2042b04 Merge pull request #9762
950ddbf30 tests: Improve p2p tx propagation functional test (iamamyth)
2025-02-14 04:00:24 +00:00
iamamyth
950ddbf30e tests: Improve p2p tx propagation functional test
Reduce the likelihood of false positive failures in the p2p
transaction propagation functional test by waiting up to a
maximum timeout for a transaction to propagate, rather than using a
fixed timeout, to reflect the random delay of Dandelion++ transaction
propagation. This strategy also speeds test execution in cases where
propagation occurs faster than the previously expected fixed delay.
2025-02-11 18:30:16 -08:00
iamamyth
274b5748da tests: Improve functional_tests_rpc startup
* Use a global startup timeout, and apply it to each socket's connect
  call, rather than repeating connection attempts with short timeouts.

* Avoid leaking sockets by closing them.
2025-01-31 21:15:20 -08:00
j-berman
3b64d1f558 functional tests: fix race in restore wallet refresh 2025-01-23 11:37:48 -08:00
j-berman
98decee8ac wallet2: remove refresh() from scan_tx
Fixes #9354
2025-01-14 13:37:46 -08:00
tobtoht
484ece1c08 tests: remove python2 compatibility 2024-10-23 14:09:59 +02:00
jeffro256
ed955bf751 build: fix build with Boost 1.85 and remove instances of viewkey logging
1. Use `std::is_standard_layout` and `std::is_trivially_copyable` instead of `std::is_pod` for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
2. Use `std::has_unique_object_representations` instead of `alignof(T) == 1` for epee byte spans and epee hex functions
3. Removed reimplementation of `std::hash` for `boost::uuids::uuid
4. Removed `<<` operator overload for `crypto::secret_key`
5. Removed instances in code where private view key was dumped to the log in plaintext
2024-09-06 11:46:22 -05:00
jeffro256
ac0af73222 rpc: add cumul weight field to block template resp
Resolves #9415
2024-08-01 01:03:41 -05:00
luigi1111
040bccc22f Merge pull request #9338
4a376d6 copyright: fix vector.h typo (hinto.janaiyo)
d61e8e9 workflows: delete copyright.yml (plowsof)
341771a copyright: bump to 2024 (copyCat)
2024-07-16 18:42:49 -04:00
j-berman
e71c8bf190 wallet: background sync with just the view key
- When background syncing, the wallet wipes the spend key
from memory and processes all new transactions. The wallet saves
all receives, spends, and "plausible" spends of receives the
wallet does not know key images for.
- When background sync disabled, the wallet processes all
background synced txs and then clears the background sync cache.
- Adding "plausible" spends to the background sync cache ensures
that the wallet does not need to query the daemon to see if any
received outputs were spent while background sync was enabled.
This would harm privacy especially for users of 3rd party daemons.
- To enable the feature in the CLI wallet, the user can set
background-sync to reuse-wallet-password or
custom-background-password and the wallet automatically syncs in
the background when the wallet locks, then processes all
background synced txs when the wallet is unlocked.
- The custom-background-password option enables the user to
open a distinct background wallet that only has a view key saved
and can be opened/closed/synced separately from the main wallet.
When the main wallet opens, it processes the background wallet's
cache.
- To enable the feature in the RPC wallet, there is a new
`/setup_background_sync` endpoint.
- HW, multsig and view-only wallets cannot background sync.
2024-05-24 23:11:58 -07:00
copyCat
341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00
luigi1111
2603a034cf Merge pull request #9245
8e80585 functional_tests: test HTTP digest auth (jeffro256)
2024-05-20 23:25:50 -05:00
jeffro256
8e80585ef5 functional_tests: test HTTP digest auth
Test:
  1. Can't login to RPC server with --rpc-login enabled, but no auth provided
  2. Can access RPC server with correct login
  3. Can use internal HTTP client to access RPC server with correct login

With commit 0ae5c91e50 not reverted, we fail test 3.
2024-03-11 23:54:50 -05:00
jeffro256
38f354e89f Enforce Tx unlock_time is Zero by Relay Rule
Related to https://github.com/monero-project/research-lab/issues/78

Added a relay rule that enforces the `unlock_time` field is equal to 0 for non-coinbase transactions.

UIs changed:
* Removed `locked_transfer` and `locked_sweep_all` commands from `monero-wallet-cli`

APIs changed:
* Removed `unlock_time` parameters from `wallet2` transfer methods
* Wallet RPC transfer endpoints send error codes when requested unlock time is not 0
* Removed `unlock_time` parameters from `construct_tx*` cryptonote core functions
2024-02-24 14:27:17 -06:00
jeffro256
b13c5f6669 wallet: feature: transfer amount with fee included
To transfer ~5 XMR to an address such that your balance drops by exactly 5 XMR, provide a `subtractfeefrom` flag to the `transfer` command. For example:

    transfer 76bDHojqFYiFCCYYtzTveJ8oFtmpNp3X1TgV2oKP7rHmZyFK1RvyE4r8vsJzf7SyNohMnbKT9wbcD3XUTgsZLX8LU5JBCfm 5 subtractfeefrom=all

If my walet balance was exactly 30 XMR before this transaction, it will be exactly 25 XMR afterwards and the destination address will receive slightly
less than 5 XMR. You can manually select which destinations fund the transaction fee and which ones do not by providing the destination index.
For example:

    transfer 75sr8AAr... 3 74M7W4eg... 4 7AbWqDZ6... 5 subtractfeefrom=0,2

This will drop your balance by exactly 12 XMR including fees and will spread the fee cost proportionally (3:5 ratio) over destinations with addresses
`75sr8AAr...` and `7AbWqDZ6...`, respectively.

Disclaimer: This feature was paid for by @LocalMonero.
2024-02-20 17:08:06 -06:00
luigi1111
d5da693866 Merge pull request #8958
b0bf49a blockchain_db: add k-anonymity to txid fetching (jeffro256)
2023-10-25 21:34:06 -04:00
jeffro256
d4d884057c functional_tests: fix multisig tests noutputs assertion
The changes to the multisig tests in #8914 and #8904 affected each other, this PR cleans up the code and fixes that issue.
2023-08-19 22:09:51 -05:00
luigi1111
3b67d5fc5b Merge pull request #8914
45b52de wallet-rpc: restore from multisig seed (jeffro256)
2023-08-17 10:20:20 -05:00
luigi1111
30ba5a5280 Merge pull request #8890
e8cac61 core_rpc_server: return ID of submitted block (jeffro256)
2023-08-17 10:17:46 -05:00
jeffro256
b0bf49a65a blockchain_db: add k-anonymity to txid fetching
Read more about k-anonymity [here](https://en.wikipedia.org/wiki/K-anonymity). We implement this feature in the monero daemon for transactions
by providing a "Txid Template", which is simply a txid with all but `num_matching_bits` bits zeroed out, and the number `num_matching_bits`. We add an operation to `BlockchainLMDB` called
`get_txids_loose` which takes a txid template and returns all txids in the database (chain and mempool) that satisfy that template. Thus, a client can
ask about a specific transaction from a daemon without revealing the exact transaction they are inquiring about. The client can control the statistical
chance that other TXIDs (besides the one in question) match the txid template sent to the daemon up to a power of 2. For example, if a client sets their `num_matching_bits`
to 5, then statistically any txid has a 1/(2^5) chance to match. With `num_matching_bits`=10, there is a 1/(2^10) chance, so on and so forth.

Co-authored-by: ACK-J <60232273+ACK-J@users.noreply.github.com>
2023-08-01 17:25:25 -05:00
jeffro256
45b52de28e wallet-rpc: restore from multisig seed 2023-07-28 12:17:14 -05:00
luigi1111
d5c7d1743f Merge pull request #8904
369a5a8 wallet: respect frozen key images in multisig wallets (jeffro256)
2023-07-06 21:37:58 -05:00
jeffro256
e8cac61f4b core_rpc_server: return ID of submitted block 2023-06-30 15:31:35 -05:00
j-berman
e6b86af931 wallet2: fix rescanning tx via scan_tx
- Detach & re-process txs >= lowest scan height
- ensures that if a user calls scan_tx(tx1) after scanning tx2,
the wallet correctly processes tx1 and tx2
- if a user provides a tx with a height higher than the wallet's
last scanned height, the wallet will scan starting from that tx's
height
- scan_tx requires trusted daemon iff need to re-process existing
txs: in addition to querying a daemon for txids, if a user
provides a txid of a tx with height *lower* than any *already*
scanned txs in the wallet, then the wallet will also query the
daemon for all the *higher* txs as well. This is likely
unexpected behavior to a caller, and so to protect a caller from
revealing txid's to an untrusted daemon in an unexpected way,
require the daemon be trusted.
2023-06-15 02:21:29 -07:00
jeffro256
369a5a8f9a wallet: respect frozen key images in multisig wallets
Before this change, if a multisig peer asked you to sign a transaction with a frozen enote, the wallet will do it without any error or warning. This change makes it
so that wallets will refuse to sign multisig transactions with frozen enotes.

Disclaimer: This PR was generously funded by @LocalMonero.
2023-06-12 16:47:28 -05:00
luigi1111
df2eb0da0a Merge pull request #8796
7a4a03d wallet2: do not commit transactions more than once (moneromooo-monero)
2023-04-25 11:24:15 -04:00
moneromooo-monero
7a4a03d9d3 wallet2: do not commit transactions more than once
Fixes #8793
2023-03-21 21:05:53 +00:00
mj-xmr
5b4fea72cf Copyright: Update to 2023
Co-authored-by: plowsof <plowsof@protonmail.com>
extra files
2023-01-16 13:00:18 +01:00
j-berman
b8271ab881 wallet2: check wallet compatibility with daemon's hard fork version 2022-09-12 21:24:24 -06:00
luigi1111
c89d06341a Merge pull request #8513
959a3e6 wallet2: ensure imported outputs subaddresses are created (moneromooo-monero)
a098504 wallet2: better test on whether to allow output import (moneromooo-monero)
c5579ac allow exporting outputs in chunks (moneromooo-monero)
1e912ec wallet2: fixes for export/import output flow (j-berman)
692f1d4 wallet2: do not assume imported outputs must be non empty (moneromooo-monero)
67b6d6a wallet2: prevent importing outputs in a hot wallet (moneromooo-monero)
d9fc666 wallet2: fix missing subaddress indices in 'light' exported outputs (moneromooo-monero)
2022-09-09 12:48:47 -05:00
luigi1111
77053298ed Merge pull request #8450
600de07 wallet_rpc_server: longer timeout for stop_mining (moneromooo-monero)
ac6db92 functional_tests: silence the cpu power test program (moneromooo-monero)
2022-08-22 22:47:45 -05:00
moneromooo-monero
a0985044d9 wallet2: better test on whether to allow output import
Being offline is not a good enough heuristic, so we keep track
of whether the wallet ever refreshed from a daemon, which is a
lot better, and probably the best we can do without manual user
designation (which would break existing cold wallet setups till
the user designates those wallets)
2022-08-18 19:29:03 +00:00
moneromooo-monero
c5579ac236 allow exporting outputs in chunks
this will make it easier huge wallets to do so without hitting
random limits (eg, max string size in node).
2022-08-18 06:53:41 +00:00