Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hyperledger/besu into EIP4788
Browse files Browse the repository at this point in the history
  • Loading branch information
pinges committed Aug 22, 2023
2 parents a3f2c3f + 8032a60 commit 8c134c5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,17 @@ public boolean warmUpAddress(final Address address) {
return !txValues.warmedUpAddresses().add(address);
}

/**
* Returns whether an address has been warmed up. Is deliberately publicly exposed for access from
* tracers.
*
* @param address the address context
* @return whether the address has been warmed up
*/
public boolean isAddressWarm(final Address address) {
return txValues.warmedUpAddresses().contains(address);
}

/**
* "Warms up" the storage slot as per EIP-2929
*
Expand All @@ -1004,6 +1015,18 @@ public boolean warmUpStorage(final Address address, final Bytes32 slot) {
return txValues.warmedUpStorage().put(address, slot, Boolean.TRUE) != null;
}

/**
* Returns whether an address' slot is warmed up. Is deliberately publicly exposed for access from
* trace
*
* @param address the address context
* @param slot the slot to query
* @return whether the address/slot couple is warmed up
*/
public boolean isStorageWarm(final Address address, final Bytes32 slot) {
return this.txValues.warmedUpStorage().contains(address, slot);
}

/**
* Return the world state.
*
Expand Down

0 comments on commit 8c134c5

Please sign in to comment.