Skip to content

Commit

Permalink
Merge pull request #234 from dmkozh/loadgen_flag2
Browse files Browse the repository at this point in the history
Propagate flag for updating Soroban costs to the relevant missions.
  • Loading branch information
dmkozh authored Jan 2, 2025
2 parents 26a9c5c + a2ce731 commit 7ce514c
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 15 deletions.
6 changes: 4 additions & 2 deletions src/App/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@ let main argv =
tag = None
numRuns = None
enableTailLogging = true
catchupSkipKnownResultsForTesting = true }
catchupSkipKnownResultsForTesting = true
updateSorobanCosts = None }

let nCfg = MakeNetworkCfg ctx [] None
use formation = kube.MakeEmptyFormation nCfg
Expand Down Expand Up @@ -716,7 +717,8 @@ let main argv =
tag = mission.Tag
numRuns = mission.NumRuns
enableTailLogging = true
catchupSkipKnownResultsForTesting = mission.CatchupSkipKnownResultsForTesting }
catchupSkipKnownResultsForTesting = mission.CatchupSkipKnownResultsForTesting
updateSorobanCosts = None }

allMissions.[m] missionContext

Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ let ctx : MissionContext =
tag = None
numRuns = None
enableTailLogging = true
catchupSkipKnownResultsForTesting = false }
catchupSkipKnownResultsForTesting = false
updateSorobanCosts = None }

let netdata = __SOURCE_DIRECTORY__ + "/../../../data/public-network-data-2024-08-01.json"
let pubkeys = __SOURCE_DIRECTORY__ + "/../../../data/tier1keys.json"
Expand Down
9 changes: 7 additions & 2 deletions src/FSLibrary/MissionInMemoryMode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ open StellarCoreHTTP

let runInMemoryMode (context: MissionContext) =
let coreSet =
MakeLiveCoreSet "core" { CoreSetOptions.GetDefault context.image with dumpDatabase = false }
MakeLiveCoreSet
"core"
{ CoreSetOptions.GetDefault context.image with
dumpDatabase = false
updateSorobanCosts = Some(true) }

let coreSetWithCaptiveCore =
MakeLiveCoreSet
Expand All @@ -25,7 +29,8 @@ let runInMemoryMode (context: MissionContext) =
validate = false
localHistory = false
quorumSet = CoreSetQuorum(CoreSetName "core")
deprecatedSQLState = true }
deprecatedSQLState = true
updateSorobanCosts = Some(true) }

let context =
{ context.WithSmallLoadgenOptions with
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/MissionLoadGenerationWithTxSetLimit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ let loadGenerationWithTxSetLimit (context: MissionContext) =
"core"
{ CoreSetOptions.GetDefault context.image with
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
dumpDatabase = false }
dumpDatabase = false
updateSorobanCosts = Some(true) }

let context =
{ context.WithSmallLoadgenOptions with
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/MissionProtocolUpgradeWithLoad.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ let protocolUpgradeWithLoad (context: MissionContext) =
"core"
{ CoreSetOptions.GetDefault context.image with
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
dumpDatabase = false }
dumpDatabase = false
updateSorobanCosts = Some(true) }

let context =
{ context.WithSmallLoadgenOptions with
Expand Down
6 changes: 4 additions & 2 deletions src/FSLibrary/MissionSorobanCatchupWithPrevAndCurr.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ let sorobanCatchupWithPrevAndCurr (context: MissionContext) =
"core"
{ CoreSetOptions.GetDefault context.image with
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
emptyDirType = DiskBackedEmptyDir }
emptyDirType = DiskBackedEmptyDir
updateSorobanCosts = Some(true) }

let quorumSet = CoreSetQuorum(CoreSetName("core"))

Expand All @@ -30,7 +31,8 @@ let sorobanCatchupWithPrevAndCurr (context: MissionContext) =
{ CoreSetOptions.GetDefault context.image with
nodeCount = 1
quorumSet = quorumSet
catchupMode = CatchupComplete }
catchupMode = CatchupComplete
updateSorobanCosts = Some(true) }

