-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Missing Error declaration in some pallets #8501
Comments
Related #6418 |
This would be a good first issue for any people who want to hunt down all the missing errors. |
Would appreciate if we can get a quick fix because all the miners on our network were halted :( |
@h4x3rotab can you elaborate on how this has broke your miners? You should be able to handle no error metadata, as it is clearly not required, and basically you should not expect it from all Substrate teams. |
It breaks SubXT, I attached a PR for them to workaround this |
It seems like that there's quite a lot of pallets nowadays that don't use the |
@KiChjang yes, that is accurate. Thew new macros solve this issue. But old pallets could be patched up in the meantime. Or you can spend your time to migrate the old pallets into the new macro. |
Now if we check
rpc.state.getMetadata
, there are a lot of pallets without error declarations populated in metadata it returns. We have checked Phala PoC3 and Polkadot (at the latest block, and block 1000). All of them have this problem.For example, if you search "Indices" pallet, and find the
errors
field in its entry, it shows:This will cause errors in polkadotjs and subxt whenever they decode a block with the errors from these bad pallets.
However, not all the pallets have this problem. We checked around the definition of the bad pallets and good pallets, and found all the bad pallets forgot to declare the error inside
decl_module!
. So we suspect this is the root cause. Now we cannot dedicate some time for further testing. So I just created this issue and leave it as a record.Good example:
substrate/frame/recovery/src/lib.rs
Lines 325 to 327 in 88243c1
Bad example:
substrate/frame/indices/src/lib.rs
Lines 105 to 111 in 88243c1
A full list of the good pallets (by grep
type Error = Error<T>
in the frame directory):The text was updated successfully, but these errors were encountered: