Skip to content

Commit dba45e8

Browse files
committed
Remove loadgen account creation mode, simplify upgrade path in tests
1 parent dc941d5 commit dba45e8

File tree

13 files changed

+311
-561
lines changed

13 files changed

+311
-561
lines changed

docs/metrics.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ ledger.operation.count | histogram | number of operations per
8787
ledger.transaction.apply | timer | time to apply one transaction
8888
ledger.transaction.count | histogram | number of transactions per ledger
8989
ledger.transaction.internal-error | counter | number of internal errors since start
90-
loadgen.account.created | meter | loadgenerator: account created
9190
loadgen.payment.native | meter | loadgenerator: native payment submitted
9291
loadgen.pretend.submitted | meter | loadgenerator: pretend ops submitted
9392
loadgen.run.complete | meter | loadgenerator: run complete

docs/software/commands.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,11 +449,14 @@ this survey mechanism, just set `SURVEYOR_KEYS` to `$self` or a bogus key
449449

450450
### The following HTTP commands are exposed on test instances
451451
* **generateload** `generateload[?mode=
452-
(create|pay|pretend|mixed_classic|soroban_upload|soroban_invoke_setup|soroban_invoke|upgrade_setup|create_upgrade|mixed_classic_soroban|pay_pregenerated|stop)&accounts=N&offset=K&txs=M&txrate=R&spikesize=S&spikeinterval=I&maxfeerate=F&skiplowfeetxs=(0|1)&dextxpercent=D&minpercentsuccess=S&instances=Y&wasms=Z&payweight=P&sorobanuploadweight=Q&sorobaninvokeweight=R&file=F]`
452+
(pay|pretend|mixed_classic|soroban_upload|soroban_invoke_setup|soroban_invoke|upgrade_setup|create_upgrade|mixed_classic_soroban|pay_pregenerated|stop)&accounts=N&offset=K&txs=M&txrate=R&spikesize=S&spikeinterval=I&maxfeerate=F&skiplowfeetxs=(0|1)&dextxpercent=D&minpercentsuccess=S&instances=Y&wasms=Z&payweight=P&sorobanuploadweight=Q&sorobaninvokeweight=R&file=F]`
453453

454454
Artificially generate load for testing; must be used with
455455
`ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING` set to true.
456-
* `create` mode creates new accounts. Batches 100 creation operations per transaction.
456+
457+
**Note**: The `create` mode has been deprecated and removed. To create test accounts,
458+
use the `GENESIS_TEST_ACCOUNT_COUNT` configuration parameter which creates accounts
459+
at genesis when initializing a test network.
457460
* `pay` mode generates `PaymentOp` transactions on accounts specified
458461
(where the number of accounts can be offset).
459462
* `pay_pregenerated` mode submits pre-generated payment transactions from an XDR file.
@@ -518,7 +521,7 @@ this survey mechanism, just set `SURVEYOR_KEYS` to `$self` or a bogus key
518521
weight divided by the sum of all weights.
519522
* `stop` mode stops any existing load generation run and marks it as "failed".
520523

521-
Non-`create` load generation makes use of the additional parameters:
524+
Load generation makes use of the additional parameters:
522525
* when a nonzero `spikeinterval` is given, a spike will occur every
523526
`spikeinterval` seconds injecting `spikesize` transactions on top of
524527
`txrate`

src/herder/test/HerderTests.cpp

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3058,6 +3058,7 @@ TEST_CASE("soroban txs each parameter surge priced", "[soroban][herder]")
30583058
cfg.LOADGEN_NUM_DATA_ENTRIES_FOR_TESTING = {mid};
30593059
cfg.LOADGEN_NUM_DATA_ENTRIES_FOR_TESTING = {1};
30603060
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 100;
3061+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 100;
30613062
tweakAppCfg(cfg);
30623063
return cfg;
30633064
});
@@ -3081,18 +3082,11 @@ TEST_CASE("soroban txs each parameter surge priced", "[soroban][herder]")
30813082
simulation);
30823083
auto& loadGen = nodes[0]->getLoadGenerator();
30833084

3084-
// Generate some accounts
30853085
auto& loadGenDone = nodes[0]->getMetrics().NewMeter(
30863086
{"loadgen", "run", "complete"}, "run");
30873087
auto currLoadGenCount = loadGenDone.count();
3088-
loadGen.generateLoad(GeneratedLoadConfig::createAccountsLoad(
3089-
numAccounts, baseTxRate));
3090-
simulation->crankUntil(
3091-
[&]() { return loadGenDone.count() > currLoadGenCount; },
3092-
10 * simulation->getExpectedLedgerCloseTime(), false);
30933088

30943089
// Setup invoke
3095-
currLoadGenCount = loadGenDone.count();
30963090
loadGen.generateLoad(
30973091
GeneratedLoadConfig::createSorobanInvokeSetupLoad(
30983092
/* nAccounts */ numAccounts, /* nInstances */ 10,
@@ -3277,6 +3271,7 @@ TEST_CASE("overlay parallel processing", "[herder][parallel]")
32773271
auto cfg = getTestConfig(i);
32783272
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 100;
32793273
cfg.BACKGROUND_OVERLAY_PROCESSING = true;
3274+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 100;
32803275
return cfg;
32813276
});
32823277
}
@@ -3290,6 +3285,7 @@ TEST_CASE("overlay parallel processing", "[herder][parallel]")
32903285
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 100;
32913286
cfg.BACKGROUND_OVERLAY_PROCESSING = true;
32923287
cfg.EXPERIMENTAL_BACKGROUND_TX_SIG_VERIFICATION = true;
3288+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 100;
32933289
return cfg;
32943290
});
32953291
}
@@ -3306,6 +3302,7 @@ TEST_CASE("overlay parallel processing", "[herder][parallel]")
33063302
cfg.EXPERIMENTAL_PARALLEL_LEDGER_APPLY = true;
33073303
cfg.ARTIFICIALLY_DELAY_LEDGER_CLOSE_FOR_TESTING =
33083304
std::chrono::milliseconds(500);
3305+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 100;
33093306
return cfg;
33103307
});
33113308
}
@@ -3324,16 +3321,9 @@ TEST_CASE("overlay parallel processing", "[herder][parallel]")
33243321
simulation);
33253322
auto& loadGen = nodes[0]->getLoadGenerator();
33263323

3327-
// Generate some accounts
33283324
auto& loadGenDone =
33293325
nodes[0]->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
33303326
auto currLoadGenCount = loadGenDone.count();
3331-
uint32_t const numAccounts = 100;
3332-
loadGen.generateLoad(
3333-
GeneratedLoadConfig::createAccountsLoad(numAccounts, desiredTxRate));
3334-
simulation->crankUntil(
3335-
[&]() { return loadGenDone.count() > currLoadGenCount; },
3336-
10 * simulation->getExpectedLedgerCloseTime(), false);
33373327

33383328
auto& secondLoadGen = nodes[1]->getLoadGenerator();
33393329
auto& secondLoadGenDone =
@@ -3377,6 +3367,7 @@ TEST_CASE("soroban txs accepted by the network",
33773367
Topologies::core(4, 1, Simulation::OVER_LOOPBACK, networkID, [](int i) {
33783368
auto cfg = getTestConfig(i, Config::TESTDB_DEFAULT);
33793369
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 100;
3370+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 100;
33803371
return cfg;
33813372
});
33823373
simulation->startAllNodes();
@@ -3406,15 +3397,9 @@ TEST_CASE("soroban txs accepted by the network",
34063397
auto& sorobanTxsFailed = nodes[0]->getMetrics().NewCounter(
34073398
{"ledger", "apply-soroban", "failure"});
34083399

3409-
// Generate some accounts
34103400
auto& loadGenDone =
34113401
nodes[0]->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
34123402
auto currLoadGenCount = loadGenDone.count();
3413-
loadGen.generateLoad(
3414-
GeneratedLoadConfig::createAccountsLoad(numAccounts, desiredTxRate));
3415-
simulation->crankUntil(
3416-
[&]() { return loadGenDone.count() > currLoadGenCount; },
3417-
10 * simulation->getExpectedLedgerCloseTime(), false);
34183403

34193404
uint64_t lastSorobanSucceeded = sorobanTxsSucceeded.count();
34203405
uint64_t lastSucceeded = txsSucceeded.count();

src/main/CommandHandler.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,7 +1165,7 @@ CommandHandler::generateLoad(std::string const& params, std::string& retStr)
11651165
std::map<std::string, std::string> map;
11661166
http::server::server::parseParams(params, map);
11671167
auto modeStr =
1168-
parseOptionalParamOrDefault<std::string>(map, "mode", "create");
1168+
parseOptionalParamOrDefault<std::string>(map, "mode", "pay");
11691169
// First check if a current run needs to be stopped
11701170
if (modeStr == "stop")
11711171
{
@@ -1174,6 +1174,15 @@ CommandHandler::generateLoad(std::string const& params, std::string& retStr)
11741174
return;
11751175
}
11761176

1177+
// Check for deprecated CREATE mode
1178+
if (modeStr == "create")
1179+
{
1180+
retStr = "DEPRECATED: CREATE mode has been removed. "
1181+
"Use GENESIS_TEST_ACCOUNT_COUNT configuration parameter "
1182+
"to create test accounts at genesis instead.";
1183+
return;
1184+
}
1185+
11771186
GeneratedLoadConfig cfg;
11781187
cfg.mode = LoadGenerator::getMode(modeStr);
11791188

src/main/test/ApplicationUtilsTests.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class SimulationHelper
8585
mMainCfg.MAX_SLOTS_TO_REMEMBER = 50;
8686
mMainCfg.USE_CONFIG_FOR_GENESIS = false;
8787
mMainCfg.TESTING_UPGRADE_DATETIME = VirtualClock::from_time_t(0);
88+
mMainCfg.GENESIS_TEST_ACCOUNT_COUNT = 50;
8889

8990
mTestCfg.ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING = true;
9091
mTestCfg.NODE_IS_VALIDATOR = false;
@@ -155,21 +156,11 @@ class SimulationHelper
155156
uint32_t selectedLedger = 0;
156157
std::string selectedHash;
157158

158-
auto& loadGen = mMainNode->getLoadGenerator();
159-
auto& loadGenDone = mMainNode->getMetrics().NewMeter(
160-
{"loadgen", "run", "complete"}, "run");
161-
162-
loadGen.generateLoad(
163-
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 50,
164-
/* txRate */ 1));
165-
auto currLoadGenCount = loadGenDone.count();
166-
167159
auto checkpoint = HistoryManager::getCheckpointFrequency(mMainCfg);
168160

169161
// Make sure validator publishes something
170162
mSimulation->crankUntil(
171163
[&]() {
172-
bool loadDone = loadGenDone.count() > currLoadGenCount;
173164
auto lcl =
174165
mMainNode->getLedgerManager().getLastClosedLedgerHeader();
175166
// Pick some ledger in the selected checkpoint to run
@@ -182,9 +173,8 @@ class SimulationHelper
182173

183174
// Validator should publish up to and including the selected
184175
// checkpoint
185-
return loadDone &&
186-
mSimulation->haveAllExternalized(
187-
(selectedCheckpoint + 1) * checkpoint, 5);
176+
return mSimulation->haveAllExternalized(
177+
(selectedCheckpoint + 1) * checkpoint, 5);
188178
},
189179
50 * mSimulation->getExpectedLedgerCloseTime(), false);
190180

src/overlay/test/OverlayTests.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,7 @@ TEST_CASE("flow control when out of sync", "[overlay][flowcontrol]")
20882088
cfg.PEER_READING_CAPACITY = 1;
20892089
cfg.FLOW_CONTROL_SEND_MORE_BATCH_SIZE = 1;
20902090
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000;
2091+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 3000;
20912092
if (i == 1)
20922093
{
20932094
cfg.FORCE_SCP = false;
@@ -2112,9 +2113,10 @@ TEST_CASE("flow control when out of sync", "[overlay][flowcontrol]")
21122113

21132114
// Generate transactions traffic, which the out of sync node will drop
21142115
auto& loadGen = node->getLoadGenerator();
2116+
// Generate payment transactions
21152117
loadGen.generateLoad(
2116-
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 3000,
2117-
/* txRate */ 1));
2118+
GeneratedLoadConfig::txLoad(LoadGenMode::PAY, /* nAccounts */ 3000,
2119+
/* nTxs */ 100, /* txRate */ 1));
21182120

21192121
auto& loadGenDone =
21202122
node->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
@@ -2162,6 +2164,7 @@ TEST_CASE("overlay flow control", "[overlay][flowcontrol][acceptance]")
21622164
Herder::FLOW_CONTROL_BYTES_EXTRA_BUFFER;
21632165
cfg.FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES = 100;
21642166
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000;
2167+
cfg.GENESIS_TEST_ACCOUNT_COUNT = 150;
21652168
configs.push_back(cfg);
21662169
}
21672170

@@ -2212,20 +2215,10 @@ TEST_CASE("overlay flow control", "[overlay][flowcontrol][acceptance]")
22122215
// Generate a bit of load to flood transactions, make sure nodes can
22132216
// close ledgers properly
22142217
auto& loadGen = node->getLoadGenerator();
2215-
loadGen.generateLoad(
2216-
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 150,
2217-
/* txRate */ 1));
2218-
22192218
auto& loadGenDone =
22202219
node->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
22212220
auto currLoadGenCount = loadGenDone.count();
22222221

2223-
simulation->crankUntil(
2224-
[&]() { return loadGenDone.count() > currLoadGenCount; },
2225-
15 * simulation->getExpectedLedgerCloseTime(), false);
2226-
2227-
currLoadGenCount = loadGenDone.count();
2228-
22292222
loadGen.generateLoad(GeneratedLoadConfig::txLoad(LoadGenMode::PAY,
22302223
/* nAccounts */ 150, 200,
22312224
/*txRate*/ 5));
@@ -2820,6 +2813,7 @@ TEST_CASE("overlay pull mode loadgen", "[overlay][pullmode][acceptance]")
28202813
{
28212814
auto cfg = getTestConfig(i + 1);
28222815
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = numAccounts * MAX_OPS_PER_TX;
2816+
cfg.GENESIS_TEST_ACCOUNT_COUNT = numAccounts * MAX_OPS_PER_TX;
28232817
configs.push_back(cfg);
28242818
}
28252819

@@ -2880,11 +2874,11 @@ TEST_CASE("overlay pull mode loadgen", "[overlay][pullmode][acceptance]")
28802874
node2->getHerder().setMaxTxSize(txSizeLimit);
28812875
}
28822876

2883-
// Create 5 txns each creating one new account.
2877+
// Generate payment transactions
28842878
// Set a really high tx rate so we create the txns right away.
2885-
loadGen.generateLoad(GeneratedLoadConfig::createAccountsLoad(
2886-
/* nAccounts */ numAccounts * MAX_OPS_PER_TX,
2887-
/* txRate */ 2));
2879+
loadGen.generateLoad(GeneratedLoadConfig::txLoad(
2880+
LoadGenMode::PAY, /* nAccounts */ numAccounts * MAX_OPS_PER_TX,
2881+
/* nTxs */ numAccounts, /* txRate */ 2));
28882882

28892883
// Let the network close multiple ledgers.
28902884
// If the logic to advertise or demand incorrectly sends more than

0 commit comments

Comments
 (0)