Commit graph

124 commits

Author SHA1 Message Date
Jason Rhinelander a8bdb1888e Remove dangerous and broken glob_to_regex function
This function is broken: if it encounters a \ it stays in "escape" more
forever.  However the entire function is also moronic because it is only
used in the test suite (and thus doesn't belong out of the test suite),
but is also only used for the test `--filter` arguments which have this
help message:

    Regular expression filter for which tests to run

Since a glob is not a regular expression, and because passing legitimate
regular expressions through this glob_to_regex function serious breaks
them, removing this stupid broken code is actually a bug fix.
2020-05-11 18:44:45 -03:00
Jason Rhinelander 5b97ff6e9c cmake modernization
The archaic (i.e. decade old) cmake usage here really got in the way of
trying to properly use newer libraries (like lokimq), so this undertakes
overhauling it considerably to make it much more sane (and significantly
reduce the size).

I left more of the architecture-specific bits in the top-level
CMakeLists.txt intact; most of the efforts here are about properly
loading dependencies, specifying dependencies and avoiding a whole pile
of cmake antipatterns.

This bumps the required cmake version to 3.5, which is what xenial comes
with.

- extensive use of interface libraries to include libraries,
definitions, and include paths

- use Boost::whatever instead of ${Boost_WHATEVER_LIBRARY}.  The
interface targets are (again) much better as they also give you any
needed include or linking flags without needing to worry about them.

- don't list header files when building things.  This has *never* been
correct cmake usage (cmake has always known how to wallet_rpc_headers
the headers that .cpp files include to know about build changes).

- remove the loki_add_library monstrosity; it breaks target names and
makes compiling less efficient because the author couldn't figure out
how to link things together.

- make loki_add_executable take the output filename, and set the output
path to bin/ and install to bin because *every single usage* of
loki_add_executable was immediately followed by setting the output
filename and setting the output path to bin/ and installing to bin.

- move a bunch of crap that is only used in one particular
src/whatever/CMakeLists.txt into that particular CMakeLists.txt instead
of the top level CMakeLists.txt (or src/CMakeLists.txt).

- Remove a bunch of redundant dependencies; most of them look like they
were just copy-and-pasted in, and many more aren't needed (since they
are implied by the PUBLIC linking of other dependencies).

- Removed `die` since it just does a FATAL_ERROR, but adds color (which
is useless since CMake already makes FATAL_ERRORs perfectly visible).

- Change the way LOKI_DAEMON_AND_WALLET_ONLY works to just change the
make targets to daemon and simplewallet rather than changing the build
process (this should make it faster, too, since there are various other
things that will be excluded).
2020-03-06 00:36:57 -04:00
Doyle 1eb45e523e Build/core test fixes, incoporate staking changes from LNS
- Fix assert to use version_t::_count in service_node_list.cpp
- Incoporate staking changes from LNS which revamp construct tx to
  derive more of the parameters from hf_version and type. This removes
  extraneous parameters that can be derived elsewhere.

  Also delegate setting loki_construct_tx_params into wallet2 atleast,
  so that callers into the wallet logic, like rpc server, simplewallet
  don't need bend backwards to get the HF version whereas the wallet has
  dedicated functions for determining the HF.
2019-12-04 15:17:55 +11:00
Jason Rhinelander d43398efed Fix wallet_rpc and tests for new loki_construct_tx_params usage 2019-11-27 20:51:07 -04:00
Doyle 5162a30621 Merge commit 'c3de019f565674fd19b9d5cafba015d9ea7f69f7' into LokiMergeUpstream 2019-04-12 15:10:33 +10:00
Doyle 4926d73bb2 Merge commit 'a28237c9cacb074216b1ee1db40da32acde3acd0' into LokiMergeUpstream 2019-04-10 10:02:15 +10:00
Riccardo Spagni c3de019f56
Merge pull request #5192
d0e07b3d performance_tests: fix NetBSD build (moneromooo-monero)
7d88d8f2 discontinue use of alloca (moneromooo-monero)
2019-03-17 17:56:52 +02:00
Doyle dc06a79b7a
Change PoW to CN Turtle Lite V2 on Hardfork 11 (#459)
* Improve parameterising of selectable hashing algorithm

* Add CN turtle light variant 2

* Incorporate cn turtle lite v2 test into loki

* Rename to cn_turtle

* Rename instances of cn_slow_hash including arm targets
2019-03-06 00:16:59 +00:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
Riccardo Spagni a28237c9ca
Merge pull request #5102
1eef0565 performance_tests: better stats, and keep track of timing history (moneromooo-monero)
2019-03-04 21:22:51 +02:00
moneromooo-monero b9a618848f
performance_tests: add tests for new Cryptonight variants 2019-03-04 11:56:38 +00:00
moneromooo-monero d0e07b3d86
performance_tests: fix NetBSD build 2019-02-25 11:11:09 +00:00
doy-lee bebecbd0a6 Merge branch 'dev' into LokiMergeUpstream 2019-01-30 16:59:47 +11:00
doy-lee 6634d97e29 Merge commit '0daa00e' into LokiMergeUpstream 2019-01-30 13:05:20 +11:00
moneromooo-monero 1eef056588
performance_tests: better stats, and keep track of timing history 2019-01-28 15:45:37 +00:00
Doyle 3a7b6b59eb
Infinite Staking Part 1 (#387)
* Remove dead branches in hot-path check_tx_inputs

Also renames #define for mixins to better match naming convention

* Shuffle around some more code into common branches

* Fix min/max tx version rules, since there 1 tx v2 on v9 fork

* First draft infinite staking implementation

* Actually generate the right key image and expire appropriately

* Add framework to lock key images after expiry

* Return locked key images for nodes, add request unlock option

* Introduce transaction types for key image unlock

* Update validation steps to accept tx types, key_image_unlock

* Add mapping for lockable key images to amounts

* Change inconsistent naming scheme of contributors

* Create key image unlock transaction type and process it

* Update tx params to allow v4 types and as a result construct_tx*

* Fix some serialisation issues not sending all the information

* Fix dupe tx extra tag causing incorrect deserialisation

* Add warning comments

* Fix key image unlocks parsing error

* Simplify key image proof checks

* Fix rebase errors

* Correctly calculate the key image unlock times

* Blacklist key image on deregistration

* Serialise key image blacklist

* Rollback blacklisted key images

* Fix expiry logic error

* Disallow requesting stake unlock if already unlocked client side

* Add double spend checks for key image unlocks

* Rename get_staking_requirement_lock_blocks

To staking_initial_num_lock_blocks

* Begin modifying output selection to not use locked outputs

* Modify output selection to avoid locked/blacklisted key images

* Cleanup and undoing some protocol breakages

* Simplify expiration of nodes

* Request unlock schedules entire node for expiration

* Fix off by one in expiring nodes

* Undo expiring code for pre v10 nodes

* Fix RPC returning register as unlock height and not checking 0

* Rename key image unlock height const

* Undo testnet hardfork debug changes

* Remove is_type for get_type, fix missing var rename

* Move serialisable data into public namespace

* Serialise tx types properly

* Fix typo in no service node known msg

* Code review

* Fix == to >= on serialising tx type

* Code review 2

* Fix tests and key image unlock

* Add additional test, fix assert

* Remove debug code in wallet

* Fix merge dev problem
2019-01-25 14:15:52 +11:00
moneromooo-monero f931e16c6e
add a bulletproof version, new bulletproof type, and rct config
This makes it easier to modify the bulletproof format
2019-01-22 23:17:24 +00:00
doy-lee 5c6a7eaa85 Merge commit '84dd674' into LokiMergeUpstream 2018-11-22 14:42:14 +11:00
Riccardo Spagni 46f989bc49
Merge pull request #4795
5d7c2316 rct: add a zeroCommit cache for common pre-rct case (moneromooo-monero)
2018-11-16 11:11:10 +02:00
doy-lee 8f03bb3fd7 Merge commit '8534f71' into LokiMergeUpstream 2018-11-12 14:55:42 +11:00
Riccardo Spagni e00a6ce9c7
Merge pull request #4732
3a056b73 performance_tests: add ge_p3_tobytes (moneromooo-monero)
30f728e3 performance_tests: measure ge_frombytes_vartime only (moneromooo-monero)
2018-11-06 21:30:40 +02:00
doy-lee 42f0933e58 Merge commit '7e2483e' into LokiMergeUpstream 2018-11-05 11:27:45 +11:00
moneromooo-monero 5d7c231604
rct: add a zeroCommit cache for common pre-rct case
This is called for every pre-rct output at blockchain sync time,
and a lot of them wil hit the cache, saving a scalarmult each.
2018-11-04 15:44:56 +00:00
moneromooo-monero 3a056b7393
performance_tests: add ge_p3_tobytes 2018-10-26 17:02:11 +00:00
moneromooo-monero 30f728e362
performance_tests: measure ge_frombytes_vartime only
not an extra dynamic cast, which might be heavy
2018-10-26 17:01:05 +00:00
moneromooo-monero 6f9ae5b6eb
multiexp: handle pippenger multiexps with part precalc 2018-10-22 16:07:44 +00:00
moneromooo-monero c415df97bd
performance_tests: sc_check and ge_dsm_precomp 2018-10-22 16:07:44 +00:00
doy-lee 339f96b0cc Merge commit 'c23b6f8' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-10 15:07:16 +11:00
doy-lee 46924fc0e4 Merge commit '8f418a6' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-09 13:04:09 +11:00
doy-lee c1da4f690d Merge commit '5ffb2ff' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-09 12:31:08 +11:00
doy-lee 43d75894f2 Merge commit '869b3bf' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-08 19:51:13 +11:00
doy-lee 5805b72778 Merge commit '2a8fcb421bc41eb254f95379dd73238915dd509d' into LokiMergeUpstreamUntil_20180911_e6d36c1
Begin fixing broken bulletproof tests in Loki
2018-10-08 13:34:36 +11:00
doy-lee ffcee98d37 Merge commit '126196b' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-04 15:00:37 +10:00
doy-lee e2ef377b4a Merge commit '9ce9f8caf6e290088711ce4d5d90c1507a837bf2' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-04 14:59:49 +10:00
doy-lee 12b8ffaee3 Merge commit 'f34e2e2' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-04 14:30:26 +10:00
Riccardo Spagni effcbf2060
Merge pull request #4459
bcf3f6af fuzz_tests: catch unhandled exceptions (moneromooo-monero)
3ebd05d4 miner: restore stream flags after changing them (moneromooo-monero)
a093092e levin_protocol_handler_async: do not propagate exception through dtor (moneromooo-monero)
1eebb82b net_helper: do not propagate exceptions through dtor (moneromooo-monero)
fb6a3630 miner: do not propagate exceptions through dtor (moneromooo-monero)
2e2139ff epee: do not propagate exception through dtor (moneromooo-monero)
0749a8bd db_lmdb: do not propagate exceptions in dtor (moneromooo-monero)
1b0afeeb wallet_rpc_server: exit cleanly on unhandled exceptions (moneromooo-monero)
418a9936 unit_tests: catch unhandled exceptions (moneromooo-monero)
ea7f9543 threadpool: do not propagate exceptions through the dtor (moneromooo-monero)
6e855422 gen_multisig: nice exit on unhandled exception (moneromooo-monero)
53df2deb db_lmdb: catch error in mdb_stat calls during migration (moneromooo-monero)
e67016dd blockchain_blackball: catch failure to commit db transaction (moneromooo-monero)
661439f4 mlog: don't remove old logs if we failed to rename the current file (moneromooo-monero)
5fdcda50 easylogging++: test for NULL before dereference (moneromooo-monero)
7ece1550 performance_test: fix bad last argument calling add_arg (moneromooo-monero)
a085da32 unit_tests: add check for page size > 0 before dividing (moneromooo-monero)
d8b1ec8b unit_tests: use std::shared_ptr to shut coverity up about leaks (moneromooo-monero)
02563bf4 simplewallet: top level exception catcher to print nicer messages (moneromooo-monero)
c57a65b2 blockchain_blackball: fix shift range for 32 bit archs (moneromooo-monero)
2018-09-29 22:20:38 +02:00
doy-lee 5617593905 Merge commit '0722287' into LokiMergeUpstream20180821 2018-09-28 16:44:46 +10:00
doy-lee 0012fe9568 Merge batch upstream changes from monero 2018-09-19 19:21:56 +10:00
moneromooo-monero 2bf636503f
bulletproofs: speed up the latest changes a bit 2018-09-11 13:38:32 +00:00
moneromooo-monero ce0c743205
performance_tests: add padded bulletproof construction 2018-09-11 13:38:24 +00:00
moneromooo-monero 5ffb2ff9b7
v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +00:00
moneromooo-monero c429176248
bulletproofs: reject points not in the main subgroup 2018-09-11 13:38:04 +00:00
moneromooo-monero 0b05a0fa74
Add Pippenger cache and limit Straus cache size 2018-09-11 13:38:02 +00:00
moneromooo-monero b17b8db3f5
performance_tests: add stats and loop count multiplier options
Stats are: min, median, standard deviation
2018-09-11 13:37:48 +00:00
moneromooo-monero d126a02b5d
performance_tests: add aggregated bulletproof tx verification 2018-09-11 13:37:46 +00:00
moneromooo-monero 263431c486
Pippenger multiexp
Based on sarang's python code
2018-09-11 13:37:45 +00:00
moneromooo-monero ef56529f93
performance_tests: document the tested bulletproof layouts 2018-09-11 13:37:41 +00:00
moneromooo-monero 2a8fcb421b
Bulletproof aggregated verification and tests
Also constrains bulletproofs to simple rct, for simplicity
2018-09-11 13:37:37 +00:00
moneromooo-monero cb9ecab197
performance_tests: add signature generation/verification 2018-09-11 13:37:33 +00:00
moneromooo-monero bacf0a1e2f
bulletproofs: add aggregated verification
Ported from sarang's java code
2018-09-11 13:37:32 +00:00