diff --git a/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java b/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java index 729b9428752..19ef4621fbc 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java @@ -1297,10 +1297,16 @@ public Optional getMaybeUpdatedStorage() { return maybeUpdatedStorage; } + /** + * Accessor for versionedHashes, if present. + * + * @return optional list of hashes + */ public Optional> getVersionedHashes() { return versionedHashes; } + /** Reset. */ public void reset() { maybeUpdatedMemory = Optional.empty(); maybeUpdatedStorage = Optional.empty(); @@ -1335,7 +1341,12 @@ public static class Builder { private Multimap accessListWarmStorage = HashMultimap.create(); private Optional> versionedHashes; - + /** + * Sets Type. + * + * @param type the type + * @return the builder + */ public Builder type(final Type type) { this.type = type; return this; @@ -1594,6 +1605,12 @@ public Builder accessListWarmStorage(final Multimap accessList return this; } + /** + * Sets versioned hashes list. + * + * @param versionedHashes the Optional list of versioned hashes + * @return the builder + */ public Builder versionedHashes(final Optional> versionedHashes) { this.versionedHashes = versionedHashes; return this; diff --git a/evm/src/main/java/org/hyperledger/besu/evm/operation/DataHashOperation.java b/evm/src/main/java/org/hyperledger/besu/evm/operation/DataHashOperation.java index 487312808e3..eda3f5dfd4e 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/operation/DataHashOperation.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/operation/DataHashOperation.java @@ -24,10 +24,23 @@ import org.apache.tuweni.bytes.Bytes; +/** + * The DataHash operation. https://eips.ethereum.org/EIPS/eip-4844 + * + *

Reads index from the top of the stack as big-endian uint256, and replaces it on the stack with + * tx.message.blob_versioned_hashes[index] if index < len(tx.message.blob_versioned_hashes), and + * otherwise with a zeroed bytes32 value. + */ public class DataHashOperation extends AbstractOperation { + /** DATAHASH opcode number */ public static final int OPCODE = 0x49; + /** + * Instantiates a new DataHash operation. + * + * @param gasCalculator the gas calculator + */ public DataHashOperation(final GasCalculator gasCalculator) { super(OPCODE, "DATAHASH", 1, 1, gasCalculator); }