Skip to content

Commit 7082b15

Browse files
Merge pull request #362 from marta-lokhova/PubnetValidatorSmoketest
Add a new mission to mimic validator setup
2 parents 488e3c7 + 5794520 commit 7082b15

3 files changed

Lines changed: 59 additions & 1 deletion

File tree

src/FSLibrary/FSLibrary.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<Compile Include="MissionMaxTPSMixed.fs" />
7777
<Compile Include="MissionUpgradeSCPSettings.fs" />
7878
<Compile Include="MissionUpgradeTxClusters.fs" />
79+
<Compile Include="MissionValidatorSetup.fs" />
7980
<Compile Include="StellarMission.fs" />
8081
</ItemGroup>
8182
<ItemGroup>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2019 Stellar Development Foundation and contributors. Licensed
2+
// under the Apache License, Version 2.0. See the COPYING file at the root
3+
// of this distribution or at http://www.apache.org/licenses/LICENSE-2.0
4+
5+
module MissionValidatorSetup
6+
7+
open StellarCoreSet
8+
open StellarCorePeer
9+
open StellarMissionContext
10+
open StellarSupercluster
11+
open StellarFormation
12+
open StellarStatefulSets
13+
open StellarCoreHTTP
14+
15+
// This mission creates a network with validator configurations that closely
16+
// mirror how tier 1 validators are actually configured. It uses both Postgres
17+
// and has history archives enabled. This is a smoke test that spins up the
18+
// network, runs for ~70 ledgers with load generation, verifies history
19+
// publishing works, then spins it down.
20+
let validatorSetup (context: MissionContext) =
21+
let opts =
22+
{ CoreSetOptions.GetDefault context.image with
23+
dbType = Postgres
24+
// Use disk-backed storage like production validators
25+
emptyDirType = DiskBackedEmptyDir
26+
localHistory = true
27+
accelerateTime = true
28+
// Enable maintenance like production validators
29+
performMaintenance = true }
30+
31+
let coreSet = MakeLiveCoreSet "core" opts
32+
33+
let context =
34+
{ context with
35+
numAccounts = 200
36+
genesisTestAccountCount = Some(200)
37+
numTxs = 500
38+
txRate = 10 }
39+
40+
context.Execute
41+
[ coreSet ]
42+
None
43+
(fun (formation: StellarFormation) ->
44+
formation.WaitUntilSynced [ coreSet ]
45+
formation.UpgradeProtocolToLatest [ coreSet ]
46+
47+
// Run load generation to ensure blocks aren't empty
48+
formation.RunLoadgen coreSet context.GeneratePaymentLoad
49+
50+
// Wait for a few more ledgers to ensure publishing happens
51+
let peer = formation.NetworkCfg.GetPeer coreSet 0
52+
peer.WaitForFewLedgers 20
53+
54+
if (peer.GetMetrics().HistoryPublishSuccess.Count = 0) then
55+
failwith "history.publish.success is 0, expected > 0")

src/FSLibrary/StellarMission.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ open MissionPubnetNetworkLimitsBench
4747
open MissionMixedNominationLeaderElection
4848
open MissionUpgradeSCPSettings
4949
open MissionUpgradeTxClusters
50+
open MissionValidatorSetup
5051

5152
type Mission = (MissionContext -> unit)
5253

@@ -95,4 +96,5 @@ let allMissions : Map<string, Mission> =
9596
("MixedNominationLeaderElectionWithOldMajority", mixedNominationLeaderElectionWithOldMajority)
9697
("MixedNominationLeaderElectionWithNewMajority", mixedNominationLeaderElectionWithNewMajority)
9798
("UpgradeSCPSettings", upgradeSCPSettings)
98-
("UpgradeTxClusters", upgradeTxClusters) |]
99+
("UpgradeTxClusters", upgradeTxClusters)
100+
("ValidatorSetup", validatorSetup) |]

0 commit comments

Comments
 (0)