Commit Graph

462 Commits

Author SHA1 Message Date
Jason Rhinelander 6f0c74ab9b
Bump oxen-encoding for header include fix 2023-04-13 17:15:13 -03:00
Jason Rhinelander d6b59ecfae
Update oxen-logging for macos build fix 2022-12-21 17:59:11 -04:00
Jason Rhinelander b51972f296
Strip project build dir from logs 2022-12-16 13:49:17 -04:00
Sean Darcy bd6b4f1e7b option to exclude making pybind on android and windows by default 2022-12-06 11:25:19 +11:00
Sean Darcy 172093fbbf wallet3 cli
This introduces wallet3 cli to the codebase, build using python and
wraps the c++ wallet3 core using pybind.
2022-12-06 08:10:31 +11:00
Jason Rhinelander 7eb357971b
Make sure we are using fmt/spdlog submodules for static builds
Otherwise we can end up linking against libfmt and/or libspdlog
2022-10-17 13:45:23 -03:00
Jason Rhinelander 5806fd7825
Change simple fmt::format calls to new "..."_format(...) 2022-10-17 13:45:22 -03:00
Jason Rhinelander eb4c9ca52d
Dep updates
- oxenmq requires >= .13 for the fmt header
- update oxen-logging with cmake build fix and text style support
2022-10-17 13:41:12 -03:00
Jason Rhinelander 469a6ebdb6
Bump oxen-logging to stable release; fix imported fmt/spdlog targets
The tagged 1.0.0 release includes a fix for the fmt::fmt/spdlog::spdlog
targets not being transitively available.  (It does require a cmake
version bump to 3.13, though, to make it work).
2022-10-17 13:41:12 -03:00
Sean Darcy d7992b5940
Logging Refactor
This replaces the current epee logging system with our oxen::log
library. It replaces the easylogging library with spdlog, removes the
macros and replaces with functions and standardises how we call the
logs.
2022-10-17 13:41:10 -03:00
Jason Rhinelander 2bd874e0b5
Merge remote-tracking branch 'tewinget/wallet3' into dev 2022-09-01 18:56:14 -03:00
Jason Rhinelander 600fb3aa96
Dependency/submodule updates 2022-08-31 12:46:53 -03:00
Thomas Winget b3a3461f92 submodule fix after merge 2022-07-25 22:18:14 -04:00
Thomas Winget 1311a20e9f merge dev branch with RPC/wallet3 changes
Incomplete, many things to fix, some annotated with
a comment MERGEFIX
2022-07-11 20:40:50 -04:00
Jason Rhinelander 6b785958b4
Clean up sys-or-submodule code, support system fmt, rename loki-mq
Synced up with oxen-storage-server.

Also rename loki-mq submodule to oxen-mq.
2022-05-30 15:59:03 -03:00
Jason Rhinelander 636ee3f622
Replace boost::endian conversion with oxenc 1.0.3
1.0.3 got some endian fixes that lets us avoid boost::endian everywhere.
2022-05-24 17:35:59 -03:00
Sean Darcy 866691d9d8 Batching of service node rewards
This updates the coinbase transactions to reward service nodes
periodically rather than every block. If you recieve a service node
reward this reward will be delayed x blocks, if you receive another
reward to the same wallet before those blocks have been completed it
will be added to your total and all will be paid out after those x
blocks has passed.

For example if our batching interval is 2 blocks:

Block 1 - Address A receives reward of 10 oxen - added to batch
Block 2 - Address A receives reward of 10 oxen - added to batch
Block 3 - Address A is paid out 20 oxen.

Batching accumulates a small reward for all nodes every block

The batching of service node rewards allows us to drip feed rewards
to service nodes. Rather than accruing each service node 16.5 oxen every
time they are pulse block leader we now reward every node the 16.5 /
num_service_nodes every block and pay each wallet the full amount that
has been accrued after a period of time (Likely 3.5 days).

To spread each payment evenly we now pay the rewards based on the
address of the recipient. This modulus of their address determines which
block the address should be paid and by setting the interval to our
service_node_batching interval we can guarantee they will be paid out
regularly and evenly distribute the payments for all wallets over this
2022-04-29 09:51:14 +10:00
Jason Rhinelander 47ff596533
Remove UPnP support
We have disabled uPnP by default for nearly a year now (#1423) with no
adverse affects; this commit finishes it off entirely, removing it from
the codebase.

Fixes #1419 -- see discussion in that issue for why UPnP really doesn't
add much utility to Oxen.
2022-04-14 14:34:49 -03:00
Jason Rhinelander 330638361e
Downgrade cpr to 1.7.2
1.8.0 requires a very recent version of curl, which breaks on buster and
bionic; there's nothing added in 1.8.x that we need anyway.
2022-04-14 14:34:49 -03:00
Jason Rhinelander cf1ee25220
cpr header build fix 2022-04-14 14:34:49 -03:00
Jason Rhinelander 9d58a07260
Update submodules to latest stable versions 2022-04-14 14:32:02 -03:00
Jason Rhinelander 6fcfd0b8ba
Update oxenmq to latest oxen-mq+oxen-encoding
All the encoding parts move to oxen-encoding recently; this updates to
the latest version of oxen-mq, adds oxen-encoding, and converts
everything to use oxenc headers rather than the oxenmq compatibility
shims.
2022-04-14 14:32:01 -03:00
Thomas Winget ecb62e8fab Wallet3 squashed initial commit
tx scanning for basic transactions working
  - TODO: subadresses.  The scanning code is there, but it does not
  currently know/care about any subaddresses.

daemon comms for basic syncing working

(multi-)wallet sync more or less working properly
  - seem to have a dangling shared_ptr somewhere when removing a wallet from
  daemon comms, so not working perfectly yet.

Lots of TODOs and cleanup needed, as well as further features of course.
2021-11-30 16:31:54 -05:00
Thomas Winget 18016ded02 rebase fixups 2021-11-01 17:27:44 -04:00
Jason Rhinelander 671a8ba0fe RPC: SUBMIT_TRANSACTION new rpc update
- Rename endpoint from "send_raw_transaction" to "submit_transaction"
  and rename the RPC struct similarly.

- Rename tx_as_hex to just tx, and start accepting it as hex, base64, or
  raw bytes.  (Transactions formats are consistent enough that we can
  easily tell which one we have from the first couple bytes).

- Drop `do_not_relay` parameter as I can see no purpose to ever
  submitting a transaction to a daemon that shouldn't be relayed.  (The
  only use I can see would be to try to exploit a PoW network with
  double-spends).

- Drop `do_sanity_checks` parameter; the checks done here should be (and
  are!) done by the wallet, not the oxend receiving the completed
  transaction.
2021-11-01 17:08:56 -04:00
Jason Rhinelander 7b871e97fc Add fmtlib::fmt backport of C++20 std::format
Because I'm tired of waiting for std::format.
2021-11-01 17:03:47 -04:00
Jason Rhinelander cb6a7d0b60 Fix nlohmann submodule 2021-11-01 14:54:21 -04:00
Jason Rhinelander 1f16daf109 Replace epee C date crap with C++20 date backport 2021-11-01 14:54:18 -04:00
Jason Rhinelander 02f1b5b982 Add nlohmann-json submodule 2021-11-01 14:53:52 -04:00
Jason Rhinelander ebc8bc79e5 RPC: GET_SERVICE_NODES & GET_SERVICE_NODE_STATUS
Converts request parsing and result generation for get_service_nodes and
get_service_node_status.

