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 99e8548def5..49d5c6d943a 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 @@ -68,15 +68,27 @@ public static void setPrecompileCaching(final boolean enablePrecompileCaching) { enableResultCaching = enablePrecompileCaching; } + /** + * enum for precompile cache metric + */ public enum CacheMetric { + /** a successful cache hit metric */ HIT, + /** a cache miss metric */ MISS, + /** a false positive cache hit metric */ FALSE_POSITIVE } + /** + * record type used for cache event + * @param precompile precompile name + * @param cacheMetric cache metric type (hit, miss, false positive). + */ public record CacheEvent(String precompile, CacheMetric cacheMetric) {} - public static Consumer cacheEventConsumer = __ -> {}; + + static Consumer cacheEventConsumer = __ -> {}; /** * Set an optional cache event consumer, such as a metrics system logger. diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128AddPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128AddPrecompiledContract.java index 03b0e7e3c16..39b9fdf03af 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128AddPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128AddPrecompiledContract.java @@ -35,7 +35,7 @@ public class AltBN128AddPrecompiledContract extends AbstractAltBnPrecompiledContract { private static final int PARAMETER_LENGTH = 128; - public static final String PRECOMPILE_NAME = "AltBN128Add"; + private static final String PRECOMPILE_NAME = "AltBN128Add"; private final long gasCost; private static final Cache bnAddCache = diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128MulPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128MulPrecompiledContract.java index fd174cac959..4012011d6f4 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128MulPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128MulPrecompiledContract.java @@ -35,7 +35,7 @@ public class AltBN128MulPrecompiledContract extends AbstractAltBnPrecompiledContract { private static final int PARAMETER_LENGTH = 96; - public static final String PRECOMPILE_NAME = "AltBN128Mul"; + private static final String PRECOMPILE_NAME = "AltBN128Mul"; private static final BigInteger MAX_N = new BigInteger( diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128PairingPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128PairingPrecompiledContract.java index 4f139b89972..1a71fb63646 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128PairingPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128PairingPrecompiledContract.java @@ -41,7 +41,7 @@ public class AltBN128PairingPrecompiledContract extends AbstractAltBnPrecompiled private static final int FIELD_LENGTH = 32; private static final int PARAMETER_LENGTH = 192; - public static final String PRECOMPILE_NAME = "AltBN128Pairing"; + private static final String PRECOMPILE_NAME = "AltBN128Pairing"; private static final Cache bnPairingCache = Caffeine.newBuilder() .maximumWeight(16_000_000) diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLAKE2BFPrecompileContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLAKE2BFPrecompileContract.java index 612cda35ce3..24b66218cb0 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLAKE2BFPrecompileContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/BLAKE2BFPrecompileContract.java @@ -38,7 +38,7 @@ public class BLAKE2BFPrecompileContract extends AbstractPrecompiledContract { private static final Logger LOG = LoggerFactory.getLogger(BLAKE2BFPrecompileContract.class); - public static final String PRECOMPILE_NAME = "BLAKE2f"; + private static final String PRECOMPILE_NAME = "BLAKE2f"; private static final Cache blakeCache = Caffeine.newBuilder().maximumSize(1000).build(); diff --git a/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java b/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java index 3cd05eed6d5..ab2c284a658 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/precompile/ECRECPrecompiledContract.java @@ -41,7 +41,7 @@ public class ECRECPrecompiledContract extends AbstractPrecompiledContract { private static final Logger LOG = LoggerFactory.getLogger(ECRECPrecompiledContract.class); private static final int V_BASE = 27; final SignatureAlgorithm signatureAlgorithm; - public static final String PRECOMPILE_NAME = "ECREC"; + private static final String PRECOMPILE_NAME = "ECREC"; private static final Cache ecrecCache = Caffeine.newBuilder().maximumSize(1000).build();