Commit graph

11494 commits

Author SHA1 Message Date
Jason Rhinelander
62c77fe4c7 Deal with negative integer encodings
Change the blink quorum checksum value on the wire to a positive
uint64_t rather than the 2s complement int64_t encoded value that
bt_value produces by default.  Also updates the bt_dict_consumer code
to handle the needed int64_t -> uint64_t conversion if a negative
int64_t (from a previous lokid version) arrives on the wire.
2020-04-30 15:13:45 -03:00
Jason Rhinelander
fb6e4659fd Make blink signature parsing single-pass
This signature parsing code was bizarrely failing to parse what appears
to be perfectly valid data, but only on one Debian buster system for
unknown reasons, and not reproducible in a small test case with the
exact data it received.

Rewrote it to use on-the-fly data deserialization (which is more
efficient anyway by avoiding heap memory allocation for
deserialization).
2020-04-29 22:35:51 -03:00
Jason Rhinelander
a5fef804e4 Minor style changes 2020-04-29 22:35:51 -03:00
Jason Rhinelander
fe8cc2aa9f Improve inter-quorum relay trace debugging 2020-04-29 22:35:38 -03:00
Jason Rhinelander
492627ae29 Fix inter-quorum relay
Blink signatures were not being relayed properly from the Q quorum to
the Q' quorum, and so Q' might never learn about the blink.
2020-04-29 15:04:35 -03:00
cryptonote.social
74ca8566d3
show amount for blacklisted stakes (#1140)
* fix segfault when exiting cli wallet due to running poll thread

* fix whitespace

* style

* support for amount of blacklisted stakes in wallets

* bump version number for blacklist entries with amounts

* default initialize ints in key_image_blacklist_entry

* whitespace
2020-04-29 10:45:44 +10:00
Jason Rhinelander
3874e7478e
Fix blink submission replies (#1142)
LokiMQ's ConnectionID wasn't working properly for routing replies to
incoming connections from non-service nodes; I already noticed and fixed
this in the lokimq update in the LMQ RPC overhaul branch, but we need to
bring it back into master.

This also changes the SN selection for blink submissions so that we
always prefer submitting to higher version service nodes (and then
randomize among SNs with the same version).  This should make blinks
work robustly again: as long as the daemon the wallet talks to and at
least *one* of the 20 quorum members is upgraded we should get a reply
properly.
2020-04-29 10:34:32 +10:00
Doyle
b4db8f7598
Merge pull request #1138 from Doy-lee/DaemonizerSimplifyer
Simplify Daemon/Wallet RPC initialization code
2020-04-24 14:25:55 +10:00
Doyle
713d848146 core_tests: Fix core still expecting cryptonote_protocol to be set 2020-04-24 14:19:04 +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
1aa6ca005f Remove old daemonizing method 2020-04-24 14:14:49 +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
2909ad886a wallet_rpc: Simplify daemonizer, remove t_handler/t_executor
The daemonizer requires you to fill out an "interface" to use it. This
imposes a design constraint on end users whens starting up applications
and led to a initialization circus with a t_executor starting up
a t_daemon that creates an instance of our application.

Instead design it so that execution flow is controlled by the user and
not the interface by returning the run_type that the user requested (run
as a service, forked, interactive or non-interactive) and launch
accordingly at the call site, and not indirected through 2 classes of
OOP cruft.

There still remains 1 wart with the Windows daemonizer requiring
templatization on the application so that Windows can callback at
a their deferred discretion and startup and shutdown the application
accordingly.
2020-04-24 14:14:49 +10:00
Doyle
ee44c01c69
Merge pull request #1119 from Doy-lee/MergeUpstream
Merge upstream changes (~130 commits)
2020-04-24 14:09:22 +10:00
Doyle
24ebce22a9
Merge pull request #1103 from Doy-lee/SNClientSignatureCheck
SN: Client side check signature
2020-04-24 13:40:03 +10:00
Doyle
35621a0979 Switch to exception based error reporting 2020-04-24 13:39:27 +10:00
Doyle
7a2efc2cac
Merge pull request #1133 from Doy-lee/KeyImageFi
Annotate how key image exporting/importing works
2020-04-24 12:33:15 +10:00
Doyle
0662b7f600 std::memcpy, convert offset to little endian 2020-04-24 12:28:07 +10:00
Doyle
1d8adbb555 Writeup how key image exporting/importing works
Remove some ambigious overloads for clarity and make it less annoying to
understand.
2020-04-24 12:13:58 +10:00
Doyle
ff2949934d SN: Move signature validating code to function and use in wallet2 & sn 2020-04-24 11:46:38 +10:00
Doyle
5d6be45a4f
The portable implementation doesn't use the light parameter causing (#1126)
inconsistent results. I desk checked against the ARM64 implementation
that does NOT used the +crypto extensions, meaning it is emulated in
software- That implementation is essentially the same as the portable
implementation, some minor differences in the pre-amble but correctly
uses the light flag.

Adapting that over allows us to sync past block 321280, which previously
emitted an "unexpected difficulty" error.

This code path was never excercised due to the '-maes' flag being forced
on via CMake. That was removed in this commit to make it specifiable by
the user.

17be0ed650
2020-04-24 10:38:16 +10:00
Doyle
9510e2b5ea
Merge pull request #932 from Doy-lee/ClassifyStakes
Classify stakes in show/export_transfers
2020-04-24 10:18:47 +10:00
Doyle
6e12ab3665 Add overload for tx_get_staking_components that accepts a txid 2020-04-24 10:18:12 +10:00
Doyle
f218d6cf45 Allow filter show_transfers by multiple arguments
- Allow show_transfers to filter by stake
- Allow combining show_transfer arguments to get a composition of
arguments specifying transfer type
- Transfer type arguments in RPC call are defaulted to true
2020-04-23 16:52:08 +10:00
Doyle
f3767a5d7e Classify staking transactions in show/export_transfers 2020-04-23 16:50:25 +10:00
Doyle
8f58ce001f get_contribution -> tx_get_staking_components and make public 2020-04-23 16:44:08 +10:00
Doyle
ba7faacab9
Handle long poll shutdown properly (#1136)
Wait for thread to end before terminating wallet_rpc

- In RPC wallet, we need to track long polling shutting down separately
from the wallet as the RPC wallet can start up without instantiating
a wallet2 instance. If this is the case, shutting down the RPC wallet
will hang the long polling thread as the terminating variable can never
be retrieved from wallet2.

- Simplify RAII of the long polling thread by putting it into the
simple_wallet destructor

- Fix long poll thread constantly resetting the host. set_server() was
currently parsing host = "localhost:38157" such that get_host()
= "localhost" and port() = 38157 so that host != get_host().
2020-04-22 16:50:08 +10:00
Doyle
1fb87c768c
Bump version 7.1 patch to 6 (#1135) 2020-04-22 10:58:53 +10:00
Doyle
aeead719e7
Update LokiMQ to 1.1.2 (#1134) 2020-04-22 10:24:08 +10:00
Doyle
74e884c640 Difficulty needs access to easylogging++.h 2020-04-21 13:27:43 +10:00
Doyle
d7f5d6bb74 Merge commit 'e72aca57f968f77e154d145bb462f4917ec16b6b' into MergeUpstream2 2020-04-21 13:23:44 +10:00
Doyle
9e359f27e9 Merge commit '441f318180c402057df3eda278d3df130c31a3f1' into MergeUpstream2 2020-04-21 13:21:27 +10:00
Doyle
3a14f3c06f Merge commit '56b98c7003e0f758d6ea6e89897726ead36b27aa' into MergeUpstream2 2020-04-21 13:17:20 +10:00
Doyle
45a6897621 Merge commit 'f1c3252df3de77073d24e7619ff7ba5bcb7a7bac' into MergeUpstream2 2020-04-21 13:10:55 +10:00
Doyle
ccdbba898f Merge commit '1010a6503e7279bb17fb3f8cfddffe4d3a66ba34' into MergeUpstream2 2020-04-21 13:09:15 +10:00
Doyle
e5e48b2ba2 Merge branch 'MergeUpstream' into MergeUpstream2 2020-04-21 12:40:45 +10:00
Doyle
3f615ff171 Merge commit '1499caf596100a279e954d4810a255f8b1ec027c' into MergeUpstream2 2020-04-21 12:32:47 +10:00
Doyle
ef2ee4e27e Update trezor-common to 31a0073c62738827b48d725facd3766879429124 2020-04-21 12:23:55 +10:00
Doyle
669b943b06 s/MONERO_VERSION/LOKI_VERSION for Trezor 2020-04-21 12:23:55 +10:00
Doyle
7e7a477048 Merge commit '198fb35' into MergeUpstream2 2020-04-20 17:28:16 +10:00
Doyle
e7e622e08b Merge commit '459beb5' into MergeUpstream2 2020-04-20 17:25:53 +10:00
Doyle
1e0f6b965f Merge commit '310c268' into MergeUpstream2 2020-04-20 17:17:29 +10:00
Doyle
98e676217f Merge commit '9120a73' into MergeUpstream2 2020-04-20 17:14:53 +10:00
Doyle
afb26695ba Merge commit '017162b' into MergeUpstream2 2020-04-20 17:14:31 +10:00
Doyle
756ac2465e Merge commit '7fb4edccdc09773b8bea246a9e2ce3f6e02fc89f' into MergeUpstream2 2020-04-20 17:13:55 +10:00
Doyle
b253994865 Merge commit 'f06c77ab7201605e34b15fa8c409fd4dc49399b4' into MergeUpstream2 2020-04-20 17:13:03 +10:00
Doyle
e91e203671 Merge commit '48229234a9146de9166a59411e8639673a3610ac' into MergeUpstream2 2020-04-20 17:07:30 +10:00
Doyle
ca9ce15103 Merge commit 'c5e9266' into MergeUpstream2 2020-04-20 17:07:14 +10:00
Doyle
7700aee464 Merge commit '14881094aff8e11c2523fcc2894bb4e24a95238f' into MergeUpstream2 2020-04-20 16:55:36 +10:00