FIP-41 Performance and scaling tests

This document contains the performance and scaling tests that were performed by development in the evaluation of the modifications for FIP-41.

 

overview --

the FIP-41 changes affect when locks are evaluated within the FIO protocol. With FIP-41 general locks will be evaluated for house cleaning of expired periods during all of the calls performed in the FIO protocol. Since we have added general lock clearing logic to the process_rewards action in fio.common the following areas of the fio.contracts are impacted by these changes and may experience perf issues when general locks are loaded with significant amounts of user accounts --

./contracts/fio.token/src/fio.token.cpp:328:        process_rewards(tpid, reg_amount,get_self(), actor);
./contracts/fio.address/fio.address.cpp:392:                process_rewards(tpid, reg_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:494:                process_rewards(tpid, reg_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:626:                process_rewards(tpid, reg_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:1392:                process_rewards(tpid, fee_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:1532:                process_rewards(tpid, fee_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:1633:                process_rewards(tpid, fee_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:1758:            process_rewards(tpid, reg_amount, get_self(), actor);
./contracts/fio.address/fio.address.cpp:1994:                process_rewards(tpid, fee_amount, get_self(), actor);
./contracts/fio.staking/fio.staking.cpp:135:            process_rewards(tpid, fee_amount,get_self(), actor);
./contracts/fio.staking/fio.staking.cpp:308:            process_rewards(tpid, fee_amount,get_self(), actor);
./contracts/fio.common/fio.common.hpp:274:    void process_rewards(const string &tpid, const uint64_t &amount, const name &auth, const name &actor) {
./contracts/fio.oracle/fio.oracle.cpp:148:            process_rewards(tpid, wrap_amount,get_self(), actor);
./contracts/fio.oracle/fio.oracle.cpp:468:            process_rewards(tpid, wrap_amount,get_self(), actor);
./contracts/fio.request.obt/fio.request.obt.cpp:232:                process_rewards(tpid, fee_amount, get_self(), aactor);
./contracts/fio.request.obt/fio.request.obt.cpp:427:                process_rewards(tpid, fee_amount, get_self(), aActor);
./contracts/fio.request.obt/fio.request.obt.cpp:581:                process_rewards(tpid, fee_amount, get_self(), aactor);
./contracts/fio.request.obt/fio.request.obt.cpp:719:            process_rewards(tpid, fee_amount, get_self(), aactor);

 

 

To test this possible performance impact, we will load the general locks with a large number of user accounts (more than 60k)…we will then test the locks by creating an account with many locking periods that will expire in short time, we will then call one of the calls in the contracts that invokes the cleaning operations and observe if the cleaning (of more than 10 locking periods) adds any overhead that impacts the successful completion of FIO operations….we will also call several of the operations that perform the cleaning using this account with general locks, and observe if there is any impact on the successful completion of these FIO operations.

 

 

once this test is complete we will also run the regression tests on the FIO protocol and observe if there are any impacts of the overhead of checking an accounts existence in the locks table during the clean check.

 

we will also try to run some set of the operations that use the cleaning operation on accounts that

 

we will make a new test file for these tests…the file will be added to the js test suite and the name will be included in this report.

 

 

 

Testing completed may 18 2022

 

a local network was spun up on a dev box

80k locked token holders were created using locks-transfer-locked-tokens-perfscaling.js

lock token tests were run several times in succession

require('./tests/locks-transfer-locked-tokens');

require ('./tests/locks-transfer-locked-tokens-testnet-smoke-tests');

require ('./tests/locks-transfer-locked-tokens-account-tests');

 

errors in parameter tests in the test net smoke tests were debugged and resolved locally, these tests were failing because they are test net specific in the accounts they use…

 

the following tests were then run

require('./tests/addaddress.js'); // v1.0.x Also includes FIP-13 tests.require('./tests/fees.js'); // v1.0.x

require('./tests/fio-request.js'); // v1.0.x

require('./tests/producer.js'); // v1.0.x

require('./tests/pushtransaction.js'); // v1.0.x

require('./tests/ram.js'); // v1.0.x //Eric to update to remove require('./tests/register-renew-fio-address.js');

require('./tests/register-renew-fio-domain.js'); // v1.0.x

require('./tests/transfer-tokens.js'); // v1.0.x

require('./tests/vote.js'); // v1.0.x

require('./tests/action-whitelisting.js'); // FIP-12, fio v2.0.0, fio.contracts v2.0.0 // Causes future tests to fail. Only run alone.

require('./tests/transfer-domain.js'); // FIP-1.a, fio v2.0.0, fio.contracts v2.1.0

require('./tests/paging.js'); // FIP-2, fio v2.0.0, fio.contracts v2.1.0

require('./tests/remove-address.js'); // FIP-4, fio v2.0.0, fio.contracts v2.1.0

require('./tests/txn-resubmit.js'); //Available with fiosdk_typescript v1.2.0

require('./tests/burn-address.js'); // FIP-7require('./tests/record-obt-data.js'); //FIP-1.b testing

require('./tests/transfer-address.js'); // FIP-1.b

require('./tests/addbundles.js'); // FIP-11.a//

require('./tests/retire-tokens.js'); // FIP-22 Retire tokens. Requires setup to run.

require('./tests/tpid.js');require('./tests/nft-add-remove.js'); //FIP-27

require('./tests/nft-sdk-tests.js');

//require('./tests/nft-performance-tests.js'); //FIP-27

require('./tests/nft-uniqueness.js'); //FIP-27

//require('./tests/nft-remove-burn.js'); //FIP-27

//require('./tests/clio.js'); // FIP-16 Only works with local testing

//require('./tests/performance-request-obt.js');

require('./tests/fee-distribution.js');

//require('./tests/eosio-updateauth.js');

require('./tests/serialize-deserialize.js'); // Tests for BD-3636

//require('./tests/expired-address-domain.js'); // Requires manual updates to contracts to shorten expiration timing

//require('./tests/expired-address-domain-modexpire.js'); // Requires modexpire action which allows expiring of domains

//require('./tests/fio-escrow'); // FIP-26 (marketplace). Requires additional configuration to add the modexpire action

//require('./tests/history.js'); // Only run against history node.

require('./tests/testnet-smoketest.js'); // Testnet smoketest. By default runs against local build./** * Locked token tests (FIP-6,21). Tests may require additional configuration. */

//require('./tests/locks-transfer-locked-tokens-max-load.js'); // OPTIONAL PERFORMANCE TEST. Loads the chain with lots of general locks. Run this before other general locks tests when its desirable to test a loaded chain.

//require('./tests/locks-transfer-locked-tokens-large-grants.js'); //FIP-21 tests for FIO genesis locks functionality. Allocates large grants from faucet.//### These Lock tests do NOT require additional configuration.

require('./tests/locks-transfer-locked-tokens-account-tests.js'); // FIP-6 tests of generic account functionality

require('./tests/locks-transfer-locked-tokens.js'); //FIP-21 locking tests for general locks//### These Lock tests require additional configuration.

//require('./tests/locks-mainnet-locked-tokens-lock1hotfix.js'); //Release 2.4.1 Hotfix for Type 1 locks (was not calculating voting power correctly)

//require('./tests/locks-mainnet-locked-tokens.js'); //FIP-21 tests for FIO genesis locks functionality.//### Testnet only. Not sure this will work. May need updates for recent lock changes

//require('./tests/locks-transfer-locked-tokens-testnet-smoke-tests.js'); //Only works for Testnet/** * Staking Tests (FIP-21) * May require additional configuration (see the notes in js files before running these tests) * in addition to this we need to possibly develop more tests for checking voting power when accounts have staked *///###These Staking tests do NOT require additional configuration.

require('./tests/stake-general-locked-tokens.js'); //FIP-21 tests for general lock accounts performing staking

require('./tests/stake-BD-3552-dev-tests.js');//###These Staking tests require additional configuration.

//require('./tests/stake-tokens.js');//require('./tests/stake-mainnet-locked-tokens-with-staking.js'); //FIP-21 tests for genesis lock accounts performing staking

//require('./tests/stake-rapid-unstake-with-mainnet-locks.js'); //FIP-21 tests for rapid fire unstaking in succession

//require('./tests/stake-regression-with-validator.js');//require('./tests/stake-regression.js'); //FIP-21 tests for new account calling staking using auto proxy, and full pull through to spend after unstaking unlock

//require('./tests/stake-timing.js');/** * clio tests. Only works with local testing since it accesses the fio.devtools/bin directory */

//require('./tests/clio.js'); // FIP-16/** * Producer Tests. Only run on devnet. Requires additional configuration */

//require('./tests/producer-fee-voting-fee-setting.js'); // FIP-10

//require('./tests/producer-fee-setting.js'); // FIP-10/** * History Node tests. Only run against history node. */

//require('./tests/history.js');/** * Performance tests. May require additional configuration. See notes in tests */

//require('./tests/performance-request-obt.js');/** * Archived tests */

//require('./tests/bravo-migr-test.js'); //This is required when testing 2.3.0 (bravo) with fio bahamas (need to do the full table migration).

//require('./tests/locks-transfer-locked-tokens-perfscaling.js');

//require('./tests/locks-transfer-locked-tokens');

require ('./tests/locks-transfer-locked-tokens-testnet-smoke-tests');

 

these tests ran successfully….