Draft: for experiments only - not to be merged
Branch based on ms_massive_trx
where the test bounces money in circle between three accounts, but does not have presign phase.
New version of the test uses custom_json_operation
on initminer
. 180k of them. For the test to work two destructive changes in the code are needed (included in this MR along with some logging extensions that are not necessary for it to work):
- when
sign_transaction
is called, the call does not overwrite given expiration and tapos data. That change is needed for preparation phase so all transactions are bound to block that is going to be exactly the same in main phase (otherwise the preparation phase would be binding transactions to blockchain reality that will be different in main phase, making them invalid) - witness plugin no longer limits amount of custom operations per block per user. That change is needed so all transactions can be generated by
initminer
. Otherwise we'd need tons of separate accounts and make sure we never go above limit when sending transactions, which is not possible, unless we have enough of them to not generate above limit on any of them in total (180k/5=36k since limit is 5)
To run the test you'll need test_tools
installed (see here - I've used virtual environment version).
- go to ./tests/functional/python_tests/massive_trx and edit test_massive_trxs.py to set
PRODUCE = True
- this will turn test into production phase - run the test with
HIVE_BUILD_ROOT_PATH=~/<path to hived testnet build>/ LIBFAKETIME_PATH=~/<path to libfaketime src>/libfaketime.so.1 python3 -m pytest test_massive_trxs.py
. The test will run for a while - each thread produces 3k transactions. - follow with
cat tx* > transactions
. - edit the test reverting to
PRODUCE = False
- this turns the test into main phase. - run the test again. Once all threads finish sending presigned transactions, the test will run indefinitely until Ctrl+C.
- you can now look into generated logs, or grep them first, f.e. with
cat generated_during_test_massive_trxs/test_massive_trxs/Alpha/WitnessNode0/logs/p2p/p2p.log | grep -e "pushing block" -e "successfully" -e "congestion" -e "Block Time Offset" -e "were applied" -e "pending transactions" > filtered.alpha1
for each node, changingAlpha
toBeta
orGamma
andWitnessNode0
toWitnessNode1
in all combinations
Transactions in this test won't expire unless you run it for very long, but if you want to test that, you can modify expiration
accordingly in production phase. You can also change transaction, f.e. reducing number of needed signatures will later make transactions to be processed faster.