Commit graph

845 commits

Author SHA1 Message Date
Jason Rhinelander 0b62b33e09 Misc. wording/typo fixes 2020-08-17 02:54:45 -03:00
Jason Rhinelander ef91df6af0 Rename stagenet to devnet 2020-08-17 02:54:43 -03:00
Jason Rhinelander 8bf3f00c03 RPC block & transaction improvements
- Add opt-in tx-extra parsing to `get_transactions`; this now lets you
  get most tx details (including service node tx info) via the RPC.
- Add ability for RPC block header requests to include a list of tx
  hashes contained in the block.
- remove long-deprecated txs_as_hex from `get_transactions`: this
  essentially doubled the length of requests since txs[i].as_hex has the
  exact same data.  Despite this being the "new" format for several
  years, wallet code was still relying on the "old" format.  Since 8.x
  already breaks the RPC, this seems a good time to remove it.
- Significantly cleaned up and documented how pruned transactions
  results are returned in GET_TRANSACTIONS.  Previously it was fairly
  uncertain when you'd get a pruned or unpruned transaction.  (See
  comments added in core_rpc_server_commands_defs.h)
- Stop returning the transaction data hex values when you ask for
  `decode_as_json`.  The documentation already implied you don't get
  it, but you do, and this is virtually always just wasted extra data
  when you're asking for the json-decoded value.
- fix miner txes being treated in the RPC as pruned transactions (they
  aren't: they just have no prunable data).
- Made a bunch of `get_transactions` fields (including virtually all of
  the new parsed tx-extras fields) into std::optional's so that the keys
  aren't included when the values are empty.
- Fix bug in `get_transactions` that raised an exception if *some* (but
  not all) of the requested transactions were missed.  Previously you
  could only get all-missed, all-found, or an exception.
2020-08-17 02:47:43 -03:00
Jason Rhinelander 08d2c68a4a Add hidden/ignored old zmq-rpc options
They do nothing, but are accepted so that lokid still works if they are
provided by an older caller (such as the GUI wallet).
2020-08-07 21:17:45 -03:00
Jason Rhinelander fb0aff57f6 Replace epee http client with curl-based client
In short: epee's http client is garbage, standard violating, and
unreliable.

This completely removes the epee http client support and replaces it
with cpr, a curl-based C++ wrapper.  rpc/http_client.h wraps cpr for RPC
requests specifically, but it is also usable directly.

This replacement has a number of advantages:

- requests are considerably more reliable.  The epee http client code
  assumes that a connection will be kept alive forever, and returns a
  failure if a connection is ever closed.  This results in some very
  annoying things: for example, preparing a transaction and then waiting
  a long tim before confirming it will usually result in an error
  communication with the daemon.  This is just terribly behaviour: the
  right thing to do on a connection failure is to resubmit the request.

- epee's http client is broken in lots of other ways: for example, it
  tries throwing SSL at the port to see if it is HTTPS, but this is
  protocol violating and just breaks (with a several second timeout) on
  anything that *isn't* epee http server (for example, when lokid is
  behind a proxying server).

- even when it isn't doing the above, the client breaks in other ways:
  for example, there is a comment (replaced in this PR) in the Trezor PR
  code that forces a connection close after every request because epee's
  http client doesn't do proper keep-alive request handling.

- it seems noticeably faster to me in practical use in this PR; both
  simple requests (for example, when running `lokid status`) and
  wallet<->daemon connections are faster, probably because of crappy
  code in epee.  (I think this is also related to the throw-ssl-at-it
  junk above: the epee client always generates an ssl certificate during
  static initialization because it might need one at some point).

- significantly reduces the amount of code we have to maintain.

- removes all the epee ssl option code: curl can handle all of that just
  fine.

- removes the epee socks proxy code; curl can handle that just fine.
  (And can do more: it also supports using HTTP/HTTPS proxies).

- When a cli wallet connection fails we know show why it failed (which
  now is an error message from curl), which could have all sorts of
  reasons like hostname resolution failure, bad ssl certificate, etc.
  Previously you just got a useless generic error that tells you
  nothing.

Other related changes in this PR:

- Drops the check-for-update and download-update code.  To the best of
my knowledge these have never been supported in loki-core and so it
didn't seem worth the trouble to convert them to use cpr for the
requests.

- Cleaned up node_rpc_proxy return values: there was an inconsistent mix
  of ways to return errors and how the returned strings were handled.
  Instead this cleans it up to return a pair<bool, val>, which (with
  C++17) can be transparently captured as:

    auto [success, val] = node.whatever(req);

  This drops the failure message string, but it was almost always set to
  something fairly useless (if we want to resurrect it we could easily
  change the first element to be a custom type with a bool operator for
  success, and a `.error` attribute containing some error string, but
  for the most part the current code wasn't doing much useful with the
  failure string).

- changed local detection (for automatic trusted daemon determination)
  to just look for localhost, and to not try to resolve anything.
  Trusting non-public IPs does not work well (e.g. with lokinet where
  all .loki addresses resolve to a local IP).

- ssl fingerprint option is removed; this isn't supported by curl
  (because it is essentially just duplicating what a custom cainfo
  bundle does)

- --daemon-ssl-allow-chained is removed; it wasn't a useful option (if
  you don't want chaining, don't specify a cainfo chain).

