Skip to content

Commit

Permalink
Add --use-known-results-for-testing flag to supercluster. Use helm te…
Browse files Browse the repository at this point in the history
…mplating to conditionally include CATCHUP_SKIP_KNOWN_RESULTS_FOR_TESTING in PubnetParallelCatchupV2 workers stellar-core.cfg when this flag is provided.
  • Loading branch information
ThomasBrady committed Dec 9, 2024
1 parent edf62fb commit 70e4d6f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
15 changes: 12 additions & 3 deletions src/App/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ type MissionOptions
pubnetParallelCatchupEndLedger: int option,
pubnetParallelCatchupNumWorkers: int,
tag: string option,
numRuns: int option
numRuns: int option,
catchupSkipKnownResultsForTesting: bool
) =

[<Option('k', "kubeconfig", HelpText = "Kubernetes config file", Required = false, Default = "~/.kube/config")>]
Expand Down Expand Up @@ -458,6 +459,12 @@ type MissionOptions
Required = false)>]
member self.NumRuns = numRuns

[<Option("catchup-skip-known-results-for-testing",
HelpText = "when this flag is provided, pubnet parallel catchup workers will run with CATCHUP_SKIP_KNOWN_RESULTS_FOR_TESTING = true, resulting in skipping application of failed transaction and signature verification",
Required = false,
Default = true)>]
member self.CatchupSkipKnownResultsForTesting = catchupSkipKnownResultsForTesting

let splitLabel (lab: string) : (string * string option) =
match lab.Split ':' with
| [| x |] -> (x, None)
Expand Down Expand Up @@ -571,7 +578,8 @@ let main argv =
pubnetParallelCatchupNumWorkers = 128
tag = None
numRuns = None
enableTailLogging = true }
enableTailLogging = true
catchupSkipKnownResultsForTesting = true }

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

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 @@ -117,7 +117,8 @@ let ctx : MissionContext =
pubnetParallelCatchupNumWorkers = 128
tag = None
numRuns = None
enableTailLogging = true }
enableTailLogging = true
catchupSkipKnownResultsForTesting = false }

let netdata = __SOURCE_DIRECTORY__ + "/../../../data/public-network-data-2024-08-01.json"
let pubkeys = __SOURCE_DIRECTORY__ + "/../../../data/tier1keys.json"
Expand Down
1 change: 1 addition & 0 deletions src/FSLibrary/MissionHistoryPubnetParallelCatchupV2.fs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ let installProject (context: MissionContext) =
setOptions.Add(sprintf "worker.stellar_core_image=%s" context.image)
setOptions.Add(sprintf "worker.replicas=%d" context.pubnetParallelCatchupNumWorkers)
setOptions.Add(sprintf "range_generator.params.starting_ledger=%d" context.pubnetParallelCatchupStartingLedger)
setOptions.Add(sprintf "worker.catchup_skip_known_results_for_testing=%b" context.catchupSkipKnownResultsForTesting)

let endLedger =
match context.pubnetParallelCatchupEndLedger with
Expand Down
3 changes: 2 additions & 1 deletion src/FSLibrary/StellarMissionContext.fs
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ type MissionContext =
// and SimulatePubnet to fail on the heartbeat handler due to what looks like a
// server disconnection. Our solution for now is to just disable tail logging on
// those missions.
enableTailLogging: bool }
enableTailLogging: bool
catchupSkipKnownResultsForTesting: bool }
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ metadata:
name: stellar-core-config
data:
stellar-core.cfg: |-
{{- if .Values.worker.catchup_skip_known_results_for_testing }}
{{ "\n" }}
CATCHUP_SKIP_KNOWN_RESULTS_FOR_TESTING = true
{{- end }}
{{- (.Files.Get "files/stellar-core.cfg") | nindent 4 }}
---
apiVersion: v1
Expand Down

0 comments on commit 70e4d6f

Please sign in to comment.