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

parse block_hashes key as hex #1099

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gurukamath
Copy link
Collaborator

(closes #1078 )

What was wrong?

The block hashes keys are sent to t8n as a string of number but has to be a hex

Related to Issue #1078

How was it fixed?

Convert the keys from hex to int.

Cute Animal Picture

@gurukamath gurukamath marked this pull request as ready for review January 29, 2025 09:30
Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gurukamath! Still failing I'm afraid, but a slightly different fail mode. You can reproduce it on https://github.com/ethereum/execution-spec-tests/tree/export_int_as_hex with:

uv run --with ethereum@git+https://github.com/gurukamath/execution-specs.git@t8n-hex-inputs pytest -c pytest-framework.ini

Relevant backtrace:

  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum_spec_tools/evm_tools/daemon.py", line 66, in do_POST
    main(args=args, out_file=out_wrapper, in_file=input)
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum_spec_tools/evm_tools/__init__.py", line 109, in main
    return t8n_tool.run()
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum_spec_tools/evm_tools/t8n/__init__.py", line 461, in run
    self.apply_body()
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum_spec_tools/evm_tools/t8n/__init__.py", line 377, in apply_body
    process_transaction_return = self.fork.process_transaction(
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum/berlin/fork.py", line 712, in process_transaction
    output = process_message_call(message, env)
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum/berlin/vm/interpreter.py", line 119, in process_message_call
    evm = process_message(message, env)
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum/berlin/vm/interpreter.py", line 233, in process_message
    evm = execute_code(message, env)
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum/berlin/vm/interpreter.py", line 296, in execute_code
    op_implementation[op](evm)
  File "/home/dtopz/.cache/ethereum-spec-evm-resolver/Berlin/src/ethereum/berlin/vm/instructions/block.py", line 49, in block_hash
    push(evm.stack, U256.from_be_bytes(hash))
  File "/home/dtopz/code/github/danceratopz/eest/.venv/lib/python3.10/site-packages/ethereum_types/numeric.py", line 561, in from_be_bytes
    if len(buffer) > byte_count:
TypeError: object of type 'NoneType' has no len()

@petertdavies
Copy link
Contributor

Thanks @gurukamath! Still failing I'm afraid, but a slightly different fail mode. You can reproduce it on https://github.com/ethereum/execution-spec-tests/tree/export_int_as_hex with:

uv run --with ethereum@git+https://github.com/gurukamath/execution-specs.git@t8n-hex-inputs pytest -c pytest-framework.ini

That command doesn't do what you want it to do. You need to change eels_resolutions.json instead. I did that and it fixed that test.

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

Successfully merging this pull request may close these issues.

t8n fails a unit tests when given input data as hex
3 participants