Commit Graph

17 Commits

Author SHA1 Message Date
Jason Rhinelander 13409ad00e
run clang format 2023-04-13 17:15:12 -03:00
Sean Darcy c95806223d blobs for keys in db 2023-03-15 09:13:18 +11:00
Jason Rhinelander c9934b9f5f
Change most oxen::log::whatever to log::whatever
oxen::log::info(...), etc. are a bit too verbose; this simplifies them
to just `log::info(...)`, etc. by aliasing the `oxen::log` namespace
into most of the common namespaces we use in core.

This result is usage that is shorter but also reads better:

    oxen::log::info(logcat, "blah: {}", 42);

    log::info(logcat, "blah: {}", 42);
2022-10-17 13:41:43 -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
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 d3684f6b44
Add iterable `prepared_results<T...>`
This gives back an iterator that lets you step through results as
tuples without having to executeStep() + get<...> yourself.
2022-05-26 15:06:12 -03:00
Jason Rhinelander 02d8e0aefc
Improve prepared interface; fix test suite bug
Add a `prepared_bind` that lets you get a prepared statement and bind
parameters to it in one shot.

Add comments to the prepared_* methods.

Fix test suite bug in sqlite testing wrapper added in the earlier
prepared statement commit: it was selecting values from the current
(new, empty) database rather than the passed-in one.
2022-05-26 13:57:01 -03:00
Jason Rhinelander 5b25671c4f
Split up sqlitedb into a compiled unit
Lessens the compilation load of various things that include the header,
and lets us avoid having to include all of fmt when we include it.
2022-05-24 17:36:24 -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
Thomas Winget f67c0f8c4b refactor wallet3 db usage
db usage all now abstracted rather than having sql lying around everywhere.

fix a couple minor bugs in tx construction logic.
2022-03-28 22:24:29 -04: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
Jason Rhinelander 25285dacc1 Use fs::path instead of std::filesystem
This uses the ghc filesystem backport when targetting older mac, and
std::filesystem everywhere else.
2021-10-27 10:36:51 -03:00
Thomas Winget a255889286 minor fixups in sqlitedb wrapper 2021-10-16 22:32:32 -04:00
Thomas Winget e12f8dc518 fix some bugs in sqlitedb abstraction.
also set BUSY timeout for internal sqlite lib to 5 seconds
2021-10-15 17:21:44 -04:00
Thomas Winget 640adb7aca fix missing include in sqlitedb
also add "maybe get" function to Database class
2021-10-13 20:29:35 -04:00
Thomas Winget df07ae3e40 require sqlite foreign_key ON 2021-10-04 22:26:33 -04:00
Thomas Winget 435c189a9b sqlitecpp 2021-10-04 20:33:24 -04:00