Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

Empty packet data or ack fails signature verification #112

@michaelfig

Description

@michaelfig

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions