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 6, 2024
1 parent edf62fb commit 2c8c0bc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 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 = false)>]
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 = false }

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 @@ -29,8 +29,7 @@ if [ -n "$JOB_KEY" ]; then
# Start timer
START_TIME=$(date +%s)
echo "Processing job: $JOB_KEY"

if [ ! "$(/usr/bin/stellar-core --conf /config/stellar-core.cfg new-db --console&&
if [ ! "$(/usr/bin/stellar-core --conf /config/stellar-core.cfg new-db --console&&
/usr/bin/stellar-core --conf /config/stellar-core.cfg catchup "$JOB_KEY" --metric 'ledger.transaction.apply' --console)" ]; then
echo "Error processing job: $JOB_KEY"
redis-cli -h "$REDIS_HOST" -p "$REDIS_PORT" LPUSH "$FAILED_QUEUE" "$JOB_KEY|$POD_NAME" # enhance the entry with pod name for tracking
Expand Down
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 2c8c0bc

Please sign in to comment.