let context =
{ context.WithMediumLoadgenOptions with
Expand Down
1 change: 1 addition & 0 deletions src/FSLibrary/MissionSorobanConfigUpgrades.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let sorobanConfigUpgrades (context: MissionContext) =
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
emptyDirType = DiskBackedEmptyDir
quorumSet = quorumSet
updateSorobanCosts = Some(true)
nodeCount = 5 }

let context =
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/MissionSorobanInvokeHostLoad.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ let sorobanInvokeHostLoad (context: MissionContext) =
"core"
{ CoreSetOptions.GetDefault context.image with
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
emptyDirType = DiskBackedEmptyDir }
emptyDirType = DiskBackedEmptyDir
updateSorobanCosts = Some(true) }

let context =
{ context.WithMediumLoadgenOptions with
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/MissionSorobanLoadGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ let sorobanLoadGeneration (context: MissionContext) =
numTxs = rate * 2000
skipLowFeeTxs = true
maxFeeRate = Some 100000000
enableTailLogging = false }
enableTailLogging = false
updateSorobanCosts = Some(true) }

let fullCoreSet = FullPubnetCoreSets context true true

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

if self.updateSorobanCosts.IsSome then
t.Add("UPDATE_SOROBAN_COSTS_DURING_PROTOCOL_UPGRADE_FOR_TESTING", self.updateSorobanCosts.Value)
|> ignore

if self.network.missionContext.peerFloodCapacityBytes.IsSome then
t.Add("PEER_FLOOD_READING_CAPACITY_BYTES", self.network.missionContext.peerFloodCapacityBytes.Value)
|> ignore
Expand Down Expand Up @@ -484,6 +489,7 @@ type NetworkCfg with
automaticMaintenanceCount = if opts.performMaintenance then 50000 else 0
accelerateTime = opts.accelerateTime
generateLoad = true
updateSorobanCosts = opts.updateSorobanCosts
manualClose = false
invariantChecks = opts.invariantChecks
unsafeQuorum = opts.unsafeQuorum
Expand Down Expand Up @@ -522,6 +528,7 @@ type NetworkCfg with
automaticMaintenanceCount = if c.options.performMaintenance then 50000 else 0
accelerateTime = c.options.accelerateTime
generateLoad = true
updateSorobanCosts = c.options.updateSorobanCosts
manualClose = false
invariantChecks = c.options.invariantChecks
unsafeQuorum = c.options.unsafeQuorum
Expand Down
6 changes: 4 additions & 2 deletions src/FSLibrary/StellarCoreSet.fs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ type CoreSetOptions =
inMemoryMode: bool
addArtificialDelayUsec: int option
deprecatedSQLState: bool
surveyPhaseDuration: int option }
surveyPhaseDuration: int option
updateSorobanCosts: bool option }

member self.WithWaitForConsensus(w: bool) =
{ self with initialization = { self.initialization with waitForConsensus = w } }
Expand Down Expand Up @@ -206,7 +207,8 @@ type CoreSetOptions =
inMemoryMode = false
addArtificialDelayUsec = None
deprecatedSQLState = false
surveyPhaseDuration = None }
surveyPhaseDuration = None
updateSorobanCosts = None }

type CoreSet =
{ name: CoreSetName
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/StellarMissionContext.fs
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ type MissionContext =
// server disconnection. Our solution for now is to just disable tail logging on
// those missions.
enableTailLogging: bool
catchupSkipKnownResultsForTesting: bool }
catchupSkipKnownResultsForTesting: bool
updateSorobanCosts: bool option }
3 changes: 2 additions & 1 deletion src/FSLibrary/StellarNetworkData.fs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ let FullPubnetCoreSets (context: MissionContext) (manualclose: bool) (enforceMin
// sync before all the nodes are online.
syncStartupDelay = Some(30)
invariantChecks = AllInvariantsExceptBucketConsistencyChecks
dumpDatabase = false }
dumpDatabase = false
updateSorobanCosts = context.updateSorobanCosts }

// Sorted list of known geolocations.
// We can choose an arbitrary geolocation such that the distribution follows that of the given data
Expand Down

0 comments on commit 7ce514c

Please sign in to comment.