Skip to content

Commit

Permalink
chore: removed uneccessary changes
Browse files Browse the repository at this point in the history
Signed-off-by: Alwin Zomotor <[email protected]>
  • Loading branch information
CRAlwin committed Sep 10, 2024
1 parent f741d69 commit 0511e55
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/castor/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (c *Client) GetTuples(count int32, tt TupleType, requestID uuid.UUID) ([]by
}
return nil, fmt.Errorf("getting tuples failed for \"%s\" with response code #%d: %s", req.URL, resp.StatusCode, string(bodyBytes))
}
if err != nil { //|| (int32(len(bodyBytes)) != count*int32(tt.Arity)*2) {
if err != nil {
return nil, fmt.Errorf("castor has returned an invalid response body: %s", err)
}
return bodyBytes, nil
Expand Down
21 changes: 10 additions & 11 deletions pkg/castor/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,29 @@ type TupleType struct {
Name string
PreprocessingName string
SpdzProtocol SPDZProtocol
Arity int8
}

var (
// BitGfp describes the Bits tuple type in the Mudulo a Prime domain.
BitGfp = TupleType{"BIT_GFP", "Bits", SPDZGfp, 1}
BitGfp = TupleType{"BIT_GFP", "Bits", SPDZGfp}
// BitGf2n describes the Bits tuple type in the GF(2^n) domain.
BitGf2n = TupleType{"BIT_GF2N", "Bits", SPDZGf2n, 1}
BitGf2n = TupleType{"BIT_GF2N", "Bits", SPDZGf2n}
// InputMaskGfp describes the Inputs tuple type in the Mudulo a Prime domain.
InputMaskGfp = TupleType{"INPUT_MASK_GFP", "Inputs", SPDZGfp, 2}
InputMaskGfp = TupleType{"INPUT_MASK_GFP", "Inputs", SPDZGfp}
// InputMaskGf2n describes the Inputs tuple type in the GF(2^n) domain.
InputMaskGf2n = TupleType{"INPUT_MASK_GF2N", "Inputs", SPDZGf2n, 2}
InputMaskGf2n = TupleType{"INPUT_MASK_GF2N", "Inputs", SPDZGf2n}
// InverseTupleGfp describes the Inverses tuple type in the Mudulo a Prime domain.
InverseTupleGfp = TupleType{"INVERSE_TUPLE_GFP", "Inverses", SPDZGfp, 2}
InverseTupleGfp = TupleType{"INVERSE_TUPLE_GFP", "Inverses", SPDZGfp}
// InverseTupleGf2n describes the Inverses tuple type in the GF(2^n) domain.
InverseTupleGf2n = TupleType{"INVERSE_TUPLE_GF2N", "Inverses", SPDZGf2n, 2}
InverseTupleGf2n = TupleType{"INVERSE_TUPLE_GF2N", "Inverses", SPDZGf2n}
// SquareTupleGfp describes the Squares tuple type in the Mudulo a Prime domain.
SquareTupleGfp = TupleType{"SQUARE_TUPLE_GFP", "Squares", SPDZGfp, 2}
SquareTupleGfp = TupleType{"SQUARE_TUPLE_GFP", "Squares", SPDZGfp}
// SquareTupleGf2n describes the Squares tuple type in the GF(2^n) domain.
SquareTupleGf2n = TupleType{"SQUARE_TUPLE_GF2N", "Squares", SPDZGf2n, 2}
SquareTupleGf2n = TupleType{"SQUARE_TUPLE_GF2N", "Squares", SPDZGf2n}
// MultiplicationTripleGfp describes the Triples tuple type in the Mudulo a Prime domain.
MultiplicationTripleGfp = TupleType{"MULTIPLICATION_TRIPLE_GFP", "Triples", SPDZGfp, 3}
MultiplicationTripleGfp = TupleType{"MULTIPLICATION_TRIPLE_GFP", "Triples", SPDZGfp}
// MultiplicationTripleGf2n describes the Triples tuple type in the GF(2^n) domain.
MultiplicationTripleGf2n = TupleType{"MULTIPLICATION_TRIPLE_GF2N", "Triples", SPDZGf2n, 3}
MultiplicationTripleGf2n = TupleType{"MULTIPLICATION_TRIPLE_GF2N", "Triples", SPDZGf2n}
)

// SupportedTupleTypes is a list of all tuple types supported by the castor client.
Expand Down
13 changes: 0 additions & 13 deletions pkg/ephemeral/spdz.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package ephemeral

import (
// "runtime/pprof"
"context"
"errors"
"fmt"
Expand Down Expand Up @@ -178,17 +177,6 @@ type SPDZEngine struct {

// Activate starts a proxy, writes an IP file, start SPDZ execution, unpacks inputs parameters, sends them to the runtime and waits for the response.
func (s *SPDZEngine) Activate(ctx *CtxConfig) ([]byte, error) {
// f, errs := os.Create("cpu2.pprof")
// if errs != nil {
// s.logger.Errorw("Error creating cpu profile", GameID, ctx.Act.GameID, "Error", errs)
// return nil, errs
// }
// defer f.Close()
// defer pprof.StopCPUProfile()
// if err := pprof.StartCPUProfile(f); err != nil {
// s.logger.Errorw("Error starting cpu profile", GameID, ctx.Act.GameID, "Error", err)
// }

proxyErrCh := make(chan error, 1)
act := ctx.Act
err := s.proxy.Run(ctx, proxyErrCh)
Expand Down Expand Up @@ -325,7 +313,6 @@ func (s *SPDZEngine) startMPC(ctx *CtxConfig) {
wg.Add(1)
s.StartStreamTuples(terminateStreams, streamErrCh, wg)
}
// command := []string{fmt.Sprintf("valgrind --tool=callgrind ./Player-Online.x %s %s -N %s --ip-file-name %s --file-prep-per-thread", fmt.Sprint(s.config.PlayerID), appName, fmt.Sprint(ctx.Spdz.PlayerCount), ipFile)}
command := []string{fmt.Sprintf("./Player-Online.x %s %s -N %s --ip-file-name %s --file-prep-per-thread", fmt.Sprint(s.config.PlayerID), appName, fmt.Sprint(ctx.Spdz.PlayerCount), ipFile)}
s.logger.Infow("Starting Player-Online.x", GameID, ctx.Act.GameID, "command", command)
go func() {
Expand Down

0 comments on commit 0511e55

Please sign in to comment.