Skip to content

Questions about sig verification decorator panic #24849

Open
@rootulp

Description

@rootulp

Context

Celestia is upgrading from Cosmos SDK v0.46.x to v0.50.x

Problem

In Cosmos SDK v0.46.x, when a user submit a tx with a nil public key in the signature data, it would fail in the sig verify decorator (confirmed in this test).

In Cosmos SDK v0.50.x, when a user submits the same tx with a nil public key in the signature data, it would result in a panic. See this issue.

These lines were added recently to main

if signerInfo.PublicKey == nil {
panic("signerInfo.PublicKey cannot be nil")
}

which make the panic message more useful to end users. I'm porting that change to Celestia's Cosmos SDK fork but I have a few questions:

  1. If a tx's signature data has a nil public key, is that always considered invalid?
  2. Instead of hitting this panic, can we introduce some stateless checks on the signature earlier in the antehandler flow in order to throw an error?

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