Skip to content

UpdateState panics if client message is of type Misbehaviour #3636

@crodriguezvega

Description

@crodriguezvega

Many thanks to @plafer for finding this bug.

Summary of Bug

It is possible for CheckForMisbehaviour to return false for a client message of type Misbehaviour, and if this happens, then UpdateState will panic.

Expected Behaviour

UpdateState does not panic if client message is of type Misbehaviour.

Version

v7.0.0

Steps to Reproduce

Submit an MsgUpdateClient where ClientMessage is of type Misbehaviour and contains two valid headers (e.g. two headers where Header1 has a higher height and later timestamp than Header2).

Proposed Solution

If the client message received by UpdateState if of type Misbehaviour then no-op (return []exported.Height{}). This solution is preferred at this moment because it is not API breaking.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions