Consensys / linea-tracer

Part of the Linea stack responsible for extracting data from the execution of an EVM client in order to construct large matrices called execution traces.
https://linea.build
Other
24 stars 20 forks source link

Precondition Check Fails in `ReturnSection` #1145

Closed DavePearce closed 6 days ago

DavePearce commented 1 week ago

Ranges

3318494-3318494

Issue

For block 3318494 on Sepolia, we get the following error:

ERROR net.consensys.linea.zktracer.ZkTracer -- First exception that was caught while tracing:
java.lang.IllegalArgumentException: null
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:129)
    at net.consensys.linea.zktracer.module.hub.section.halt.ReturnSection.<init>(ReturnSection.java:229)
    at net.consensys.linea.zktracer.module.hub.Hub.traceOpcode(Hub.java:1078)
    at net.consensys.linea.zktracer.module.hub.Hub.processStateExec(Hub.java:1001)
    at net.consensys.linea.zktracer.module.hub.Hub.tracePreExecution(Hub.java:774)
    at net.consensys.linea.zktracer.ZkTracer.tracePreExecution(ZkTracer.java:258)
    at net.consensys.linea.zktracer.ConflationAwareOperationTracer$SequencingOperationTracer.lambda$tracePreExecution$5(ConflationAwareOperationTracer.java:97)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4305)
    at net.consensys.linea.zktracer.ConflationAwareOperationTracer$SequencingOperationTracer.tracePreExecution(ConflationAwareOperationTracer.java:97)
    at org.hyperledger.besu.evm.EVM.runToHalt(EVM.java:207)

I have created a test for this, which is to be merged as part of #1143 (marked as @Disabled)

  @Test
  void largeInitCode() {
    replay(LINEA_SEPOLIA, "3318494.sepolia.json.gz", true);
  }

NOTE: #1143 fixes problems related to the replay file not replaying correctly.

OlivierBBB commented 1 week ago

For me it works without complaining about a failing Precondition:

image

What fails is the state check (chain ID)

12:57:36.520 [Test worker] DEBUG org.hyperledger.besu.ethereum.mainnet.MainnetTransactionProcessor -- Invalid transaction: transaction was meant for chain id 1337 and not this chain id 59144

and storage value

tx 0x2cc6fc665e395b460fc0933f9bb232af6f5bad4c94a5aba6a6739e04374c5050 storage at 0x1ed75cb175e667287451c78d8f85d48535749cb6:0x2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40(0x000000000000000000000000000000000000000000000000000000000005f2d1) does not match expected value (0x000000000000000000000000000000000000000000000000000000000005f2d2)
java.lang.RuntimeException: tx 0x2cc6fc665e395b460fc0933f9bb232af6f5bad4c94a5aba6a6739e04374c5050 storage at 0x1ed75cb175e667287451c78d8f85d48535749cb6:0x2569078dfb4b0305704d3008e7403993ae9601b85f7ae5e742de3de8f8011c40(0x000000000000000000000000000000000000000000000000000000000005f2d1) does not match expected value (0x000000000000000000000000000000000000000000000000000000000005f2d2)
    at net.consensys.linea.blockcapture.snapshots.TransactionResultSnapshot$TransactionChecker.traceEndTransaction(TransactionResultSnapshot.java:83)
    at net.consensys.linea.zktracer.ConflationAwareOperationTracer$SequencingOperationTracer.lambda$traceEndTransaction$12(ConflationAwareOperationTracer.java:148)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4305)
    at net.consensys.linea.zktracer.ConflationAwareOperationTracer$SequencingOperationTracer.traceEndTransaction(ConflationAwareOperationTracer.java:146)
DavePearce commented 1 week ago

I see that outcome when the block is captured from mainnet, but a different outcome when the block is captured from sepolia. #1143 has now merged and that includes the replay file I captured from the nodes synced with sepolia.