Skip to content

Commit 4e712f9

Browse files
authored
feat: update to delivery-25.1-develop-1be83c5 (#1694)
1 parent 948d423 commit 4e712f9

File tree

20 files changed

+57
-53
lines changed

20 files changed

+57
-53
lines changed

tracer/arithmetization/src/main/java/net/consensys/linea/blockcapture/BlockCapturer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void tracePreExecution(MessageFrame frame) {
173173
// Sanity check block within last 256 blocks.
174174
if (blockNumber < currentBlockNumber && (currentBlockNumber - blockNumber) <= 256) {
175175
// Use enclosing frame to determine hash
176-
Hash blockHash = frame.getBlockHashLookup().apply(blockNumber);
176+
Hash blockHash = frame.getBlockHashLookup().apply(frame, blockNumber);
177177
// Record it was seen
178178
this.reaper.touchBlockHash(blockNumber, blockHash);
179179
}

tracer/arithmetization/src/main/java/net/consensys/linea/blockcapture/snapshots/ConflationSnapshot.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
import java.util.Map;
2121

2222
import org.hyperledger.besu.datatypes.Hash;
23-
import org.hyperledger.besu.evm.operation.BlockHashOperation.BlockHashLookup;
23+
import org.hyperledger.besu.evm.blockhash.BlockHashLookup;
24+
import org.hyperledger.besu.evm.frame.MessageFrame;
2425

2526
/**
2627
* Contain the minimal set of information to replay a conflation as a unit test without requiring
@@ -64,7 +65,7 @@ private static class BlockHashMap implements BlockHashLookup {
6465
private final Map<Long, Hash> blockHashCache = new HashMap<>();
6566

6667
@Override
67-
public Hash apply(Long blockNumber) {
68+
public Hash apply(MessageFrame frame, Long blockNumber) {
6869
// Sanity check we found the hash
6970
if (!this.blockHashCache.containsKey(blockNumber)) {
7071
// Missing for some reason

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/ConflationAwareOperationTracer.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,10 @@ public void traceEndConflation(WorldView state) {
8080
this.tracers.forEach(tracer -> tracer.traceEndConflation(state));
8181
}
8282

83-
public void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
84-
this.tracers.forEach(tracer -> tracer.traceStartBlock(blockHeader, blockBody));
85-
}
86-
87-
public void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {
88-
this.tracers.forEach(tracer -> tracer.traceStartBlock(processableBlockHeader));
83+
public void traceStartBlock(
84+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {
85+
this.tracers.forEach(
86+
tracer -> tracer.traceStartBlock(processableBlockHeader, miningBeneficiary));
8987
}
9088

9189
public void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -173,25 +173,16 @@ public void traceEndConflation(final WorldView state) {
173173
}
174174

175175
@Override
176-
public void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {
176+
public void traceStartBlock(
177+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {
177178
try {
178-
this.hub.traceStartBlock(processableBlockHeader);
179+
this.hub.traceStartBlock(processableBlockHeader, miningBeneficiary);
179180
this.debugMode.ifPresent(DebugMode::traceEndConflation);
180181
} catch (final Exception e) {
181182
this.tracingExceptions.add(e);
182183
}
183184
}
184185

185-
@Override
186-
public void traceStartBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
187-
try {
188-
this.hub.traceStartBlock(blockHeader);
189-
this.debugMode.ifPresent(x -> x.traceStartBlock(blockHeader, blockBody));
190-
} catch (final Exception e) {
191-
this.tracingExceptions.add(e);
192-
}
193-
}
194-
195186
@Override
196187
public void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {
197188
try {

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/container/module/Module.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import net.consensys.linea.zktracer.ColumnHeader;
2222
import net.consensys.linea.zktracer.types.TransactionProcessingMetadata;
23+
import org.hyperledger.besu.datatypes.Address;
2324
import org.hyperledger.besu.evm.frame.MessageFrame;
2425
import org.hyperledger.besu.evm.worldstate.WorldView;
2526
import org.hyperledger.besu.plugin.data.BlockBody;
@@ -33,7 +34,8 @@ default void traceStartConflation(final long blockCount) {}
3334

3435
default void traceEndConflation(final WorldView state) {}
3536

36-
default void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {}
37+
default void traceStartBlock(
38+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {}
3739

3840
default void traceEndBlock(final BlockHeader blockHeader, final BlockBody blockBody) {}
3941

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/module/blockhash/Blockhash.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import net.consensys.linea.zktracer.module.wcp.Wcp;
3333
import net.consensys.linea.zktracer.opcode.OpCode;
3434
import org.apache.tuweni.bytes.Bytes32;
35+
import org.hyperledger.besu.datatypes.Address;
3536
import org.hyperledger.besu.evm.frame.MessageFrame;
3637
import org.hyperledger.besu.evm.operation.Operation;
3738
import org.hyperledger.besu.evm.worldstate.WorldView;
@@ -67,7 +68,8 @@ public String moduleKey() {
6768
}
6869

6970
@Override
70-
public void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {
71+
public void traceStartBlock(
72+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {
7173
relBlock += 1;
7274
absBlock = processableBlockHeader.getNumber();
7375
}

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/module/blockhash/Trace.java

Whitespace-only changes.

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/Hub.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,14 @@ public void traceEndConflation(final WorldView world) {
473473
}
474474

475475
@Override
476-
public void traceStartBlock(final ProcessableBlockHeader processableBlockHeader) {
476+
public void traceStartBlock(
477+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {
478+
this.coinbaseAddress = miningBeneficiary;
477479
state.firstAndLastStorageSlotOccurrences.add(new HashMap<>());
478-
this.transients().block().update(processableBlockHeader);
480+
this.transients().block().update(processableBlockHeader, miningBeneficiary);
479481
txStack.resetBlock();
480482
for (Module m : modules) {
481-
m.traceStartBlock(processableBlockHeader);
483+
m.traceStartBlock(processableBlockHeader, miningBeneficiary);
482484
}
483485
}
484486

@@ -499,7 +501,6 @@ public void traceStartTransaction(final WorldView world, final Transaction tx) {
499501

500502
if (!transactionProcessingMetadata.requiresEvmExecution()) {
501503
state.setProcessingPhase(TX_SKIP);
502-
Address coinbaseAddress = Address.fromHexString("8f81e2e3f8b46467523463835f965ffe476e1c9e");
503504
new TxSkipSection(this, world, transactionProcessingMetadata, transients);
504505
} else {
505506
if (transactionProcessingMetadata.requiresPrewarming()) {
@@ -552,7 +553,6 @@ public void traceContextEnter(MessageFrame frame) {
552553

553554
// root and transaction call data context's
554555
if (frame.getDepth() == 0) {
555-
coinbaseAddress = frame.getMiningBeneficiary();
556556
if (state.getProcessingPhase() == TX_SKIP) {
557557
checkState(currentTraceSection() instanceof TxSkipSection);
558558
((TxSkipSection) currentTraceSection()).coinbaseSnapshots(this, frame);

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/module/hub/transients/Block.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ public class Block {
3434
*
3535
* @param processableBlockHeader the processable block header
3636
*/
37-
public void update(final ProcessableBlockHeader processableBlockHeader) {
37+
public void update(
38+
final ProcessableBlockHeader processableBlockHeader, final Address miningBeneficiary) {
3839
this.blockNumber++;
39-
this.coinbaseAddress = processableBlockHeader.getCoinbase();
40+
this.coinbaseAddress = miningBeneficiary;
4041
this.baseFee = Wei.fromQuantity(processableBlockHeader.getBaseFee().orElseThrow());
4142
}
4243
}

tracer/arithmetization/src/main/java/net/consensys/linea/zktracer/module/txndata/TxnData.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import net.consensys.linea.zktracer.module.hub.Hub;
3030
import net.consensys.linea.zktracer.module.wcp.Wcp;
3131
import net.consensys.linea.zktracer.types.TransactionProcessingMetadata;
32+
import org.hyperledger.besu.datatypes.Address;
3233
import org.hyperledger.besu.plugin.data.BlockBody;
3334
import org.hyperledger.besu.plugin.data.BlockHeader;
3435
import org.hyperledger.besu.plugin.data.ProcessableBlockHeader;
@@ -57,7 +58,8 @@ public void traceStartConflation(final long blockCount) {
5758
}
5859

5960
@Override
60-
public final void traceStartBlock(final ProcessableBlockHeader blockHeader) {
61+
public final void traceStartBlock(
62+
final ProcessableBlockHeader blockHeader, final Address miningBeneficiary) {
6163
blocks.add(new BlockSnapshot(blockHeader));
6264
}
6365

0 commit comments

Comments
 (0)