diff --git a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BLS12Benchmark.java b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BLS12Benchmark.java index a95f48c0dfb..0c3e12bef08 100644 --- a/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BLS12Benchmark.java +++ b/ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/benchmarks/BLS12Benchmark.java @@ -17,10 +17,8 @@ import org.hyperledger.besu.evm.EvmSpecVersion; import org.hyperledger.besu.evm.precompile.AbstractBLS12PrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12G1AddPrecompiledContract; -import org.hyperledger.besu.evm.precompile.BLS12G1MulPrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12G1MultiExpPrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12G2AddPrecompiledContract; -import org.hyperledger.besu.evm.precompile.BLS12G2MulPrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12G2MultiExpPrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12MapFp2ToG2PrecompiledContract; import org.hyperledger.besu.evm.precompile.BLS12MapFpToG1PrecompiledContract; @@ -166,11 +164,9 @@ public void runBenchmark( } benchmarkG1Add(output); - benchmarkG1Mul(output); benchmarkG1MultiExp32Pairs(output); benchmarkMapFpToG1(output); benchmarkG2Add(output); - benchmarkG2Mul(output); benchmarkG2MultiExp32Pairs(output); benchmarkMapFp2ToG2(output); benchmarkBlsPairing(output); @@ -198,28 +194,6 @@ private void benchmarkG1Add(final PrintStream output) { gasCost, execTime * 1_000_000, gasCost / execTime / 1_000_000); } - private void benchmarkG1Mul(final PrintStream output) { - final Map testCases = new LinkedHashMap<>(); - for (int i = 0; i < g1PointPairs.length; i++) { - testCases.put("G1 Mul " + i, Bytes.fromHexString(g1PointPairs[i] + scalars[i])); - } - - BLS12G1MulPrecompiledContract g1addContract = new BLS12G1MulPrecompiledContract(); - warmup = MATH_WARMUP / testCases.size(); - iterations = MATH_ITERATIONS / testCases.size(); - double execTime = Double.MIN_VALUE; // a way to dodge divide by zero - long gasCost = 0; - for (final Map.Entry testCase : testCases.entrySet()) { - execTime += runPrecompileBenchmark(testCase.getValue(), g1addContract); - gasCost += g1addContract.gasRequirement(testCase.getValue()); - } - execTime /= testCases.size(); - gasCost /= testCases.size(); - output.printf( - "Bls12 G1 Mul %,6d avg gas @%,7.1f µs /%,8.1f MGps%n", - gasCost, execTime * 1_000_000, gasCost / execTime / 1_000_000); - } - private void benchmarkG1MultiExp32Pairs(final PrintStream output) { final Map testCases = new LinkedHashMap<>(); @@ -290,28 +264,6 @@ private void benchmarkG2Add(final PrintStream output) { gasCost, execTime * 1_000_000, gasCost / execTime / 1_000_000); } - private void benchmarkG2Mul(final PrintStream output) { - final Map testCases = new LinkedHashMap<>(); - for (int i = 0; i < g2PointPairs.length; i++) { - testCases.put("G2 Mul " + i, Bytes.fromHexString(g2PointPairs[i] + scalars[i])); - } - - BLS12G2MulPrecompiledContract g1addContract = new BLS12G2MulPrecompiledContract(); - warmup = MATH_WARMUP / testCases.size(); - iterations = MATH_ITERATIONS / testCases.size(); - double execTime = Double.MIN_VALUE; // a way to dodge divide by zero - long gasCost = 0; - for (final Map.Entry testCase : testCases.entrySet()) { - execTime += runPrecompileBenchmark(testCase.getValue(), g1addContract); - gasCost += g1addContract.gasRequirement(testCase.getValue()); - } - execTime /= testCases.size(); - gasCost /= testCases.size(); - output.printf( - "Bls12 G2 Mul %,6d avg gas @%,7.1f µs /%,8.1f MGps%n", - gasCost, execTime * 1_000_000, gasCost / execTime / 1_000_000); - } - private void benchmarkG2MultiExp32Pairs(final PrintStream output) { final Map testCases = new LinkedHashMap<>();