Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated stress test to base node wallet #2355

Merged

Conversation

hansieodendaal
Copy link
Contributor

@hansieodendaal hansieodendaal commented Oct 19, 2020

Description

  1. This change adds the ability to perform an automated stress test that uses a command file as input. The command file accommodates one optional coin-split command and one or more make-it-rain commands. The number and amount of
    test UTXOs will be assessed, and if found to be inadequate to perform the entire test, the coin-split will be attempted if requested. In the event of a coin-split, the wallet will be monitored for up to 30 minutes to determine if a sufficient number of UTXOs became available, and when that is achieved, the stress test will start. The make-it-rain commands can be scheduled to start at a specific time, thus the test can be started in advance.
  2. Updated the make-it-rain to not rely on peer discovery anymore before starting the test, but rather using a ping transaction's direct send results to determine connectivity.
  3. Fixed a bug in the make-it-rain transaction rate controller where subtracting two unsigned ints resulted in a large positive number, which broke the logic.
  4. Fixed clippy warnings.
  5. Fixed doc test.

Example console command:

stress-test ../stress_test.txt

Example command file:

# We need these!
coin-split 10000 121
# Let us stress the network
make-it-rain 10 15 8000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!
make-it-rain 10 15 9000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!

Example terminal output - test could not be performed due to time-out:

>> stress-test ..\stress_test.txt

>>
The test requires 300 UTXOs, minimum value of 9925 each (average fee included); 
  our current wallet has 271 UTXOs that is adequate.

Command: coin-split 10000 121

coin-split 10000 99
Coin split transaction created with tx_id:
16124744115680775216
coin-split 10000 22
Coin split transaction created with tx_id:
9181473920642184746

We still need 33 UTXOs, waiting for them to be created...

We have created enough UTXOs, initiating the stress test.

Command: make-it-rain 10 15 8000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!
Command: make-it-rain 10 15 9000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!
馃拃 Test transaction to `7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518` timed out , cannot perform 'make-it-rain' test
馃拃 Test transaction to `7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518` timed out , cannot perform 'make-it-rain' test

Example terminal output - test successful:

>> stress-test ..\stress_test.txt

>>
The test requires 300 UTXOs, minimum value of 9925 each (average fee included); our current wallet has 386 UTXOs that is adequate.

Command: make-it-rain 10 15 8000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!
Command: make-it-rain 10 15 9000 1 now 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518 Testing the network!
Sending 9000 碌T Tari to 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518
Sending 8000 碌T Tari to 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518
Sending 8001 碌T Tari to 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518
Sending 9001 碌T Tari to 7ad67f1c608d25bf6126f5ce5e44cabc5f1b0464ae14efd1969d52f2dfb5c518
...

Motivation and Context

Stress tests need to be performed more frequent for testnet an easy barrier for entry for community members.

How Has This Been Tested?

Tested between three base nodes in Windows.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Feature refactor (No new feature or functional changes, but performance or technical debt improvements)
  • New Tests
  • Documentation

Checklist:

  • I'm merging against the development branch.
  • I ran cargo-fmt --all before pushing.
  • I ran cargo test successfully before submitting my PR.
  • I have squashed my commits into a single commit.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@hansieodendaal hansieodendaal changed the title Add automated stress test to base node wallet WIP: Add automated stress test to base node wallet Oct 19, 2020
@hansieodendaal hansieodendaal force-pushed the ho_stress_test branch 2 times, most recently from 4f754aa to df4adfc Compare October 20, 2020 08:44
@hansieodendaal hansieodendaal changed the title WIP: Add automated stress test to base node wallet Add automated stress test to base node wallet Oct 20, 2020
delta1
delta1 previously approved these changes Oct 20, 2020
Copy link
Contributor

@delta1 delta1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to test the happy path since I had enough utxos. Haven't tested the coin-split path though.

applications/tari_base_node/src/parser.rs Outdated Show resolved Hide resolved
@hansieodendaal
Copy link
Contributor Author

I managed to test the happy path since I had enough utxos. Haven't tested the coin-split path though.

Thanks!

@hansieodendaal hansieodendaal force-pushed the ho_stress_test branch 7 times, most recently from f73dfac to d607c07 Compare October 27, 2020 08:06
@hansieodendaal hansieodendaal changed the title Add automated stress test to base node wallet WIP: Add automated stress test to base node wallet Oct 27, 2020
@hansieodendaal hansieodendaal force-pushed the ho_stress_test branch 3 times, most recently from f195a8f to c3e0029 Compare October 27, 2020 12:41
This change adds the ability to perform an automated stress test that uses a
command file as input. The command file accommodates one optional `coin-split`
command and one or more `make-it-rain` commands. The number and amount of
test UTXOs will be assessed, and if found to be inadequate to perform the
entire test, the `coin-split` will be attempted if requested. In the event of
a `coin-split`, the wallet will be monitored for up to 30 minutes to determine
if a sufficient number of UTXOs became available, and when that is achieved,
the stress test will start. The `make-it-rain` commands can be scheduled to
start at a specific time, thus the test can be started in advance.
@hansieodendaal hansieodendaal changed the title WIP: Add automated stress test to base node wallet Add automated stress test to base node wallet Oct 27, 2020
@stringhandler stringhandler merged commit d118b20 into tari-project:development Oct 27, 2020
@hansieodendaal hansieodendaal deleted the ho_stress_test branch October 27, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants