Commit graph

45 commits

Author SHA1 Message Date
Doyle 5f0c146e07 Mask the name by hashing using sodium's blake2b 2020-03-06 16:25:21 +11:00
Doyle 77cda2ad48
Merge pull request #1055 from jagerman/lokimq
Change quorumnet to use loki-mq
2020-03-06 15:57:47 +11:00
Jason Rhinelander c98688fd84 Convert quorumnet to loki-mq
This adds the loki-mq dependency and replaces SNNetwork with it (along
with some syntax updates for how loki-mq changed a bit from SNNetwork).

This also replaces common/hex.h and common/string_view.h with loki-mq's
faster (hex) and more complete and tested (string_view) implementations.
2020-03-06 00:36:57 -04:00
Doyle 7f4572cc1f Move out economic related constants/functions to loki_economy
Add TODO for staking requirement/block reward as they require giving
acccess to loki::exp2/loki::round, till post testnet cleanup.
2020-03-05 11:11:02 +11:00
Doyle d6dc29bb5a LNS: Test all lokinet year expirations, take string by val in lowercase_string 2020-03-05 10:15:57 +11:00
Doyle cbc0740f43 LNS: Allow multi-year registration for lokinet entries 2020-02-25 12:56:42 +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 1197ae9635 Add RPC calls for updating lns tx 2020-02-20 10:08:38 +11: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 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
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 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 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
Doyle 91d9783487 Turn plain enums into enum-struct in loki name system 2020-02-13 11:07:46 +11:00
Doyle 4e09eda234 Be consistent with identifier quoting in SQLite 2020-02-13 11:07:46 +11:00
Doyle 70979fbeba Fix requirement to 30, and actually do the atomic step 2020-02-13 11:07:46 +11:00
Doyle 1093bab034 Send LNS values as blobs to the blockchain 2020-02-13 11:07:46 +11:00
Doyle cb955c1952 Fix travis CI complaint about mapping_type not declared 2020-02-13 11:07:46 +11:00
Doyle 2962e27400 Update LNS burn to 15 loki, add tests to check burns 2020-02-13 11:07:46 +11:00
Doyle 9f3c97881e Force all incoming LNS txs to represent values as hex in the name->value mapping 2020-02-13 11:07:46 +11:00
Doyle cc2e65db49 Improve error messaging for LNS txes 2020-02-13 11:07:46 +11:00
Doyle 632f6a6e83 Rebase fix, blink_lns -> blink, v15 and reserve types for protocol 2020-02-13 11:07:46 +11:00
Doyle 0b3df6c5ad Remove owner signature from loki name service tx extra
We want to allow people to buy LNS entries on behalf of other users. If
this is the case we don't need signatures to verify that the purchaser
knows the secret key. What we actually want in this scenario is that,
there's a LNS entry, and people can voluntarily pay to renew/buy that.
2020-02-13 11:07:46 +11:00
Doyle 766ea613ed Implement rpc, get_mappings_by_user 2020-02-13 11:07:46 +11:00
Doyle b78587c7b1 Handle duplicate LNS txs that are not checkpointed yet 2020-02-13 11:07:46 +11:00
Doyle 4340813d4b Check duplicate LNS entries via the name not the value 2020-02-13 11:07:46 +11:00
Doyle 7d259d47ff Verify LNS burn amounts and fix up tests to use burns 2020-02-13 11:07:46 +11:00
Doyle aedd3675e7 Add lokinet domain name validation 2020-02-13 11:07:46 +11:00
Doyle c19dad418b Formatting: loki_name_system_db -> loki_name_system, cold_sign_tx arg const 2020-02-13 11:07:46 +11:00
Renamed from src/cryptonote_core/loki_name_system_db.cpp (Browse further)