Commit graph

25 commits

Author SHA1 Message Date
Doyle
8aacc33fb1
Rewrite the integration tests to use pipes (#1045) 2020-02-21 14:48:25 +11:00
Jason Rhinelander
b51fd0c5db --regtest fixes and mine n blocks ability
`--regtest` didn't work in some edge cases, this fixes various things:

- the genesis block wasn't accepted because it needed to be v7, not
  vMax
- reduce initial uptime proof delay to 5s in regtest mode
- add --regtest flag to the wallet so that it can talk to a daemon in
  --regtest mode.

This also adds two new mining options, available via rpc:

- slow_mining - this avoids the RandomX initialization.  It is much
  slower, but for regtest with fixed difficulty of 1 that is perfectly
  fine.
- `num_blocks` - instruct the miner to mine for the given number of
  blocks, then stop.  (This can overmine if mining with multiple
  threads at a low difficulty, but that's fine).
2019-12-26 12:29:05 -04:00
Doyle
e6b5ef558a
Service node checkpointing deregistration (#672)
* Add deregistration of checkpoints by checking how many votes are missed

Move uptime proofs and add checkpoint counts in the service_node_list
because we typically prune uptime proofs by time, but it seems we want
to switch to a model where we persist proof data until the node expires
otherwise currently we would prune uptime entries and potentially our
checkpoint vote counts which would cause premature deregistration as the
expected vote counts start mismatching with the number of received
votes.

* Revise deregistration

* Fix test breakages

* uint16_t for port, remove debug false, min votes to 2 in integration mode

* Fix integration build
2019-06-27 17:05:44 +10:00
Doyle
fdc340b0ee
Service node checkpointing: rebased on relaxed deregistration (#662)
* core: do not commit half constructed batch db txn

* Add defer macro

* Revert dumb extra copy/move change

* Fix pop_blocks not calling hooks, fix BaseTestDB missing prototypes

* Merge ServiceNodeCheckpointing5 branch, syncing and integration fixes

* Update tests to compile with relaxed-registration changes

* Get back to feature parity pre-relaxed registration changes

* Remove debug changes noticed in code review and some small bugs
2019-06-26 14:00:05 +10:00
Doyle
b1c92fd216 Add helper functions to facilitate more reliable integration tests 2019-04-09 15:47:23 +10:00
doy-lee
37260e5540 Add build target for integration binaries 2019-02-05 15:13:36 +11:00
doy-lee
9c6193167b Revamp to use semaphores for IPC
Delay hooks into stdin/out until core is idle for daemons

Disable logging for daemon (super problematic)
2019-01-31 18:29:08 +11:00
doy-lee
dc37d80a16 Remove constant sharedmem open and buffer fail print_sn message 2018-12-11 20:07:05 +11:00
doy-lee
cb0e6a17e0 Fix print sn status to output one message
- Allow interaction during autostaking in integration mode
- Reorder read/write to prevent race conditions
- Fix incorrect cmd_index cast back to int32_t
2018-12-11 14:43:04 +11:00
doy-lee
e7025839ef Null terminate the read response from shared mem 2018-12-11 14:43:04 +11:00
doy-lee
cf6570fb12 Add ability to handle multiple daemon/wallets 2018-12-11 14:43:04 +11:00
doy-lee
de5f64addb Move sleep to after first failed read, switch to cmd counter 2018-12-11 14:43:04 +11:00
doy-lee
e8a8ebb23a Allow overriding hardforks without forcing fakechain 2018-12-11 14:43:04 +11:00
doy-lee
d3b12ee2fa Allow passing custom hardfork heights through cmdline
Expected format: <fork_version>:<fork_height>, ...
Example: 7:0, 8:10, 9:20, 10:100
2018-12-11 14:43:04 +11:00
doy-lee
2454d07273 Minimise sleep, remove ANSI color codes from msg writer in testing mode 2018-12-11 14:43:04 +11:00
doy-lee
3f4a76f862 Fix subtle bug reading wrong shared memory region 2018-12-11 14:43:04 +11:00
doy-lee
c623c416f8 Remove shoom destructor and add shared mem handling to own thread
Shoom destructor is causing more problems than it solves right now,
somewhere at sometime the destructor is called and implicitly unlinking
files and I can't identify where.
2018-12-11 14:43:04 +11:00
doy-lee
9e0c43aa8a Fixes to shoom lib, move test context init to main for wallet 2018-12-11 14:43:04 +11:00
doy-lee
31f6ac6ee9 Simplify shared memory initialisation 2018-12-11 14:43:04 +11:00
doy-lee
dc8917b766 Cleanup pass, got it working with single header again! 2018-12-11 14:43:04 +11:00
doy-lee
d07f3d4840 Undo single header file because breakage .. 2018-12-11 14:43:04 +11:00
doy-lee
8978d1c19b Respect exit command for integration hooks 2018-12-11 14:43:04 +11:00
doy-lee
092d99819e Hook into scoped_message_writer 2018-12-11 14:43:04 +11:00
doy-lee
f1759683ec Add hooks into std::cin in rpc command executor 2018-12-11 14:43:04 +11:00
doy-lee
9adbe5b8e4 Move integration testing tools into own file 2018-12-11 14:43:04 +11:00