Note that there are some significant changes here (due to no longer
having to be under epee's output constraints) that significantly reduce
the size of an all-service-nodes request by nearly half, most notably in
a significantly more compact representation of vote/participation
results.

- added a "decomm_reasons" which decomposes the reason codes into string
  values such as:

    "decomm_reasons": {
        "all": ["uptime"],
        "some": ["pulse", "lokinet"]
    }
- reworded/fixed/expanded various field descriptions
- Various Loki currency references changed to OXEN
- added "operator_fee" which is a rounded operator fee expressed as
  thousanths of a percent (e.g.  100000 means 100%, 4567 means 4.567%).
  This is inaccurate but much easier to deal with than the raw
  portions_for_operator value (especially because the value *usually*
  exceeds what can be stored in a double, and thus is not safe with
  various JSON parsers).
- added "swarm" which is a hex string representation of the swarm_id,
  because swarm_id also isn't double-storage safe.
- reserved and total_reserved fields are now only included if they are
  actually different from the amount/total_contributed values.
- various uptime-proof-dependent values (like versions, public ip,
  ports) are now omitted if we haven't received an uptime proof yet.
- Flipped inverted descriptions of timestamp participation / synced
  values in the RPC documentation.
- checkpoint/pulse/timecheck/timesync participations data is completely
  redesigned to be less bloated; the names are now changed to
  "checkpoint_votes" and "pulse_votes" and information is returned much
  more compactly using lists of lists and/or plain values rather than
  lists of dicts that repeat a ton of fields.
- Renamed timestamp_participation in the RPC to quorumnet_tests since,
  although we're doing the test for time checking, the main purpose of
  the participation is to see that we can reach them.  As above, the
  result value is significantly more compact: [SUCCESS,FAILS] instead of
  an array of dicts.
- Similarly renamed timesync_status to timesync_tests ("status" was
  fine, but changing the value completely to [SUCCESS,FAILS] warrants a
  name change).
- dropped the "as_json" field because it is asking oxend to
  double-encode json, and that is retarded.
- also applies all the same refactoring to get_service_node_status
  (which is really just a shortcut for getting the current node's status
  out of get_service_nodes).
- overhauled how "fields" works to take a list of field names (the dict
  is name: bool values is still supported for backwards compatibility).
  Also extended fields to handle "locked_contributions" as a supported
  field (so that you can easily omit it, since it often isn't cared
  about).
2021-11-01 14:53:10 -04:00
Jason Rhinelander f66ff340aa Update oxenmq to latest dev (needed for inproc rpc support) 2021-11-01 14:19:27 -04:00
Thomas Winget 4ed8ae2614 bump SQLiteCpp submodule version -- should fix mac 2021-10-06 20:01:34 -04:00
Thomas Winget 73e787a9ec sqlitecpp cmake nonsense 2021-10-06 19:36:46 -04:00
Thomas Winget 435c189a9b sqlitecpp 2021-10-04 20:33:24 -04:00
Jason Rhinelander eefd42f93f Add fmtlib::fmt backport of C++20 std::format
Because I'm tired of waiting for std::format.
2021-09-02 17:25:13 -03:00
Jason Rhinelander aafd0a6282 Update gtest 2021-07-06 16:31:07 -03:00
Jason Rhinelander e5bc4e31c4 Clean up pkg-config use
- Convert pkg-config library finding to use IMPORTED_TARGET rather than
the old hacky way of using multiple variables.

- Remove libunbound finding from external (it gets set up already in the
root CMakeLists.txt)

- Remove libzmq searching since we no longer directly depend on it
(except through oxenmq).
2021-05-12 11:59:22 -03:00
Jason Rhinelander c789fd5d77 Remove dead DEPENDS code
We dropped the contrib/depends build system quite a while ago (because
it was nasty), but there are still various DEPENDS checks scattered
through cmake that are just dead code now.  This removes them.
2021-05-12 10:46:57 -03:00
Jason Rhinelander 6adb9f8ac2 Don't build libuv on ios 2021-04-21 22:03:19 -03:00
Jason Rhinelander 7ea286f332 Dep update: miniupnpc to 2.2.2 2021-04-21 01:19:33 -03:00
Jason Rhinelander aa6426451b Dep update: oxenmq to 1.2.5 2021-04-21 01:19:33 -03:00
Jason Rhinelander 82414b29e8 Dep update: libuv to 1.41.0 2021-04-21 01:19:33 -03:00
Jason Rhinelander 6e386813be Dep update: ghc::filesystem v1.5.4 2021-04-21 01:19:33 -03:00
Jason Rhinelander fa1605ca41 Dep update: cpr to 1.6.0 2021-04-21 01:19:33 -03:00
Jason Rhinelander 9c13076c5c Dep update: uWebSockets to 19.2.0 2021-04-21 01:19:33 -03:00
Jason Rhinelander 0a60b69ef0 Update randomx with arm64 patch 2021-02-16 18:56:15 -04:00
Jason Rhinelander 466a1317d2 Rename lokimq -> oxenmq 2021-01-14 19:35:00 -04:00
Jason Rhinelander e285cf0af1 Update dependencies to latest stable versions
I tried to update protobuf as well, but it doesn't compile on mingw, so
leave it as-is for now.
2021-01-06 19:30:08 -04:00
Jason Rhinelander daaa8dbefd Lots of build hacks for iOS 2020-11-04 15:06:59 -04:00
Jason Rhinelander a1674fb521 Downgrade libuv to 1.38.1
1.39 and 1.40 will not build on iOS.
2020-11-04 12:11:20 -04:00