Commit graph

7389 commits

Author SHA1 Message Date
Doyle
df69008d07
Move simple string view out to common/string_view.h (#1049) 2020-02-28 12:00:54 +11:00
Doyle
8aacc33fb1
Rewrite the integration tests to use pipes (#1045) 2020-02-21 14:48:25 +11:00
Doyle
02a1f0741a
Merge pull request #1044 from Doy-lee/LokiNameServiceUpdateTX
Loki Name Service - Update Mappings TX
2020-02-21 11:06:01 +11:00
Doyle
7a584a45a0 Use libsodium to hash the contents for signatures
Prefer libsodium so that external libraries don't have to link against
Monero crypto and can instead opt for more standardized cryptography
libraries.
2020-02-21 09:32:45 +11:00
Doyle
0b695592ec Use operator<< for structs, adjust LNS wording, move command_t to lns:: 2020-02-21 09:32:45 +11:00
Doyle
675fe32030
Merge pull request #1042 from jagerman/blink-lower-fees
Blink - lower fees & default
2020-02-20 12:19:31 +11:00
Doyle
1197ae9635 Add RPC calls for updating lns tx 2020-02-20 10:08:38 +11:00
Doyle
c2b0d37c60 Make LNS records print out a friendly name for the type 2020-02-20 10:08:38 +11:00
Jason Rhinelander
2711afdeb7 Remove mixin handling from wallet_api; fix create_transactions_2 call
mixins don't do anything (plus the default value in wallet_api was
simply wrong because `// copy-pasted from simplewallet`).

Also fixed the create_transactions_2 call to pass the tx_params and
remove a duplicate definition.
2020-02-19 18:53:24 -04:00
Jason Rhinelander
c989a59fed Fix invalid_priority exception
invalid_priority doesn't support a message argument.
2020-02-19 18:50:24 -04:00
Doyle
2ee128c47a Use enum_field for type to use lns::mapping_type 2020-02-20 09:34:25 +11:00
Doyle
086cd874bd Use tx/extra print helpers in loki_name_system.cpp 2020-02-20 09:34:25 +11:00
Doyle
845c973103 Prevent blink in update_lns_mapping in CLI wallet when confirm_and_send-ing 2020-02-20 09:34:25 +11:00
Doyle
523635db0b Generate a proper hash for signatures to prevent LNS update replays 2020-02-20 09:34:25 +11:00
Doyle
0363e5d50c Add various LNS tests for updating record variants 2020-02-20 09:34:25 +11:00
Doyle
d5cc6fc9af Prevent LNS TX updates, updating to the same value 2020-02-20 09:34:25 +11:00
Doyle
f47efd713a Introduce LNS update transaction to update the underlying value mapping 2020-02-20 09:34:25 +11:00
Jason Rhinelander
f2f0d947f7
Allow get_staking_requirement to return current height (#1038)
This allows it to be used to fetch the current staking requirement by
just asking for a height of 0, while currently you'd first have to fetch
the height and then pass that in.
2020-02-20 09:28:16 +11:00
Jason Rhinelander
283711d6f6 Remove ancient MSVC workaround; use perfect forwarding
The boost code generation being used here is a workaround for ancient
versions of MSVC that have no relevance today.

This also fixes throw_wallet_ex to use perfect forwarding (rather than
forcing const lvalue reference arguments).
2020-02-19 13:08:28 -04:00
Jason Rhinelander
05d33eb01d Throw exception if using blink priority on non-blinkable tx type 2020-02-19 13:05:11 -04:00
Jason Rhinelander
a561eb21b8 Remove ring_size parameter from API 2020-02-19 12:53:55 -04:00
Jason Rhinelander
0b0e909d8f Lower blink fees, remove higher priorities and backlog checking
This reduces blink fees by half (from 5x to 2.5x base fee) at HF15, and
makes anything other than "unimportant" priority map to blink for
ordinary transactions.

For non-blink txes priorities are still accepted (so that, if the
mempool is clogged, you can still get a registration or stake through by
upping the priority).

It also updates the wallets default priority for transactions to blink
(that is, "default" now becomes blink).

With the priorities gone and default set to blink, the backlog-checking
code and automatic priority bumping code don't serve any useful purpose,
so this rips them out, along with a few other related code
simplifications.
2020-02-19 12:52:28 -04:00
Jason Rhinelander
228fcdb493 Reformatted messy/broken multiline strings
These were each wrong in separate but disturbing ways.

The `set` help included an indent at the *end* of each string for some
inexplicable reason, and (quite predictably) got lost when someone added
a new option, which thus didn't indent properly.

show_transfers help was particularly bad: it was originally lined up
nicely in the output, but the escaped "'s meant it didn't line up nicely
in the code.  But it had a comment to explain *why* it wasn't nicely
lined up in the code.  But then apparently someone came along and
changed it to line things up in the code and left the comment.

In both cases life is improved massively by using C++11 raw strings.
2020-02-19 12:52:28 -04:00
Jason Rhinelander
d1a67b4497 Remove confirm-missing-payment-id option
This has been deprecated for a while and it's time to kill the warning
option off (and the associated code).
2020-02-19 12:52:28 -04:00
Jason Rhinelander
1f3d50b425 Remove wallet mixin code
Since you can't change it there's no point in having a default, or in
worrying about "adjusting" the passed in value.
2020-02-19 12:52:28 -04:00
Jason Rhinelander
5db01be8aa Move hard-coded Monero donation address
No need for this to be in the wallet code when we don't use it (it is
used in one test case, but that is now simply hard-coded there instead).
2020-02-19 12:52:28 -04:00
Jason Rhinelander
94bb266d75 Simplify static_asserts
Divisible by 2, 3 and 4 is the same as divisible by 12.
2020-02-19 12:52:28 -04:00
Jason Rhinelander
391e89e7ed
Merge pull request #1043 from Doy-lee/LokiNameSystemSweepAllFix
Undo line deletes and make a copy of change_dts in transfer_selected_rct
2020-02-19 12:49:17 -04:00
Jason Rhinelander
9561ce47c2
Fix priority=5 not doing an actual blink submission (#1041)
The RPC wallet `fill_response` calls were still passing `req.blink` to
blink a tx, but that is supposed to be deprecated in favour of passing
(just) `priority=5`.  Fixed it to blink based on the priority instead.
2020-02-19 15:57:21 +11:00
Doyle
78530e4c50 Undo line deletes and make a copy of change_dts in transfer_selected_rct
construct_tx_and_get_tx_key modifies the splitted_dsts vector which can
change the value of the reference I took to the dts entry. This change
undoes that and restores the behaviour to make a copy of the dst.
2020-02-19 15:52:41 +11:00
Doyle
a3ee18be3b
Merge pull request #1026 from Doy-lee/LokiNameServiceWalletCleanup
Loki Name Service - Wallet parts
2020-02-17 10:42:26 +11:00
Doyle
6ddc247696 sqlite3_prepare_v3 prototype doesn't exist in some sql distributions 2020-02-14 17:06:44 +11:00
Jason Rhinelander
2315c60a3c SQLITE_PREPARE_PERSISTENT requires sqlite >= 3.20.0 2020-02-13 11:09:40 +11:00
Doyle
103f92a6a0 Resolve enabled mapping types via hf aware function instead of via enum 2020-02-13 11:07:47 +11:00
Doyle
e10356430f Fix subtle bugs that crept in
- get_settings SQL was using get_owner_by_id query
- Settings row was queried sometimes by ID vs rowid
- Initialising DB against the checkpoint instead of the latest block
- Removing other LNS type references means needing to update the lns commands in CLI wallet
- wallet2 passing the value encoded in ascii into tx extra
2020-02-13 11:07:47 +11:00
Doyle
e19b1b8b39 LNS: query owners by keys in a single sql query 2020-02-13 11:07:47 +11:00
Doyle
7c6cdaf4c2 Make get_mappings execute in a single query, s/user/owner 2020-02-13 11:07:47 +11:00
Doyle
8c69dd14ad Add register_height to the serialized members for LNS owners to name RPC 2020-02-13 11:07:47 +11:00
Doyle
e3a6f20f85 Code review
- constexpr functions in common/loki.h for inlining
- move hex functions out from common/loki.h to common/hex.h
- use and apply prev_txid on LNS TX's to all LNS types (for updating in the future)
- add lns burn type, for custom burn amounts
- accept and validate lokinet addresses via base32z
- return lokinet addresses in RPC LNS calls via base32z
- updated Messenger references to Session
- update documentation to note that only Session LNS entries are allowed currently
- remove raw c-string interface from LNS db
- update multi-SQL queries into single SQL queries
- remove tx estimation backlog in anticipation for 2 priorities only, blink + unimportant
2020-02-13 11:07:47 +11:00
Doyle
dafc95ac91 txid and prev_txid should be returning as a string in RPC 2020-02-13 11:07:47 +11:00
Doyle
f460fc08ba Add a constructor for tx_extra_loki_name_system and use it 2020-02-13 11:07:47 +11:00
Doyle
528e41bec1 Cleanup pass 2 for github 2020-02-13 11:07:47 +11:00
Doyle
075c97b27f Expose the wallet public ed25519 key in on_get_address and address cmd 2020-02-13 11:07:46 +11:00
Doyle
cf1d8adc67 Avoid serializing the prev_txid in LNS extra if not needed 2020-02-13 11:07:46 +11:00
Doyle
8d532e470a Scope the DB transaction around the settings table update as well 2020-02-13 11:07:46 +11:00
Doyle
42567b711c Support pop_blocks for LNS DB.
We allow arbitrary reorganizations for the LNS DB by storing the
previous TXID that purchased the LNS record. When reorganizing, we
iterate back through the blockchain looking for the first LNS entry that
is before the reorganize height and revert the LNS entry to that record.
2020-02-13 11:07:46 +11:00
Doyle
c4a9c7ab20 Add txid/prev_txid into LNS db for rollbacks 2020-02-13 11:07:46 +11:00
Doyle
e050b53c66 Ensure lns_value has sufficient size buffer, remove unused prototype 2020-02-13 11:07:46 +11:00
Doyle
394d587c2c Remove vendored SQLite, rely on system installed lib 2020-02-13 11:07:46 +11:00
Doyle
cb579a1dec Robustify sql transactions, formalise LNS values maximums 2020-02-13 11:07:46 +11:00