diff --git a/arithmetization/src/main/java/net/consensys/linea/blockcapture/BlockCapturer.java b/arithmetization/src/main/java/net/consensys/linea/blockcapture/BlockCapturer.java index f3fde8172..ea5fb4912 100644 --- a/arithmetization/src/main/java/net/consensys/linea/blockcapture/BlockCapturer.java +++ b/arithmetization/src/main/java/net/consensys/linea/blockcapture/BlockCapturer.java @@ -70,7 +70,7 @@ public void traceEndConflation(WorldView state) {} @Override public void traceStartBlock( - BlockHeader blockHeader, BlockBody blockBody, Address miningBeneficiary) { + BlockHeader blockHeader, BlockBody blockBody, final Address miningBeneficiary) { this.reaper.enterBlock(blockHeader, blockBody, miningBeneficiary); } diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/ConflationAwareOperationTracer.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/ConflationAwareOperationTracer.java index 01fc47f79..913592431 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/ConflationAwareOperationTracer.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/ConflationAwareOperationTracer.java @@ -80,6 +80,12 @@ public void traceEndConflation(WorldView state) { this.tracers.forEach(tracer -> tracer.traceEndConflation(state)); } + public void traceStartBlock( + final BlockHeader blockHeader, final BlockBody blockBody, final Address miningBeneficiary) { + this.tracers.forEach( + tracer -> tracer.traceStartBlock(blockHeader, blockBody, miningBeneficiary)); + } + public void traceStartBlock( final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) { this.tracers.forEach( diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java index 0edc2be74..d89766c53 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java @@ -183,6 +183,17 @@ public void traceStartBlock( } } + @Override + public void traceStartBlock( + final BlockHeader blockHeader, final BlockBody blockBody, final Address miningBeneficiary) { + try { + this.hub.traceStartBlock(blockHeader, miningBeneficiary); + this.debugMode.ifPresent(x -> x.traceStartBlock(blockHeader, blockBody, miningBeneficiary)); + } catch (final Exception e) { + this.tracingExceptions.add(e); + } + } + @Override public void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) { try { diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/DebugMode.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/DebugMode.java index e4ccf4f63..dc8824163 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/module/DebugMode.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/module/DebugMode.java @@ -23,6 +23,7 @@ import net.consensys.linea.zktracer.opcode.OpCode; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.DelegatingBytes; +import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Quantity; import org.hyperledger.besu.datatypes.Transaction; import org.hyperledger.besu.evm.frame.MessageFrame; @@ -159,7 +160,10 @@ public void traceEndConflation() { log.info("=== Stop conflation ==="); } - public void traceStartBlock(ProcessableBlockHeader processableBlockHeader, final BlockBody body) { + public void traceStartBlock( + ProcessableBlockHeader processableBlockHeader, + final BlockBody body, + final Address miningBeneficiary) { if (!this.l.doBlock()) { return; } diff --git a/reference-tests/src/test/java/net/consensys/linea/GeneralStateReferenceTestTools.java b/reference-tests/src/test/java/net/consensys/linea/GeneralStateReferenceTestTools.java index c3e9058b2..6098bf4e9 100644 --- a/reference-tests/src/test/java/net/consensys/linea/GeneralStateReferenceTestTools.java +++ b/reference-tests/src/test/java/net/consensys/linea/GeneralStateReferenceTestTools.java @@ -178,7 +178,7 @@ public static void executeTest(final GeneralStateTestCaseEipSpec spec) { final ZkTracer zkTracer = new ZkTracer(); zkTracer.traceStartConflation(1); - zkTracer.traceStartBlock(blockHeader, blockHeader.getCoinbase()); + zkTracer.traceStartBlock(blockHeader, blockBody, blockHeader.getCoinbase()); final TransactionProcessingResult result = processor.processTransaction( diff --git a/testing/src/main/java/net/consensys/linea/testing/GeneralStateReferenceTestTools.java b/testing/src/main/java/net/consensys/linea/testing/GeneralStateReferenceTestTools.java index 772a816b0..cf913ff50 100644 --- a/testing/src/main/java/net/consensys/linea/testing/GeneralStateReferenceTestTools.java +++ b/testing/src/main/java/net/consensys/linea/testing/GeneralStateReferenceTestTools.java @@ -93,7 +93,7 @@ public static void executeTest( .blobGasPricePerGas(blockHeader.getExcessBlobGas().orElse(BlobGas.ZERO)); tracer.traceStartConflation(1); - tracer.traceStartBlock(blockHeader, blockHeader.getCoinbase()); + tracer.traceStartBlock(blockHeader, blockBody, blockHeader.getCoinbase()); TransactionProcessingResult result = null; for (Transaction transaction : blockBody.getTransactions()) { // Several of the GeneralStateTests check if the transaction could potentially diff --git a/testing/src/main/java/net/consensys/linea/testing/ReplayExecutionEnvironment.java b/testing/src/main/java/net/consensys/linea/testing/ReplayExecutionEnvironment.java index f2c3cdfa0..f0f95267d 100644 --- a/testing/src/main/java/net/consensys/linea/testing/ReplayExecutionEnvironment.java +++ b/testing/src/main/java/net/consensys/linea/testing/ReplayExecutionEnvironment.java @@ -207,7 +207,7 @@ private static void executeFrom( useCoinbaseAddressFromBlockHeader ? header.getCoinbase() : CliqueHelpers.getProposerOfBlock(header); - tracer.traceStartBlock(header, miningBeneficiary); + tracer.traceStartBlock(header, body, miningBeneficiary); for (TransactionSnapshot txs : blockSnapshot.txs()) { final Transaction tx = txs.toTransaction();