encointer / encointer-parachain

The common good parachain for Kusama
https://encointer.org
GNU General Public License v3.0
9 stars 13 forks source link

proposals using utility.batch fail with `BadOrigin` #169

Closed brenzi closed 1 year ago

brenzi commented 1 year ago

We have noticed that using batch calls to add locations for greenbaydollar on mainnet results in BadOrigin:

https://encointer.subscan.io/extrinsic/2444412-2

The encoded call has been generated along our tutorial https://book.encointer.org/tutorials-register-locations.html#how-to-add-locations-on-mainnet yielding this call

This could be reproduced on rococo: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.api.encointer.org#/explorer/query/0x59167a7a5533cd18f37d0157ecaacbe7c6888a58979de15ba3e7fb6c3451fe0b

If we supply just a single location without a batch, the origin is fine (fails because of wrong phase, but thats out of scope here) https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frococo.api.encointer.org#/explorer/query/0x59167a7a5533cd18f37d0157ecaacbe7c6888a58979de15ba3e7fb6c3451fe0b

mainnet runs runtime V12 rococo runs runtime V13

This has to be a recent regression issue, because batch worked 200d back with spec_version 7: https://encointer.subscan.io/block/1063818?tab=event

brenzi commented 1 year ago

@pifragile could you have a look at this?

pifragile commented 1 year ago

My theory was that the call fails here, because the custom origin of the collective pallet would somehow wrongly be converted into None somewhere along the way.

I tested this on a local parachain setup with v1.3.2 and it fails with BadOrigin. But when testing it on the new v0.9.37 branch, it works again. so my theory is that this will work again after the next runtime upgrade, i suppose this was some bug that was fixed in Substrate in the meantime.

Bildschirmfoto 2023-05-02 um 14.10.12.png