diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java index 025cee874b8..c275bde61ff 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AbstractPrecompiledContract.java @@ -54,8 +54,15 @@ public String getName() { return name; } - protected static Boolean enableResultCaching = Boolean.TRUE; + /** + * Default result caching to false unless otherwise set. + */ + protected static Boolean enableResultCaching = Boolean.FALSE; + /** + * Enable or disable precompile result caching. + * @param enablePrecompileCaching boolean indicating whether to cache precompile results + */ public static void setPrecompileCaching(final boolean enablePrecompileCaching) { enableResultCaching = enablePrecompileCaching; } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/PrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/PrecompiledContract.java index af37eab25f5..651f8deb04a 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/PrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/PrecompiledContract.java @@ -110,5 +110,11 @@ public static PrecompileContractResult halt( } } + + /** + * Record type used for precompile result caching. + * @param cachedInput cached input bytes + * @param cachedResult cached result + */ record PrecompileInputResultTuple(Bytes cachedInput, PrecompileContractResult cachedResult) {} }