@@ -73,7 +73,7 @@ func readBenchmarkConfig(path string) (*benchmark.BenchmarkConfig, error) {
7373 return config , err
7474}
7575
76- func (s * service ) setupInternalDirectories (testDir string , params types.RunParams , genesis * core.Genesis , snapshot * benchmark.SnapshotDefinition , role string ) (* config.InternalClientOptions , error ) {
76+ func (s * service ) setupInternalDirectories (testDir string , params types.RunParams , genesis * core.Genesis , snapshot * benchmark.SnapshotDefinition , role string , datadirsConfig * benchmark. DatadirConfig ) (* config.InternalClientOptions , error ) {
7777 err := os .MkdirAll (testDir , 0755 )
7878 if err != nil {
7979 return nil , errors .Wrap (err , "failed to create test directory" )
@@ -102,7 +102,7 @@ func (s *service) setupInternalDirectories(testDir string, params types.RunParam
102102 isSnapshot := snapshot != nil && snapshot .Command != ""
103103 if isSnapshot {
104104 // if we have a snapshot, restore it if needed or reuse from a previous test
105- snapshotDir , err := s .dataDirState .EnsureSnapshot (* snapshot , params .NodeType , role )
105+ snapshotDir , err := s .dataDirState .EnsureSnapshot (datadirsConfig , * snapshot , params .NodeType , role )
106106 if err != nil {
107107 return nil , errors .Wrap (err , "failed to ensure snapshot" )
108108 }
@@ -291,18 +291,18 @@ func (s *service) getGenesisForSnapshotConfig(snapshotConfig *benchmark.Snapshot
291291 return genesis , nil
292292}
293293
294- func (s * service ) setupDataDirs (workingDir string , params types.RunParams , genesis * core.Genesis , snapshot * benchmark.SnapshotDefinition ) (* config.InternalClientOptions , * config.InternalClientOptions , error ) {
294+ func (s * service ) setupDataDirs (workingDir string , params types.RunParams , genesis * core.Genesis , snapshot * benchmark.SnapshotDefinition , datadirsConfig * benchmark. DatadirConfig ) (* config.InternalClientOptions , * config.InternalClientOptions , error ) {
295295 // create temp directory for this test
296296 testName := fmt .Sprintf ("%d-%s-test" , time .Now ().Unix (), params .NodeType )
297297 sequencerTestDir := path .Join (workingDir , fmt .Sprintf ("%s-sequencer" , testName ))
298298 validatorTestDir := path .Join (workingDir , fmt .Sprintf ("%s-validator" , testName ))
299299
300- sequencerOptions , err := s .setupInternalDirectories (sequencerTestDir , params , genesis , snapshot , "sequencer" )
300+ sequencerOptions , err := s .setupInternalDirectories (sequencerTestDir , params , genesis , snapshot , "sequencer" , datadirsConfig )
301301 if err != nil {
302302 return nil , nil , errors .Wrap (err , "failed to setup internal directories" )
303303 }
304304
305- validatorOptions , err := s .setupInternalDirectories (validatorTestDir , params , genesis , snapshot , "validator" )
305+ validatorOptions , err := s .setupInternalDirectories (validatorTestDir , params , genesis , snapshot , "validator" , datadirsConfig )
306306 if err != nil {
307307 return nil , nil , errors .Wrap (err , "failed to setup internal directories" )
308308 }
@@ -320,7 +320,7 @@ func (s *service) setupBlobsDir(workingDir string) error {
320320 return nil
321321}
322322
323- func (s * service ) runTest (ctx context.Context , params types.RunParams , workingDir string , outputDir string , snapshotConfig * benchmark.SnapshotDefinition , proofConfig * benchmark.ProofProgramOptions , transactionPayload payload.Definition ) (* benchmark.RunResult , error ) {
323+ func (s * service ) runTest (ctx context.Context , params types.RunParams , workingDir string , outputDir string , snapshotConfig * benchmark.SnapshotDefinition , proofConfig * benchmark.ProofProgramOptions , transactionPayload payload.Definition , datadirsConfig * benchmark. DatadirConfig ) (* benchmark.RunResult , error ) {
324324
325325 s .log .Info (fmt .Sprintf ("Running benchmark with params: %+v" , params ))
326326
@@ -336,7 +336,7 @@ func (s *service) runTest(ctx context.Context, params types.RunParams, workingDi
336336 validatorTestDir := path .Join (workingDir , fmt .Sprintf ("%s-validator" , testName ))
337337
338338 // setup data directories (restore from snapshot if needed)
339- sequencerOptions , validatorOptions , err := s .setupDataDirs (workingDir , params , genesis , snapshotConfig )
339+ sequencerOptions , validatorOptions , err := s .setupDataDirs (workingDir , params , genesis , snapshotConfig , datadirsConfig )
340340 if err != nil {
341341 return nil , errors .Wrap (err , "failed to setup data dirs" )
342342 }
@@ -566,7 +566,7 @@ outerLoop:
566566 return errors .Wrap (err , "failed to create output directory" )
567567 }
568568
569- metricSummary , err := s .runTest (ctx , c .Params , s .config .DataDir (), outputDir , testPlan .Snapshot , testPlan .ProofProgram , transactionPayloads [c .Params .PayloadID ])
569+ metricSummary , err := s .runTest (ctx , c .Params , s .config .DataDir (), outputDir , testPlan .Snapshot , testPlan .ProofProgram , transactionPayloads [c .Params .PayloadID ], testPlan . Datadir )
570570 if err != nil {
571571 log .Error ("Failed to run test" , "err" , err )
572572 metricSummary = & benchmark.RunResult {
0 commit comments