- --daemon-address is now a URL instead of just host:port.  (If you omit
  the protocol, http:// is prepended).

- --daemon-host and --daemon-port are now deprecated and produce a
  warning (in simplewallet) if used; the replacement is to use
  --daemon-address.

- --daemon-ssl is deprecated; specify --daemon-address=https://whatever
  instead.

- the above three are now hidden from --help

- reordered the wallet connection options to make more logical sense.
2020-08-07 17:14:03 -03:00
Jason Rhinelander 42a7e83c33 Replace epee http rpc server with uWebSockets
This replaces the NIH epee http server which does not work all that well
with an external C++ library called uWebSockets.  Fundamentally this
gives the following advantages:

- Much less code to maintain
- Just one thread for handling HTTP connections versus epee's pool of
threads
- Uses existing LokiMQ job server and existing thread pool for handling
the actual tasks; they are processed/scheduled in the same "rpc" or
"admin" queues as lokimq rpc calls.  One notable benefit is that "admin"
rpc commands get their own queue (and thus cannot be delayed by long rpc
commands).  Currently the lokimq threads and the http rpc thread pool
and the p2p thread pool and the job queue thread pool and the dns lookup
thread pool and... are *all* different thread pools; this is a step
towards consolidating them.
- Very little mutex contention (which has been a major problem with epee
RPC in the past): there is one mutex (inside uWebSockets) for putting
responses back into the thread managing the connection; everything
internally gets handled through (lock-free) lokimq inproc sockets.
- Faster RPC performance on average, and much better worst case
performance.  Epee's http interface seems to have some race condition
that ocassionally stalls a request (even a very simple one) for a dozen
or more seconds for no good reason.
- Long polling gets redone here to no longer need threads; instead we
just store the request and respond when the thread pool, or else in a
timer (that runs once/second) for timing out long polls.

---

The basic idea of how this works from a high level:

We launch a single thread to handle HTTP RPC requests and response data.
This uWebSockets thread is essentially running an event loop: it never
actually handles any logic; it only serves to shuttle data that arrives
in a request to some other thread, and then, at some later point, to
send some reply back to that waiting connection.  Everything is
asynchronous and non-blocking here: the basic uWebSockets event loop
just operates as things arrive, passes it off immediately, and goes back
to waiting for the next thing to arrive.

The basic flow is like this:

    0. uWS thread -- listens on localhost:22023
    1. uWS thread -- incoming request on localhost:22023
    2. uWS thread -- fires callback, which injects the task into the LokiMQ job queue
    3. LMQ main loop -- schedules it as an RPC job
    4. LMQ rpc thread -- Some LokiMQ thread runs it, gets the result
    5. LMQ rpc thread -- Result gets queued up for the uWS thread
    6. uWS thread -- takes the request and starts sending it
       (asynchronously) back to the requestor.

In more detail:

uWebSockets has registered has registered handlers for non-jsonrpc
requests (legacy JSON or binary).  If the port is restricted then admin
commands get mapped to a "Access denied" response handler, otherwise
public commands (and admin commands on an unrestricted port) go to the
rpc command handler.

POST requests to /json_rpc have their own handler; this is a little
different than the above because it has to parse the request before it
can determine whether it is allowed or not, but once this is done it
continues roughly the same as legacy/binary requests.

uWebSockets then listens on the given IP/port for new incoming requests,
and starts listening for requests in a thread (we own this thread).
When a request arrives, it fires the event handler for that request.
(This may happen multiple times, if the client is sending a bunch of
data in a POST request).  Once we have the full request, we then queue
the job in LokiMQ, putting it in the "rpc" or "admin" command
categories.  (The one practical different here is that "admin" is
configured to be allowed to start up its own thread if all other threads
are busy, while "rpc" commands are prioritized along with everything
else.)  LokiMQ then schedules this, along with native LokiMQ "rpc." or
"admin." requests.

When a LMQ worker thread becomes available, the RPC command gets called
in it and runs.  Whatever output it produces (or error message, if it
throws) then gets wrapped up in jsonrpc boilerplate (if necessary), and
delivered to the uWebSockets thread to be sent in reply to that request.

uWebSockets picks up the data and sends whatever it can without
blocking, then buffers whatever it couldn't send to be sent again in a
later event loop iteration once the requestor can accept more data.
(This part is outside lokid; we only have to give uWS the data and let
it worry about delivery).

---

PR specifics:

Things removed from this PR:

1. ssl settings; with this PR the HTTP RPC interface is plain-text.  The
previous default generated a self-signed certificate for the server on
startup and then the client accepted any certificate.  This is actually
*worse* than unencrypted because it is entirely MITM-readable and yet
might make people think that their RPC communication is encrypted, and
setting up actual certificates is difficult enough that I think most
people don't bother.

uWebSockets *does* support HTTPS, and we could glue the existing options
into it, but I'm not convinced it's worthwhile: it works much better to
put HTTPS in a front-end proxy holding the certificate that proxies
requests to the backend (which can then listen in restricted mode on
some localhost port).  One reason this is better is that it is much
easier to reload and/or restart such a front-end server, while
certificate updates with lokid require a full restart.  Another reason
is that you get an error page instead of a timeout if something is wrong
with the backend.  Finally we also save having to generate a temporary
certificate on *every* lokid invocation.

2. HTTP Digest authentication.  Digest authentication is obsolete (and
was already obsolete when it got added to Monero).  HTTP-Digest was
originally an attempt to provide a password authentication mechanism
that does not leak the password in transit, but still required that the
server know the password.  It only has marginal value against replay
attacks, and is made entirely obsolete by sending traffic over HTTPS
instead.  No client out there supports Digest but *not* Basic auth, and
so given the limited usefulness it seems pointless to support more than
Basic auth for HTTP RPC login.

What's worse is that epee's HTTP Digest authentication is a terrible
implementation: it uses boost::spirit -- a recursive descent parser
meant for building complex language grammars -- just to parse a single
HTTP header for Digest auth.  This is a big load of crap that should
never have been accepted upstream, and that we should get rid of (even
if we wanted to support Digest auth it takes less than 100 lines of code
to do it when *not* using a recursive descent parser).
2020-08-07 17:14:02 -03:00
Jason Rhinelander 3ea01fb5f5 Fix interactive prepare_registration under --regtest
The interactive mode handler for `prepare_registration` didn't properly
detect FAKECHAIN mode and so would show mainnet values in the prompts;
this fixes it to notice FAKECHAIN mode properly.

I did this by just checking the `.nettype` string rather than adding a
new field since fakechain is a dev tool that didn't seem to warrant a
new field in the RPC struct.
2020-08-02 13:17:13 -03:00
Jason Rhinelander 6f3d3edd0d Use string_view for address lookups
Also DRY out a bunch of identical address-from-string code blocks.
2020-07-02 12:52:13 -03:00
Jason Rhinelander c42ee9c831 Miscellaneous string handling cleanups
De-boosts some string handling
2020-07-02 12:52:13 -03:00
Jason Rhinelander 718a9496fb Replace boost chrono & posix_time with stl chrono 2020-07-02 12:52:13 -03:00
Jason Rhinelander 515b96e20b Replace (most) boost::thread with std::thread
This removes some boost thread interruption code, but that code is
highly unlikely to have done anything: you cannot preemptively interrupt
a thread, and pretty much anywhere a thread would get stuck is in I/O,
where boost's (voluntary) thread interruption cannot follow.

It also removes thread attributes because they have really limited
usefulness.  There *was* a reason to introduce them many years ago (when
musl libc ran into a stack limit problem with libunbound) but musl
increased the default stack size long since.
2020-07-02 12:52:13 -03:00
Jason Rhinelander 65a37c65c1 Remove horrible logging macros 2020-07-02 12:52:13 -03:00
Jason Rhinelander 49c693d0a9 Split up common/util.h
common/util.h has become something of a dumping ground of random
functions.  This splits them up a little by moving the filesystem bits
to common/file.h, the sha256sum functions to common/sha256sum.h, and the
(singleton) signal handler to common/signal_handler.h.
2020-07-02 12:52:12 -03:00
Jason Rhinelander 96354a0e0f boost::optional -> std::optional 2020-07-02 12:52:12 -03:00
Jason Rhinelander 60c56b39a6 Avoid value truncation warning
STAKING_PORTIONS doesn't fit in a double, and so clang is warning about
the precision loss.  Be explicit about double cast to avoid this
warning.
2020-06-09 23:06:54 -03:00
Doyle a1dd3d54ca Propagate fakechain for integration tests 2020-06-05 13:45:41 +10:00
Doyle 469e6bc583 output_blacklist: Remove redundant return, report exception 2020-06-02 15:50:27 +10:00
Doyle 10bc1753e6 Merge commit 'b1808c9' into MergeUpstream3 2020-05-28 15:39:47 +10:00
Doyle d84679e269 Merge commit '5e492c4cbcf966d8e73601358d35d70eb75bb4ca' into MergeUpstream3 2020-05-27 17:17:46 +10:00
Doyle dc5175c4eb Fix merge mistakes 2020-05-27 16:57:39 +10:00
Doyle 7c07a3e8f3 Merge commit '8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7' into MergeUpstream3 2020-05-27 15:40:27 +10:00
Doyle 5be250d124 Manual merge rpc version command from dad4cf121e
We want the RPC addition but not the regex additions.
2020-05-27 14:18:53 +10:00
Doyle 12076c3f3e Merge commit '8cc7d5b6c0c611dd03eba21c9cc7a9a043fa7b04' into MergeUpstream3 2020-05-25 16:08:05 +10:00
Doyle 0f818c929b Merge commit 'f253bf3' into MergeUpstream3 2020-05-25 15:17:47 +10:00
Doyle c750797304 Merge commit 'f6da34c02853e04405a50d973dc984ce768ca473' into MergeUpstream3 2020-05-25 14:07:52 +10:00
Doyle 72085b20d7 Merge commit 'bb2bcf35216b819778fe09cee328e7acc2f680cf' into MergeUpstream3 2020-05-25 13:49:06 +10:00
Doyle 1391f35ef0 Merge commit 'dc64fcb8a6c046c6e30665a6217b8fb6ec2471bc' into MergeUpstream3 2020-05-22 11:25:15 +10:00
Doyle 69a3dd1a93 Merge commit 'b52620800100063ffac771e98101ae10fb5a3fbd' into MergeUpstream3 2020-05-21 15:45:45 +10:00
Doyle c3ad8177c1 Merge commit 'cdbb225da3c1698d102b0d686333a995af8a6329' into MergeUpstream3 2020-05-21 14:16:20 +10:00
Doyle d4d3f6d1ab Merge commit '063eebbd434d25fc7880edfd31d33d602b9ff306' into MergeUpstream3 2020-05-21 13:58:43 +10:00
Doyle e3e3990fa8 Merge commit '15dabf7d18244ec5e592f2ad4cfe49495c4d1c80' into MergeUpstream3 2020-05-21 13:38:08 +10:00
Doyle 15fd7f8200 Merge branch 'dev' into MergeUpstream3 2020-05-20 14:59:12 +10:00
Jason Rhinelander 44d6715d56 Make suspend_readline a (usable) no-op when readline not available
This moves all the conditional HAVE_READLINE into once place rather than
scattering it everywhere we want to suspend readline.  (Since the class
does nothing the compiler can trivially optimize it away when we don't
have readline).
2020-05-20 00:48:59 -03:00
Jason Rhinelander b1cad5ced9 Simplify readline linking
Link readline directly into epee; having a separate epee_readline
library is not saving anything since we have it widely linked anyway.
Conditionally linking it to epee simplifies a bit of CMake code.

Also simplify how epee detects cmake to just look for a `readline`
target, which we now only set up if we find readline in the top-level
CMakeLists.txt
2020-05-20 00:47:38 -03:00
Doyle f65d67da86 console_handler: Log errors properly, gracefully shut down wallet
- In simplewallet, we don't report invalid/missing commands to the
CLI because we throw and catch errors that are logged silently. Now we
always log the to the user unless it's thrown by something other than
the wallet.

- Add invalid_command exception to distinguish between an error thrown
by the console_handler (i.e. missing/empty command) versus an actual
std::out_of_range thrown by wallet code (previously would have
incorrectly reported "Unknown command ... ", when it was a known command).

- Catch exceptions thrown via commands sent by RPC over the terminal and
shut down the wallet properly.

- In console_handler don't react to cmd_handler failing. Previously, if
a command failed it'd assume invalid command and log or try the next
branch which was detecting application exit.
2020-05-20 12:27:22 +10:00
Doyle ba471f3a7e Fix dev merge to upstream branch 2020-05-18 14:44:42 +10:00
Doyle 184183f309 Merge branch 'dev' into MergeUpstream2 2020-05-18 12:58:59 +10:00
Jason Rhinelander 2f174345b7 Pass some args by lvalue reference 2020-05-11 18:45:15 -03:00
Jason Rhinelander 0e3f173c7f RPC overhaul
High-level details:

This redesigns the RPC layer to make it much easier to work with,
decouples it from an embedded HTTP server, and gets the vast majority of
the RPC serialization and dispatch code out of a very commonly included
header.

There is unfortunately rather a lot of interconnected code here that
cannot be easily separated out into separate commits.  The full details
of what happens here are as follows:

Major details:
- All of the RPC code is now in a `cryptonote::rpc` namespace; this
  renames quite a bit to be less verbose: e.g. CORE_RPC_STATUS_OK
  becomes `rpc::STATUS_OK`, and `cryptonote::COMMAND_RPC_SOME_LONG_NAME`
  becomes `rpc::SOME_LONG_NAME` (or just SOME_LONG_NAME for code already
  working in the `rpc` namespace).
- `core_rpc_server` is now completely decoupled from providing any
  request protocol: it is now *just* the core RPC call handler.
- The HTTP RPC interface now lives in a new rpc/http_server.h; this code
  handles listening for HTTP requests and dispatching them to
  core_rpc_server, then sending the results back to the caller.
- There is similarly a rpc/lmq_server.h for LMQ RPC code; more details
  on this (and other LMQ specifics) below.
- RPC implementing code now returns the response object and throws when
  things go wrong which simplifies much of the rpc error handling.  They
  can throw anything; generic exceptions get logged and a generic
  "internal error" message gets returned to the caller, but there is
  also an `rpc_error` class to return an error code and message used by
  some json-rpc commands.
- RPC implementing functions now overload `core_rpc_server::invoke`
  following the pattern:

    RPC_BLAH_BLAH::response core_rpc_server::invoke(RPC_BLAH_BLAH::request&& req, rpc_context context);

  This overloading makes the code vastly simpler: all instantiations are
  now done with a small amount of generic instantiation code in a single
  .cpp rather than needing to go to hell and back with a nest of epee
  macros in a core header.
- each RPC endpoint is now defined by the RPC types themselves,
  including its accessible names and permissions, in
  core_rpc_server_commands_defs.h:
  - every RPC structure now has a static `names()` function that returns
    the names by which the end point is accessible.  (The first one is
    the primary, the others are for deprecated aliases).
  - RPC command wrappers define their permissions and type by inheriting
    from special tag classes:
    - rpc::RPC_COMMAND is a basic, admin-only, JSON command, available
      via JSON RPC.  *All* JSON commands are now available via JSON RPC,
      instead of the previous mix of some being at /foo and others at
      /json_rpc.  (Ones that were previously at /foo are still there for
      backwards compatibility; see `rpc::LEGACY` below).
    - rpc::PUBLIC specifies that the command should be available via a
      restricted RPC connection.
    - rpc::BINARY specifies that the command is not JSON, but rather is
      accessible as /name and takes and returns values in the magic epee
      binary "portable storage" (lol) data format.
    - rpc::LEGACY specifies that the command should be available via the
      non-json-rpc interface at `/name` for backwards compatibility (in
      addition to the JSON-RPC interface).
- some epee serialization got unwrapped and de-templatized so that it
  can be moved into a .cpp file with just declarations in the .h.  (This
  makes a *huge* difference for core_rpc_server_commands_defs.h and for
  every compilation unit that includes it which previously had to
  compile all the serialization code and then throw all by one copy away
  at link time).  This required some new macros so as to not break a ton
  of places that will use the old way putting everything in the headers;
  The RPC code uses this as does a few other places; there are comments
  in contrib/epee/include/serialization/keyvalue_serialization.h as to
  how to use it.
- Detemplatized a bunch of epee/storages code.  Most of it should have
  have been using templates at all (because it can only ever be called
  with one type!), and now it isn't.  This broke some things that didn't
  properly compile because of missing headers or (in one case) a messed
  up circular dependency.
- Significantly simplified a bunch of over-templatized serialization
  code.
- All RPC serialization definitions is now out of
  core_rpc_server_commands_defs.h and into a single .cpp file
  (core_rpc_server_commands_defs.cpp).
- core RPC no longer uses the disgusting
  BEGIN_URI_MAP2/MAP_URI_BLAH_BLAH macros.  This was a terrible design
  that forced slamming tons of code into a common header that didn't
  need to be there.
- epee::struct_init is gone.  It was a horrible hack that instiated
  multiple templates just so the coder could be so lazy and write
  `some_type var;` instead of properly value initializing with
  `some_type var{};`.
- Removed a bunch of useless crap from epee.  In particular, forcing
  extra template instantiations all over the place in order to nest
  return objects inside JSON RPC values is no longer needed, as are a
  bunch of stuff related to the above de-macroization of the code.
- get_all_service_nodes, get_service_nodes, and get_n_service_nodes are
  now combined into a single `get_service_nodes` (with deprecated
  aliases for the others), which eliminates a fair amount of
  duplication.  The biggest obstacle here was getting the requested
  fields reference passed through: this is now done by a new ability to
  stash a context in the serialization object that can be retrieved by a
  sub-serialized type.

LMQ-specifics:

- The LokiMQ instance moves into `cryptonote::core` rather than being
  inside cryptonote_protocol.  Currently the instance is used both for
  qnet and rpc calls (and so needs to be in a common place), but I also
  intend future PRs to use the batching code for job processing
  (replacing the current threaded job queue).
- rpc/lmq_server.h handles the actual LMQ-request-to-core-RPC glue.
  Unlike http_server it isn't technically running the whole LMQ stack
  from here, but the parallel name with http_server seemed appropriate.
- All RPC endpoints are supported by LMQ under the same names as defined
  generically, but prefixed with `rpc.` for public commands and `admin.`
  for restricted ones.
- service node keys are now always available, even when not running in
  `--service-node` mode: this is because we want the x25519 key for
  being able to offer CURVE encryption for lmq RPC end-points, and
  because it doesn't hurt to have them available all the time.  In the
  RPC layer this is now called "get_service_keys" (with
  "get_service_node_key" as an alias) since they aren't strictly only
  for service nodes.  This also means code needs to check
  m_service_node, and not m_service_node_keys, to tell if it is running
  as a service node.  (This is also easier to notice because
  m_service_node_keys got renamed to `m_service_keys`).
- Added block and mempool monitoring LMQ RPC endpoints: `sub.block` and
  `sub.mempool` subscribes the connection for new block and new mempool
  TX notifications.  The latter can notify on just blink txes, or all
  new mempool txes (but only new ones -- txes dumped from a block don't
  trigger it).  The client gets pushed a [`notify.block`, `height`,
  `hash`] or [`notify.tx`, `txhash`, `blob`] message when something
  arrives.

Minor details:
- rpc::version_t is now a {major,minor} pair.  Forcing everyone to pack
  and unpack a uint32_t was gross.
- Changed some macros to constexprs (e.g. CORE_RPC_ERROR_CODE_...).
  (This immediately revealed a couple of bugs in the RPC code that was
  assigning CORE_RPC_ERROR_CODE_... to a string, and it worked because
  the macro allows implicit conversion to a char).
- De-templatizing useless templates in epee (i.e. a bunch of templated
  types that were never invoked with different types) revealed a painful
  circular dependency between epee and non-epee code for tor_address and
  i2p_address.  This crap is now handled in a suitably named
  `net/epee_network_address_hack.cpp` hack because it really isn't
  trivial to extricate this mess.
- Removed `epee/include/serialization/serialize_base.h`.  Amazingly the
  code somehow still all works perfectly with this previously vital
  header removed.
- Removed bitrotted, unused epee "crypted_storage" and
  "gzipped_inmemstorage" code.
- Replaced a bunch of epee::misc_utils::auto_scope_leave_caller with
  LOKI_DEFERs.  The epee version involves quite a bit more instantiation
  and is ugly as sin.  Also made the `loki::defer` class invokable for
  some edge cases that need calling before destruction in particular
  conditions.
- Moved the systemd code around; it makes much more sense to do the
  systemd started notification as in daemon.cpp as late as possible
  rather than in core (when we can still have startup failures, e.g. if
  the RPC layer can't start).
- Made the systemd short status string available in the get_info RPC
  (and no longer require building with systemd).
- during startup, print (only) the x25519 when not in SN mode, and
  continue to print all three when in SN mode.
- DRYed out some RPC implementation code (such as set_limit)
- Made wallet_rpc stop using a raw m_wallet pointer
2020-05-11 18:44:45 -03:00
Jason Rhinelander 52838aa5b2 "Remove namespace pollution" << ENDL
Removes all "using namespace epee;" and "using namespace std;" from the
code and fixes up the various crappy places where unnamespaced types
were being used.

Also removes the ENDL macro (which was defined to be `std::endl`)
because it is retarded, and because even using std::endl instead of a
plain "\n" is usually a mistake (`<< std::endl` is equivalent to `<<
"\n" << std::flush`, and that explicit flush is rarely desirable).
2020-05-11 18:44:45 -03:00
Jason Rhinelander 51b247bfac daemon & daemonize overhaul
This commit continues the complete replacement of the spaghetti code
mess that was inside daemon/ and daemonize/ which started in #1138, and
looked like a entry level Java programmer threw up inside the code base.
This greatly simplifies it, removing a whole pile of useless abstraction
layers that don't actually abstract anything, and results in
considerably simpler code.  (Many of the changes here were also carried
out in #1138; this commit updates them with the merged result which
amends some things from that PR and goes further in some places).

In detail:

- the `--detach` (and related `--pidfile`) options are gone.  (--detach
  is still handled, but now just prints a fatal error).  Detaching a
  process is an archaic unix mechanism that has no place on a modern
  system.  If you *really* want to do it anyway, `nohup lokid &` will do
  the job.  (The Windows service control code, which is probably seldom
  used, is kept because it seems potentially useful for Windows users).

- Many of the `t_whatever` classes in daemon/* are just deleted (mostly
  done in #1138); each one was a bunch of junk code that wraps 3-4 lines
  but forces an extra layer (not even a generic abstraction, just a
  useless wrapper) for no good reason and made the daemon code painfully
  hard to understand and work with.

- All of the remaining `t_whatever` classes in daemon/* are either
  renamed to `whatever` (because prefixing every class with `t_` is
  moronic).

- Some stupid related code (e.g. epee's command handler returning an
  unsuitable "usage" string that has to be string modified into what we
  want) was replaced with more generic, useful code.

- Replaced boost mutexes/cvs with std ones in epee command handler, and
  deleted some commented out code.

- The `--public-node` option handling was terrible: it was being handled
  in main, but main doesn't know anything about options, so then it
  forced it through the spaghetti objects *beside* the pack of all
  options that got passed along.  Moved it to a more sane location
  (core_rpc_server) and parse it out with some sanity.

- Changed a bunch of std::bind's to lambdas because, at least for small
  lambdas (i.e. with only one-or-two pointers for captures) they will
  generally be more efficient as the values can be stored in
  std::function's without any memory allocations.
2020-05-11 18:44:45 -03:00
Jason Rhinelander 14fcc7cad1 Make --help support >80 char width terminals 2020-05-11 18:44:45 -03:00
Jason Rhinelander d3098ce023 Simplify/enhance command_line::is_yes etc.
This uses templates to simplify the is_yes (etc.) functions, also
removing a boost dependency and making them more flexible where callers
sometimes want "is_yes or one of these other truthy strings".
2020-05-11 18:44:45 -03:00
Jason Rhinelander 5fd8939c6a Remove background mining
This was a useless feature to begin with.  According to a Monero
insider, this was introduced at the time with an intention of making it
on-by-default on every monerod instance everywhere, but because that was
such an overwhelmingly stupid idea, it never happened yet all this code
(which is probably used by no one anywhere ever) remains in the code
base.

Even if the idea wasn't dumb to start with, this will also become even
more pointless with pulse, so just drop it (it is over 1000 lines of
code, not even counting the extra headers pulled in to do things like
querying CPU usage and battery status).
2020-05-11 18:44:45 -03:00
Doyle 0bcd895d7a Merge branch 'dev' into MergeUpstream2 2020-05-06 14:06:30 +10:00
Doyle 90360bdcb0 Remove unused variables, remove os-version flag
OS version flag doesn't return the OS it was compiled on, just uname.
2020-04-24 14:19:04 +10:00
Doyle 22d1b76fee Remove optional dependencies from constructor, no code actually uses it 2020-04-24 14:19:04 +10:00
Doyle fa139fb2bc daemon: Remove oop cruft and layers of indirection
Inline everything so daemon initialisation reads more linearly.
2020-04-24 14:14:49 +10:00
Doyle d7f5d6bb74 Merge commit 'e72aca57f968f77e154d145bb462f4917ec16b6b' into MergeUpstream2 2020-04-21 13:23:44 +10:00
Doyle edc1a13601 Merge commit '52cd2fa0aff4d6393e91ebb400c33c2449dd1301' into MergeUpstream2 2020-04-20 16:55:01 +10:00
Doyle 7162902a6d Merge commit '880ebfdeeaceab5e1ca40b748516987e9c6cecb7' into MergeUpstream2 2020-04-20 16:33:56 +10:00
Doyle 66790db9e5 Merge commit '8774555d29a3594d430d1bc7c744ca904f38b389' into MergeUpstream 2020-04-09 16:19:40 +10:00
Doyle 7264c9c3e2 Merge commit '96cda93a9313821a3e82d593218fcd628ade848b' into MergeUpstream 2020-04-09 16:04:42 +10:00
Doyle a897eb6105 Merge commit '9f746b72e289cd0f12c14d9190815fce8e929068' into MergeUpstream 2020-04-09 16:02:56 +10:00
luigi1111 6a6eedd842
Merge pull request #6353
6810150 daemon: if no banned IPs print something (sumogr)
2020-04-04 12:56:36 -05:00
luigi1111 c4f75fe898
Merge pull request #6339
c61abf8 remove empty statements (shopglobal)
2020-04-04 12:47:31 -05: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
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
Jason Rhinelander 5b97ff6e9c cmake modernization
The archaic (i.e. decade old) cmake usage here really got in the way of
trying to properly use newer libraries (like lokimq), so this undertakes
overhauling it considerably to make it much more sane (and significantly
reduce the size).

I left more of the architecture-specific bits in the top-level
CMakeLists.txt intact; most of the efforts here are about properly
loading dependencies, specifying dependencies and avoiding a whole pile
of cmake antipatterns.

This bumps the required cmake version to 3.5, which is what xenial comes
with.

- extensive use of interface libraries to include libraries,
definitions, and include paths

- use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}.  The
interface targets are (again) much better as they also give you any
needed include or linking flags without needing to worry about them.

- don't list header files when building things.  This has *never* been
correct cmake usage (cmake has always known how to wallet_rpc_headers
the headers that .cpp files include to know about build changes).

- remove the loki_add_library monstrosity; it breaks target names and
makes compiling less efficient because the author couldn't figure out
how to link things together.

- make loki_add_executable take the output filename, and set the output
path to bin/ and install to bin because *every single usage* of
loki_add_executable was immediately followed by setting the output
filename and setting the output path to bin/ and installing to bin.

- move a bunch of crap that is only used in one particular
src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead
of the top level CMakeLists.txt (or src/CMakeLists.txt).

- Remove a bunch of redundant dependencies; most of them look like they
were just copy-and-pasted in, and many more aren't needed (since they
are implied by the PUBLIC linking of other dependencies).

- Removed `die` since it just does a FATAL_ERROR, but adds color (which
is useless since CMake already makes FATAL_ERRORs perfectly visible).

- Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the
make targets to daemon and simplewallet rather than changing the build
process (this should make it faster, too, since there are various other
things that will be excluded).
2020-03-06 00:36:57 -04:00
Alexander Blair 4371ac4265
Merge pull request #6225
987c3139 print_coinbase_tx_sum now supports 128 bits sums (moneromooo-monero)
2020-02-28 19:48:11 -08:00
Alexander Blair 4da37daf67
Merge pull request #6211
5985c5af rpc: add bad-blocks to flush_cache RPC (moneromooo-monero)
2020-02-28 19:36:16 -08:00
sumogr 6810150d46 daemon: if no banned IPs print something 2020-02-24 20:52:55 +00:00
Doyle 8aacc33fb1
Rewrite the integration tests to use pipes (#1045) 2020-02-21 14:48:25 +11:00
luigi1111 39e1890276
Merge pull request #6198
5f2a32c daemon: run with -rpc-payment-address and --rpc-restricted-bind-port (moneromooo-monero)
2020-02-19 22:25:44 -05:00
Interchained c61abf87c0 remove empty statements
Cleaning up a little around the code base.
2020-02-17 11:55:15 -05:00
Alexander Blair 8136bf37e2
Merge pull request #6096
a633f85d daemon: allow printing N blocks from the end of the chain (moneromooo-monero)
2020-02-06 00:31:50 -08:00
Alexander Blair b8e5c769c7
Merge pull request #6095
7ba31191 daemon: add +meta print_tx parameter (moneromooo-monero)
2020-02-06 00:31:17 -08:00
Alexander Blair 34d7ea62f6
Merge pull request #6053
deb350b7 always print peer IDs in the same format (moneromooo-monero)
2020-02-06 00:28:47 -08:00
Doyle cef9cdc52c
Merge pull request #986 from Doy-lee/LongPoll
Wallet long polls for transactions in the pool
2020-01-07 17:14:37 +11:00
Doyle 92e5fb0e3f Parameterize the number of long poll connections via rpc-long-poll-connections
Reduce the default to 16 connections
2020-01-07 13:36:07 +11:00
Doyle 136dbd0e4d
Include <stack> in rpc_command_executor, macOSX10.13 failure (#999) 2020-01-07 12:48:51 +11:00
Doyle 6d71d2fd6e Rate limit long polling connections 2020-01-07 12:35:06 +11:00
Doyle 3009f8fff7 Add wallet long polling to wallet-cli 2020-01-07 12:35:06 +11:00
Jason Rhinelander 5d0b568709 Sort print_sn checkpoint votes (#985)
Checkpoint votes internally use a circular buffer, but that's rather
difficult to read for the `print_sn` output; this changes print_sn to
de-circularize the listed votes.
2019-12-17 10:28:26 +10:00
luigi1111 ccde60838b
Merge pull request #6054
017f816 daemon: handle printing higher hash rates (moneromooo-monero)
2019-12-12 13:45:50 -06:00
moneromooo-monero 987c3139dc
print_coinbase_tx_sum now supports 128 bits sums
The tail emission will bring the total above 64 bits
2019-12-12 01:56:59 +00:00
Jason Rhinelander fe2260ea61 Add lokinet ping to RPC and status + status message tweaks
This adds the last lokinet ping time to the second `status` line.  It
also compresses this (and storage server's) ping time format to (for
example) `4.7min` instead of `4.7 minutes ago`.

I also add a few tweaks here to the first line of the status message to
save some space for the most common cases:
- just don't show " on mainnet" at all since that's the common case, and
  instead capitalize "ON TESTNET"/"ON STAGENET" to make it more obvious
  that something is non-default.
- just don't show ", not mining" when not mining
- show the daemon version returned by RPC in addition to the hf version,
  as "vX.Y.Z(net vAA)".  You usually get a version display from an info
  log message when running `lokid version`, but that can be quite
  misleading as it's the local lokid binary version which is not
  necessarily the same version as the running daemon.

Sample output:

SN:

    Height: 174791/174791 (100.0%) ON TESTNET, net hash 455 H/s, v6.0.0(net v14), up to date, 8(out)+12(in) connections, uptime 0d 0h 4m 32s
    SN: ff00062fa69397f5580ac2b3d060064d89edac625c77a58fdcd520f94ea54727 active, proof: (never), last pings: 1.6min (storage), 1.6min (lokinet)

Regular node (while mining):

    Height: 174791/174791 (100.0%) ON TESTNET, mining at 94 H/s, net hash 455 H/s, v6.0.0(net v14), up to date, 8(out)+32(in) connections, uptime 0d 0h 44m 2s
2019-12-04 23:17:49 -04:00
Jason Rhinelander e3e48709b7 Don't show +detail in not found message
Fixes:

    print_sn SOMEPUBKEY +detail

to suppress the `+detail` (or `+json`) from the error message:

    No service node is currently known on the network: 7984cd23f950a52a13199f1ed22c3a396d6eea330b375bd94f6323d8db196953, +detail,

Also fixes a bug in the comma separator logic (see the unwanted
separator above).
2019-12-04 15:31:12 -04:00
Jason Rhinelander a59920fad5 print_sn formatting tweaks & aux pubkeys
- Reformat the Registration details line; I found the formatting really
confusing.  Changes from:

    Registration Hardfork Version | Register/Expiry Height: 14 | 174767 / Staking Infinitely (stake unlock not requested yet)

to:

    Registration: Hardfork Version: 14; Height: 174770; Expiry: Staking Infinitely (stake unlock not requested)

(perhaps not obvious - I also dropped "yet" from the infinite expiry
message to slightly shorten the line as it seemed superfluous).

- add `(Or Penalty)` into last reward value since this value gets reset
  without a reward on IP change penalty and recommissions:

    Last Reward (Or Penalty) At (Height/TX Index): 177529/4294967295

- add Ed25519 and X25519 pubkeys to +detail mode:

    Auxiliary Public Keys:
        729916aa41aaa3f2e729e2f9a5516207c39da30debe8e6d0ae7711a3dcfb0d9d (Ed25519)
        7984cd23f950a52a13199f1ed22c3a396d6eea330b375bd94f6323d8db196953 (X25519)
2019-12-04 15:31:12 -04:00
Doyle 9471db15cc
Merge pull request #912 from Doy-lee/DisablePruning
Disable pruning in Loki, it is not supported yet
2019-12-04 15:36:19 +11:00
Jason Rhinelander 08ff25be94 Use PkgConfig to properly find zmq/sodium
The existing code just assumes it is already in the path, which fails
when it's in some prefixed place with a proper .pc file installed (such
as for a homebrew installation).
2019-12-03 00:51:18 -04:00
Jason Rhinelander f93a0bde3c Fix print_sn sort order
print_sn was only sorting by last block reward and last tx index, but it
needs to also fallback to sorting by pubkey if both are equal (which
can happen with recomms and ip penalties).

(This is cosmetic only for the `print_sn` command).
2019-12-02 18:19:39 -04:00
moneromooo-monero 5985c5afe8
rpc: add bad-blocks to flush_cache RPC
Flushes m_invalid_blocks in Blockchain.
2019-12-02 18:53:30 +00:00
moneromooo-monero 5f2a32c15a
daemon: run with -rpc-payment-address and --rpc-restricted-bind-port 2019-11-29 20:07:01 +00:00
Jason Rhinelander 442f2182d2 Blink synchronization
- Adds blink signature synchronization and storage through the regular
  p2p network
- Adds wallet support (though this is still currently buggy and needs
  additional fixes - it sees the tx when it arrives in the mempool but
  isn't properly updating when the blink tx gets mined.)
2019-11-27 14:09:28 -04:00
Jason Rhinelander 03a6ee5583 DRY pool printing
The only difference between long and short is one string (the json
info).

Also remove std::endl because using it like this indicates that the
author doesn't understand what std::endl is for.

Also removed a completely ridiculous inline lambda.
2019-11-27 14:08:57 -04:00
Jason Rhinelander dd7a4104b5 Blink
This is the bulk of the work for blink.  There is two pieces yet to come
which will follow shortly, which are: the p2p communication of blink
transactions (which needs to be fully synchronized, not just shared,
unlike regular mempool txes); and an implementation of fee burning.

Blink approval, multi-quorum signing, cli wallet and node support for
submission denial are all implemented here.

This overhauls and fixes various parts of the SNNetwork interface to fix
some issues (particularly around non-SN communication with SNs, which
wasn't working).

There are also a few sundry FIXME's and TODO's of other minor details
that will follow shortly under cleanup/testing/etc.
2019-11-27 14:07:52 -04:00
Jason Rhinelander f028cb805d Reduce scope of rpc-specific value
Separation of responsibility: service_nodes doesn't need to store an
rpc-specific value.
2019-11-27 14:07:52 -04:00
Jason Rhinelander 57e64b7d1c Add quorumnet comms
This adds vote relaying via quorumnet.

- The main glue between existing code and quorumnet code is in
  cryptonote_protocol/quorumnet.{h,cpp}
- Uses function pointers assigned at initialization to call into the
  glue without making cn_core depend on p2p
- Adds ed25519 and quorumnet port to uptime proofs and serialization.
- Added a second uptime proof signature using the ed25519 key to that
  SNs are proving they actually have it (otherwise they could spoof
  someone else's pubkey).
- Adds quorumnet port, defaulting to zmq rpc port + 1.  quorumnet
  listens on the p2p IPv4 address (but broadcasts the `public_ip` to the
  network).
- Derives x25519 when received or deserialized.
- Converted service_info_info::version_t into a scoped enum (with the
  same underlying type).
- Added contribution_t::version_t scoped enum.  It was using
  service_info_info::version for a 0 value which seemed rather wrong.

Random small details:
- Renamed internal `arg_sn_bind_port` for consistency
- Moved default stagenet ports from 38153-38155 to 38056-38058, and add the default stagenet
  quorumnet port at 38059 (this keeps the range contiguous; otherwise the next stagenet default port
  would collide with the testnet p2p port).
2019-11-27 14:07:45 -04:00
1point21gigabytes 40946bd92f explicitly specify UTC (#931) 2019-11-25 15:30:12 +11:00
Nathan Dorfman dce6f055f9 rpc: Only show version string if it matches expected pattern 2019-11-12 18:19:24 -07:00
Nathan Dorfman 3293780992 daemon: Use rpc for "version" command 2019-11-12 17:57:36 -07:00
moneromooo-monero a633f85da9
daemon: allow printing N blocks from the end of the chain
It's a very common usage (for my anyway) and avoids the need to
get the current height, paste, subtract one, etc
2019-11-04 17:38:14 +00:00
moneromooo-monero 7ba31191f3
daemon: add +meta print_tx parameter
prints size, weight and (if mined) height
2019-11-04 15:57:56 +00:00
moneromooo-monero 017f816897
daemon: handle printing higher hash rates 2019-10-29 11:33:15 +00:00
moneromooo-monero deb350b783
always print peer IDs in the same format 2019-10-29 11:30:20 +00:00
moneromooo-monero a4dc575ccb
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache,
which will allow debugging a stuck monerod after it has failed to
verify a transaction in a block, since it would otherwise not try
again, making subsequent log changes pointless)
2019-10-25 18:41:54 +00:00
luigi1111 960c215801
Merge pull request #5357
b3a9a4d add a quick early out to get_blocks.bin when up to date (moneromooo-monero)
2899379 daemon, wallet: new pay for RPC use system (moneromooo-monero)
ffa4602 simplewallet: add public_nodes command (moneromooo-monero)
2019-10-25 13:38:21 -05:00
moneromooo-monero 2899379791
daemon, wallet: new pay for RPC use system
Daemons intended for public use can be set up to require payment
in the form of hashes in exchange for RPC service. This enables
public daemons to receive payment for their work over a large
number of calls. This system behaves similarly to a pool, so
payment takes the form of valid blocks every so often, yielding
a large one off payment, rather than constant micropayments.

This system can also be used by third parties as a "paywall"
layer, where users of a service can pay for use by mining Monero
to the service provider's address. An example of this for web
site access is Primo, a Monero mining based website "paywall":
https://github.com/selene-kovri/primo

This has some advantages:
 - incentive to run a node providing RPC services, thereby promoting the availability of third party nodes for those who can't run their own
 - incentive to run your own node instead of using a third party's, thereby promoting decentralization
 - decentralized: payment is done between a client and server, with no third party needed
 - private: since the system is "pay as you go", you don't need to identify yourself to claim a long lived balance
 - no payment occurs on the blockchain, so there is no extra transactional load
 - one may mine with a beefy server, and use those credits from a phone, by reusing the client ID (at the cost of some privacy)
 - no barrier to entry: anyone may run a RPC node, and your expected revenue depends on how much work you do
 - Sybil resistant: if you run 1000 idle RPC nodes, you don't magically get more revenue
 - no large credit balance maintained on servers, so they have no incentive to exit scam
 - you can use any/many node(s), since there's little cost in switching servers
 - market based prices: competition between servers to lower costs
 - incentive for a distributed third party node system: if some public nodes are overused/slow, traffic can move to others
 - increases network security
 - helps counteract mining pools' share of the network hash rate
 - zero incentive for a payer to "double spend" since a reorg does not give any money back to the miner

And some disadvantages:
 - low power clients will have difficulty mining (but one can optionally mine in advance and/or with a faster machine)
 - payment is "random", so a server might go a long time without a block before getting one
 - a public node's overall expected payment may be small

Public nodes are expected to compete to find a suitable level for
cost of service.

The daemon can be set up this way to require payment for RPC services:

  monerod --rpc-payment-address 4xxxxxx \
    --rpc-payment-credits 250 --rpc-payment-difficulty 1000

These values are an example only.

The --rpc-payment-difficulty switch selects how hard each "share" should
be, similar to a mining pool. The higher the difficulty, the fewer
shares a client will find.
The --rpc-payment-credits switch selects how many credits are awarded
for each share a client finds.
Considering both options, clients will be awarded credits/difficulty
credits for every hash they calculate. For example, in the command line
above, 0.25 credits per hash. A client mining at 100 H/s will therefore
get an average of 25 credits per second.
For reference, in the current implementation, a credit is enough to
sync 20 blocks, so a 100 H/s client that's just starting to use Monero
and uses this daemon will be able to sync 500 blocks per second.

The wallet can be set to automatically mine if connected to a daemon
which requires payment for RPC usage. It will try to keep a balance
of 50000 credits, stopping mining when it's at this level, and starting
again as credits are spent. With the example above, a new client will
mine this much credits in about half an hour, and this target is enough
to sync 500000 blocks (currently about a third of the monero blockchain).

There are three new settings in the wallet:

 - credits-target: this is the amount of credits a wallet will try to
reach before stopping mining. The default of 0 means 50000 credits.

 - auto-mine-for-rpc-payment-threshold: this controls the minimum
credit rate which the wallet considers worth mining for. If the
daemon credits less than this ratio, the wallet will consider mining
to be not worth it. In the example above, the rate is 0.25

 - persistent-rpc-client-id: if set, this allows the wallet to reuse
a client id across runs. This means a public node can tell a wallet
that's connecting is the same as one that connected previously, but
allows a wallet to keep their credit balance from one run to the
other. Since the wallet only mines to keep a small credit balance,
this is not normally worth doing. However, someone may want to mine
on a fast server, and use that credit balance on a low power device
such as a phone. If left unset, a new client ID is generated at
each wallet start, for privacy reasons.

To mine and use a credit balance on two different devices, you can
use the --rpc-client-secret-key switch. A wallet's client secret key
can be found using the new rpc_payments command in the wallet.
Note: anyone knowing your RPC client secret key is able to use your
credit balance.

The wallet has a few new commands too:

 - start_mining_for_rpc: start mining to acquire more credits,
regardless of the auto mining settings
 - stop_mining_for_rpc: stop mining to acquire more credits
 - rpc_payments: display information about current credits with
the currently selected daemon

The node has an extra command:

 - rpc_payments: display information about clients and their
balances

The node will forget about any balance for clients which have
been inactive for 6 months. Balances carry over on node restart.
2019-10-25 09:34:38 +00:00
moneromooo-monero 951ceab4f6
daemon: print difficulty in decimal, as it used to be
It got switched to hexadecimal when we went to 128 bit values
2019-10-24 17:37:05 +00:00
luigi1111 f9b5af85ea
Merge pull request #6001
705edd8 daemon: fix coinbase txes always being seen as pruned (moneromooo-monero)
2019-10-24 10:57:30 -05:00
luigi1111 8926829569
Merge pull request #6000
641c9cf daemon: add miner tx hash in print_block output (moneromooo-monero)
2019-10-24 10:56:20 -05:00
Doyle 5ac419ac1a Disable pruning in Loki, it is not supported yet 2019-10-23 13:44:56 +11:00
luigi1111 2c497bc411
Merge pull request #5989
4f583d5 daemon: fix print_pl synopsis missing recent options (moneromooo-monero)
2019-10-22 10:24:09 -05:00
moneromooo-monero 705edd81d9
daemon: fix coinbase txes always being seen as pruned 2019-10-18 12:25:08 +00:00
moneromooo-monero 641c9cf19d
daemon: add miner tx hash in print_block output 2019-10-18 12:21:30 +00:00
moneromooo-monero 4f583d564c
daemon: fix print_pl synopsis missing recent options 2019-10-15 13:35:52 +00:00
Doyle f298a9187f Fix wrong amount in number of blocks to unlock on boundary 2019-10-15 11:54:31 +11:00
Jason Rhinelander 790f0858e8 Change operator fee wording (#879)
The word "reserve" here has apparently led to some registration errors.

Fixes #878
2019-10-09 09:25:40 +11:00
Jason Rhinelander 13f7b7f11e Wait for storage server (#874)
* Fix elapsed time in storage server warning message

This was passing the time value rather than the number of seconds so
basically always printed "a long time" instead of the elapsed time.

* Removed pre-HF12 code

* Wait for storage server before sending proof

On startup we send a proof immediately, but this is misleading to the
operator - they may see a proof broadcast over the network suggesting
everything is good even when the storage server is still down.  This
makes lokid wait for a first ping before the first proof so that the
user doesn't get mislead.

It also adds the storage server last ping into the `lokid status`
message, such as:

    Height: 375634/375634 (100.0%) on mainnet, not mining, net hash 63.00 MH/s, v12, up to date, 1(out)+0(in) connections, uptime 0d 0h 0m 4s
    SN: f4558f60b1c4075e469a15411f12d5a747c1c62b44bcbc8523f1a90becc80475 not registered, s.server: NO PING RECEIVED

or:

    Height: 375663/375663 (100.0%) on mainnet, not mining, net hash 76.17 MH/s, v12, up to date, 1(out)+0(in) connections, uptime 0d 0h 0m 32s
    SN: f4558f60b1c4075e469a15411f12d5a747c1c62b44bcbc8523f1a90becc80475 not registered, s.server: last ping 11 seconds ago
2019-10-08 15:40:11 +11:00
Doyle 413d33a524
Print service node winner, cdifficulty and fix block_weight (#870) 2019-10-08 14:25:57 +11:00
Doyle fd4846134d Print cdifficulty and don't serialize miner tx hash twice 2019-10-07 12:50:05 +11:00
Doyle 73d4821ea8
Clarify some error message wording, don't print quorum failures early (#858)
You don't want to report your node as failing locally if you can't be
voted on in that quorum (i.e. you re-registered quickly after
deregistration and still exist in the old quorums)
2019-09-25 14:08:19 +10:00
luigi1111 06bee964a8
Merge pull request #5878
f9b3f6e Removed Berkeley DB and db switching logic (JesusRami)
2019-09-24 10:10:28 -05:00
Jason Rhinelander 9ae112ab48 Show "(never)" instead of 18163.1 days ago
The uptime proof time in `status` wasn't handling a 0 value propery.
2019-09-23 23:39:03 -03:00
Jason Rhinelander ccaff4268a Show one-line SN summary in status
This adds the pubkey, current status, and last uptime proof on a second
line of output in the `status` command (if a service node and we can
query the SN info successfully).
2019-09-23 18:47:59 -03:00
Doyle 16ba84413b Report portential decomission and recommission for your node
When processing a quorum for a block, if you are not in the quorum to
validate other nodes, check if you're a node that is going to be tested.
If you are, check based on your current data if you're potentially
a candidate to be decommissioned/deregistered and if so report it to the
console log.

Note that this is only a heuristic and ultimately the decision lies on
what the the other Service Nodes perceive the current state of your node
is (i.e. if they're acting malicious then you will be deregistered
irrespectively).
2019-09-19 17:46:21 +10:00
Doyle c41bfbdfe4 Add +detail to print_sn|print_n_status, display checkpoint and reachability 2019-09-19 17:42:19 +10:00
Jesus Ramirez f9b3f6ef3b Removed Berkeley DB and db switching logic 2019-09-16 16:18:05 +02:00
luigi1111 b526208001
Merge pull request #5868
1f1fff2 daemon: print mining algorithm in mining_status even when not mining (moneromooo-monero)
2019-09-14 13:10:51 -05:00
luigi1111 d30b234f08
Merge pull request #5849
b51f4cd daemon: add pruned and publicrpc flags to print_pl (moneromooo-monero)
2019-09-08 19:59:05 -05:00
luigi1111 21290005d7
Merge pull request #5840
063eebb daemon: implement 'set_bootstrap_daemon' command (xiphon)
2019-09-08 19:46:03 -05:00
luigi1111 da4512639e
Merge pull request #5830
5a4c6cc daemon: fix merge error removing the 'never seen before' timestamp check (moneromooo-monero)
2019-09-08 19:40:29 -05:00
moneromooo-monero 1a367d6a22
simplewallet: lock console on inactivity 2019-08-28 19:01:48 +00:00
moneromooo-monero 1f1fff2679
daemon: print mining algorithm in mining_status even when not mining 2019-08-28 15:55:31 +00:00
Jason Rhinelander 0350ccfc9a Switch to per-byte + per-output fees, reduce max multiplier
This switches loki 5.x to use a fee formula of

    SIZE * PER_BYTE + OUTPUTS * PER_OUTPUT

where we reduce the PER_BYTE fee back to what it was in 3.x; and with
the PER_OUTPUT fee set to 0.02 LOKI.  This compares to the 4.x fee of:

    SIZE * PER_BYTE * 80

(the *80 multiple was introduced in 4.x).

It also reduces the multiplier for the maximum priority level to 125
instead of 1000 because 1000 produced uselessly high tx fees.  The new
multipliers go up 5x at each level: {1, 5, 25, 125} while previously
they went {1, 5, 25, 1000}.

As for the base change: we added the *80 multiplier in 4.x because we
wanted to make a theoretical de-anonymizing tx spam attack more costly.
The unanticipated consequence was that we also made *large* transactions
(such as sweeps) considerably more costly despite the fact that these
transactions typically only create 2 outputs.

This better captures what we meant to do in 4.x (making output creation
relatively more expensive) without making large txes (e.g. sweeps
required for staking) highly expensive.

The end effect is that the fee for a minimum-sized, 1-input/2-output
transaction should stay roughly the same (slightly over 0.04 LOKI),
while a 100-input/2-output transction (a typical spend or sweep from a
wallet with lots of smaller rewards) will drop in fee by somewhere
around 95%.

The most efficient theoretical deanonymizing tx spamming of this sort
was a 1-input/16-output transaction which will become about 2.5x as
expensive as currently the case in v4.x.
2019-08-26 17:42:30 -03:00
moneromooo-monero b51f4cdcaf
daemon: add pruned and publicrpc flags to print_pl 2019-08-23 19:15:45 +00:00
xiphon 063eebbd43 daemon: implement 'set_bootstrap_daemon' command 2019-08-23 12:09:02 +00:00
moneromooo-monero 5a4c6cc3a8
daemon: fix merge error removing the "never seen before" timestamp check 2019-08-20 12:48:55 +00:00
moneromooo-monero fd60d05d5d
daemon: fix print_pl only printing public zone peers 2019-08-19 23:39:51 +00:00
Doyle 763a6322c7 Update ip to address param change for integration test 2019-08-17 15:11:55 +10:00
luigi1111 48229234a9
Merge pull request #5659
6bb2797 daemon: print 128bit diff properly (stoffu)
2019-08-15 17:17:36 -05:00
Thomas Winget 80be9b1dfa Add IPv6 support
new cli options (RPC ones also apply to wallet):
  --p2p-bind-ipv6-address (default = "::")
  --p2p-bind-port-ipv6    (default same as ipv4 port for given nettype)
  --rpc-bind-ipv6-address (default = "::1")

  --p2p-use-ipv6          (default false)
  --rpc-use-ipv6          (default false)

  --p2p-require-ipv4      (default true, if ipv4 bind fails and this is
                           true, will not continue even if ipv6 bind
                           successful)
  --rpc-require-ipv4      (default true, description as above)

ipv6 addresses are to be specified as "[xx:xx:xx::xx:xx]:port" except
in the cases of the cli args for bind address.  For those the square
braces can be omitted.
2019-08-14 23:05:22 -03:00
moneromooo-monero 78f820b2f5 remove obsolete save_graph skeleton code 2019-08-14 22:28:20 -03:00
moneromooo-monero de1f881b01 allow blocking whole subnets 2019-08-14 22:26:49 -03:00
luigi1111 564bb1da3a
Merge pull request #5525
0605406 daemon: sort alt chains by height (moneromooo-monero)
4228ee0  daemon: add optional arguments to alt_chain_info (moneromooo-monero)
880ebfd daemon: add more chain specific info in alt_chain_info (moneromooo-monero)
2019-08-14 15:31:52 -05:00
moneromooo-monero 13c13bfc2d daemon: fix "never seen before" time span display for peers 2019-08-12 14:51:22 -03:00
Thomas Winget 155475d971
Add IPv6 support
new cli options (RPC ones also apply to wallet):
  --p2p-bind-ipv6-address (default = "::")
  --p2p-bind-port-ipv6    (default same as ipv4 port for given nettype)
  --rpc-bind-ipv6-address (default = "::1")

  --p2p-use-ipv6          (default false)
  --rpc-use-ipv6          (default false)

  --p2p-require-ipv4      (default true, if ipv4 bind fails and this is
                           true, will not continue even if ipv6 bind
                           successful)
  --rpc-require-ipv4      (default true, description as above)

ipv6 addresses are to be specified as "[xx:xx:xx::xx:xx]:port" except
in the cases of the cli args for bind address.  For those the square
braces can be omitted.
2019-07-31 20:04:57 -04:00
stoffu 6bb279710c
daemon: print 128bit diff properly 2019-07-30 05:37:38 -07:00
luigi1111 015c1792c0
Merge pull request #5597
343c0b4 add a command line option to disable ZMQ server (jtgrassie)
2019-07-24 14:26:59 -05:00
luigi1111 8774555d29
Merge pull request #5595
2aa1134 daemon: display peer address type in print_cn (moneromooo-monero)
2019-07-24 14:25:51 -05:00
luigi1111 96cda93a93
Merge pull request #5588
cd720c7 add cumulative difficulty to diff command (wowario)
2019-07-24 14:20:12 -05:00
luigi1111 e241a6280d
Merge pull request #5582
fcfcc3a rpc: in/out peers can now return the setting's value (moneromooo-monero)
2019-07-24 14:18:09 -05:00
luigi1111 5cecf4138b
Merge pull request #5573
c07bbd5 daemon: fix 'never seen before' time span display for peers (moneromooo-monero)
2019-07-24 14:13:33 -05:00
luigi1111 e579fe4ae0
Merge pull request #5530
6abaaaa remove obsolete save_graph skeleton code (moneromooo-monero)
2019-07-24 14:07:29 -05:00
Doyle 09c4f64683
Make cosmetic changes for RPC declarations for the documentation generator (#756)
The doc generator doesn't know how to parse using statements, so upgrade
contributor/contributions to global scope in the RPC definitions file so
it's able to parse it for both service node RPC calls.

The best option will be to eventually deprecate the various ways to
query the network down to 1 call that doesn't duplicate functionality.
2019-07-24 14:19:16 +10:00
Doyle 83e24dd820
Revert to manually serializing checkpoints/quorum (#743)
KV_SERIALIZE doesn't handle non-primitive types well and requires adding
in extra deserialize/reserialize code. It's more straightforward to
manually serialize the output, rather than add serialization overloads.
Furthermore, KV_SERIALIZE doesn't support serializing enums in a sane
way.
2019-07-17 10:04:20 +10:00
moneromooo-monero 65c4004963
allow blocking whole subnets 2019-07-16 11:35:53 +00:00
sachaaaaa 631e3f66fe New print_sn_state_changes command (#727)
* new `print_sn_state_changes` command

* Address reviews

* Fix fetching txs for each blocks

* sentinel value is set to current height - 1
2019-07-15 13:45:09 +10:00
Doyle fb89f670b3
Update print_checkpoints to be integration_test friendly (#723) 2019-07-11 14:17:43 +10:00
Doyle 823627a5ad
Improve print quorum state + rpc update (#709)
* print_quorum_state displays checkpointing quorums, remove batched call

* Update the help text for quorum commands

* <= for the max_quorum_type not <

* Handle heights greater than the latest

* Don't repeatedly add partially filled quorums

* Revert get_quorum_state to take a range (common case)

* Update the help text from print_quorum_state
2019-07-09 13:02:10 +10:00
Doyle d0fb04db46
Improved print_checkpoints + json_rpc get_checkpoints call (#708)
* Improved print_checkpoints

* Flesh out print checkpoints and associated RPC call

* Remove debug print checkpoints

* Update help text for print_checkpoints

* Rewrite to fix num_checkpoints != heights as a unit of measurement

* Use GET_ALL_CHECKPOINTS defined value in get_checkpoints_range

* Let T be deduced in parse_if_present, json_rpc_request not rpc_request
2019-07-05 09:34:51 +10:00
Doyle 0ffd003b15
Remove the update command in the daemon since Loki doesn't implement (#703) 2019-07-02 14:24:56 +10:00
Jason Rhinelander aea751c69f Change monero -> LOKI in expected mining returns (#694) 2019-07-01 10:10:48 +10:00
Doyle 2393843ec2
Move miner.h to fix cn basic referencing core and core referencing basic (#679) 2019-06-27 19:15:58 +10:00
Doyle e6b5ef558a
Service node checkpointing deregistration (#672)
* Add deregistration of checkpoints by checking how many votes are missed

Move uptime proofs and add checkpoint counts in the service_node_list
because we typically prune uptime proofs by time, but it seems we want
to switch to a model where we persist proof data until the node expires
otherwise currently we would prune uptime entries and potentially our
checkpoint vote counts which would cause premature deregistration as the
expected vote counts start mismatching with the number of received
votes.

* Revise deregistration

* Fix test breakages

* uint16_t for port, remove debug false, min votes to 2 in integration mode

* Fix integration build
2019-06-27 17:05:44 +10:00
Doyle 212b859a66 Merge branch 'dev' into LokiMergeUpstream 2019-06-26 15:46:06 +10:00
Doyle fdc340b0ee
Service node checkpointing: rebased on relaxed deregistration (#662)
* core: do not commit half constructed batch db txn

* Add defer macro

* Revert dumb extra copy/move change

* Fix pop_blocks not calling hooks, fix BaseTestDB missing prototypes

* Merge ServiceNodeCheckpointing5 branch, syncing and integration fixes

* Update tests to compile with relaxed-registration changes

* Get back to feature parity pre-relaxed registration changes

* Remove debug changes noticed in code review and some small bugs
2019-06-26 14:00:05 +10:00
Doyle f761ed6345 Merge commit '51766d0' into LokiMergeUpstream 2019-06-26 12:43:21 +10:00
Jason Rhinelander 6d6541670e Relax deregistration rules
The replaces the deregistration mechanism with a new state change
mechanism (beginning at the v12 fork) which can change a service node's
network status via three potential values (and is extensible in the
future to handle more):

- deregistered -- this is the same as the existing deregistration; the
SN is instantly removed from the SN list.
- decommissioned -- this is a sort of temporary deregistration: your SN
remains in the service node list, but is removed from the rewards list
and from any network duties.
- recommissioned -- this tx is sent by a quorum if they observe a
decommissioned SN sending uptime proofs again.  Upon reception, the SN
is reactivated and put on the end of the reward list.

Since this is broadening the quorum use, this also renames the relevant
quorum to a "obligations" quorum (since it validates SN obligations),
while the transactions are "state_change" transactions (since they
change the state of a registered SN).

The new parameters added to service_node_rules.h control how this works:

    // Service node decommissioning: as service nodes stay up they earn "credits" (measured in blocks)
    // towards a future outage.  A new service node starts out with INITIAL_CREDIT, and then builds up
    // CREDIT_PER_DAY for each day the service node remains active up to a maximum of
    // DECOMMISSION_MAX_CREDIT.
    //
    // If a service node stops sending uptime proofs, a quorum will consider whether the service node
    // has built up enough credits (at least MINIMUM): if so, instead of submitting a deregistration,
    // it instead submits a decommission.  This removes the service node from the list of active
    // service nodes both for rewards and for any active network duties.  If the service node comes
    // back online (i.e. starts sending the required performance proofs again) before the credits run
    // out then a quorum will reinstate the service node using a recommission transaction, which adds
    // the service node back to the bottom of the service node reward list, and resets its accumulated
    // credits to 0.  If it does not come back online within the required number of blocks (i.e. the
    // accumulated credit at the point of decommissioning) then a quorum will send a permanent
    // deregistration transaction to the network, starting a 30-day deregistration count down.

This commit currently includes values (which are not necessarily
finalized):
- 8 hours (240 blocks) of credit required for activation of a
decommission (rather than a deregister)
- 0 initial credits at registration
- a maximum of 24 hours (720 blocks) of credits
- credits accumulate at a rate that you hit 24 hours of credits after 30
days of operation.

Miscellaneous other details of this PR:

- a new TX extra tag is used for the state change (including
deregistrations).  The old extra tag has no version or type tag, so
couldn't be reused.  The data in the new tag is slightly more
efficiently packed than the old deregistration transaction, so it gets
used for deregistrations (starting at the v12 fork) as well.

- Correct validator/worker selection required generalizing the shuffle
function to be able to shuffle just part of a vector.  This lets us
stick any down service nodes at the end of the potential list, then
select validators by only shuffling the part of the index vector that
contains active service indices.  Once the validators are selected, the
remainder of the list (this time including decommissioned SN indices) is
shuffled to select quorum workers to check, thus allowing decommisioned
nodes to be randomly included in the nodes to check without being
selected as a validator.

- Swarm recalculation was not quite right: swarms were recalculated on
SN registrations, even if those registrations were include shared node
registrations, but *not* recalculated on stakes.  Starting with the
upgrade this behaviour is fixed (swarms aren't actually used currently
and aren't consensus-relevant so recalculating early won't hurt
anything).

- Details on decomm/dereg are added to RPC info and print_sn/print_sn_status

- Slightly improves the % of reward output in the print_sn output by
rounding it to two digits, and reserves space in the output string to
avoid excessive reallocations.

- Adds various debugging at higher debug levels to quorum voting (into
all of voting itself, vote transmission, and vote reception).

- Reset service node list internal data structure version to 0.  The SN
list has to be rescanned anyway at upgrade (its size has changed), so we
might as well reset the version and remove the version-dependent
serialization code.  (Note that the affected code here is for SN states
in lmdb storage, not for SN-to-SN communication serialization).
2019-06-23 22:37:53 -03:00
Doyle ed0ef399db
Various integration test fixes (#628)
- Don't try participate in quorums at startup if you are not a service node
- Add lock for when potentially writing to the DB
- Pre-existing batch can be open whilst updating checkpoint so can't use
  DB guards
- Temporarily emit the ban message using msgwriter instead of logs
2019-06-06 14:44:57 +10:00
Maxim Shishmarev d3d8a14df0 Print ip and port with print_sn command (#627) 2019-06-06 13:10:43 +10:00
Doyle 639ab2bf9b
Integration Test: Granular block mining (#625)
* Add debug_mine_singular_block to mine one block at a time for integration tests

* Add workaround for mining thread modifying main thread state causing lock

* Change debug_mine_singular blocks to debug_mine_n_blocks
2019-06-05 12:34:54 +10:00
Jethro Grassie 343c0b4255
add a command line option to disable ZMQ server 2019-06-01 13:03:37 -04:00
moneromooo-monero 880ebfdeea
daemon: add more chain specific info in alt_chain_info 2019-06-01 15:43:52 +00:00
moneromooo-monero 2aa11341fc
daemon: display peer address type in print_cn 2019-05-31 09:10:05 +00:00
moneromooo-monero fcfcc3ac86
rpc: in/out peers can now return the setting's value 2019-05-30 12:13:31 +00:00
wowario cd720c7e0b
add cumulative difficulty to diff command 2019-05-30 11:57:21 +03:00
moneromooo-monero c07bbd5c04
daemon: fix "never seen before" time span display for peers 2019-05-24 10:47:36 +00:00
Lee Clagett 3544596f9f Add ssl_options support to monerod's rpc mode. 2019-05-22 00:09:11 -04:00
Doyle 2649eb79da Merge commit 'ebb1c03' into LokiMergeUpstream 2019-05-17 03:43:06 +10:00
moneromooo-monero 6abaaaa994
remove obsolete save_graph skeleton code 2019-05-10 14:17:18 +00:00
moneromooo-monero 4228ee0b9e
daemon: add optional arguments to alt_chain_info
>N limits display to alt chains with more than N blocks
-N limits display to alt chains younger than N blocks
2019-05-09 09:13:11 +00:00
moneromooo-monero 0605406714
daemon: sort alt chains by height 2019-05-09 09:12:49 +00:00
moneromooo-monero a4c4a2d8aa
blockchain: keep a rolling long term block weight median 2019-05-02 09:47:01 +00:00
Doyle d2d5b74b03 Merge commit '4609b36' into LokiMergeUpstream 2019-05-02 13:22:33 +10:00
Doyle f1a5cd16c0 Merge commit 'c8ce421' into LokiMergeUpstream 2019-05-02 12:59:16 +10:00
Doyle da18d45871 Merge commit 'e98cbfb' into LokiMergeUpstream 2019-05-02 12:28:01 +10:00
Doyle cc0d51078c Merge dev into upstream 2019-05-01 16:01:17 +10:00
moneromooo-monero b0a346689b
daemon: fix absolute/relative log file test for windows 2019-04-16 22:15:36 +00:00
Riccardo Spagni f376cd5605
Merge pull request #5446
7d79222f daemon: remove debug info (moneromooo-monero)
8fec0f98 functional_tests: add sweep_single test (moneromooo-monero)
9880d61b wallet_rpc_server: remove unused code (moneromooo-monero)
8a61b33d rpc: omit irrelevant fields for pool txes in gettransactions (moneromooo-monero)
56508524 rpc: add relayed in get_transaction output (moneromooo-monero)
82e510f1 rpc: set default log category in core_rpc_server.h (moneromooo-monero)
2019-04-16 22:46:29 +02:00
Riccardo Spagni 8af1a89e4c
Merge pull request #5441
b3648232 daemon: fix ratio not being floating point (moneromooo-monero)
e1b097b9 core_rpc_server: remove dummy assigning int to bool (moneromooo-monero)
2019-04-16 22:44:41 +02:00
moneromooo-monero 7d79222f5c
daemon: remove debug info 2019-04-15 22:32:09 +00:00
moneromooo-monero b364823286
daemon: fix ratio not being floating point
Coverity 197648
2019-04-14 09:26:12 +00:00
moneromooo-monero 5140c15e56
daemon: if a log file has a /, interpret it from the cwd
rather than from data dir where it normally is.

It makes things like --log-file ./foo.log behave as you'd expect.
2019-04-13 11:21:08 +00:00
Doyle 4778d862c9 Merge commit 'bd42903' into LokiMergeUpstream 2019-04-12 18:37:56 +10:00
Doyle aded2cef69 Merge commit '1ed6441' into LokiMergeUpstream 2019-04-12 17:44:20 +10:00
Doyle 5162a30621 Merge commit 'c3de019f565674fd19b9d5cafba015d9ea7f69f7' into LokiMergeUpstream 2019-04-12 15:10:33 +10:00
Doyle 6f779e7a3d Merge commit '429930534df43b8bef46a4a39dbfbc3d3b5939b0' into LokiMergeUpstream 2019-04-12 15:06:49 +10:00
Doyle 892469ded1 Update monero copyright to 2019 pre-emptively to make merge simpler 2019-04-12 14:36:43 +10:00
Riccardo Spagni bd429033df
Merge pull request #5378
eda2661a Allow pruning before v10 (moneromooo-monero)
2019-04-11 13:02:35 +02:00
Doyle cdd8243d48 Merge commit 'c83e80c2634f2c14fbd9fe4dbfb6a0abc2eb20ea' into LokiMergeUpstream 2019-04-10 15:36:02 +10:00
Doyle a41bed8a32 Merge branch 'dev' into LokiMergeUpstream 2019-04-10 13:55:30 +10:00
Doyle 4f0a729533 Merge commit '4466f4504e8bc41d353a6becce0526df8272bc1d' into LokiMergeUpstream 2019-04-10 09:59:38 +10:00
Doyle b1c92fd216 Add helper functions to facilitate more reliable integration tests 2019-04-09 15:47:23 +10:00
moneromooo-monero a2561653cb
wallet: new option to start background mining
The setup-background-mining option can be used to select
background mining when a wallet loads. The user will be asked
the first time the wallet is created.
2019-04-04 18:10:45 +00:00
Riccardo Spagni 1ed6441925
Merge pull request #5327
c23ea796 New interactive daemon command 'print_net_stats': Global traffic stats (rbrunner7)
2019-04-01 17:32:01 +02:00
moneromooo-monero eda2661aa2
Allow pruning before v10
This check is now not needed anymore, and would prevent people
from using --prune-blockchain when starting a new sync
2019-04-01 14:06:49 +00:00
Doyle 0919819a9f
Fix incorrectly using staking portions as loki causing incorrect UI (#534) 2019-03-29 16:50:08 +11:00
Doyle 1b07d10493
Prepare registration dust failure minimal fix (#523)
* Add the minimal fix for prepare registration failing by dust amounts

* Add dust redistribution at final step

* Comment and clean up useless lines

* Add fudge factor for dust amounts

* Avoid possible overflow with portions if contributor 1 is insufficient
2019-03-28 18:18:23 +11:00