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

T8N return an error when asked BLOCKHASH in state test mode #1023

Open
winsvega opened this issue Oct 17, 2024 · 1 comment
Open

T8N return an error when asked BLOCKHASH in state test mode #1023

winsvega opened this issue Oct 17, 2024 · 1 comment
Labels
A-tool Area: tooling C-bug Category: this is a bug, deviation, or other problem. E-hard Experience: difficult, probably not for the faint of heart

Comments

@winsvega
Copy link
Contributor

Original issue:
ethereum/execution-spec-tests#899

here is the evmdump:
http://retesteth.ethdevops.io/temp/pyspecs/frontier__scenarios__test_scenarios__test_blockhash_bug/

error:

.venv/lib/python3.12/site-packages/requests/models.py:974: in json
    return complexjson.loads(self.text, **kwargs)
/usr/lib/python3.12/json/__init__.py:346: in loads
    return _default_decoder.decode(s)
/usr/lib/python3.12/json/decoder.py:337: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
/usr/lib/python3.12/json/decoder.py:355: in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
E   json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:
tests/frontier/scenarios/test_scenarios.py:257: in test_scenarios
    state_test(env=tx_env, pre=pre, post=post, tx=tx, post_hint=hint)
src/pytest_plugins/filler/filler.py:836: in __init__
    fixture = self.generate(
src/ethereum_test_specs/state.py:188: in generate
    return self.make_state_test_fixture(t8n, fork, eips, self.post_hint)
src/ethereum_test_specs/state.py:139: in make_state_test_fixture
    transition_tool_output = t8n.evaluate(
src/ethereum_clis/transition_tool.py:487: in evaluate
    return self._evaluate_server(t8n_data=t8n_data, debug_output_path=debug_output_path)
src/ethereum_clis/transition_tool.py:314: in _evaluate_server
    output: TransitionToolOutput = TransitionToolOutput.model_validate(response.json())
.venv/lib/python3.12/site-packages/requests/models.py:978: in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
E   requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
------------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------------
----------------------------------------
Exception occurred during processing of request from ['local', 0]
Traceback (most recent call last):
  File "/usr/lib/python3.12/socketserver.py", line 318, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.12/socketserver.py", line 349, in process_request
    self.finish_request(request, client_address)
  File "/home/wins/.cache/ethereum-spec-evm-resolver/Cancun/src/ethereum_spec_tools/evm_tools/daemon.py", line 91, in finish_request
    super().finish_request(request, client_address)
  File "/usr/lib/python3.12/socketserver.py", line 362, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.12/socketserver.py", line 761, in __init__
    self.handle()
  File "/usr/lib/python3.12/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/usr/lib/python3.12/http/server.py", line 424, in handle_one_request
    method()
  File "/home/wins/.cache/ethereum-spec-evm-resolver/Cancun/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/wins/.cache/ethereum-spec-evm-resolver/Cancun/src/ethereum_spec_tools/evm_tools/__init__.py", line 109, in main
    return t8n_tool.run()
           ^^^^^^^^^^^^^^

@winsvega winsvega changed the title T8N return and error when asked BLOCKHASH in state test mode T8N return an error when asked BLOCKHASH in state test mode Oct 17, 2024
@SamWilsn SamWilsn added A-tool Area: tooling C-bug Category: this is a bug, deviation, or other problem. labels Nov 4, 2024
@SamWilsn SamWilsn added the E-hard Experience: difficult, probably not for the faint of heart label Nov 14, 2024
@SamWilsn
Copy link
Collaborator

To confirm, the expected behaviour here is that when the chain does not contain a block at the given number (so for example current block has number 8 but it has no parent), you keccak the string representation of the missing block number?

If my above understanding is correct, we will not implement this behaviour. There are other ways we could provide fake block hashes (like pushing empty blocks before beginning the test), but this is just too weird for us to include in the spec itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tool Area: tooling C-bug Category: this is a bug, deviation, or other problem. E-hard Experience: difficult, probably not for the faint of heart
Projects
None yet
Development

No branches or pull requests

2 participants