Commit Graph

14016 Commits

Author SHA1 Message Date
Jason Rhinelander 2956a10351
Schedule 19.3 hard spoon
- Scheduled for Feb 9th, 0:00 UTC.
- Bump required lokinet version to latest stable
- Bump SS version to 2.5.0
2023-01-24 11:37:25 -04:00
Jason Rhinelander 0652014573
Fix HF19.2 timestamp
The timestamp in the file didn't match the comment or the block height
(this doesn't break anything; the timestamp is only used for future
block arrival estimates).
2023-01-24 11:32:51 -04:00
Sean b50067ea20
Merge pull request #1597 from jagerman/cleanups
Cleanups
2023-01-16 07:08:54 +11:00
Sean d101f9026b
Merge pull request #1623 from darcys22/wallet2-log-to-file-only
Disable logging to stdout for wallet2
2023-01-16 07:08:42 +11:00
Jason Rhinelander f6bd60c891
Remove bitrotten headers 2023-01-12 19:51:37 -04:00
Jason Rhinelander aaebf9d9d7
Remove epee/time_helper
It's included in a bunch of places, but only actually half-used in one,
which is easily replaced with `<chrono>` and tools::friendly_duration.
2023-01-12 19:51:37 -04:00
Jason Rhinelander 9dc312b0d9
Move gross single-macro-only "header" into wallet2
This header is stupid and gross and is only used from wallet2.  Remove
it from common/ to contain the damage within wallet2.

simplewallet.cpp includes it just for fun, but never actually uses it,
because why not?
2023-01-12 19:51:36 -04:00
Jason Rhinelander 53b981b865
Fix moronic code
This `getKeyFromBlockchain` function is completely moronic: it doesn't
do anything with its `reference_index`, and has a commented description
that doesn't match the actual implementation at all.

Moreover the `reference_index` argument, at once place here, is passed a
*function pointer cast to a size_t*.  A generous interpretation is the
author knew that it wasn't being used, and thus could be passed the
abitrary address of a function that happens to return a random value --
but it's all fine because the argument isn't used, right?

Replace it with a .randomize() on ctkey that does the same thing, but
with 97% less moron.

This code is beyond pathetic.  I am starting to see why some people need
Rust to guard their incompetence away from the code they write.
2023-01-12 19:51:36 -04:00
Jason Rhinelander 8020f29e25
Replace std::tuple<A, B> with std::pair<A, B>
Tuple is general purpose, but also heavier, so prefer pair when it is a
pair.
2023-01-12 19:51:36 -04:00
Jason Rhinelander d16bb75075
Cure std's
One should be careful when dealing with std's; this commit reduces the
spread of std's into places they don't belong.
2023-01-12 19:51:36 -04:00
Sean Darcy 7cab3c4b19 Disable logging to stdout for wallet2
The logging refactor brought in some changes to how the logs are
created and as a result logs were polluting the command line where wallet2 was
displaying information. This makes the logging for wallet only to file
and stdout is reserved to the wallet to communicate to the user.
2023-01-13 10:26:16 +11:00
Sean d370fa71ac
Merge pull request #1620 from jagerman/rpc-fixes
RPC fixes
2023-01-12 14:30:52 +11:00
Jason Rhinelander ca5b3a24fa
Move 2023-01-11 19:47:13 -04:00
Jason Rhinelander 8a16ab664c
Handle missing total_reserved
Like reserved, it is omitted when not different than total_contributed.
2023-01-11 19:29:34 -04:00
Jason Rhinelander 2953502cf4
Small optimizations/cleanups 2023-01-11 19:10:45 -04:00
Jason Rhinelander 0b746215d3
Fix wallet2 staking
`get_service_nodes` no longer includes the `"reserved"` field if there
is no unfilled reservation, but wallet2 was expecting it.

This makes it okay with not having it.

Along the way this converts various `[]` to `.at()` to throw proper
exceptions when the key being accessed doesn't exist.
2023-01-11 19:07:11 -04:00
Jason Rhinelander e42414c8e3
Fix GET requests
They should not have a body set (even if empty), but did, causing the
request handler to try to parse it as json and failing.

