forked from stellar/stellar-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestUtils.cpp
More file actions
653 lines (562 loc) · 20.4 KB
/
Copy pathTestUtils.cpp
File metadata and controls
653 lines (562 loc) · 20.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
// Copyright 2016 Stellar Development Foundation and contributors. Licensed
// under the Apache License, Version 2.0. See the COPYING file at the root
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
#include "TestUtils.h"
#include "herder/TxSetFrame.h"
#include "ledger/ImmutableLedgerView.h"
#include "ledger/test/LedgerTestUtils.h"
#include "rust/RustBridge.h"
#include "simulation/LoadGenerator.h"
#include "simulation/Simulation.h"
#include "test/Catch2.h"
#include "test/TxTests.h"
#include "test/test.h"
#include "transactions/test/SorobanTxTestUtils.h"
#include "util/MetricsRegistry.h"
#include "util/ProtocolVersion.h"
#include "work/WorkScheduler.h"
#include "xdrpp/marshal.h"
#include <algorithm>
#include <sstream>
namespace stellar
{
namespace testutil
{
bool isTestApplicationProtocolVersionSupported(Config const& cfg);
namespace
{
bool
isProtocolBackedByLinkedSorobanHost(uint32_t protocolVersion,
std::vector<uint32_t> const& hostProtocols)
{
if (protocolVersionIsBefore(protocolVersion, SOROBAN_PROTOCOL_VERSION))
{
return true;
}
auto selectedHost = std::find_if(
hostProtocols.begin(), hostProtocols.end(),
[&](uint32_t hostProtocol) { return protocolVersion <= hostProtocol; });
if (selectedHost == hostProtocols.end())
{
return false;
}
// Protocol 20 is serviced by the p21 host. All later Soroban protocols
// should have their own linked host in non-fastdev builds.
return protocolVersion == static_cast<uint32_t>(SOROBAN_PROTOCOL_VERSION)
? *selectedHost == static_cast<uint32_t>(ProtocolVersion::V_21)
: *selectedHost == protocolVersion;
}
std::string
joinProtocolVersions(std::vector<uint32_t> const& protocolVersions)
{
std::ostringstream out;
for (size_t i = 0; i < protocolVersions.size(); ++i)
{
if (i != 0)
{
out << ", ";
}
out << protocolVersions[i];
}
return out.str();
}
}
void
validateTestApplicationProtocolVersion(Config const& cfg)
{
if (isTestApplicationProtocolVersionSupported(cfg))
{
return;
}
auto const protocolVersion = cfg.TESTING_UPGRADE_LEDGER_PROTOCOL_VERSION;
std::vector<uint32_t> hostProtocols;
auto rustVersions = rust_bridge::get_soroban_version_info(
Config::CURRENT_LEDGER_PROTOCOL_VERSION);
for (auto const& host : rustVersions)
{
hostProtocols.emplace_back(host.env_max_proto);
}
std::ostringstream msg;
msg << "Test application requested genesis ledger protocol "
<< protocolVersion
<< ", but this binary does not have the matching Soroban host linked. "
<< "Linked Soroban host protocols: ["
<< joinProtocolVersions(hostProtocols)
<< "]. This usually means the build is using fastdev/unified Rust "
<< "mode, where historical Soroban protocols are collapsed to a newer "
<< "host and can fail later with opaque Soroban invocation errors. "
<< "Use a linked protocol for this test, or rebuild without fastdev "
<< "when testing historical Soroban protocol behavior.";
throw std::runtime_error(msg.str());
}
bool
isTestApplicationProtocolVersionSupported(Config const& cfg)
{
if (!cfg.USE_CONFIG_FOR_GENESIS)
{
return true;
}
auto const protocolVersion = cfg.TESTING_UPGRADE_LEDGER_PROTOCOL_VERSION;
if (protocolVersionIsBefore(protocolVersion, SOROBAN_PROTOCOL_VERSION))
{
return true;
}
std::vector<uint32_t> hostProtocols;
auto rustVersions = rust_bridge::get_soroban_version_info(
Config::CURRENT_LEDGER_PROTOCOL_VERSION);
for (auto const& host : rustVersions)
{
hostProtocols.emplace_back(host.env_max_proto);
}
if (isProtocolBackedByLinkedSorobanHost(protocolVersion, hostProtocols))
{
return true;
}
return false;
}
void
crankSome(VirtualClock& clock)
{
auto start = clock.now();
for (size_t i = 0;
(i < 100 && clock.now() < (start + std::chrono::seconds(1)) &&
clock.crank(false) > 0);
++i)
;
}
void
crankFor(VirtualClock& clock, VirtualClock::duration duration)
{
auto start = clock.now();
while (clock.now() < (start + duration) && clock.crank(false) > 0)
;
}
void
crankUntil(Application::pointer app, std::function<bool()> const& predicate,
VirtualClock::duration timeout)
{
crankUntil(*app, predicate, timeout);
}
void
crankUntil(Application& app, std::function<bool()> const& predicate,
VirtualClock::duration timeout)
{
auto start = std::chrono::system_clock::now();
while (!predicate())
{
app.getClock().crank(false);
auto current = std::chrono::system_clock::now();
auto diff = current - start;
if (diff > timeout)
{
break;
}
}
}
void
shutdownWorkScheduler(Application& app)
{
if (app.getClock().getIOContext().stopped())
{
throw std::runtime_error("Work scheduler attempted to shutdown after "
"VirtualClock io context stopped.");
}
app.getWorkScheduler().shutdown();
while (app.getWorkScheduler().getState() != BasicWork::State::WORK_ABORTED)
{
app.getClock().crank();
}
}
std::vector<Asset>
getInvalidAssets(SecretKey const& issuer)
{
std::vector<Asset> assets;
// control char in asset name
assets.emplace_back(txtest::makeAsset(issuer, "\n"));
// non-trailing zero in asset name
assets.emplace_back(txtest::makeAsset(issuer, "\0a"));
// zero asset name
assets.emplace_back(txtest::makeAsset(issuer, "\0"));
// start right after z(122), and go through some of the
// extended ascii codes
for (int v = 123; v < 140; ++v)
{
std::string assetCode;
signed char i = static_cast<signed char>((v < 128) ? v : (127 - v));
assetCode.push_back(i);
assets.emplace_back(txtest::makeAsset(issuer, assetCode));
}
{
// AssetCode12 with less than 5 chars
Asset asset;
asset.type(ASSET_TYPE_CREDIT_ALPHANUM12);
asset.alphaNum12().issuer = issuer.getPublicKey();
strToAssetCode(asset.alphaNum12().assetCode, "aaaa");
assets.emplace_back(asset);
}
return assets;
}
int32_t
computeMultiplier(LedgerEntry const& le)
{
switch (le.data.type())
{
case ACCOUNT:
return 2;
case TRUSTLINE:
return le.data.trustLine().asset.type() == ASSET_TYPE_POOL_SHARE ? 2
: 1;
case OFFER:
case DATA:
return 1;
case CLAIMABLE_BALANCE:
return static_cast<uint32_t>(
le.data.claimableBalance().claimants.size());
case CONFIG_SETTING:
case CONTRACT_DATA:
case CONTRACT_CODE:
case TTL:
default:
throw std::runtime_error("Unexpected LedgerEntry type");
}
}
template <class BucketT>
BucketListDepthModifier<BucketT>::BucketListDepthModifier(uint32_t newDepth)
: mPrevDepth(BucketListBase<BucketT>::kNumLevels)
{
BucketListBase<BucketT>::kNumLevels = newDepth;
}
template <class BucketT>
BucketListDepthModifier<BucketT>::~BucketListDepthModifier()
{
BucketListBase<BucketT>::kNumLevels = mPrevDepth;
}
template class BucketListDepthModifier<LiveBucket>;
template class BucketListDepthModifier<HotArchiveBucket>;
}
TestInvariantManager::TestInvariantManager(Application& app)
: InvariantManagerImpl(app)
{
}
void
TestInvariantManager::handleInvariantFailure(bool isStrict,
std::string const& message) const
{
CLOG_DEBUG(Invariant, "{}", message);
throw InvariantDoesNotHold{message};
}
TestApplication::TestApplication(VirtualClock& clock, Config const& cfg)
: ApplicationImpl(clock, cfg)
{
}
std::unique_ptr<InvariantManager>
TestApplication::createInvariantManager()
{
return std::make_unique<TestInvariantManager>(*this);
}
TimePoint
getTestDate(int day, int month, int year)
{
auto tm = getTestDateTime(day, month, year, 0, 0, 0);
VirtualClock::system_time_point tp = VirtualClock::tmToSystemPoint(tm);
TimePoint t = VirtualClock::to_time_t(tp);
return t;
}
std::tm
getTestDateTime(int day, int month, int year, int hour, int minute, int second)
{
std::tm tm = {0};
tm.tm_hour = hour;
tm.tm_min = minute;
tm.tm_sec = second;
tm.tm_mday = day;
tm.tm_mon = month - 1; // 0 based
tm.tm_year = year - 1900;
return tm;
}
VirtualClock::system_time_point
genesis(int minute, int second)
{
return VirtualClock::tmToSystemPoint(
getTestDateTime(1, 7, 2014, 0, minute, second));
}
void
upgradeSorobanNetworkConfig(std::function<void(SorobanNetworkConfig&)> modifyFn,
std::shared_ptr<Simulation> simulation,
bool applyUpgrade)
{
auto nodes = simulation->getNodes();
auto& lg = nodes[0]->getLoadGenerator();
auto& app = *nodes[0];
auto& complete =
app.getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
auto completeCount = complete.count();
// Only create an account if upgrade has not ran before.
if (!simulation->isSetUpForSorobanUpgrade())
{
// Create upload wasm transaction using root account.
auto createUploadCfg =
GeneratedLoadConfig::createSorobanUpgradeSetupLoad();
lg.generateLoad(createUploadCfg);
completeCount = complete.count();
simulation->crankUntil(
[&]() { return complete.count() == completeCount + 1; },
300 * simulation->getExpectedLedgerCloseTime(), false);
simulation->markReadyForSorobanUpgrade();
}
// Create upgrade transaction using root account.
auto createUpgradeLoadGenConfig = GeneratedLoadConfig::txLoad(
LoadGenMode::SOROBAN_CREATE_UPGRADE, 1, 1, 1);
// Get current network config.
auto cfg = nodes[0]->getLedgerManager().getLastClosedSorobanNetworkConfig();
modifyFn(cfg);
createUpgradeLoadGenConfig.copySorobanNetworkConfigToUpgradeConfig(
nodes[0]->getLedgerManager().getLastClosedSorobanNetworkConfig(), cfg);
auto upgradeSetKey = lg.getConfigUpgradeSetKey(
createUpgradeLoadGenConfig.getSorobanUpgradeConfig());
lg.generateLoad(createUpgradeLoadGenConfig);
completeCount = complete.count();
simulation->crankUntil(
[&]() { return complete.count() == completeCount + 1; },
10 * simulation->getExpectedLedgerCloseTime(), false);
// Arm for upgrade.
for (auto app : nodes)
{
Upgrades::UpgradeParameters scheduledUpgrades;
auto lclHeader =
app->getLedgerManager().getLastClosedLedgerHeader().header;
scheduledUpgrades.mUpgradeTime =
VirtualClock::from_time_t(lclHeader.scpValue.closeTime);
scheduledUpgrades.mConfigUpgradeSetKey = upgradeSetKey;
app->getHerder().setUpgrades(scheduledUpgrades);
}
if (applyUpgrade)
{
// Wait for upgrade to be applied
simulation->crankUntil(
[&]() {
return std::all_of(
nodes.begin(), nodes.end(), [&](auto const& node) {
return node->getLedgerManager()
.getLastClosedSorobanNetworkConfig() == cfg;
});
},
10 * simulation->getExpectedLedgerCloseTime(), false);
}
}
// This will go through the full process of upgrading the network config.
// This includes:
// 1. Deploying the upgrade contract wasm
// 2. Creating the upgrade contract instance
// 3. Creating the upgrade ContractData entry
// 4. Arming for the upgrade
// Note that the armed ledger will not be closed.
std::pair<SorobanNetworkConfig, UpgradeType>
prepareSorobanNetworkConfigUpgrade(
Application& app, std::function<void(SorobanNetworkConfig&)> modifyFn)
{
releaseAssertOrThrow(modifyFn);
TxGenerator txGenerator(app);
auto root = app.getRoot();
auto closeWithTx = [&](TransactionFrameBaseConstPtr tx) {
auto res = txtest::closeLedgerOn(
app, app.getLedgerManager().getLastClosedLedgerNum() + 1, 2, 1,
2016, {tx});
root->loadSequenceNumber();
};
auto wasm = rust_bridge::get_write_bytes();
xdr::opaque_vec<> wasmBytes;
wasmBytes.assign(wasm.data.begin(), wasm.data.end());
LedgerKey contractCodeLedgerKey;
contractCodeLedgerKey.type(CONTRACT_CODE);
contractCodeLedgerKey.contractCode().hash = sha256(wasmBytes);
auto instanceSalt = sha256("upgrade");
auto contractIDPreimage =
txtest::makeContractIDPreimage(*root, instanceSalt);
auto contractID = xdrSha256(txtest::makeFullContractIdPreimage(
app.getNetworkID(), contractIDPreimage));
auto instanceLk = txtest::makeContractInstanceKey(
txtest::makeContractAddress(contractID));
// Step 1: Create upload wasm transaction.
auto createUploadWasmTxnPair = txGenerator.createUploadWasmTransaction(
app.getLedgerManager().getLastClosedLedgerNum(),
TxGenerator::ROOT_ACCOUNT_ID, wasmBytes, contractCodeLedgerKey,
std::nullopt);
closeWithTx(createUploadWasmTxnPair.second);
bool instanceExists = false;
{
// Step 1: Check if instance already exists.
LedgerTxn ltx(app.getLedgerTxnRoot());
if (ltx.load(instanceLk))
{
instanceExists = true;
}
}
if (!instanceExists)
{
// Step 2: Create instance txn
auto contractOverhead = 160 + wasmBytes.size();
auto instanceTxPair = txGenerator.createContractTransaction(
app.getLedgerManager().getLastClosedLedgerNum(),
TxGenerator::ROOT_ACCOUNT_ID, contractCodeLedgerKey,
contractOverhead, instanceSalt, std::nullopt);
closeWithTx(instanceTxPair.second);
}
// Step 3: Create upgrade transaction.
auto createUpgradeLoadGenConfig = GeneratedLoadConfig::txLoad(
LoadGenMode::SOROBAN_CREATE_UPGRADE, 1, 1, 1);
auto upgradeCfg =
app.getLedgerManager().getLastClosedSorobanNetworkConfig();
modifyFn(upgradeCfg);
createUpgradeLoadGenConfig.copySorobanNetworkConfigToUpgradeConfig(
app.getLedgerManager().getLastClosedSorobanNetworkConfig(), upgradeCfg);
auto sorobanUpgradeCfg =
createUpgradeLoadGenConfig.getSorobanUpgradeConfig();
auto upgradeBytes =
txGenerator.getConfigUpgradeSetFromLoadConfig(sorobanUpgradeCfg);
auto txPair = txGenerator.invokeSorobanCreateUpgradeTransaction(
app.getLedgerManager().getLastClosedLedgerNum(),
TxGenerator::ROOT_ACCOUNT_ID, upgradeBytes, contractCodeLedgerKey,
instanceLk, std::nullopt);
closeWithTx(txPair.second);
// Step 4: Arm for upgrade.
auto lclHeader = app.getLedgerManager().getLastClosedLedgerHeader();
auto upgradeSetKey =
txGenerator.getConfigUpgradeSetKey(sorobanUpgradeCfg, contractID);
ConfigUpgradeSet configUpgradeSet;
xdr::xdr_from_opaque(upgradeBytes, configUpgradeSet);
Upgrades::UpgradeParameters scheduledUpgrades;
scheduledUpgrades.mUpgradeTime =
VirtualClock::from_time_t(lclHeader.header.scpValue.closeTime + 1);
scheduledUpgrades.mConfigUpgradeSetKey = upgradeSetKey;
app.getHerder().setUpgrades(scheduledUpgrades);
auto configSetFrame = std::make_shared<ConfigUpgradeSetFrame>(
configUpgradeSet, upgradeSetKey, lclHeader.header.ledgerVersion);
auto ledgerUpgrade = txtest::makeConfigUpgrade(*configSetFrame);
return {upgradeCfg, LedgerTestUtils::toUpgradeType(ledgerUpgrade)};
}
// This will go through the full process of upgrading the network config.
// This includes:
// 1. Deploying the upgrade contract wasm
// 2. Creating the upgrade contract instance
// 3. Creating the upgrade ContractData entry
// 4. Arming for the upgrade
// 5. Closing the ledger for which the upgrade is armed
void
modifySorobanNetworkConfig(Application& app,
std::function<void(SorobanNetworkConfig&)> modifyFn)
{
if (!modifyFn)
{
return;
}
auto [upgradeCfg, upgrade] =
prepareSorobanNetworkConfigUpgrade(app, modifyFn);
auto lclHeader = app.getLedgerManager().getLastClosedLedgerHeader();
TimePoint closeTime = lclHeader.header.scpValue.closeTime + 1;
app.getHerder().externalizeValue(TxSetXDRFrame::makeEmpty(lclHeader),
lclHeader.header.ledgerSeq + 1, closeTime,
{upgrade});
app.getRoot()->loadSequenceNumber();
txtest::captureLastClosedLedgerLcm(app);
// Check that the upgrade was actually applied.
auto postUpgradeCfg =
app.getLedgerManager().getLastClosedSorobanNetworkConfig();
releaseAssertOrThrow(postUpgradeCfg == upgradeCfg);
}
void
setSorobanNetworkConfigForTest(SorobanNetworkConfig& cfg,
std::optional<uint32_t> ledgerVersion)
{
cfg.mMaxContractSizeBytes = 64 * 1024;
cfg.mMaxContractDataEntrySizeBytes = 64 * 1024;
cfg.mTxMaxSizeBytes = 100 * 1024;
cfg.mLedgerMaxTransactionsSizeBytes = cfg.mTxMaxSizeBytes * 10;
cfg.mTxMaxInstructions = 100'000'000;
cfg.mLedgerMaxInstructions = cfg.mTxMaxInstructions * 10;
cfg.mTxMemoryLimit = 100 * 1024 * 1024;
cfg.mTxMaxDiskReadEntries = 40;
cfg.mTxMaxDiskReadBytes = 200 * 1024;
cfg.mTxMaxWriteLedgerEntries = 20;
cfg.mTxMaxWriteBytes = 100 * 1024;
cfg.mLedgerMaxDiskReadEntries = cfg.mTxMaxDiskReadEntries * 10;
cfg.mLedgerMaxDiskReadBytes = cfg.mTxMaxDiskReadBytes * 10;
cfg.mLedgerMaxWriteLedgerEntries = cfg.mTxMaxWriteLedgerEntries * 10;
cfg.mLedgerMaxWriteBytes = cfg.mTxMaxWriteBytes * 10;
cfg.mStateArchivalSettings.minPersistentTTL = 20;
cfg.mStateArchivalSettings.maxEntryTTL = 6'312'000;
cfg.mLedgerMaxTxCount = 100;
cfg.mTxMaxContractEventsSizeBytes = 10'000;
if (!ledgerVersion ||
protocolVersionStartsFrom(*ledgerVersion, ProtocolVersion::V_23))
{
cfg.mTxMaxFootprintEntries = cfg.mTxMaxDiskReadEntries;
}
}
void
overrideSorobanNetworkConfigForTest(Application& app)
{
modifySorobanNetworkConfig(app, [&app](SorobanNetworkConfig& cfg) {
setSorobanNetworkConfigForTest(cfg, app.getLedgerManager()
.getLastClosedLedgerHeader()
.header.ledgerVersion);
});
}
bool
appProtocolVersionStartsFrom(Application& app, ProtocolVersion fromVersion)
{
LedgerTxn ltx(app.getLedgerTxnRoot());
auto ledgerVersion = ltx.loadHeader().current().ledgerVersion;
return protocolVersionStartsFrom(ledgerVersion, fromVersion);
}
void
generateTransactions(Application& app, std::filesystem::path const& outputFile,
uint32_t numTransactions, uint32_t accounts,
uint32_t offset)
{
// Create a TxGenerator for generating payment transactions
TxGenerator txgen(app);
// Open the output file for writing
std::remove(outputFile.string().c_str());
XDROutputFileStream out(app.getClock().getIOContext(), true);
out.open(outputFile.string());
if (accounts == 0)
{
throw std::runtime_error("Number of accounts must be greater than 0");
}
LOG_INFO(DEFAULT_LOG,
"Generating {} payment transactions using {} accounts with offset "
"{}...",
numTransactions, accounts, offset);
// Loop through accounts to create payment transactions
for (uint32_t i = 0; i < numTransactions; i++)
{
uint64_t sourceAccountId = (i % accounts) + offset;
// Create a payment transaction
auto [account, tx] = txgen.paymentTransaction(
accounts, offset, 0, sourceAccountId, 1, std::nullopt);
// Convert to TransactionEnvelope and write to output
TransactionEnvelope txEnv = tx->getEnvelope();
out.writeOne(txEnv);
}
out.close();
LOG_INFO(DEFAULT_LOG, "Generated {} transactions in {}", numTransactions,
outputFile);
}
bool
isSorobanProtocolLinked(Config const& cfg, ProtocolVersion protocolVersion)
{
auto sorobanProtocolCfg = cfg;
sorobanProtocolCfg.USE_CONFIG_FOR_GENESIS = true;
sorobanProtocolCfg.TESTING_UPGRADE_LEDGER_PROTOCOL_VERSION =
static_cast<uint32_t>(protocolVersion);
auto res =
testutil::isTestApplicationProtocolVersionSupported(sorobanProtocolCfg);
if (!res)
{
SUCCEED("Skipping historical Soroban protocol test: requested "
"protocol is not linked in this build");
}
return res;
}
}