Closed vtexier closed 1 year ago
Which network/runtime are you experiencing this? It seems to be a type mismatch, unfortunately runtime calls are not a part of the Substrate metadata (yet), so I have to manually update this types.
A quick-and-dirty workaround until a fix is released (to force the library to fallback on the old RPC methods) you can add after init:
substrate.config['rpc_methods'] = substrate.rpc_request("rpc_methods", [])['result']['methods']
substrate.config['rpc_methods'].remove('state_call')
Thanks for the quick fix! My app is currently in alpha stage so no hurry here. ;)
The blockchain project name is Duniter, and in early alpha stage too.
In polkadot.js.org I got this:
Duniter v0.3.0 api v9.10.5 apps v0.122.3-216
If you need more info on data types or substrate version, I can ask the Duniter project devs for more.
I'm wondering if the type definition of RuntimeDispatchInfo
is different than the default Substrate one: https://github.com/paritytech/substrate/blob/a1c1286d2ca6360a16d772cc8bea2190f77f4d8f/frame/transaction-payment/src/types.rs#L105
And also its components like Weight
or Balance
The unit tests for Polkadot/Kusama are passing, so I guess it's a type override. Is there a public endpoint available by any chance? That would make it easier for me to run some tests
Ok I found the type difference, the Balance
type for Duniter is a u64
in stead of an u128
in default Substrate. Normally those type differences doesn't need any manual administration, because the embedded metadata takes care of this for calls and storage functions. But since runtime API calls are not part of the embedded metadata yet, they still need to be administered manually.
So a better solution than the earlier mentioned workaround would be (until Substrate includes runtime API calls and types into the metadata):
custom_type_registry = {
"types": {
"Balance": "u64"
}
}
substrate = SubstrateInterface(
url="wss://gdev.p2p.legal/ws",
type_registry=custom_type_registry
)
Ok I just found out the friendly people at Parity are working on a solution for this exact issue :)
Thanks for the clean config solution. Works like a charm.
On the Duniter project side, the devs are talking about the risk to break the compatibility with the ecosystem by customizing the node. It raises a real concern here. Customizing is powerful, but only possible if the ecosystem can handle the changes seamlessly.
Happy to see that this question is discussed too at Parity.
Version: 1.4.2
Requesting fees does not work anymore
I think it is since issue #277.
https://github.com/polkascan/py-substrate-interface/blob/a6adde8578f83c3cc057679443d64d0891b15190/substrateinterface/base.py#L2150
If I skip the new code in
base.p
y at line2150
:to run on the old code, everything works fine.
It seems to be a scale decode error (offset > length)
To help, here is the debug window with the scale value decoded.