Skip to content

Commit

Permalink
fix(message): do not EncodeToNode selectors (#326)
Browse files Browse the repository at this point in the history
avoid an unneccesary serialization roundtrip when sending requests for selectors
  • Loading branch information
hannahhoward committed May 31, 2022
1 parent aa14aad commit d16098a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions message/message1_1prime/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ func NewRequest(id datatransfer.TransferID, isRestart bool, isPull bool, vtype d
return nil, xerrors.Errorf("base CID must be defined")
}

selnode, err := encoding.EncodeToNode(selector)
if err != nil {
return nil, xerrors.Errorf("Creating request: %w", err)
}

var typ uint64
if isRestart {
typ = uint64(types.RestartMessage)
Expand All @@ -43,7 +38,7 @@ func NewRequest(id datatransfer.TransferID, isRestart bool, isPull bool, vtype d
MessageType: typ,
Pull: isPull,
VoucherPtr: &vnode,
SelectorPtr: &selnode,
SelectorPtr: &selector,
BaseCidPtr: &baseCid,
VoucherTypeIdentifier: vtype,
TransferId: uint64(id),
Expand Down

0 comments on commit d16098a

Please sign in to comment.