- Adds script to extract markdown from the rpc comments to build a docs
page suitable for docsify.
- Split up daemon rpc docs logically into sections
- Reformat (mostly rewrapping) various docs entries
- Add examples, many of which are live-fetched at documentation
generation time.
- Mark various required options as `required{...}` so that they produce
an error if not provided in a request.
Using string_view is slightly faster as it lets us get a view directly
into nlohmann's string value, rather than making an intermediate copy
into a temporary string.
Manually creating json the way we were doing is dumb. This redoes it
using nlohmann::json, which in turn lets us merge the serialized json
into rpc results.
We removed it at some point during the RPC refactor because its purpose
is replaced by get_transactions' new `memory_pool` parameter, but we
also need a wrapper to do that for older clients making direct
`get_transaction_pool` rpc requests.
This was throwing when there was no pow_hash (can't construct a string
from a nullptr).
It doesn't make much sense to stick an empty string there at all,
though, so this amends it to only set the `pow_hash` key when there is
something to set (rather than setting it to an empty string).
This call can make the node do a full tx scan for state change
transactions, which can be expensive. It is currently only used in the
oxend CLI interface, so seems fine to make admin-restricted.
The ed/x pubkeys were not being properly set via the json proxy, and so
were throwing when use. (This only triggered when calling on a service
node as the non-service-node path did the wrong thing).
This adds a new table to the batching schema to copy the accrued
balances every so often. This means that we can jump back to a
previous point without popping blocks.
The archiving is triggered in sql every 100 blocks and added to the
archive table, then pruned from the archive table at a later time to
ensure the size is kept small. Rebuilding 100 blocks is pretty
reasonable and should be less than 10s.
For longer distance pop_blocks and blockchain detached every 10k blocks
is kept in the archiving table. This takes longer to rebuild but is
better than rebuilding from scratch.
The blockchain detached function is also added to our regular blockchain
detached hooks so that it gets called every time the blockchain
detaches. Which appears to have caused some issues previously when some
of the modules would detach but batching would be stuck in an advanced
state.
- This was infinitely recursing because it was picking up fmt::to_string
(on macos) rather than formattable::to_string, which led to infinite
recursion and then a crash.
- Add a custom ghc::filesystem::path formatter (because it just seems
wrong to add a function into ghc::filesystem) instead of using the
to_string formatting. Same for boost formatting crap in simplewallet.
- Move the formatter structs into the `formattable` namespace so that
this sort of recursive error can't happen again.
- Remove implicit `operator bool` from ec_point/public_key/etc. which
was causing all sorts of implicit conversion mess and bugs.
- Change ec_point/public_key/etc. to use a `std::array<unsigned char,
32>` (via a base type) rather than a C-array of char that has to be
reinterpret_cast<>'ed all over the place.
- Add methods to ec_point/public_key/etc. that make it work more like a
container of bytes (`.data()`, `.size()`, `operator[]`, `begin()`,
`end()`).
- Make a generic `crypto::null<T>` that is a constexpr all-0 `T`, rather
than the mishmash `crypto::null_hash`, crypto::null_pkey,
crypto:#️⃣:null(), and so on.
- Replace three metric tons of `crypto::hash blahblah =
crypto::null_hash;` with the much simpler `crypto::hash blahblah{};`,
because there's no need to make a copy of a null hash in all these
cases. (Likewise for a few other null_whatevers).
- Remove a whole bunch of `if (blahblah == crypto::null_hash)` and `if
(blahblah != crypto::null_hash)` with the more concise `if
(!blahblah)` and `if (blahblah)` (which are fine via the newly
*explicit* bool conversion operators).
- `crypto::signature` becomes a 64-byte container (as above) but with
`c()` and `r()` to get the c() and r() data pointers. (Previously
`.c` and `.r` were `ec_scalar`s).
- Delete with great prejudice CRYPTO_MAKE_COMPARABLE and
CRYPTO_MAKE_HASHABLE and all the other utter trash in
`crypto/generic-ops.h`.
- De-inline functions in very common crypto/*.h files so that they don't
have to get compiled 300 times.
- Remove the disgusting include-a-C-header-inside-a-C++-namespace
garbage from some crypto headers trying to be both a C and *different*
C++ header at once.
- Remove the toxic, disgusting, shameful `operator&` on ec_scalar, etc.
that replace `&x` with `reinterpret_cast x into an unsigned char*`.
This was pure toxic waste.
- changed some `<<` outputs to fmt
- Random other small changes encountered while fixing everything that
cascaded out of the above changes.
Fixed a bug where ec_point subclasses were not getting formatted via
to_string(ec_point).
Also fixed the crappy test code that was incapable of reporting the
actual test failure.
- Don't touch <fmt/std.h> because it touches std::filesystem which makes
macOS throw a hissy fit and refuse to compile.
- int_to_string is broken on macOS because it uses std::to_chars which
makes macos throw a hissy fit like a cranky old female cat seeing a
kitten if it sees it.
- wallet3 was using std::filesystem and std::visit, both of which make
macos throw a hissy fit. (There is a pattern here). Apply the dumb
fs::path and var::visit workarounds needed to appease this garbage OS.
- use var::get (from oxenc/variant.h) instead of std::get because, oh
yeah, we need to support a garbage OS that Apple themselves don't even
properly support. Yay!
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);
oxen_logger was getting included indirectly via something
device_ledger.hpp includes, but that doesn't get included at all if
HIDAPI headers weren't found.
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.
This lets lokinet or SS signal to oxend that something is known to be
wrong, and so oxend should not send a proof so that, hopefully, the
problem gets noticed and fixed.
Currently we're putting the last-uptime-received data in the service
node list info, even when we have more updated info that hasn't yet been
accepted by the network.
This causes problems for lokinet, in particular, because it ignores any
SNs in the list without ed25519 pubkeys, including itself, which can
result in lokinet thinking it is deregistered for a while after the SN
becomes registered.
This updates `get_service_nodes` to always include current info (rather
than latest proof info) for itself when querying a service node.
wallet3 had changes to miner.cpp frankenstein merge-resolved, which was
resulting in various fields in miner.h being uninitialized. This fixes
the conflict (and fixes the auto-mine-at-startup from the wallet3 branch
merge).
This reapplies all of the changes from
b9755af4b4 to fix it.
demo is vaguely presentable now. syncing and basic tx send work.
change output was being sent to void (change address was unimplemented)
but that works now as well.
- 10.2.0 oxend version
- keep lokinet at 0.9.9
- require storage server 2.4.0
- schedule 10.2.0 mandatory date as 14 September 00:00 UTC (10am in
Australia Eastern Time; 8pm (on the 13th) in US Eastern time.
Fixes a few merge conflicts, several compilation errors, and
some behavioral incorrectness. Still a few bugs with wallet3
but as far as I can tell wallet2 and daemon etc. should be working
correctly.
This modifies the current behaviour from only creating the hwdev.txt
file, when a new wallet is created if content is specified as an
argument to always creating the file. This file is used by the GUI
wallet to detect if the device is a hardware device and the CLI wallet
behaviour is kept the same to keep behavious consistent between CLI and
RPC wallets.
The checking if the service node contributers are small miscalculated
atomic oxen. This brings in the correct figure for HF20 and in the
interim brings measures into the wallet and blink to prevent small
contributors from being to unlock in HF19.
This brings a simple config structure into the wallet3 that all of the
wallet submodules should be able to access. The first module included in
this PR is the daemon comms module which has its own substruct on the
config and the submodule is now constructed with a reference to the
config.
This was nasty.
Remove --block-rate-notify entirely; it's nearly useless on Oxen.
block and reorg notify remain, but now use a post-block hook rather than
shoving toxic Notify crap into cryptonote_core headers.
Add hooks that are called *after* a block is successfully added to the
blockchain.
This also fixes a race condition with OMQ notify.block subscriptions:
because the notification was firing during (instead of after) block
addition, the lokinet/storage server receiving the notify would race to
fetch the block info, but that request could happen *before* the block
addition is finished, ending up with lokinet/SS sometimes getting a
stale block.
This hook *isn't* called after a block is added, but rather it is part
of the block addition process and can abort the whole thing by raising
an exception (or returning false, prior to this PR).
This is unintuitive and causes bugs if using it as a "block has been
added" hook.
bool returns suck in general, but in most cases here they are also a
pain in the ass because *each* place that returns false is also issuing
a log statement. If only there were a way to return error information
to the common caller to have the common caller handle it... oh wait,
there is!
- Instead of inheriting from a pure virtual base class, we know just use
lambdas for hook callbacks.
- The signature of hooks also changes to take an info struct rather than
a list of parameters, so that you don't have to change everything to
ignore unwanted parameters if someone adds something to a hook.