Open lana-shanghai opened 3 years ago
The get_block_metadata
function depends on the state_getMetadata
RPC call and that the results directly contains the hex-bytes (0x...). It seems for some reason that is not the case (apparently a dict
), is that something that has changed in the runtime? What exactly does state_getMetadata
return in your case?.
Also, are you using the latest version? It could also be an error is present in the RPC call result and at some point I added better error handling:
The
get_block_metadata
function depends on thestate_getMetadata
RPC call and that the results directly contains the hex-bytes (0x...). It seems for some reason that is not the case (apparently adict
), is that something that has changed in the runtime? What exactly doesstate_getMetadata
return in your case?.Also, are you using the latest version? It could also be an error is present in the RPC call result and at some point I added better error handling:
so the dictionary I get looks like so:
data: {'apis': [['0xdf6acb689907609b', 3], ['0x37e397fc7c91f5e4', 1], ['0x40fe3ad401f8959a', 4], ['0xd2bc9897eed08f15', 2], ['0xf78b278be53f454c', 2], ['0xdd718d5cc53262d4', 1], ['0xab3c0572291feb8b', 1], ['0xed99c5acb25eedf5', 2], ['0xbc9d89904f5b923f', 1], ['0x37c8bb1350a9a2a8', 1], ['0x68b66ba122c93fa7', 1]], 'authoringVersion': 1, 'implName': 'canvas', 'implVersion': 0, 'specName': 'canvas', 'specVersion': 8, 'transactionVersion': 1}
The substrate interface version in 0.11.15 - the latest I think :)
@arjanz do you think adding a check to the type of the data variable would help? It tries to get the block hash, so maybe adding a re-try would help? E.g. somewhere around here? https://github.com/polkascan/py-substrate-interface/blob/7da12f022947d59d34b89b14b944e5d6796119fe/substrateinterface/base.py#L748
Do you have a way for me to reproduce this error you are getting? Otherwise it will be very difficult for me to analyse this or give you pointers in the right direction..
Do you have a way for me to reproduce this error you are getting? Otherwise it will be very difficult for me to analyse this or give you pointers in the right direction..
I'm getting this error when running our d3a simulation with a node. The process is described in our wiki https://gridsingularity.github.io/d3a/blockchain/
It sends transactions to a substrate node we have in the cluster. It fails about mid-way through the 96 transactions in the basic test scenario (I posted the traceback above). Somehow at some point it returns the result of {"id":1, "jsonrpc":"2.0", "method": "state_getRuntimeVersion"}
instead of {"id":1, "jsonrpc":"2.0", "method": "state_getMetadata"}
and I can't figure out in the interface, where this could happen. The RPC call is here https://github.com/polkascan/py-substrate-interface/blob/7da12f022947d59d34b89b14b944e5d6796119fe/substrateinterface/base.py#L764
Hey Arjan,
There is a little issue happening when I'm running a python simulation and sending transactions to the substrate node. At some point I get the traceback below, do you think there is a workaround here to re-try getting the correct metadata result?
The error: https://github.com/polkascan/py-scale-codec/blob/master/scalecodec/base.py#L243
The function where this error drags from: https://github.com/polkascan/py-substrate-interface/blob/master/substrateinterface/base.py#L744
The traceback: