Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ws_provider.get_block(block_number=23108420) fails for some blocks with the below error #405

Open
mds512 opened this issue Oct 25, 2024 · 0 comments

Comments

@mds512
Copy link

mds512 commented Oct 25, 2024

versions:

scalecodec 1.2.11
substrate-interface 1.7.11

>>> ws_provider.get_block(block_number=23108420)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/dist-packages/substrateinterface/base.py", line 2450, in get_block
    return self.__get_block_handler(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/substrateinterface/base.py", line 2409, in __get_block_handler
    return decode_block(response['result']['block'], block_data_hash=block_hash)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/substrateinterface/base.py", line 2302, in decode_block
    extrinsic_decoder.decode()
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 2886, in process
    self.value_object.update(self.process_type(extrinsic_version, metadata=self.metadata).value_object)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 572, in process
    field_obj = self.process_type(data_type, metadata=self.metadata)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 1536, in process
    call_obj = self.process_type(call_type_string, metadata=self.metadata)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 1238, in process
    result_obj = self.process_type(enum_type_mapping[1], metadata=self.metadata)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 572, in process
    field_obj = self.process_type(data_type, metadata=self.metadata)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 874, in decode
    self.value_serialized = self.process()
                            ^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/types.py", line 970, in process
    element = self.process_type(self.sub_type, metadata=self.metadata)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 979, in process_type
    obj.decode(check_remaining=False)
  File "/usr/local/lib/python3.11/dist-packages/scalecodec/base.py", line 889, in decode
    raise RemainingScaleBytesNotEmptyException(
scalecodec.exceptions.RemainingScaleBytesNotEmptyException: Decoding <scale_info::14> - No more bytes available (needed: 175026426 / total: 148)

>>> ws_provider.get_block(block_number=23108422)
{'header': {'parentHash': '0x4c15d9e07b47943efefa4ab2d90dfec55635be64e8ccc590efd2aa7502860683', 'number': 23108422, 'stateRoot': '0x0f5ab83a0569e45ee40b8d0b64028e0565ad8504e947755f231f09c5180ca668', 'extrinsicsRoot': '0x669053aee8c5e980e22224dd36332adba9bbb7e93fae57a1582b3861817b22a5', 'digest': {'logs': [<scale_info::17(value={'PreRuntime': ('0x42414245', '0x03670000000b122f1100000000ca3d658fa3c3b4b6137f412b189a8ad1a7d789761ddf92a6a20f971e15de6d0fbf17f0922fcab704345fbe8301cca2440bdcc6053e866536906083c0d3299c052cad35bfe58883fd7890ea74d79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant