Commit Graph

85 Commits

Author SHA1 Message Date
Doyle cc0d51078c Merge dev into upstream 2019-05-01 16:01:17 +10:00
Doyle 9d9d309d03 Merge commit '48e3a341f8bb601895c94e7b637475f8911ae530' into LokiMergeUpstream 2019-04-12 15:48:19 +10:00
Doyle 550e56ac1e Merge commit 'c88e9921043d7c40f023d24c3a3f39f2e96f8738' into LokiMergeUpstream 2019-04-12 14:17:05 +10:00
Doyle 8d7d90c374 Merge commit 'ed6aa76cca69e4f6d0b84eb55ef7061dc4b6fc77' into LokiMergeUpstream 2019-04-11 15:08:26 +10:00
Doyle 3fda0a071a Fix uninitialised variable in core tests causing intermittent failures 2019-04-10 15:16:28 +10:00
Riccardo Spagni 48e3a341f8
Merge pull request #5211
c9b13fbb tests/trezor: HF9 and HF10 tests (Dusan Klinec)
a1fd1d49 device/trezor: HF10 support added, wallet::API (Dusan Klinec)
d74d26f2 crypto: hmac_keccak added (Dusan Klinec)
2019-03-21 14:44:04 +02:00
Dusan Klinec c9b13fbbc2
tests/trezor: HF9 and HF10 tests
- tests fixes for HF10, builder change, rct_config; fix_chain
- get_tx_key test
- proper testing after live refresh added
- live refresh synthetic test
- log available funds for easier test construction
- wallet::API tests with mocked daemon
2019-03-20 21:11:02 +01:00
Maxim Shishmarev 4be45d29cf Fix SN expirations and deregistrations in core tests (#493) 2019-03-18 09:48:50 +10:00
Riccardo Spagni 4c91eb23a0
Merge pull request #5061
1f2930ce Update 2019 copyright (binaryFate)
2019-03-17 17:49:30 +02:00
Riccardo Spagni c88e992104
Merge pull request #4977
5ea17909 device/trezor: debugging features, trezor tests (Dusan Klinec)
2019-03-14 09:43:02 +02:00
binaryFate 1f2930ce0b Update 2019 copyright 2019-03-05 22:05:34 +01:00
Dusan Klinec 5ea17909ca
device/trezor: debugging features, trezor tests 2019-03-05 14:02:45 +01:00
moneromooo-monero 88c85c18e0
cryptonote: avoid double parsing blocks when syncing 2019-03-05 11:58:18 +00:00
Maxim Shishmarev 2eaeb3b6fd Fixed inconsistent types causing error when compiling core tests (#457) 2019-03-04 02:50:08 +00:00
Doyle 53794c7658 Use u64 weights to avoid size_t mismatch across platforms 2019-02-25 18:52:41 +11:00
Doyle 43436b081d
Infinite Staking Part 2 (#406)
* 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 command to print locked key images

* Update ui to display lock stakes, query in print cmd blacklist

* Modify print stakes to be less slow

* Remove autostaking code

* Refactor staking into sweep functions

It appears staking was derived off stake_main written separately at
implementation at the beginning. This merges them back into a common
code path, after removing autostake there's only some minor differences.

It also makes sure that any changes to sweeping upstream are going to be
considered in the staking process which we want.

* Display unlock height for stakes

* Begin creating output blacklist

* Make blacklist output a migration step

* Implement get_output_blacklist for lmdb

* In wallet output selection ignore blacklisted outputs

* Apply blacklisted outputs to output selection

* Fix broken tests, switch key image unlock

* Fix broken unit_tests

* Begin change to limit locked key images to 4 globally

* Revamp prepare registration for new min contribution rules

* Fix up old back case in prepare registration

* Remove debug code

* Cleanup debug code and some unecessary changes

* Fix migration step on mainnet db

* Fix blacklist outputs for pre-existing DB's

* Remove irrelevant note

* Tweak scanning addresses for locked stakes

Since we only now allow contributions from the primary address we can
skip checking all subaddress + lookahead to speed up wallet scanning

* Define macro for SCNu64 for Mingw

* Fix failure on empty DB

* Add missing error msg, remove contributor from stake

* Improve staking messages

* Flush prompt to always display

* Return the msg from stake failure and fix stake parsing error

* Tweak fork rules for smaller bulletproofs

* Tweak pooled nodes minimum amounts

* Fix crash on exit, there's no need to store on destructor

Since all information about service nodes is derived from the blockchain
and we store state every time we receive a block, storing in the
destructor is redundant as there is no new information to store.

* Make prompt be consistent with CLI

* Check max number of key images from per user to node

* Implement error message on get_output_blacklist failure

* Remove resolved TODO's/comments

* Handle infinite staking in print_sn

* Atoi->strtol, fix prepare_registration, virtual override, stale msgs
2019-02-14 12:12:57 +11:00
doy-lee bebecbd0a6 Merge branch 'dev' into LokiMergeUpstream 2019-01-30 16:59:47 +11:00
doy-lee e9247ce107 Merge commit '08f08' into LokiMergeUpstream 2019-01-30 11:15:40 +11: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
doy-lee cbd8193ba2 Fix destruction of service node list locking destroyed mutex 2019-01-18 16:16:23 +11:00
doy-lee da32932ad9 Merge commit 'c8fc06c' into LokiMergeUpstream 2019-01-17 15:14:42 +11:00
moneromooo-monero 524bf750c0
core_tests: add a --list_tests command line switch 2019-01-07 14:42:19 +00:00
doy-lee 40506127a4 Merge commit '7e957c1' into LokiMergeUpstream 2018-12-11 13:46:35 +11:00
doy-lee a52aa2ef3a Revert off by 1 fix, fix git merge issue 2018-12-10 19:33:28 +11:00
doy-lee 45af8b928c Fix off by one initialising hardforks 2018-12-10 14:54:42 +11:00
moneromooo-monero d4f50cb109
remove some unused code
Found by codacy.com
2018-11-23 15:37:36 +00:00
Doyle 713adfe92c
Core Tests TX Validation (#337)
* Fix gen_tx_unlock_time, gen_tx_big_version

* Fix gen_tx_input_is_not_txin_to_key

* Change convention for block naming in working tests

* Fix gen_tx_has_inputs_no_outputs, invalid_input_amount

* Fix gen_tx_input_wo_key_offsets

* Add test note about gen_tx_mixed_key_offset_not_exist

* Uncomment tests

* Unbreak broken gx_ten tests

* Fix gen_tx_key_image_not_derive_from_tx_key

* Fix gen_tx_key_image_is_invalid

* Fix gen_tx_txout_to_key_has_invalid_key

* Add note for gen_tx_output_with_zero_amount

* Fix gen_tx_signatures_are_invalid
2018-11-22 13:00:15 +11:00
doy-lee 6154d3af6a Fix TXBuilder default hf value causing regression in core_tests 2018-11-21 16:34:07 +11:00
Maxim Shishmarev 6d763041e0 add core tests for swarms (#321) 2018-11-16 16:07:41 +11:00
Doyle fad67eee46
Rotating Governance Schedule (#303)
* Add multiple governance keys

* Batch governance payments to every interval blocks

* Batching of gov rewards and fix breakages in tests

* Add changes to api for working with core tests

* Clean up left over debug stuff

* more cleanup

* Fix uninitialised batched governance value

* Remove dependency on blockchain in tx utils

* Remove redundant vector reserve
2018-11-12 14:02:21 +11:00
Doyle cd04e1efa3
Merge pull request #287 from Doy-lee/LokiMergeUpstreamUntil_20181010_77e1ebf
Loki merge upstream until 2018-10-10 #77e1ebf
2018-10-19 14:28:51 +11:00
Maxim Shishmarev 63337de3d9 fixed some (previously working) core tests (#288) 2018-10-15 12:23:28 +11:00
doy-lee e2c8660d22 Merge dev changes 2018-10-10 17:51:16 +11:00
doy-lee 339f96b0cc Merge commit 'c23b6f8' into LokiMergeUpstreamUntil_20181010_77e1ebf 2018-10-10 15:07:16 +11:00
Maxim Shishmarev 1157d90345 use vector for hard fork versions in test options 2018-10-10 13:02:45 +11:00
doy-lee c1da4f690d Merge commit '5ffb2ff' into LokiMergeUpstreamUntil_20180911_e6d36c1 2018-10-09 12:31:08 +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
naughtyfox 9acf42d371 Multisig M/N functionality core tests added 2018-10-01 19:17:34 +03:00
naughtyfox 9f3963e823 Arbitrary M/N multisig schemes:
* support in wallet2
* support in monero-wallet-cli
* support in monero-wallet-rpc
* support in wallet api
* support in monero-gen-trusted-multisig
* unit tests for multisig wallets creation
2018-10-01 19:16:56 +03:00
doy-lee 0012fe9568 Merge batch upstream changes from monero 2018-09-19 19:21:56 +10:00
Maxim Shishmarev d8944cb5ca core_tests: more tests and some refactoring (#205)
* core_tests: test that deregister tx make it into full blocks

* correct derivation of the service nodes winner in core tests

* core_tests: check deregistrations with non-zero fee declined

* core_tests: linear chain generator refactoring

* core_tests: test deregister safety buffer

* fix build error with const elements

* remote unnecessary const from return type
2018-09-14 14:35:29 +10:00
moneromooo-monero 8d769392d9 replace std::list with std::vector on some hot paths
also use reserve where appropriate
2018-09-13 18:31:35 +10:00
moneromooo-monero 5ffb2ff9b7
v8: per byte fee, pad bulletproofs, fixed 11 ring size 2018-09-11 13:38:07 +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
Doyle 25292b3e86 Version 0.4.0 Release Candidate (#216)
* core: submit uptime proof immediately after registering

* Increase visibility of autostaking prompts

* quorum_cop: changed uptime proof prune timeout to 2 hours 10 minutes

* cleanup: removed scope limiting block

* check_tx_inputs: fix deregister double spend test to include deregisters from other heights

* config: new testnet network id, genesis tx, and version bump

* wallet2: fix testnet wallet blockheight approximation

* Fix change in address format in RPC which broke parsing and pooling contributors (#184)

* Fix service node endpoints for RPC to also use stdout (#185)

* fixed some further rct core tests (#180)

* Fix service node state by calling detached hooks on failure to switch to alt chain (#188)

* fixed block verification core tests (#186)

* fixed block verification core tests

* core tests: removed gen_block_miner_tx_out_is_small which is only relevant to hardfork version 1

*  Don't consider expired deregistrations when filling block template

* Add unit tests for getting staking requirement (#191)

* First service node test (#190)

* core_tests: added service node tests

* core_tests: check balance after registration tx

* Fix underflow for popping rollback events (#189)

* Move deregistration age check into check_tx_inputs

* Zero initialise rct_signatures member txnFee is a uint64_t and has uninit values

* Enforce that deregisters must be 0 fee since we skip checks

* Add unit tests for vote validation (#193)

* Add unit tests for deregistration validation (#194)

* Mainnet checkpoint 86535, testnet 3591, 4166

* Bump version number

* Add print_sr for getting staking requirement (#198)

* Misc bugfixes (#203)

* removed unnecessary cast to double during txfee+coinbase calculation

* simplewallet: increased autostaking interval from 2 minutes to 40

* Fix casting issues from uint to int (#204)

* core_tests: check service node registration and expiration (#195)

* core_tests: check service node registration and deregistration

* core_tests for service nodes:

- include service nodes rewards when calculating account's balance
- check that service nodes rewards have been received

* fixed namespace error; reduced the scope of staking requirement constants

* On blockchain inc/dec mark deregisters relayble based on age (#201)

* Service nodes restore only 1 rollback bug (#206)

* Fix restore 1 rollback event, ensure prevent rollback is always added

* Remove adding prevent_rollback event at init

It gets called in on block added generic anyway.

* Log db exception, fix relation operators for vote/deregister lifetime (#207)

* Filter relayable deregisters w/ check_tx_inputs instead of blockchain callbacks

* Bump version to 0.3.7-beta

* fix build with GCC 8.1.0 (#211)

* Add temp hardfork rule in testnet for deregister lifetimes (#210)

* Update testnet, remove testnet forks, remove checkpoints, update blockheight estimate (#212)

* Don't ban peers for a bad vote, just drop their connection (#213)

* Update to version 0.3.0 release candidate (#215)
2018-09-07 17:42:48 +10:00
Maxim Shishmarev 857aa8e7b6 returning correct amount in for rct txs in tests 2018-08-21 19:07:17 +10:00
Maxim Shishmarev 5898c3eedd core_tests: helper functions in core tests to create rct transactions
* core tests: update transaction generating code to support RCT
* fixed some of the first core tests
2018-08-18 22:21:42 +10:00
jcktm dbe25f7a57 tests: change MAKE_TX test macros to use ring ct and bulletproofs; begin preparations for service node tests 2018-08-10 14:29:51 +10:00
jcktm ce173c9d44
Begin fixing core tests (#132)
- Difficulty fix to prevent 0 difficulty which is not considered valid.
- CURRENT_BLOCK_MAJOR/MINOR_VERSION is only used for tests it appears
- Core Tests generate a blockchain using the nettype FAKECHAIN, so some
  codepaths need to accept FAKECHAIN as a nettype. FAKECHAIN is essentially the
  mainnet.
- Core Tests uses their own hard-fork data that specifies the current hard-fork
  version and time it forked etc instead of using the data in blockchain.cpp at
  the top. We started from v7, so get_test_options() is updated accordingly.
2018-08-10 10:43:02 +10:00
sachaaaaa 4349bc43c4 Remove max_outs argument from construct_miner_tx 2018-07-23 11:12:09 +10:00