Commit graph

73 commits

Author SHA1 Message Date
Jason Rhinelander
ca36648749 Split up huge instanciations & header fixes
rpc/instanciations.cpp is a huge compiler job because it includes two
separate huge template instanciations [sic] in it.  Splitting it apart
into two separate compilation units makes compilation more
parallelizable and requires less ram for the individual job.

The split also revealed a few missing headers in epee for logging macros.
2019-12-03 00:51:18 -04:00
Jason Rhinelander
00098181fe epee serialization simplifications
Removes one unnecessary layer of templated indirection in kv
serialization, and removes use of boost::mpl::vector code generation.

Also removes a double-specification of the same type in the epee
array_entry specification.
2019-11-27 14:07:52 -04:00
Jason Rhinelander
29be7f6552 Allow epee async call response values to be moved
This allows the caller to also take the response by rvalue reference so
that they can move outsubvalues.  The rvalue is totally fine here (once
the callback is invoked it is never used again) and still binds
perfectly well to const-lvalue accepting callbacks.
2019-11-27 14:07:52 -04:00
Jason Rhinelander
a9294cdbef Remove boost::value_initialized and BOOST_FOREACH (#921)
Neither of these have a place in modern C++11; boost::value_initialized
is entirely superseded by `Type var{};` which does value initialization
(or default construction if a default constructor is defined).  More
problematically, each `boost::value_initialized<T>` requires
instantiation of another wrapping templated type which is a pointless
price to pay the compiler in C++11 or newer.

Also removed is the AUTO_VAL_INIT macro (which is just a simple macro
around constructing a boost::value_initialized<T>).

BOOST_FOREACH is a similarly massive pile of code to implement
C++11-style for-each loops. (And bizarrely it *doesn't* appear to fall
back to C++ for-each loops even when under a C++11 compiler!)

This removes both entirely from the codebase.
2019-11-01 09:26:58 +11:00
Doyle
639d7456f7 Merge commit '1d5e8f4' into LokiMergeUpstream 2019-06-26 13:04:37 +10:00
moneromooo-monero
39169ace09
epee: basic sanity check on allocation size from untrusted source
Reported by guidov
2019-06-14 08:47:01 +00:00
Doyle
c53bee7177 Merge commit '5dbcceb' into LokiMergeUpstream 2019-04-12 18:21:16 +10:00
Doyle
aded2cef69 Merge commit '1ed6441' into LokiMergeUpstream 2019-04-12 17:44:20 +10:00
Riccardo Spagni
38317f384c
Merge pull request #5348
59776a64 epee: some more minor JSON parsing speedup (moneromooo-monero)
2019-04-06 16:00:18 +02:00
moneromooo-monero
59776a64ff
epee: some more minor JSON parsing speedup 2019-03-25 14:29:29 +00:00
Guido Vranken
43042a28ec Implement array_entry_t copy constructor
Manually initialize the array_entry_t iterator to ensure it points
to the correct m_array, thereby preventing a potential use-after-free
situation.

Signed-off-by: Guido Vranken <guidovranken@gmail.com>
2019-03-18 00:49:12 +01:00
doy-lee
d0bab8e6f5 Merge commit '13b1297' into LokiMergeUpstream 2019-01-29 20:11:17 +11:00
doy-lee
06cbe13f2f Merge commit 'e59813c' into LokiMergeUpstream 2019-01-18 11:27:03 +11:00
doy-lee
074ed7680f Merge commit '3e9bb96' into LokiMergeUpstream 2019-01-18 10:35:18 +11:00
doy-lee
8d22d47d69 Merge commit 'b67eb48' into LokiMergeUpstream 2019-01-17 17:41:10 +11:00
moneromooo-monero
21777daf6e
epee: speedup word/number matching
Number matching semantics are slightly changed: since this is used
as a filter to check whether a number is signed and/or floating
point, we can speed this up further. strto* functions are called
afterwards and will error out where necessary. We now also accept
numbers like .4 which were not accepted before.

The strto* calls on a boost::string_ref will not access unallocated
memory since the parsers always stop at the first bad character,
and the original string is zero terminated.

in arbitrary time measurement units for some arbitrary test case:

match_number2: 235 -> 70
match_word2: 330 -> 108
2019-01-16 19:59:40 +00:00
Riccardo Spagni
a093a7569e
Merge pull request #5021
b82efa32 epee: speed up json parsing (moneromooo-monero)
2019-01-16 21:37:29 +02:00
Riccardo Spagni
846362842c
Merge pull request #4976
85665003 epee: better network buffer data structure (moneromooo-monero)
2019-01-16 19:04:22 +02:00
Riccardo Spagni
ad1eb3338c
Merge pull request #4938
a13eb0a1 epee: speed up string matching a bit (moneromooo-monero)
3a3858dc epee: avoid string allocation when parsing a pod from string (moneromooo-monero)
2019-01-06 20:36:46 +02:00
moneromooo-monero
b82efa32e7
epee: speed up json parsing 2018-12-27 14:28:30 +00:00
moneromooo-monero
85665003a7
epee: better network buffer data structure
avoids pointless allocs and memcpy
2018-12-23 16:46:07 +00:00
doy-lee
40506127a4 Merge commit '7e957c1' into LokiMergeUpstream 2018-12-11 13:46:35 +11:00
moneromooo-monero
a13eb0a1a4
epee: speed up string matching a bit 2018-12-08 02:00:37 +00:00
moneromooo-monero
9c923bad9b
epee: fix network packet header field endianness 2018-12-04 15:14:32 +00:00
doy-lee
5c6a7eaa85 Merge commit '84dd674' into LokiMergeUpstream 2018-11-22 14:42:14 +11:00
Riccardo Spagni
3880cae134
Merge pull request #4775
741e4a11 epee: speed up json number parsing (moneromooo-monero)
2018-11-16 11:00:56 +02:00
doy-lee
8f03bb3fd7 Merge commit '8534f71' into LokiMergeUpstream 2018-11-12 14:55:42 +11:00
moneromooo-monero
741e4a1172
epee: speed up json number parsing 2018-11-01 16:36:16 +00:00
moneromooo-monero
07c6280909
epee: some minor speedup in parsing 2018-10-24 08:34:25 +00:00
doy-lee
4caffeff78 Merge branch 'dev' into LokiMergeUpstreamUntil_20180905_fad88e1 2018-10-01 16:48:40 +10:00
doy-lee
5617593905 Merge commit '0722287' into LokiMergeUpstream20180821 2018-09-28 16:44:46 +10:00
Riccardo Spagni
a1074a82cd Merge pull request #4438
e350cc5a wallet2: fix duplicate output making it to the RPC (moneromooo-monero)
bf9a0f4c epee: fix stack overflow on crafted input (moneromooo-monero)
45683ee0 epee: fix invalid memory write reading an array entry (moneromooo-monero)
2018-09-25 07:30:03 -07:00
moneromooo-monero
bf9a0f4c65
epee: fix stack overflow on crafted input 2018-09-25 11:27:50 +00:00
moneromooo-monero
45683ee02c
epee: fix invalid memory write reading an array entry
Reported by Lilith Wyatt at Talos.

Since this is not needed in normal operation, I just let this
error out.
2018-09-25 11:27:48 +00:00
moneromooo-monero
76affd941b
epee: some speedup in parsing 2018-08-19 15:29:01 +00:00
Doyle T
161eda3fd1 First pass Monero to Loki refs 2018-04-10 14:49:20 +10:00
Riccardo Spagni
f4a6bc79d9
Merge pull request #3226
e4646379 keccak: fix mdlen bounds sanity checking (moneromooo-monero)
2e3e90ac pass large parameters by const ref, not value (moneromooo-monero)
61defd89 blockchain: sanity check number of precomputed hash of hash blocks (moneromooo-monero)
9af6b2d1 ringct: fix infinite loop in unused h2b function (moneromooo-monero)
8cea8d0c simplewallet: double check a new multisig wallet is multisig (moneromooo-monero)
9b98a6ac threadpool: catch exceptions in dtor, to avoid terminate (moneromooo-monero)
24803ed9 blockchain_export: fix buffer overflow in exporter (moneromooo-monero)
f3f7da62 perf_timer: rewrite to make it clear there is no division by zero (moneromooo-monero)
c6ea3df0 performance_tests: remove add_arg call stray extra param (moneromooo-monero)
fa6b4566 fuzz_tests: fix an uninitialized var in setup (moneromooo-monero)
03887f11 keccak: fix sanity check bounds test (moneromooo-monero)
ad11db91 blockchain_db: initialize m_open in base class ctor (moneromooo-monero)
bece67f9 miner: restore std::cout precision after modification (moneromooo-monero)
1aabd14c db_lmdb: check hard fork info drop succeeded (moneromooo-monero)
2018-02-16 14:26:58 +01:00
moneromooo-monero
2e3e90acbe
pass large parameters by const ref, not value
Coverity 136394 136397 136409 136526 136529 136533 175302
2018-02-02 19:36:09 +00:00
Erik de Castro Lopo
8f30350d03 Fix method name in invoke_http_json_rpc
Previously, the method name was printed as an exmpty string because
the input string had already been moved with `std::move`.
2018-01-29 11:14:02 +11:00
Riccardo Spagni
9fff66f004
Merge pull request #3012
e4bbeff2 epee: check some error return values (moneromooo-monero)
2018-01-25 16:36:27 -08:00
moneromooo-monero
b7e5a70bb1
epee: detect strptime, use std::get_time as fallback 2018-01-11 21:41:07 +00:00
moneromooo-monero
e4bbeff2f5
epee: check some error return values 2017-12-27 00:14:43 +00:00
moneromooo-monero
373d1d504b
epee: use strptime instead of std::get_time, for compatibility 2017-12-21 16:04:47 +00:00
moneromooo-monero
09ce03d612
move includes around to lessen overall load 2017-12-16 22:46:38 +00:00
moneromooo-monero
f80f408b7e
epee: don't disable -Wtautological-constant-out-of-range-compare on GCC
It's a CLANG only option, and causes GCC to error out
2017-11-14 17:22:39 +00:00
moneromooo-monero
9ff8e139cd
epee: disable a spurious warning for a storage function 2017-10-28 11:52:14 +01:00
Jaquee
76961ddc3e Serializer: string to integer conversion for MyMonero compatibility
mymonero timestamp conversion
2017-10-15 17:29:07 +02:00
Jaquee
1cf940f2a1 epee http_client SSL support 2017-10-15 17:29:04 +02:00
Riccardo Spagni
170526dc02
Merge pull request #2253
51ebedb8 epee: remove a couple unused locals (moneromooo-monero)
2017-08-15 20:48:45 +02:00
moneromooo-monero
51ebedb803
epee: remove a couple unused locals 2017-08-05 18:42:53 +01:00