Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/App/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ type MissionOptions
tolerateNodeTaints: seq<string>,
apiRateLimit: int,
pubnetData: string option,
pubnetDataDelay: bool,
measureE2eLatency: bool,
peerAuthenticationTimeout: int option,
flatQuorum: bool option,
tier1Keys: string option,
maxConnections: int option,
Expand Down Expand Up @@ -298,6 +301,23 @@ type MissionOptions
[<Option("pubnet-data", HelpText = "JSON file containing pubnet connectivity graph data", Required = false)>]
member self.PubnetData = pubnetData

[<Option("pubnet-data-delay",
HelpText = "Set to use the new style format for --pubnet-data",
Required = false,
Default = false)>]
member self.PubnetDataDelay = pubnetDataDelay

[<Option("measure-e2e-latency",
HelpText = "Set to enable the loadgen e2e metrics",
Required = false,
Default = false)>]
member self.MeasureE2eLatency = measureE2eLatency

[<Option("peer-authentication-timeout",
HelpText = "Maximum time overlay waits for a peer to authenticate before dropping",
Required = false)>]
member self.PeerAuthenticationTimeout = peerAuthenticationTimeout

[<Option("flat-quorum", HelpText = "Use flat Tier1 quorum", Required = false)>]
member self.FlatQuorum = flatQuorum

Expand Down Expand Up @@ -689,6 +709,12 @@ let main argv =
0

| :? MissionOptions as mission ->
if mission.PubnetData.IsNone && mission.PubnetDataDelay then
failwith "Error: --pubnet-data-delay requires --pubnet-data to be set"

if mission.MeasureE2eLatency && not mission.PubnetDataDelay then
failwith "Error: --measure-e2e-latency requires --pubnet-data-delay to be set"

let _ = logToConsoleAndFile (sprintf "%s/stellar-supercluster.log" mission.Destination)

let ll =
Expand Down Expand Up @@ -789,6 +815,9 @@ let main argv =
tolerateNodeTaints = List.map splitLabel (List.ofSeq mission.TolerateNodeTaints)
apiRateLimit = mission.ApiRateLimit
pubnetData = mission.PubnetData
pubnetDataDelay = mission.PubnetDataDelay
measureE2eLatency = mission.MeasureE2eLatency
peerAuthenticationTimeout = mission.PeerAuthenticationTimeout
flatQuorum = mission.FlatQuorum
tier1Keys = mission.Tier1Keys
maxConnections = mission.MaxConnections
Expand Down
8 changes: 7 additions & 1 deletion src/FSLibrary.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ let ctx : MissionContext =
tolerateNodeTaints = []
apiRateLimit = 10
pubnetData = None
pubnetDataDelay = false
measureE2eLatency = false
peerAuthenticationTimeout = None
flatQuorum = None
tier1Keys = None
maxConnections = None
Expand Down Expand Up @@ -373,7 +376,10 @@ type Tests(output: ITestOutputHelper) =
let Chennai = { lat = 13.08784; lon = 80.27847 }
let dns1 = PeerDnsName "www.foo.com"
let dns2 = PeerDnsName "www.bar.com"
let cmd = getNetworkDelayCommands Ashburn [| (Beauharnois, dns1); (Chennai, dns2) |] None

let cmd =
getNetworkDelayCommands (getPeerDelays Ashburn [| (Beauharnois, dns1); (Chennai, dns2) |]) None

let cmdStr = cmd.ToString()

Assert.Contains(dns1.StringName, cmdStr)
Expand Down
10 changes: 8 additions & 2 deletions src/FSLibrary/MaxTPSTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ let maxTPSTest (context: MissionContext) (baseLoadGen: LoadGen) (setupCfg: LoadG
List.find (fun (cs: CoreSet) -> cs.name.StringName = "stellar" || cs.name.StringName = "sdf") allNodes

let tier1 = List.filter (fun (cs: CoreSet) -> cs.options.tier1 = Some true) allNodes
let loadGenNodes = List.filter (fun (cs: CoreSet) -> cs.options.generatesLoad = Some true) allNodes

let loadGenNodes =
if List.isEmpty loadGenNodes then
// On smaller networks, run loadgen on all nodes to better balance the overhead of load generation
if List.length allNodes > smallNetworkSize then tier1 else allNodes
else
loadGenNodes

// On smaller networks, run loadgen on all nodes to better balance the overhead of load generation
let loadGenNodes = if List.length allNodes > smallNetworkSize then tier1 else allNodes
let isLoadGenNode cs = List.exists (fun (cs': CoreSet) -> cs' = cs) loadGenNodes

// Assign pre-generated transaction information to each load generator node.
Expand Down
7 changes: 6 additions & 1 deletion src/FSLibrary/MinBlockTimeTest.fs
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,13 @@ let minBlockTimeTest (context: MissionContext) (baseLoadGen: LoadGen) (setupCfg:
None }

let tier1 = List.filter (fun (cs: CoreSet) -> cs.options.tier1 = Some true) allNodes
let loadGenNodes = List.filter (fun (cs: CoreSet) -> cs.options.generatesLoad = Some true) allNodes

let loadGenNodes = if List.length allNodes > smallNetworkSize then tier1 else allNodes
let loadGenNodes =
if List.isEmpty loadGenNodes then
if List.length allNodes > smallNetworkSize then tier1 else allNodes
else
loadGenNodes

let isLoadGenNode cs = List.exists (fun (cs': CoreSet) -> cs' = cs) loadGenNodes

Expand Down
10 changes: 10 additions & 0 deletions src/FSLibrary/StellarCoreCfg.fs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ type StellarCoreCfg =
automaticMaintenanceCount: int
accelerateTime: bool
generateLoad: bool
measureE2eLatency: bool
updateSorobanCosts: bool option
manualClose: bool
invariantChecks: InvariantChecksSpec
Expand Down Expand Up @@ -294,6 +295,9 @@ type StellarCoreCfg =
t.Add("ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING", self.accelerateTime) |> ignore
t.Add("ARTIFICIALLY_GENERATE_LOAD_FOR_TESTING", self.generateLoad) |> ignore

if self.measureE2eLatency && self.network.missionContext.measureE2eLatency then
t.Add("LOADGEN_MEASURE_TX_LATENCY_FOR_TESTING", true) |> ignore

if self.updateSorobanCosts.IsSome then
t.Add("UPDATE_SOROBAN_COSTS_DURING_PROTOCOL_UPGRADE_FOR_TESTING", self.updateSorobanCosts.Value)
|> ignore
Expand Down Expand Up @@ -342,6 +346,10 @@ type StellarCoreCfg =
t.Add("MAX_ADDITIONAL_PEER_CONNECTIONS", self.targetPeerConnections * 3)
|> ignore

match self.network.missionContext.peerAuthenticationTimeout with
| Some timeout -> t.Add("PEER_AUTHENTICATION_TIMEOUT", timeout) |> ignore
| None -> ()

t.Add("QUORUM_INTERSECTION_CHECKER", false) |> ignore
t.Add("MANUAL_CLOSE", self.manualClose) |> ignore

Expand Down Expand Up @@ -630,6 +638,7 @@ type NetworkCfg with
automaticMaintenanceCount = if opts.performMaintenance then 50000 else 0
accelerateTime = opts.accelerateTime
generateLoad = true
measureE2eLatency = opts.generatesLoad = Some true
updateSorobanCosts = opts.updateSorobanCosts
manualClose = false
invariantChecks = opts.invariantChecks
Expand Down Expand Up @@ -671,6 +680,7 @@ type NetworkCfg with
automaticMaintenanceCount = if c.options.performMaintenance then 50000 else 0
accelerateTime = c.options.accelerateTime
generateLoad = true
measureE2eLatency = c.options.generatesLoad = Some true
updateSorobanCosts = c.options.updateSorobanCosts
manualClose = false
invariantChecks = c.options.invariantChecks
Expand Down
5 changes: 5 additions & 0 deletions src/FSLibrary/StellarCoreSet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ type QuorumSetConfiguration =
type CoreSetOptions =
{ nodeCount: int
nodeLocs: GeoLoc list option
edgeDelays: Map<byte [] * byte [], int> option
dbType: DBType
emptyDirType: EmptyDirType
syncStartupDelay: int option
Expand All @@ -211,6 +212,8 @@ type CoreSetOptions =
validate: bool
homeDomain: string option
tier1: bool option
// This should only be set in the pubnet data with delay case
generatesLoad: bool option
catchupMode: CatchupMode
image: string
initialization: CoreSetInitialization
Expand All @@ -233,6 +236,7 @@ type CoreSetOptions =
static member GetDefault(image: string) =
{ nodeCount = 3
nodeLocs = None
edgeDelays = None
dbType = Sqlite
emptyDirType = MemoryBackedEmptyDir
syncStartupDelay = Some(5)
Expand All @@ -252,6 +256,7 @@ type CoreSetOptions =
validate = true
homeDomain = Some "stellar.org"
tier1 = None
generatesLoad = None
catchupMode = CatchupComplete
image = image
initialization = CoreSetInitialization.Default
Expand Down
3 changes: 3 additions & 0 deletions src/FSLibrary/StellarMissionContext.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ type MissionContext =
tolerateNodeTaints: ((string * string option) list)
apiRateLimit: int
pubnetData: string option
pubnetDataDelay: bool
measureE2eLatency: bool
peerAuthenticationTimeout: int option
flatQuorum: bool option
tier1Keys: string option
maxConnections: int option
Expand Down
Loading
Loading