test_blockhash_zero_out_of_window()¶
Documentation for tests/frontier/opcodes/test_blockhash_state_test_recency.py::test_blockhash_zero_out_of_window@2867859a.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/frontier/opcodes/test_blockhash_state_test_recency.py::test_blockhash_zero_out_of_window --fork Amsterdam
BLOCKHASH(0) must be 0 when block 0 is outside the recency window.
At current_number well past the window, block 0 is ancient, so every
spec-conformant client returns 0. Nethermind's state-test runner instead
returns keccak256("0") because TestBlockhashProvider skips the
window check, which is the bug this test guards against.
Marked state_test_only: the bug lives solely in the state-test code
path (the production blockhash provider enforces the window), and a state
test with such a high env.number cannot be converted into a real
blockchain-test fixture (no genesis chain up to that height).
Source code in tests/frontier/opcodes/test_blockhash_state_test_recency.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
Parametrized Test Cases¶
This test generates 4 parametrized test cases across 16 forks.