Skip to content

Commit

Permalink
Revert "parsigex: unmarshal data that is about to be broadcasted (#2434
Browse files Browse the repository at this point in the history
…)"

This reverts commit 6075930.
  • Loading branch information
gsora committed Jul 21, 2023
1 parent f20b602 commit 0061211
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
5 changes: 0 additions & 5 deletions core/parsigex/parsigex.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ func (m *ParSigEx) Broadcast(ctx context.Context, duty core.Duty, set core.ParSi
return err
}

// TODO: remove this from prod once we know what's going on
if _, err = core.ParSignedDataSetFromProto(duty.Type, pb); err != nil {
log.Warn(ctx, "ParSignedDataSet which was just marshaled can't be unmarshaled back", err)
}

msg := pbv1.ParSigExMsg{
Duty: core.DutyToProto(duty),
DataSet: pb,
Expand Down
6 changes: 2 additions & 4 deletions core/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,13 @@ func unmarshal(data []byte, v any) error {
return nil
} else if !bytes.HasPrefix(bytes.TrimSpace(data), []byte("{")) {
// No json prefix, so no point attempting json unmarshalling.
// TODO: remove "data" log before v0.17.0
return errors.Wrap(err, "unmarshal ssz", z.Hex("data", data))
return errors.Wrap(err, "unmarshal ssz")

Check warning on line 254 in core/proto.go

View check run for this annotation

Codecov / codecov/patch

core/proto.go#L254

Added line #L254 was not covered by tests
}
}

// Else try json
if err := json.Unmarshal(data, v); err != nil {
// TODO: remove "data" log before v0.17.0
return errors.Wrap(err, "unmarshal json", z.Hex("data", data))
return errors.Wrap(err, "unmarshal json")

Check warning on line 260 in core/proto.go

View check run for this annotation

Codecov / codecov/patch

core/proto.go#L260

Added line #L260 was not covered by tests
}

return nil
Expand Down

0 comments on commit 0061211

Please sign in to comment.