vit
5 January 2023 15:31
1
Tikka 0.6.6 crash if you click on the fees button in the transfer window.
It is a bug in substrate-interface
last version 1.4.2.
I have opened a new issue:
opened 03:28PM - 05 Jan 23 UTC
closed 11:02AM - 06 Feb 23 UTC
Version: 1.4.2
Requesting fees does not work anymore
I think it is since i… ssue #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 line `2150` :
```python
if not self.supports_rpc_method('state_call'):
```
to run on the old code, everything works fine.
It seems to be a scale decode error (offset > length)
```
DEBUG:substrateinterface.base:Executing Runtime Call TransactionPaymentApi.query_info
DEBUG:substrateinterface.base:RPC request #39: "state_call"
Traceback (most recent call last):
File "/home/vit/Documents/dev/python/tikka/tikka/slots/pyqt/entities/worker.py", line 43, in run
self.call()
File "/home/vit/Documents/dev/python/tikka/tikka/slots/pyqt/windows/transfer.py", line 291, in fetch_fees_from_network
self.account, self.recipient_account.address, blockchain_value
File "/home/vit/Documents/dev/python/tikka/tikka/domains/transfers.py", line 55, in fees
return self.network.fees(sender_account, recipient_address, amount)
File "/home/vit/Documents/dev/python/tikka/tikka/adapters/network/transfers.py", line 111, in fees
call=call, keypair=sender_account_keypair
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/substrateinterface/base.py", line 2154, in get_payment_info
result = self.runtime_call("TransactionPaymentApi", "query_info", [extrinsic, extrinsic_len])
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/substrateinterface/base.py", line 1599, in runtime_call
result_obj.decode(ScaleBytes(result_data['result']))
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 696, in decode
self.value_serialized = self.process()
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/types.py", line 526, in process
field_obj = self.process_type(data_type, metadata=self.metadata)
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 778, in process_type
obj.decode(check_remaining=False)
File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 712, in decode
f'Decoding <{self.__class__.__name__}> - No more bytes available (needed: {self.data.offset} / total: {self.data.length})'
scalecodec.exceptions.RemainingScaleBytesNotEmptyException: Decoding <U128> - No more bytes available (needed: 25 / total: 17)
python-BaseException
```
To help, here is the debug window with the scale value decoded.

3 Likes
vit
6 January 2023 12:52
2
@HugoTrentesaux can you take a look at the issue ?
Because it reveals that the Balance Type in Duniter (U64) is different than the substrate default type (U128). Is there a reason for that ?
Substrate does not allow yet to query the custom type automatically so the dev have to handle it manually.
Parity is working on a solution to this problem.
1 Like
Élois thought we didn’t need so much precision (as we have only 2 decimal digits), so he chose to use 64 bits instead of 128 to save storage space.
If needed we can easily switch to u128, but if we want to go back to u64 it may be more complex as it may be lossy.
1 Like
I think elois wanted to test the substrate abstraction capabilities. His conclusion is that even substrate is quite easy to customize, this is not the case of the ecosystem around it.
To minimize friction against the ecosystem, I would prefer to stay closer to polkadot. The Duniter account-data
is a customization of parity balances account-data which only adds the randomId whose utility is still subject to debate (La solution pour des identicones sécurisées: le random id - #16 by HugoTrentesaux ).
In order to gain grain for transaction fees, I think it would be good to keep a 128 bit account balance. Elois obsession for optimization can be a bit cumbersome.
see also
So I’m adding this to my TODO list: Je me lance à plein temps (HugoTrentesaux) - #2 by HugoTrentesaux
1 Like
I created the issue about u128 , so it’s not only tracked in your forum todo-list.
2 Likes