Commit graph

7488 commits

Author SHA1 Message Date
Doyle
436c4b7797
Fix warnings on Mac, evaluation order and uninit var (#1080) 2020-03-17 13:01:14 +11:00
Jason Rhinelander
9e3328877d
Bump version to 7.1.0 for final release (#1082)
Also bumps up the required lokinet version to 0.7.0.
2020-03-17 13:01:03 +11:00
Jason Rhinelander
1942020a7c
Eliminate superfluous new top block info logs (#1079)
This eliminates superfluous info logs:

    Sync data returned a new top block candidate: blah blah

Blink changed the logic here to not early return when we already have
the remote's top block because we may need to sync blinks even if the
top block is the same, but then resulted in lots of the above info
messages whenever we sync up with a new peer (even if the peer has no
new blocks for us).

This restores it to the 5.x behaviour where we only want to display the
info if we don't have the remote's block.
2020-03-17 12:03:27 +11:00
Jason Rhinelander
5b4bc1687d libwallet needs to link to openssl
I'm not sure exactly when this is strictly needed -- only the debian
stretch build had a linking failure while sid and buster were fine
without it.  There is some SSL code happening in the wallet, though, so
it seems correct to have it.
2020-03-15 21:31:24 -03:00
Jason Rhinelander
e615133621 Loki zmq.hpp indirectly through lokimq.h
Many linux systems have a severely outdated zmq.hpp which we don't want;
lokimq includes an up-to-date one (which it loads locally, avoiding the
system one).
2020-03-15 20:20:07 -03:00
Doyle
575cab3454
Merge pull request #1075 from Doy-lee/LNSStoreWalletAddress
LNS: Store wallet addresses in LNS DB
2020-03-16 10:13:22 +11:00
Doyle
5b5a74842b LNS: Use hex_to_pod on crypto primitive instead of generic_signature
Moving generic_signature out of crypto, I deleted some of the helper
macros EPEE_TYPE_IS_SPANNABLE and CRYPTO_MAKE_HASHABLE which let
hex_to_pod behave correctly on generic_signature. Instead opt for
putting signature into the ed25519 primitive.

We static assert that the size is the same as crypto::signature.
2020-03-16 09:34:59 +11:00
Doyle
28cecfe558 LNS: Serialize owner if not specified, use subaddress keys if possible
- Also fix a subtle bug that use to always default a the wallet's spend
key in update mappings even if no owner or backup owner was specified
for update.
2020-03-16 09:34:59 +11:00
Doyle
2d8c2ba7ef LNS: Print out owners using the to_string() instead of operator bool() 2020-03-16 09:34:59 +11:00
Doyle
826b5d04ac LNS: s/owner/address, we now store wallet addresses or ed keys 2020-03-16 09:34:59 +11:00
Jason Rhinelander
97cc0fdc2b
Merge pull request #1057 from darcys22/calculate-total-burnt-loki
Calculate total burnt loki
2020-03-15 14:34:58 -03:00
Jason Rhinelander
743d4e60ce Various linking and build fixes
- updating to latest loki-mq (1.0.0 + various linking fixes)
- BUILD_SHARED_LIBS was being handled very strangely; make it a full
option instead (defaulting to off) that a cmake invoker can specify, as
per cmake recommendations.
- travis ci tweaks/changes:
  - Add a static bionic build
  - Simplify cmake argument code
  - Add `--version` invocation for lokid and loki-wallet-cli to test
    that the binaries were linked properly.
- always build an embedded sodium statically; if we do it dynamically
and an older system one exists we are going to have trouble.
- don't force epee and blocks to be static; rather they get controlled
by the above BUILD_SHARED_LIBS, just like all the other internal
libraries.
- use some PkgConfig:: imported targets rather than bunch-of-variables.
2020-03-15 14:29:47 -03:00
Jason Rhinelander
10f73f01dc Fix C-ism causing warning 2020-03-15 13:27:15 -03:00
Sean Darcy
a9a03af126 serialize the response 2020-03-13 07:56:01 +00:00
Doyle
02c581168c LNS: Update documentation to say wallet addresses are valid for owners 2020-03-13 16:16:50 +11:00
Doyle
0112974dda LNS: Store wallet addresses to DB
- Renames generic_key->generic_owner
- Move generic_owner and generic_signature out of crypto.h because they
aren't really crypto items, rather composition of crypto primitives.
generic_owner also needs access to account_public_address, while that is
just 2 public keys, I've decided to include cryptonote_basic.h into
tx_extra.h instead of crypto.h.
- Some generic_owner helper functions were moved into
cryptonote_basic/format_utils as they need to avoid circular
dependencies between cryptonote_core/cryptonote_basic had I included
generic_owner/generic_signature into loki_name_system.h
- Utilise the normal serialize macros since tx_extra.h already includes
the serializing headers.
2020-03-13 16:07:14 +11:00
Jason Rhinelander
1fe5889d24
Add missing checkpoints dep to cryptonote_core (#1074)
The missing dep caused a linking failure while building debs.
2020-03-13 15:42:29 +11:00
Sean Darcy
837afd916b Add burn amount to rpc get_coinbase_tx_sum 2020-03-13 03:58:34 +00:00
Doyle
b95c1cb1fd
Merge pull request #1072 from Doy-lee/LNSNameValidationUpdate
LNS: Revise name validation on client side
2020-03-13 13:58:21 +11:00
Doyle
22e51bca1c LNS: Lowercase names at the boundary between LNS and user code 2020-03-13 13:46:45 +11:00
Doyle
6a0043ad00
Merge pull request #1069 from Doy-lee/Version700
Valiant Vidar 7.0.0
2020-03-13 13:27:58 +11:00
Doyle
100281edb8 LNS: Disable localhost.loki, disallow '_'s in lokinet 2020-03-13 09:24:47 +11:00
Sean Darcy
788d81e24e Calculate total burnt loki
Adds the total burnt loki as a return value to the
get_coinbase_tx_sum as it will commonly be used in relation to the
other variables.
2020-03-12 09:53:24 +00:00
Doyle
266654cfd9 LNS: Remove parse_lns_name from CLI wallet 2020-03-12 16:52:16 +11:00
Doyle
ea38dc0fe4 LNS: Disconnect rpc query if name is invalid for type 2020-03-12 16:51:41 +11:00
Doyle
6b981eb0a8 LNS: Update client side name validation
- Disallow spaces
- Allow underscores for Session/Wallet names

In summary

SESSION or WALLET
Name has to start with a (alphanumeric or underscore), and can have
(alphanumeric, hyphens or underscores) in between and must end with
a (alphanumeric or underscore)

LOKINET
Domain has to start with an alphanumeric, and can have (alphanumeric or
hyphens) in between, the character before the suffix <char>'.loki' must
be alphanumeric followed by the suffix '.loki'
2020-03-12 16:51:41 +11:00
Doyle
8c3985a6ad
Merge pull request #1071 from Doy-lee/RemoveWalletEdKey
LNS: Remove the wallet's ed25519 key, we support wallet addresses
2020-03-12 16:47:23 +11:00
Doyle
82ed16cd1d LNS: Remove the wallet's ed25519 key, we support wallet addresses 2020-03-12 12:16:35 +11:00
Doyle
ce2716ed48 Avoid serializing hashes if null, add null operator to crypto::hash 2020-03-12 12:05:48 +11:00
Doyle
b45bc64911 Display (none) correctly for empty owners and prev_txid 2020-03-12 11:50:29 +11:00
Doyle
fc0f6f8899 LNS size check after eating all arguments (potential null ptr deref) 2020-03-12 11:49:04 +11:00
Doyle
558a5d53c3 Accept wallet address for LNS buy/querying for type safety
We still pull out the spend public key, in a future coming PR we will
take the entire wallet address as to improve the usability of LNS.
Said PR will also accept subaddresses which should work out of the box
as long as we use the correct secret key of said subaddress to generate
the required signature.
2020-03-12 11:48:06 +11:00
Doyle
c433a15b8a Min uptime version=7.0.0, centralise defn to other version vars 2020-03-12 10:47:24 +11:00
Doyle
d2c250dc6c Update version name and value to 7.0.0 2020-03-12 09:47:04 +11:00
Doyle
c5b8988057
Merge pull request #1051 from Doy-lee/LokiNameServiceGranularUpdateTX
Loki Name Service: Update TX, allow individual field updates
2020-03-11 22:59:45 +11:00
doyle
99ebd16d06 Move operator<<(stream, tx_extra_loki_name_system) above check_condition 2020-03-11 21:29:08 +11:00
Doyle
b74a5c1c08 LNS: Print name hash when requesting names to owners
LNS: Don't display quotes around name hash
2020-03-11 18:46:15 +11:00
Doyle
28a040e547
Merge pull request #1061 from jagerman/block-reward-lrc6
Change block reward for HF15 & 16 as per LRC-6
2020-03-11 18:36:58 +11:00
Jason Rhinelander
32d84f92a8
Add testnet HF-15 fork height (#1066) 2020-03-11 17:27:35 +11:00
Doyle
5d50feb2f3
Merge pull request #1064 from jagerman/blink-fix
Blink fix
2020-03-11 17:05:29 +11:00
Maxim Shishmarev
8153f1a71b
Bump min storage server version requirement to 2.0.0 (#1065) 2020-03-11 17:01:44 +11:00
Jason Rhinelander
b963731715 Fix blink test coin generation
The --regtest/fakechain mode that blink uses no longer generates enough
mining rewards to submit blink registrations under the LRC-6 change
(with HF16 mining rewards ta 0).  This commit changes two things:

- fakechain now goes hf7-8-9-...-16 instead of jumping immediately from
hf7 to hf16 at height 2; this ensures that there are *some* mining
rewards (before hf16) that can be used to register SNs and thus get
additional rewards.

- the registration logic is adapted to work with the more blocks needed
under HF16 SN rewards before submitting registrations.
2020-03-11 02:23:44 -03:00
Jason Rhinelander
4ff472f9f1 quorumnet blink fix: reply using a ConnectionID instead of pubkey
ConnectionID's are loki-mq's (new from quorumnet) way of replying to a
specific connection; replying by pubkey now only works for service
nodes, while sending via ConnectionID is designed to work for any
connections.

The existing code was using the pubkey, which failed to send a reply
from the blink quorum when the initiator was not itself a service node.
2020-03-11 02:21:55 -03:00
Jason Rhinelander
d9a3afdd54
gcc is (correctly) throwing a misleading indent warning here (#1063)
Fix with braces.
2020-03-11 15:31:10 +11:00
Jason Rhinelander
1e7b6612c1 Add HF16 miner fee = 1 sat temporary hack
We'll come back and fix this by properly dropping the miner tx when we
actually implement the HF16 changes.
2020-03-10 23:58:39 -03:00
Doyle
146b6327f1 Add type check to polymorphic keys/signatures
I opted for just a enum instead of pulling in mapbox::variant for
simplicity. mapbox::variant saves a few lines of code for easily
capturing the type at assignment, whereas here we have helper functions
for assigning type.
2020-03-11 13:53:14 +11:00
Jason Rhinelander
e496c27f2f Remove unused functions 2020-03-10 23:28:22 -03:00
Maxim Shishmarev
5cdf090539
Add storage server lokimq port (#1056)
* Add storage server lokimq port

* Don't hash storage lmq port until HF15

* Parse storage lmq port from ping
2020-03-11 12:35:36 +11:00
Doyle
7be1ff5a32 Fix rebase bugs 2020-03-11 10:58:05 +11:00
Doyle
f900cd0382 Rewrite error reporting to use check_condition 2020-03-11 10:58:05 +11:00