Skip to content

Commit

Permalink
commit progress
Browse files Browse the repository at this point in the history
  • Loading branch information
srinathln7 committed Feb 19, 2025
1 parent 4d467b6 commit dcb9076
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions prover/cmd/controller/controller/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ func cobraControllerRunCmd(c *cobra.Command, args []string) {
}
cfg.Controller.LocalID = fLocalID

// Disable Legacy for testing
cfg.Controller.EnableExecution = true

// Disable for testing
cfg.Controller.EnableBlobDecompression = false
cfg.Controller.EnableAggregation = false

cfg.Controller.EnableExecBootstrap = false
cfg.Controller.EnableExecGL = false
cfg.Controller.EnableExecRndBeacon = false
Expand Down
24 changes: 12 additions & 12 deletions prover/cmd/prover/cmd/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import (
)

type ProverArgs struct {
Input string
Output string
Input []string
Output []string
Large bool
ConfigFile string
}
Expand All @@ -33,32 +33,32 @@ func Prove(args ProverArgs) error {
}

// discover the type of the job from the input file name
jobExecution := strings.Contains(args.Input, "getZkProof")
jobBlobDecompression := strings.Contains(args.Input, "getZkBlobCompressionProof")
jobAggregation := strings.Contains(args.Input, "getZkAggregatedProof")
jobExecution := strings.Contains(args.Input[0], "getZkProof")
jobBlobDecompression := strings.Contains(args.Input[0], "getZkBlobCompressionProof")
jobAggregation := strings.Contains(args.Input[0], "getZkAggregatedProof")

if jobExecution {
req := &execution.Request{}
if err := readRequest(args.Input, req); err != nil {
if err := readRequest(args.Input[0], req); err != nil {
return fmt.Errorf("could not read the input file (%v): %w", args.Input, err)
}

// we use the large traces in 2 cases;
// 1. the user explicitly asked for it (args.Large)
// 2. the job contains the large suffix and we are a large machine (cfg.Execution.CanRunLarge)
large := args.Large || (strings.Contains(args.Input, "large") && cfg.Execution.CanRunFullLarge)
large := args.Large || (strings.Contains(args.Input[0], "large") && cfg.Execution.CanRunFullLarge)

resp, err := execution.Prove(cfg, req, large)
if err != nil {
return fmt.Errorf("could not prove the execution: %w", err)
}

return writeResponse(args.Output, resp)
return writeResponse(args.Output[0], resp)
}

if jobBlobDecompression {
req := &blobdecompression.Request{}
if err := readRequest(args.Input, req); err != nil {
if err := readRequest(args.Input[0], req); err != nil {
return fmt.Errorf("could not read the input file (%v): %w", args.Input, err)
}

Expand All @@ -67,12 +67,12 @@ func Prove(args ProverArgs) error {
return fmt.Errorf("could not prove the blob decompression: %w", err)
}

return writeResponse(args.Output, resp)
return writeResponse(args.Output[0], resp)
}

if jobAggregation {
req := &aggregation.Request{}
if err := readRequest(args.Input, req); err != nil {
if err := readRequest(args.Input[0], req); err != nil {
return fmt.Errorf("could not read the input file (%v): %w", args.Input, err)
}

Expand All @@ -81,7 +81,7 @@ func Prove(args ProverArgs) error {
return fmt.Errorf("could not prove the aggregation: %w", err)
}

return writeResponse(args.Output, resp)
return writeResponse(args.Output[0], resp)
}

return errors.New("unknown job type")
Expand Down
9 changes: 7 additions & 2 deletions prover/cmd/prover/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ func init() {

rootCmd.AddCommand(proveCmd)

proveCmd.Flags().StringVar(&proverArgs.Input, "in", "", "input file")
proveCmd.Flags().StringVar(&proverArgs.Output, "out", "", "output file")
// ASSUMED 0 index here
// proveCmd.Flags().StringVar(&proverArgs.Input[0], "in", "", "input file")
// proveCmd.Flags().StringVar(&proverArgs.Output[0], "out", "", "output file")

proveCmd.Flags().StringSliceVar(&proverArgs.Input, "in", make([]string, len(proverArgs.Input)), "input file")
proveCmd.Flags().StringSliceVar(&proverArgs.Output, "out", make([]string, len(proverArgs.Output)), "output file")

proveCmd.Flags().BoolVar(&proverArgs.Large, "large", false, "run the large execution circuit")
}

Expand Down

0 comments on commit dcb9076

Please sign in to comment.