mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 21:17:54 -05:00
Improve BLOCKHASH Short Circuit (#8171)
* Improve BLOCKHASH Short Circuit Signed-off-by: Danno Ferrin <danno@numisight.com> Co-authored-by: Justin Florentine <justin+github@florentine.us>
This commit is contained in:
@@ -57,9 +57,9 @@ public class BlockHashOperation extends AbstractOperation {
|
||||
final long currentBlockNumber = blockValues.getNumber();
|
||||
final BlockHashLookup blockHashLookup = frame.getBlockHashLookup();
|
||||
|
||||
// If the current block is the genesis block or the sought block is
|
||||
// not within the lookback window, zero is returned.
|
||||
if (currentBlockNumber == 0
|
||||
// If the sought block is negative, a future block, the current block, or not in the
|
||||
// lookback window, zero is returned.
|
||||
if (soughtBlock < 0
|
||||
|| soughtBlock >= currentBlockNumber
|
||||
|| soughtBlock < (currentBlockNumber - blockHashLookup.getLookback())) {
|
||||
frame.pushStackItem(Bytes32.ZERO);
|
||||
|
||||
Reference in New Issue
Block a user