Closed ebma closed 2 years ago
I think that the root cause of the issue is a mismatch of Address
types.
The interbtc test chain uses AccountId
as Address whereas the substrate template chain wraps the AccountId
with MultiAddress<AccountId, ()>
before using it as Address.
So after changing the Address
field in the SpacewalkRuntime Config in clients/runtime/src/lib.rs
as follows:
impl Config for SpacewalkRuntime {
type Index = Index;
type BlockNumber = BlockNumber;
type Hash = H256;
type Hashing = BlakeTwo256;
type AccountId = AccountId;
- type Address = Self::AccountId;
+ type Address = spacewalk_runtime::Address;
type Header = Header<Self::BlockNumber, BlakeTwo256>;
type Extrinsic = OpaqueExtrinsic;
type Signature = MultiSignature;
}
i.e.using the Address
that is defined in the testchain runtime, the extrinsic calls worked even for the default substrate chain for which the RPC error occurred previously.
If we encounter this RPC error again in the future, I assume that checking if all the types defined in the impl Config for SpacewalkRuntime
block of the spacevault client are matching the types of the target chain will fix the problem.
During the development of the vault client we encountered the following error:
The error was shown after calling an extrinsic of the spacewalk pallet from within the vault client. To be precise it is thrown after this function call (that can be found in
/clients/runtime/rpc.rs
):After trying lots of things, the error was finally resolved in this commit by replacing the files of the substrate template testchain with the interbtc chain. But the root cause of this error remains unknown. Since we want the vault and spacewalk to work with other parachains as well, it is important to pin down this issue in case it pops up again.
There likely is a type mismatch somewhere, i.e. the vault client expects the chain it connects to, to have a certain type for e.g. addresses of the keypair.
To investigate this issue I would suggest starting with the substrate template chain again and modifying parts of it step by step until this RPC issue does not occur anymore. Note that every time the chain runtime changes, you should recreate the
metadata-standalone.scale
file used by the vault (see here or in the README of the vault client).