You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query of this block by it's number: 17034890 gives an error.
The command: await w3.eth.get_block(block_id, full_transactions=True)
The exception I get:
+ Exception Group Traceback (most recent call last):
| File "<frozen runpy>", line 198, in _run_module_as_main
| File "<frozen runpy>", line 88, in _run_code
| File "/src/app/cli/__main__.py", line 15, in <module>
| app()
| File "/src/app/utils/time_decorator.py", line 30, in wrapped
| result = fn(*args, **kwargs)
| ^^^^^^^^^^^^^^^^^^^
| File "/src/app/cli/data/commands.py", line 85, in bulk_import_bare_blocks
| asyncio.run(_do())
| File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
| return runner.run(main)
| ^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
| return self._loop.run_until_complete(task)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
| return future.result()
| ^^^^^^^^^^^^^^^
| File "/src/app/cli/data/commands.py", line 68, in _do
| async with asyncio.TaskGroup() as tg:
| File "/usr/local/lib/python3.11/asyncio/taskgroups.py", line 147, in __aexit__
| raise me from None
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/env/lib/python3.11/site-packages/eth_utils/applicators.py", line 84, in apply_formatters_to_dict
| yield key, formatters[key](item)
| ^^^^^^^^^^^^^^^^^^^^^
| File "cytoolz/functoolz.pyx", line 253, in cytoolz.functoolz.curry.__call__
| File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.__call__
| File "/env/lib/python3.11/site-packages/eth_utils/decorators.py", line 91, in wrapper
| return ReturnType(result) # type: ignore
| ^^^^^^^^^^^^^^^^^^
| TypeError: NoneType takes no arguments
|
| The above exception was the direct cause of the following exception:
|
| Traceback (most recent call last):
| File "/src/app/cli/data/commands.py", line 24, in fetch_block
| block_data = await w3.eth.get_block(block_id, full_transactions=True)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/env/lib/python3.11/site-packages/web3/eth/async_eth.py", line 402, in get_block
| return await self._get_block(block_identifier, full_transactions)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/env/lib/python3.11/site-packages/web3/module.py", line 96, in caller
| return apply_result_formatters(result_formatters, result)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "cytoolz/functoolz.pyx", line 253, in cytoolz.functoolz.curry.__call__
| File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.__call__
| File "/env/lib/python3.11/site-packages/web3/module.py", line 43, in apply_result_formatters
| formatted_result = pipe(result, result_formatters)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "cytoolz/functoolz.pyx", line 666, in cytoolz.functoolz.pipe
| File "cytoolz/functoolz.pyx", line 641, in cytoolz.functoolz.c_pipe
| File "cytoolz/functoolz.pyx", line 253, in cytoolz.functoolz.curry.__call__
| File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.__call__
| File "/env/lib/python3.11/site-packages/eth_utils/applicators.py", line 72, in apply_formatter_if
| return formatter(value)
| ^^^^^^^^^^^^^^^^
| File "cytoolz/functoolz.pyx", line 253, in cytoolz.functoolz.curry.__call__
| File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.__call__
| File "/env/lib/python3.11/site-packages/web3/_utils/method_formatters.py", line 163, in type_aware_apply_formatters_to_dict
| formatted_dict: Dict[str, Any] = apply_formatters_to_dict(formatters, dict(value))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "cytoolz/functoolz.pyx", line 253, in cytoolz.functoolz.curry.__call__
| File "cytoolz/functoolz.pyx", line 249, in cytoolz.functoolz.curry.__call__
| File "/env/lib/python3.11/site-packages/eth_utils/functional.py", line 45, in inner
| return callback(fn(*args, **kwargs))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/env/lib/python3.11/site-packages/eth_utils/applicators.py", line 95, in apply_formatters_to_dict
| raise TypeError(new_error_message) from exc
| TypeError: Could not format invalid type of None for field 'withdrawals'
+------------------------------------
Receiving this block with curl shows that the withdrawals field is null:
@remort I wasn't able to replicate this on the latest Geth or Infura. It looks like Geth started sending back an empty list as of 1.11.1, so this shouldn't be a problem any more but I'm also not opposed to doing a check.
pip freeze
outputWhat was wrong?
query of this block by it's number: 17034890 gives an error.
The command:
await w3.eth.get_block(block_id, full_transactions=True)
The exception I get:
Receiving this block with curl shows that the
withdrawals
field isnull
:Checked on Infura API and private Geth node.
How can it be fixed?
It seems that the web3 formatter for this field is not ready for the None value.
The text was updated successfully, but these errors were encountered: