Commit Graph

2347 Commits

Author SHA1 Message Date
selsta e6f4875219
wallet2: adjust fee during backlog, fix set priority 2024-03-08 14:13:58 +01:00
luigi1111 72d87cd10a
Merge pull request #9160
c50ade5 Daemon-specific proxy for the wallet-rpc. (0xFFFC0000)
2024-02-24 10:11:51 -05:00
luigi1111 2dc918402c
Merge pull request #9006
47042ce wallet2: call on_reorg callback in handle_reorg (j-berman)
2024-02-24 09:57:55 -05: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
0xFFFC0000 c50ade514f
Daemon-specific proxy for the wallet-rpc.
1. Daemon-specific proxy is exclusive with global proxy (--proxy).
2. If you set global proxy (--proxy) you cannot set daemon-specific proxy.
3. If you don't set global proxy, you can set proxy (or not set) proxy for
each daemon connection with the proxy field in jsonrpc to the wallet-rpc.
2024-02-18 18:36:52 +00:00
luigi1111 8ee57110b0
Merge pull request #9077
2525200 serialization: remove container wrappers and serialize directly (jeffro256)
2024-01-18 18:02:31 -05:00
luigi1111 2eed43cef2
Merge pull request #9059
2766d12 MMS: Ignore 2 more API errors thrown by latest PyBitmessage (rbrunner7)
2024-01-18 17:58:57 -05:00
luigi1111 2a6f7efca6
Merge pull request #9049
1062b17 wallet: sign_tx: get tx pubkey from extra (tobtoht)
2024-01-18 17:56:55 -05:00
luigi1111 5f6646020e
Merge pull request #9023
b2eb47d wallet: mitigate statistical dependence for decoy selection within rings (jeffro256)
2024-01-18 17:55:49 -05:00
jeffro256 2525200185
serialization: remove container wrappers and serialize directly
Some downstream code (most notably PR https://github.com/UkoeHB/monero/pull/25) wants to use the src/serialization lib
for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use
the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled
with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class
field types. By serializing STL containers directly, we can abstract the serialization details away, making for much
cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators,
and Hashers are serializable. `std::multimap` is added to the list of serializable containers.

Depends upon https://github.com/monero-project/monero/pull/9069.
2023-11-28 14:06:24 -06:00
luigi1111 ac02af9286
Merge pull request #9050
23179a0 wallet: fix multisig key memory leak (jeffro256)
2023-11-06 09:38:08 -05:00
luigi1111 b22ba16dec
Merge pull request #9038
e191083 epee: remove dead code in math_helper and string_tools (jeffro256)
2023-11-06 09:31:33 -05:00
rbrunner7 2766d12a62 MMS: Ignore 2 more API errors thrown by latest PyBitmessage 2023-11-05 16:11:52 +01:00
tobtoht 1062b172b6
wallet: sign_tx: get tx pubkey from extra 2023-11-02 15:19:05 +01:00
jeffro256 23179a0ba4
wallet: fix multisig key memory leak
Multisig keys per-transfer were being wiped, but not erased, which lead to a ginormous
quadratic bloat the more transfers and exports you performed with the wallet.
2023-11-02 02:58:50 -05:00
luigi1111 e946315627
Merge pull request #9002
932bba3 depends: remove libiconv: unused (tobtoht)
2023-10-25 21:38:32 -04:00
luigi1111 fc4397010d
Merge pull request #8974
759293d wallet2: fix version check at hf version 1 (j-berman)
2023-10-25 21:36:36 -04:00
luigi1111 e3d0154b5b
Merge pull request #8969
8190f25 KV_SERIALIZE: remove extraneous semicolons in DSL (jeffro256)
2023-10-25 21:35:43 -04:00
jeffro256 e191083bed
epee: remove dead code in math_helper and string_tools 2023-10-25 16:41:21 -05:00
jeffro256 b2eb47d875
wallet: mitigate statistical dependence for decoy selection within rings
Since we are required to check for uniqueness of decoy picks within any given
ring, and since some decoy picks may fail due to unlock time or malformed EC points,
the wallet2 decoy selection code was building up a larger than needed *unique* set of
decoys for each ring according to a certain distribution *without replacement*. After
filtering out the outputs that it couldn't use, it chooses from the remaining decoys
uniformly random *without replacement*.

The problem with this is that the picks later in the picking process are not independent
from the picks earlier in the picking process, and the later picks do not follow the
intended decoy distribution as closely as the earlier picks. To understand this
intuitively, imagine that you have 1023 marbles. You label 512 marbles with the letter A,
label 256 with the letter B, so on and so forth, finally labelling one marble with the
letter J. You put them all into a bag, shake it well, and pick 8 marbles from the bag,
but everytime you pick a marble of a certain letter, you remove all the other marbles
from that bag with the same letter. That very first pick, the odds of picking a certain
marble are exactly how you would expect: you are twice as likely to pick A as you are B,
twice as likely to pick B as you are C, etc. However, on the second pick, the odds of
getting the first pick are 0%, and the chances for everything else is higher. As you go
down the line, your picked marbles will have letters that are increasingly more unlikely
to pick if you hadn't remove the other marbles. In other words, the distribution of the
later marbles will be more "skewed" in comparison to your original distribution of marbles.

In Monero's decoy selection, this same statistical effect applies. It is not as dramatic
since the distribution is not so steep, and we have more unique values to choose from,
but the effect *is* measureable. Because of the protocol rules, we cannot have duplicate
ring members, so unless that restriction is removed, we will never have perfectly
independent picking. However, since the earlier picks are less affected by this
statistical effect, the workaround that this commit offers is to store the order that
the outputs were picked and commit to this order after fetching output information over RPC.
2023-10-17 00:53:40 -05:00
j-berman 47042ce808 wallet2: call on_reorg callback in handle_reorg 2023-09-26 20:37:11 -07:00
tobtoht 932bba3b79
depends: remove libiconv: unused 2023-09-25 14:00:34 +02:00
jeff 9f981ac219
wallet: store watch-only wallet correctly when `change_password()` is called
The Monero GUI code was calling `Monero::wallet::setPassword()` on every open/close for some reason,
and the old `store_to()` code called `store_keys()` with `watch_only=false`, even for watch-only wallets.
This caused a bug where the watch-only keys file got saved with with the JSON field `watch_only` set to 0,
and after saving a watch-only wallet once, a user could never open it back up against because `load()` errored out.
This never got brought up before this because you would have to change the file location of the watch-only
wallet to see this bug, and I guess that didn't happen often, but calling the new `store_to()` function with the
new `force_rewrite` parameter set to `true` triggers key restoring and the bug appeared.
2023-09-21 22:42:16 -05:00
jeffro256 1bea8ef42a
wallet2: fix `store_to()` and `change_password()`
Resolves #8932 and:
2. Not storing cache when new path is different from old in `store_to()` and
3. Detecting same path when new path contains entire string of old path in `store_to()` and
4. Changing your password / decrypting your keys (in this method or others) and providing a bad original password and getting no error and
5. Changing your password and storing to a new file
2023-08-23 11:48:18 -05:00
j-berman 759293de08 wallet2: fix version check at hf version 1 2023-08-17 13:29:46 -07:00
luigi1111 72211163b8
Merge pull request #8956
f7fb5c7 scan_tx: fix custom comparator for == case; fixes #8951 (j-berman)
2023-08-17 10:26:24 -05:00
luigi1111 1ab593991c
Merge pull request #8950
a0e5c3c wallet2: when checking frozen multisig tx set, don't assume order (jeffro256)
2023-08-17 10:24:53 -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 83df9b1429
Merge pull request #8882
a8d2a58 wallet2: ensure transfers and sweeps use same fee calc logic (j-berman)
2023-08-17 10:17:22 -05:00
jeffro256 8190f2532b
`KV_SERIALIZE`: remove extraneous semicolons in DSL
Prereq of https://github.com/monero-project/monero/pull/8867
2023-08-10 11:13:14 -05:00
jeffro256 45b52de28e
wallet-rpc: restore from multisig seed 2023-07-28 12:17:14 -05:00
j-berman f7fb5c7faa scan_tx: fix custom comparator for == case; fixes #8951
Co-authored-by: woodser <woodser@protonmail.com>
2023-07-19 07:48:29 -07:00
jeffro256 a0e5c3c326
wallet2: when checking frozen multisig tx set, don't assume order 2023-07-16 13:29:52 -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
luigi1111 e67f82a164
Merge pull request #8902
c138a28 wallet2: take ignored-by-value outputs into account in balance (Crypto City)
2023-07-06 21:36:19 -05:00
luigi1111 00323bae5e
Merge pull request #8747
a668312 wallet: remove CLI code for non default ring sizes (Jeffro256)
2023-07-06 21:29:41 -05:00
luigi1111 41735185a8
Merge pull request #8888
a6639df wallet_rpc_server: dedup transfer RPC responses (jeffro256)
Very special PR.
2023-07-06 21:24:46 -05:00
Jeffro256 a668312cfa
wallet: remove CLI code for non default ring sizes 2023-06-27 20:18:21 +02:00
luigi1111 0a1eaf26f9
Merge pull request #8884
eeda4a8 wallet2: do not lose exception in current thread on refresh (Crypto City
 f868768 wallet2: fix missing exceptions from failing wallet refresh (Crypto City)
2023-06-27 11:48:27 -05:00
luigi1111 570fd364aa
Merge pull request #8772
87e2a64 Allow option 'non-interactive' in monerod config file (almalh)
2023-06-27 11:31:27 -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
Crypto City c138a28f51
wallet2: take ignored-by-value outputs into account in balance 2023-06-10 06:41:17 +00:00
jeffro256 a6639df9e4 wallet_rpc_server: dedup transfer RPC responses 2023-06-02 01:07:30 -05:00
Crypto City eeda4a8497
wallet2: do not lose exception in current thread on refresh 2023-05-30 17:08:05 +00:00
Crypto City f8687684e3
wallet2: fix missing exceptions from failing wallet refresh 2023-05-30 16:57:48 +00:00
j-berman a8d2a58190 wallet2: ensure transfers and sweeps use same fee calc logic
Ensures both transfers and sweeps use a fee that's calculated
from the tx's weight. Using different logic could theoretically
enable distinguishability between the two types of txs. We don't
want that.
2023-05-27 07:27:54 -07:00
tobtoht c32befe4f8
fix missing <cstdint> includes 2023-05-06 18:13:18 +02:00
tobtoht 1698cb1f84
remove defunct light wallet code 2023-04-25 21:22:10 +02:00
luigi1111 1c9686cb45
Merge pull request #8724
d2a591d wallet, simplewallet: Drop support for mine-to-use RPC system (Jeffrey Ryan)
2023-04-25 12:36:11 -04:00