Skip to content

Commit

Permalink
use constant
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Feb 9, 2024
1 parent 23333d7 commit 74ed493
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EIPS/eip-2935.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def process_block_hash_history(block :Block, state: State):
# If this is the first fork block, add the parent's direct 255 ancestors as well
if block.parent.timestamp < FORK_TIMESTAMP:
ancestor = block.parent
for i in range(255):
for i in range(HISTORY_SERVE_WINDOW - 1):
# stop at genesis block
if ancestor.number == 0:
break
Expand All @@ -50,7 +50,7 @@ def process_block_hash_history(block :Block, state: State):
state.insert_slot(HISTORY_STORAGE_ADDRESS, ancestor.number, ancestor.hash)
```

Note that if this is the fork block, then it persists the additional requisite history that could be needed while resolving `BLOCKHASH` opcode for all of the `256` ancestors (up untill the genesis).
Note that if this is the fork block, then it persists the additional requisite history that could be needed while resolving `BLOCKHASH` opcode for all of the `HISTORY_SERVE_WINDOW` ancestors (up untill genesis).

For resolving the `BLOCKHASH` opcode this fork onwards (`block.timestamp > FORK_TIMESTAMP`), switch the logic to:

Expand Down

0 comments on commit 74ed493

Please sign in to comment.