relayer-archive icon indicating copy to clipboard operation
relayer-archive copied to clipboard

Empty packet data or ack fails signature verification

Open michaelfig opened this issue 4 years ago • 0 comments

I observed that if I send a packet data or ack consisting of []byte{}, then the relayer cannot relay it. Sorry, but I don't have exact logs here.

This is consistent with an observation I made a while ago. Amino, and Proto3 both can't round-trip an empty slice.

type MyStruct struct {
  Data []byte
}

Marshalling and unmarshalling the following:

ms := MyStruct{
   Data: []byte{},
}

Results in:

MyStruct{
  Data: nil,
}

Special treatment is needed to accommodate these empty values (replacing nil slices with empty slices before signing and after deserialising before verifying).

I don't know if I'll get to this for a while, but I thought I'd at least put it on people's radar.

Thanks, Michael.

michaelfig avatar May 06 '20 03:05 michaelfig