From f338ab17b49069db431d1025468335a5bbdc851a Mon Sep 17 00:00:00 2001 From: Gabriel-Trintinalia Date: Mon, 22 Apr 2024 23:16:06 -0300 Subject: [PATCH] Fix build Signed-off-by: Gabriel-Trintinalia --- sequencer/build.gradle | 9 +++- .../continoustracing/ContinuousTracer.java | 2 +- .../continoustracing/TraceFailureHandler.java | 2 +- .../linea/rpc/capture/CaptureToFile.java | 2 +- .../rpc/counters/GenerateCountersV0.java | 2 +- .../GenerateConflatedTracesV0.java | 2 +- .../validators/SimulationValidator.java | 3 +- sequencer/src/main/resources/spillings.toml | 42 ------------------- .../validators/SimulationValidatorTest.java | 2 +- ...ckCallDataSizeTransactionSelectorTest.java | 3 +- .../MaxBlockGasTransactionSelectorTest.java | 3 +- .../ProfitableTransactionSelectorTest.java | 3 +- .../TestTransactionEvaluationContext.java | 2 +- ...TraceLineLimitTransactionSelectorTest.java | 3 +- .../test/resources/sequencer/line-limits.toml | 1 + 15 files changed, 22 insertions(+), 59 deletions(-) delete mode 100644 sequencer/src/main/resources/spillings.toml diff --git a/sequencer/build.gradle b/sequencer/build.gradle index 2acdc039..aad31ffa 100644 --- a/sequencer/build.gradle +++ b/sequencer/build.gradle @@ -40,7 +40,7 @@ dependencies { compileOnly 'com.google.auto.service:auto-service' compileOnly 'com.google.auto.service:auto-service-annotations' - implementation 'net.consensys.linea.zktracer:arithmetization:0.1.4-20240421.234102-3' + implementation "${besuArtifactGroup}:evm" implementation "${besuArtifactGroup}:plugin-api" implementation "${besuArtifactGroup}:besu-datatypes" @@ -69,6 +69,9 @@ dependencies { testImplementation "${besuArtifactGroup}.internal:core:${besuVersion}" testImplementation "${besuArtifactGroup}.internal:rlp:${besuVersion}" testImplementation "${besuArtifactGroup}.internal:core:${besuVersion}" + implementation ('net.consensys.linea.zktracer:arithmetization:0.1.4-20240421.234102-3'){ + transitive = false + } } configurations { @@ -79,3 +82,7 @@ configurations { apply from: rootProject.file("gradle/dist.gradle") apply from: rootProject.file("gradle/publishing.gradle") + +jar { + zip64=true +} diff --git a/sequencer/src/main/java/net/consensys/linea/continoustracing/ContinuousTracer.java b/sequencer/src/main/java/net/consensys/linea/continoustracing/ContinuousTracer.java index d3f6bac1..ee82fa9e 100644 --- a/sequencer/src/main/java/net/consensys/linea/continoustracing/ContinuousTracer.java +++ b/sequencer/src/main/java/net/consensys/linea/continoustracing/ContinuousTracer.java @@ -53,7 +53,7 @@ public CorsetValidator.Result verifyTraceOfBlock( } catch (final Exception e) { throw new TraceVerificationException(blockHash, e.getMessage()); } finally { - zkTracer.traceEndConflation(); + // zkTracer.traceEndConflation(); } for (final TransactionTraceResult transactionTraceResult : diff --git a/sequencer/src/main/java/net/consensys/linea/continoustracing/TraceFailureHandler.java b/sequencer/src/main/java/net/consensys/linea/continoustracing/TraceFailureHandler.java index 43466229..ed62584e 100644 --- a/sequencer/src/main/java/net/consensys/linea/continoustracing/TraceFailureHandler.java +++ b/sequencer/src/main/java/net/consensys/linea/continoustracing/TraceFailureHandler.java @@ -18,10 +18,10 @@ import lombok.extern.slf4j.Slf4j; import net.consensys.linea.continoustracing.exception.InvalidTraceHandlerException; +import net.consensys.linea.corset.CorsetValidator; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.plugin.data.BlockHeader; - @Slf4j public class TraceFailureHandler { final SlackNotificationService slackNotificationService; diff --git a/sequencer/src/main/java/net/consensys/linea/rpc/capture/CaptureToFile.java b/sequencer/src/main/java/net/consensys/linea/rpc/capture/CaptureToFile.java index 5bb4630f..958a9b3c 100644 --- a/sequencer/src/main/java/net/consensys/linea/rpc/capture/CaptureToFile.java +++ b/sequencer/src/main/java/net/consensys/linea/rpc/capture/CaptureToFile.java @@ -69,7 +69,7 @@ public Capture execute(final PluginRpcRequest request) { tracer.setWorld(worldStateBeforeTracing); tracer.traceStartConflation(toBlock - fromBlock + 1); }, - worldStateAfterTracing -> tracer.traceEndConflation(), + tracer::traceEndConflation, tracer); log.info("[CAPTURE] capture for {}-{} computed in {}", fromBlock, toBlock, sw); return new Capture(tracer.toJson()); diff --git a/sequencer/src/main/java/net/consensys/linea/rpc/counters/GenerateCountersV0.java b/sequencer/src/main/java/net/consensys/linea/rpc/counters/GenerateCountersV0.java index 98a770e4..c59803be 100644 --- a/sequencer/src/main/java/net/consensys/linea/rpc/counters/GenerateCountersV0.java +++ b/sequencer/src/main/java/net/consensys/linea/rpc/counters/GenerateCountersV0.java @@ -90,7 +90,7 @@ public Counters execute(final PluginRpcRequest request) { blockNumber, blockNumber, worldStateBeforeTracing -> tracer.traceStartConflation(1), - worldStateAfterTracing -> tracer.traceEndConflation(), + tracer::traceEndConflation, tracer); return tracer.getModulesLineCount(); diff --git a/sequencer/src/main/java/net/consensys/linea/rpc/tracegeneration/GenerateConflatedTracesV0.java b/sequencer/src/main/java/net/consensys/linea/rpc/tracegeneration/GenerateConflatedTracesV0.java index 874bed30..d03bcb50 100644 --- a/sequencer/src/main/java/net/consensys/linea/rpc/tracegeneration/GenerateConflatedTracesV0.java +++ b/sequencer/src/main/java/net/consensys/linea/rpc/tracegeneration/GenerateConflatedTracesV0.java @@ -78,7 +78,7 @@ public TraceFile execute(final PluginRpcRequest request) { fromBlock, toBlock, worldStateBeforeTracing -> tracer.traceStartConflation(toBlock - fromBlock + 1), - worldStateAfterTracing -> tracer.traceEndConflation(), + tracer::traceEndConflation, tracer); log.info("[TRACING] trace for {}-{} computed in {}", fromBlock, toBlock, sw); sw.reset().start(); diff --git a/sequencer/src/main/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidator.java b/sequencer/src/main/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidator.java index 3b1a8de0..2104dca2 100644 --- a/sequencer/src/main/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidator.java +++ b/sequencer/src/main/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidator.java @@ -81,12 +81,13 @@ public Optional validateTransaction( if (simulationResult.isInvalid()) { return Optional.of( "Invalid transaction" - + simulationResult.getInvalidReason().map(ir -> ": " + ir).orElse("")); + + simulationResult.result().getInvalidReason().map(ir -> ": " + ir).orElse("")); } if (!simulationResult.isSuccessful()) { return Optional.of( "Reverted transaction" + simulationResult + .result() .getRevertReason() .map(rr -> ": " + rr.toHexString()) .orElse("")); diff --git a/sequencer/src/main/resources/spillings.toml b/sequencer/src/main/resources/spillings.toml deleted file mode 100644 index d4d5fece..00000000 --- a/sequencer/src/main/resources/spillings.toml +++ /dev/null @@ -1,42 +0,0 @@ -# These values should be set from `corset debug -s zkevm.bin` -[spillings] -ADD = 2 -BIN = 16 -EC_DATA = 12 -EUC = 1 -EXT = 8 -PUB_HASH = 0 -PUB_HASH_INFO = 0 -HUB = 2 -PUB_LOG = 1 -PUB_LOG_INFO = 5 -MOD = 8 -MUL = 9 -MXP = 4 -MMU = 10 -RLP_ADDR = 7 -TX_RLP = 7 -RLP_TXRCPT = 7 -ROM = 2 -ROM_LEX = 1 -TXN_DATA = 15 -SHF = 16 -STP = 4 -TRM = 7 -WCP = 16 - -PRECOMPILE_ECRECOVER_EFFECTIVE_CALL = 0 -PRECOMPILE_SHA2_BLOCKS = 0 -PRECOMPILE_RIPEMD_BLOCKS = 0 -PRECOMPILE_IDENTITY = 0 -PRECOMPILE_MODEXP_EFFECTIVE_CALL = 0 -PRECOMPILE_ECADD_EFFECTIVE_CALL = 0 -PRECOMPILE_ECMUL_EFFECTIVE_CALL = 0 -PRECOMPILE_ECPAIRING_EFFECTIVE_CALL = 0 -PRECOMPILE_ECPAIRING_MILLER_LOOP = 0 -PRECOMPILE_BLAKE2F_ROUNDS = 0 - -BLOCK_TX = 0 -BLOCK_L2L1LOGS = 0 -BLOCK_KECCAK = 0 -BLOCK_L1SIZE = 0 \ No newline at end of file diff --git a/sequencer/src/test/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidatorTest.java b/sequencer/src/test/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidatorTest.java index 88c4892c..620cd463 100644 --- a/sequencer/src/test/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidatorTest.java +++ b/sequencer/src/test/java/net/consensys/linea/txpoolvalidation/validators/SimulationValidatorTest.java @@ -33,7 +33,7 @@ import net.consensys.linea.config.LineaTracerConfiguration; import net.consensys.linea.config.LineaTransactionPoolValidatorConfiguration; import net.consensys.linea.modulelimit.ModuleLineCountValidator; -import net.consensys.linea.sequencer.txselection.selectors.TraceLineLimitTransactionSelectorTest; +import net.consensys.linea.txselection.selectors.TraceLineLimitTransactionSelectorTest; import org.apache.tuweni.bytes.Bytes; import org.bouncycastle.asn1.sec.SECNamedCurves; import org.bouncycastle.asn1.x9.X9ECParameters; diff --git a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockCallDataSizeTransactionSelectorTest.java b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockCallDataSizeTransactionSelectorTest.java index 052787fb..40008cbe 100644 --- a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockCallDataSizeTransactionSelectorTest.java +++ b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockCallDataSizeTransactionSelectorTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package net.consensys.linea.sequencer.txselection.selectors; +package net.consensys.linea.txselection.selectors; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.BLOCK_CALLDATA_OVERFLOW; import static org.assertj.core.api.Assertions.assertThat; @@ -20,7 +20,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import net.consensys.linea.txselection.selectors.MaxBlockCallDataTransactionSelector; import org.apache.tuweni.bytes.Bytes; import org.hyperledger.besu.datatypes.PendingTransaction; import org.hyperledger.besu.datatypes.Transaction; diff --git a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockGasTransactionSelectorTest.java b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockGasTransactionSelectorTest.java index 9e80da01..a3b8ed39 100644 --- a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockGasTransactionSelectorTest.java +++ b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/MaxBlockGasTransactionSelectorTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package net.consensys.linea.sequencer.txselection.selectors; +package net.consensys.linea.txselection.selectors; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_GAS_EXCEEDS_USER_MAX_BLOCK_GAS; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_TOO_LARGE_FOR_REMAINING_USER_GAS; @@ -21,7 +21,6 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import net.consensys.linea.txselection.selectors.MaxBlockGasTransactionSelector; import org.hyperledger.besu.datatypes.PendingTransaction; import org.hyperledger.besu.datatypes.Transaction; import org.hyperledger.besu.plugin.data.TransactionProcessingResult; diff --git a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/ProfitableTransactionSelectorTest.java b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/ProfitableTransactionSelectorTest.java index a38c7f21..f6a40f99 100644 --- a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/ProfitableTransactionSelectorTest.java +++ b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/ProfitableTransactionSelectorTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package net.consensys.linea.sequencer.txselection.selectors; +package net.consensys.linea.txselection.selectors; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_UNPROFITABLE; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_UNPROFITABLE_MIN_GAS_PRICE_NOT_DECREASED; @@ -27,7 +27,6 @@ import net.consensys.linea.config.LineaProfitabilityConfiguration; import net.consensys.linea.config.LineaTransactionSelectorCliOptions; import net.consensys.linea.config.LineaTransactionSelectorConfiguration; -import net.consensys.linea.txselection.selectors.ProfitableTransactionSelector; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; import org.bouncycastle.crypto.digests.KeccakDigest; diff --git a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TestTransactionEvaluationContext.java b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TestTransactionEvaluationContext.java index 5ee9700f..8a11afe9 100644 --- a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TestTransactionEvaluationContext.java +++ b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TestTransactionEvaluationContext.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package net.consensys.linea.sequencer.txselection.selectors; +package net.consensys.linea.txselection.selectors; import com.google.common.base.Stopwatch; import org.hyperledger.besu.datatypes.PendingTransaction; diff --git a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TraceLineLimitTransactionSelectorTest.java b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TraceLineLimitTransactionSelectorTest.java index 1d7a305a..034678be 100644 --- a/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TraceLineLimitTransactionSelectorTest.java +++ b/sequencer/src/test/java/net/consensys/linea/txselection/selectors/TraceLineLimitTransactionSelectorTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package net.consensys.linea.sequencer.txselection.selectors; +package net.consensys.linea.txselection.selectors; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_MODULE_LINE_COUNT_OVERFLOW; import static net.consensys.linea.txselection.LineaTransactionSelectionResult.TX_MODULE_LINE_COUNT_OVERFLOW_CACHED; @@ -31,7 +31,6 @@ import net.consensys.linea.config.LineaTracerConfiguration; import net.consensys.linea.config.LineaTransactionSelectorConfiguration; import net.consensys.linea.modulelimit.ModuleLineCountValidator; -import net.consensys.linea.txselection.selectors.TraceLineLimitTransactionSelector; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; import org.hyperledger.besu.datatypes.Address; diff --git a/sequencer/src/test/resources/sequencer/line-limits.toml b/sequencer/src/test/resources/sequencer/line-limits.toml index e80f7e5c..fe35d238 100644 --- a/sequencer/src/test/resources/sequencer/line-limits.toml +++ b/sequencer/src/test/resources/sequencer/line-limits.toml @@ -6,6 +6,7 @@ ADD = 524286 BIN = 262128 BIN_RT = 262144 EC_DATA = 4084 +EXP = 32760 EXT = 32760 HUB = 2097150 INSTRUCTION_DECODER = 512 # Ugly hack, TODO: @franklin