Fixes it to only set the body to a string if we actually have a
non-empty body to set.
2023-01-11 16:46:21 -04:00
Jason Rhinelander a3ecb3cfa6
Revert wallet2 output blacklist retrieval
Wallet2 needs to keep using the binary endpoint as we don't have (or,
really, want) a non-binary version for wallet2 to use.
2023-01-11 16:09:06 -04:00
Jason Rhinelander 06d1c1dbb3
Remove can-be-empty on ss/lokinet ping pubkey handling 2023-01-11 16:08:38 -04:00
Jason Rhinelander 38e2b1518e
Fix ping pubkey_ed25519 parameter name
SS and Lokinet are using pubkey_ed25519 instead of ed25519_pubkey; fix
it to match what they are sending.
2023-01-11 16:08:38 -04:00
Jason Rhinelander 955692b72d
Lower pre-request rpc access logging to debug level 2023-01-11 14:31:50 -04:00
Jason Rhinelander 965e4f05eb
Documentation generation using docsify
- 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.
2023-01-11 14:27:26 -04:00
Jason Rhinelander 6122164735
Change ["key"] -> .at("key")
So that we throw when the key doesn't exist.
2023-01-10 23:14:34 -04:00
Jason Rhinelander bb111c3959
Fix get_service_nodes rpc node proxy query
Also fixes the wrong error message being shown when it fails.
2023-01-10 22:43:31 -04:00
Jason Rhinelander 78192856ab
Small string_view optimizations
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.
2023-01-10 22:26:28 -04:00
Jason Rhinelander 64fbdb8c7f
Fix locked_contributions not included in cached SN list
Not having it broke wallet2 that was expecting it to exist; this fixes
it and also changes the `[]` usage to `.at()` to throw on non-existent
keys.
2023-01-10 22:25:03 -04:00
Jason Rhinelander 31fff4cb0a
Fix get_service_node_blacklisted_key_images
- the endpoint wasn't publicly accessible
- fixed typo in wallet2 miscalling it
2023-01-10 22:23:39 -04:00
Jason Rhinelander c64c1c329a
Fix get_accrued_batched_earnings missing "status": "OK"
Not having it broke wallet2.
2023-01-10 22:22:44 -04:00
Jason Rhinelander cf9f1c0823
Bump minor network revision for testnet 2023-01-10 16:12:40 -04:00
Jason Rhinelander 8b54c010d9
Fix error when pow_hash missing 2022-12-21 19:08:21 -04:00
Jason Rhinelander 10a45781cd
Fix coinbase_payouts in block rpc output, continued 2022-12-21 19:01:08 -04:00
Jason Rhinelander d6b59ecfae
Update oxen-logging for macos build fix 2022-12-21 17:59:11 -04:00
Jason Rhinelander 3963bb8f5b
Move nlohmann_json dependency to 'common' target 2022-12-21 17:04:07 -04:00
Jason Rhinelander 883658fbda
Fix segfault in get_block
Only `.reserve()` was called here, so assigning into `.begin()` isn't
valid (we either need to `.resize()`, or use `std::back_inserter`).
2022-12-21 15:21:59 -04:00
Jason Rhinelander 165b545975
Remove json_archiver debugging 2022-12-21 15:14:32 -04:00
Jason Rhinelander 9496a3b6e9
Fix coinbase_payouts in block rpc output 2022-12-21 14:31:16 -04:00
Jason Rhinelander eaf8bd39f2
Redo json_archiver in nlohmann::json
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.
2022-12-20 21:34:04 -04:00
Jason Rhinelander 466e08e413
Disable stringop-overflow warnings under GCC12
They are really buggy and produce tons of false positives and, as far as
I've seen, no true positives so just disable them.

I kept this only to 12.x in the hope that gcc 13 will improve the
warning's usefulness.
2022-12-20 18:23:39 -04:00
Jason Rhinelander fb3b414118
Re-add `get_transaction_pool`
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.
2022-12-19 16:41:18 -04:00
Jason Rhinelander 2a8b0733be
Log levels: case-insensitive levels; add abbreviations 2022-12-19 16:41:18 -04:00
Jason Rhinelander 2b3a71527b
Debug log bad request body 2022-12-19 16:00:22 -04:00
Jason Rhinelander 402aa450c9
Rename LMQ -> OMQ in code
(This doesn't rename the `--lmq-...` cli options because that would
break backwards compatibility.)
2022-12-19 13:22:02 -04:00
Jason Rhinelander d3d0a4460d
Fix string construction when no pow_hash
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).
2022-12-19 12:30:09 -04:00
Jason Rhinelander af37b44427
Reformatting/cleanup 2022-12-19 12:27:10 -04:00
Jason Rhinelander 73ccce8a55
Remove errant extra {} from error string 2022-12-19 12:08:34 -04:00
Jason Rhinelander b128f373d3
More RPC fixes 2022-12-16 22:42:20 -04:00
Jason Rhinelander 3179a97b32
Make get_sn_state_changes admin-only
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.
2022-12-16 19:22:21 -04:00
Jason Rhinelander 2c7a4ab841
Activate various RPC endpoints
These all appear to be converted, but weren't moved into the active
endpoint type list.

Includes a rename of SETBANS/GETBANS to SET_BANS/GET_BANS
2022-12-16 16:10:14 -04:00
Jason Rhinelander 47107e6e37
Fix out-of-order argument parsing
Incoming RPC arguments *must* be parsed in alphabetical order because
our parsing is consuming a bt_dict in order, when the parameters are
bt-encoded.
2022-12-16 16:07:23 -04:00
Jason Rhinelander f71b848b6a
:sort 2022-12-16 15:55:38 -04:00