Commit graph

10483 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
5cbb595395
Merge pull request #1076 from jagerman/allow-system-liblokimq
Allow linking to a system-installed lokimq
2020-03-15 14:30:57 -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
a53b9fff22 Allow linking to a system-installed lokimq
It makes the debs easier (especially on the older distributions) to
package it separately.
2020-03-15 13:27:15 -03:00
Jason Rhinelander
dc29d66ed7 Set OPENSSL_LIBRARIES hack for bundled libunbound 2020-03-15 13:27:15 -03:00
Jason Rhinelander
4e57bfed1f Eliminate warnings from unknown warning flags on apple clang 2020-03-15 13:27:15 -03:00
Jason Rhinelander
10f73f01dc Fix C-ism causing warning 2020-03-15 13:27:15 -03:00
Jason Rhinelander
10ff717ef9 Update qnet-ping to support direct port pings 2020-03-14 16:41:01 -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
8ceeb0276f
Merge pull request #1073 from Doy-lee/DockerV700Jagerman
Dockerfile updates for v7.0.0
2020-03-13 13:27:35 +11:00
Doyle
8b724d3327 Update loki-mq submodule 2020-03-13 11:01:35 +11:00
Doyle
120f37ebdf Replace ARG NPROC with invoke $(nproc) directly, remove unbound hack
- ARG is a build time variable that you must pass in via docker build
--build-arg NPROC=<number>. What we want is if NPROC is not set, use
$(nproc) otherwise use NPROC passed via command line. You can't do this,
even with setting ENV, because it can't evaluate commands at runtime.

Exporting commands via RUN, only persist for that RUN command as each
RUN sets up a containerized ENV, so you'd have to run an if/else check
for each RUN. There are other hacky work-arounds like writing $(nproc)
to a file and reading it if NPROC isn't passed but all of this is more
trouble than its worth.

When we have an issue with needing to restrict the -j param on make, we
can use one of the workarounds.

- Change openssl to just vanilla make and make install_sw, currently as
is doesn't work in the container, reports make error.
2020-03-13 11:00:34 +11:00
Doyle
933c16b92d Docker static build hacks/fixes for Valiant Vidar
- use kitware upstream cmake instead of building it from source
- use NPROC everywhere
- upgrade openssl to 1.1.1d
- don't install libzmq (just let loki-mq build it)
- boost 1.72
- various tweaks to build parameters to speed up/correct build a bit
2020-03-13 11:00:34 +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
8172b499e0
Merge pull request #1070 from Doy-lee/AcceptWalletAddressForLNSClientSide
LNS: Accept wallet address for lns on the client side
2020-03-12 16:47:12 +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
2df6809214
Remove unused gpg_keys (#1068) 2020-03-12 10:54:13 +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
46e3868725
Merge pull request #1067 from Doy-lee/BlockRewardTestFixes
Block reward change fixes for core_tests
2020-03-11 18:39:09 +11:00
Doyle
77e1b0e135 Add workaround for non-existent miner fee in HF16
HF16 removes the miner fee. This breaks a lot of assumptions in the
testing code which blanket mines are bunch of blocks to fund the miner
wallet which we use throughout the test.

Instead, on tests that require use of hardforks later than HF16, the
generated hard-fork table allocates at least 60 blocks prior to the
block reward changes in HF15 and 16. The 60 blocks was chosen as it's
the largest number of blocks that tests use to accumulate funds for the
miner meaning all tests should continue working with this change.

We could also opt for generating a Service Node for the default miner so
that they get funds, but this brough up additional testing suite errors.
In the interest of time, this is the least intrusive but working way to
get tests running for the upcoming hard fork.
2020-03-11 18:37:41 +11:00