stride icon indicating copy to clipboard operation
stride copied to clipboard

txs API requests that include MsgLiquidStake fail to parse internally

Open joeabbey opened this issue 3 years ago • 5 comments

Summary of Bug

Executing a REST query against: /cosmos/tx/v1beta1/txs may fail with:

{
  "code": 2,
  "message": "codespace sdk code 2: tx parse error: Mismatched \"*types.MsgLiquidStake\": {TagNum: 2, GotWireType: \"varint\" != WantWireType: \"bytes\"}",
  "details": [
  ]
}

Version

v8.0.0

Steps to Reproduce

https://api-stride.mzonder.com/cosmos/tx/v1beta1/txs?page=1&limit=100&order_by=2&events=transfer.recipient%3D%27stride1xwazl8ftks4gn00y5x3c47auquc62ssuxqxxju%27

Screenshots

The above should be sufficient

Additional context

While it's possible to "step over" this txn, it is kind of a pain while trying to gather data for tax reporting


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

joeabbey avatar Apr 15 '23 15:04 joeabbey

Well, this is where it is originating (from cosmos-sdk):

https://github.com/cosmos/cosmos-sdk/blob/f71df80e93bffbf7ce5fbd519c6154a2ee9f991b/codec/unknownproto/unknown_fields.go#L64-L72

joeabbey avatar Apr 15 '23 15:04 joeabbey

So if this is due to falling into "unknownproto", I'm guessing this is a codec registration issue?

joeabbey avatar Apr 15 '23 15:04 joeabbey

Works here https://stride-api.polkachu.com/cosmos/tx/v1beta1/txs?page=1&limit=100&order_by=2&events=transfer.recipient%3D%27stride1xwazl8ftks4gn00y5x3c47auquc62ssuxqxxju%27

Seems like it may be specific to this RPC?

asalzmann avatar Apr 15 '23 17:04 asalzmann

@asalzmann, that's likely because Polkachu's RPC is not an archive node, whereas mzonder's is.

Note: there's no MsgLiquidStake return from Polkachu.

joeabbey avatar Apr 15 '23 21:04 joeabbey

My understanding was that this is a consequence of the fact that the MsgLiquidStake data type was changed in v5 (uint64 → sdk.Int). So when querying archive nodes with a history before v5, it's unable to reconcile the differing types.

@joeabbey are you aware of a way to fix this?

sampocs avatar Apr 18 '23 22:04 sampocs