From 510d494d4d655a25d16b1d4d11a6a47eb926efc2 Mon Sep 17 00:00:00 2001 From: ahamlat Date: Fri, 19 Jul 2024 16:59:48 +0200 Subject: [PATCH] feat: improve ZkTracer initialization time by doing only once Opcodes and spillings loading from disk resources (#720) Signed-off-by: Ameziane H --- .../consensys/linea/zktracer/ZkTracer.java | 42 +++++++++---------- .../linea/zktracer/opcode/OpCodes.java | 6 ++- .../consensys/linea/zktracer/types/Utils.java | 16 +++++++ .../linea/zktracer/module/EcDataTest.java | 38 +++++++++++++++++ .../linea/zktracer/module/add/AddTest.java | 3 -- .../linea/zktracer/module/bin/BinTest.java | 3 -- .../module/blockhash/BlockhashTest.java | 3 -- .../zktracer/module/ecdata/EcDataTest.java | 3 -- .../linea/zktracer/module/exp/ExpTest.java | 3 -- .../module/ext/TestDuplicatedOperations.java | 3 -- .../module/hub/CallEmptyNoStopTest.java | 3 -- .../linea/zktracer/module/hub/OtherTests.java | 3 -- .../zktracer/module/hub/TestTwoPlusTwo.java | 3 -- .../zktracer/module/mmu/MemoryTests.java | 3 -- .../linea/zktracer/module/mod/ModTest.java | 3 -- .../linea/zktracer/module/mxp/MxpTest.java | 3 -- .../zktracer/module/oob/OobCallTest.java | 3 -- .../module/oob/OobJumpAndJumpiTest.java | 3 -- .../linea/zktracer/module/oob/OobRdcTest.java | 3 -- .../module/oob/OobSha2RipemdIdentityTest.java | 3 -- .../module/precompiles/PrecompileTests.java | 4 -- .../module/rlpaddr/TestRlpAddress.java | 3 -- .../zktracer/module/shf/ShfRtTracerTest.java | 3 -- .../linea/zktracer/module/stp/StpTest.java | 6 --- .../zktracer/module/trm/TrmTracerTest.java | 3 -- .../zktracer/module/wcp/WcpEdgeCaseTest.java | 3 -- .../linea/zktracer/testing/DynamicTests.java | 2 - .../linea/zktracer/testing/EvmExtension.java | 31 -------------- .../linea/zktracer/testing/ExampleTxTest.java | 2 - .../net/consensys/linea/EvmExtension.java | 31 -------------- .../BlockchainReferenceTest.java.template | 3 -- .../GeneralStateReferenceTest.java.template | 3 -- zkevm-constraints | 2 +- 33 files changed, 79 insertions(+), 167 deletions(-) create mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/module/EcDataTest.java delete mode 100644 arithmetization/src/test/java/net/consensys/linea/zktracer/testing/EvmExtension.java delete mode 100644 reference-tests/src/test/java/net/consensys/linea/EvmExtension.java 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 d080dd1160..4bfaaf29f1 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/ZkTracer.java @@ -39,10 +39,8 @@ import net.consensys.linea.zktracer.module.Module; import net.consensys.linea.zktracer.module.Pin55; import net.consensys.linea.zktracer.module.hub.Hub; -import net.consensys.linea.zktracer.opcode.OpCodes; +import net.consensys.linea.zktracer.types.Utils; import org.apache.tuweni.bytes.Bytes; -import org.apache.tuweni.toml.Toml; -import org.apache.tuweni.toml.TomlTable; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.datatypes.PendingTransaction; @@ -64,10 +62,22 @@ public class ZkTracer implements ConflationAwareOperationTracer { public static final GasCalculator gasCalculator = new LondonGasCalculator(); public static final FeeMarket feeMarket = FeeMarket.london(-1); + private static final Map spillings; + + static { + try { + // Load spillings configured in src/main/resources/spillings.toml. + spillings = Utils.computeSpillings(); + } catch (final Exception e) { + final String errorMsg = + "A problem happened during spillings initialization, cause " + e.getCause(); + log.error(errorMsg); + throw new RuntimeException(e); + } + } @Getter private final Hub hub; private final Optional pin55; - private final Map spillings = new HashMap<>(); private Hash hashOfLastTransactionTraced = Hash.EMPTY; /** Accumulate all the exceptions that happened at tracing time. */ @@ -79,26 +89,12 @@ public ZkTracer() { public ZkTracer(final LineaL1L2BridgeConfiguration bridgeConfiguration) { this.hub = new Hub(bridgeConfiguration.contract(), bridgeConfiguration.topic()); - - // Load opcodes configured in src/main/resources/opcodes.yml. - OpCodes.load(); - // Load spillings configured in src/main/resources/spillings.toml. - try { - final TomlTable table = - Toml.parse(getClass().getClassLoader().getResourceAsStream("spillings.toml")) - .getTable("spillings"); - table.toMap().keySet().forEach(k -> spillings.put(k, Math.toIntExact(table.getLong(k)))); - - for (Module m : this.hub.getModulesToCount()) { - if (!this.spillings.containsKey(m.moduleKey())) { - throw new IllegalStateException( - "Spilling for module " + m.moduleKey() + " not defined in spillings.toml"); - } + for (Module m : this.hub.getModulesToCount()) { + if (!spillings.containsKey(m.moduleKey())) { + throw new IllegalStateException( + "Spilling for module " + m.moduleKey() + " not defined in spillings.toml"); } - } catch (final Exception e) { - throw new RuntimeException(e); } - // >>>> CHANGE ME >>>> // >>>> CHANGE ME >>>> // >>>> CHANGE ME >>>> @@ -329,7 +325,7 @@ public Map getModulesLineCount() { modulesLineCount.put( m.moduleKey(), m.lineCount() - + Optional.ofNullable(this.spillings.get(m.moduleKey())) + + Optional.ofNullable(spillings.get(m.moduleKey())) .orElseThrow( () -> new IllegalStateException( diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/OpCodes.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/OpCodes.java index 2b293bfb6f..7880b98c58 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/OpCodes.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/opcode/OpCodes.java @@ -35,9 +35,13 @@ public class OpCodes { private static Map valueToOpCodeDataMap; private static Map opCodeToOpCodeDataMap; + static { + init(); + } + /** Loads all opcode metadata from src/main/resources/opcodes.yml. */ @SneakyThrows(IOException.class) - public static void load() { + private static void init() { JsonNode rootNode = YAML_CONVERTER .getObjectMapper() diff --git a/arithmetization/src/main/java/net/consensys/linea/zktracer/types/Utils.java b/arithmetization/src/main/java/net/consensys/linea/zktracer/types/Utils.java index 54a184640c..222c91c71b 100644 --- a/arithmetization/src/main/java/net/consensys/linea/zktracer/types/Utils.java +++ b/arithmetization/src/main/java/net/consensys/linea/zktracer/types/Utils.java @@ -15,10 +15,15 @@ package net.consensys.linea.zktracer.types; +import java.io.IOException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; import com.google.common.base.Preconditions; import org.apache.tuweni.bytes.Bytes; +import org.apache.tuweni.toml.Toml; +import org.apache.tuweni.toml.TomlTable; public class Utils { @@ -83,4 +88,15 @@ public static BitDecOutput bitDecomposition(int input, int nbStep) { } return output; } + + public static Map computeSpillings() throws IOException { + final Map spillings = new HashMap<>(); + + final TomlTable table = + Toml.parse(Utils.class.getClassLoader().getResourceAsStream("spillings.toml")) + .getTable("spillings"); + table.toMap().keySet().forEach(k -> spillings.put(k, Math.toIntExact(table.getLong(k)))); + + return spillings; + } } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/EcDataTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/EcDataTest.java new file mode 100644 index 0000000000..9289167340 --- /dev/null +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/EcDataTest.java @@ -0,0 +1,38 @@ +/* + * Copyright Consensys Software Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +package net.consensys.linea.zktracer.module; + +import net.consensys.linea.zktracer.testing.BytecodeRunner; +import org.apache.tuweni.bytes.Bytes; +import org.junit.jupiter.api.Test; + +public class EcDataTest { + @Test + void testEcData() { + BytecodeRunner.of( + Bytes.fromHexString( + "608060405234801561001057600080fd5b5061004a6001601b6001620f00007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe610b9760201b60201c565b61005757610056610e05565b5b61006f60016019600060016000610b9760201b60201c565b61007c5761007b610e05565b5b6100936001601e6001806000610b9760201b60201c565b6100a05761009f610e05565b5b6100d76001601b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000610b9760201b60201c565b6100e4576100e3610e05565b5b610152600160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476101169190610e6d565b600160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476101459190610e6d565b6003610bd260201b60201c565b61015f5761015e610e05565b5b610176600080600160026000610bd260201b60201c565b61018357610182610e05565b5b6101c5600060018060027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476101b89190610e6d565b6000610bd260201b60201c565b156101d3576101d2610e05565b5b6102146000806001807f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476102079190610ea1565b6000610bd260201b60201c565b1561022257610221610e05565b5b610283600160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476102549190610e6d565b610f007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610c0c60201b60201c565b6102905761028f610e05565b5b6102d0600160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476102c29190610e6d565b600080610c0c60201b60201c565b6102dd576102dc610e05565b5b6102f260008060036000610c0c60201b60201c565b6102ff576102fe610e05565b5b6103156000600460036000610c0c60201b60201c565b1561032357610322610e05565b5b61033860006004600080610c0c60201b60201c565b1561034657610345610e05565b5b60006040518060c001604052806001815260200160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476103879190610e6d565b81526020016000815260200160008152602001600081526020016000815250905060006040518060c001604052806001815260200160027f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd476103e99190610e6d565b81526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b815250905060006040518060c0016040528060008152602001600081526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b815250905060006040518060c001604052806000815260200160008152602001600181526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b815250905060006040518060c0016040528060008152602001600c81526020017f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed81526020017f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c281526020017f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa81526020017f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b815250905060008067ffffffffffffffff81111561069c5761069b610ed5565b5b6040519080825280602002602001820160405280156106d557816020015b6106c2610dcf565b8152602001906001900390816106ba5790505b5090506106e9816000610c4060201b60201c565b6106f6576106f5610e05565b5b600167ffffffffffffffff81111561071157610710610ed5565b5b60405190808252806020026020018201604052801561074a57816020015b610737610dcf565b81526020019060019003908161072f5790505b509050858160008151811061076257610761610f04565b5b602002602001018190525061077e816000610c4060201b60201c565b61078b5761078a610e05565b5b85816000815181106107a05761079f610f04565b5b6020026020010181905250600267ffffffffffffffff8111156107c6576107c5610ed5565b5b6040519080825280602002602001820160405280156107ff57816020015b6107ec610dcf565b8152602001906001900390816107e45790505b509050858160008151811061081757610816610f04565b5b6020026020010181905250848160018151811061083757610836610f04565b5b6020026020010181905250610853816000610c4060201b60201c565b6108605761085f610e05565b5b61087181600a610c4060201b60201c565b1561087f5761087e610e05565b5b828160018151811061089457610893610f04565b5b60200260200101819052506108b0816000610c4060201b60201c565b156108be576108bd610e05565b5b600367ffffffffffffffff8111156108d9576108d8610ed5565b5b60405190808252806020026020018201604052801561091257816020015b6108ff610dcf565b8152602001906001900390816108f75790505b509050858160008151811061092a57610929610f04565b5b6020026020010181905250848160018151811061094a57610949610f04565b5b6020026020010181905250838160028151811061096a57610969610f04565b5b6020026020010181905250610986816000610c4060201b60201c565b61099357610992610e05565b5b6109a4816001610c4060201b60201c565b156109b2576109b1610e05565b5b6109e2817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610c4060201b60201c565b156109f0576109ef610e05565b5b8181600281518110610a0557610a04610f04565b5b6020026020010181905250610a21816000610c4060201b60201c565b15610a2f57610a2e610e05565b5b600a67ffffffffffffffff811115610a4a57610a49610ed5565b5b604051908082528060200260200182016040528015610a8357816020015b610a70610dcf565b815260200190600190039081610a685790505b50905060005b8151811015610b36576000600382610aa19190610f62565b03610aca5786828281518110610aba57610ab9610f04565b5b6020026020010181905250610b23565b6001600382610ad99190610f62565b03610b025785828281518110610af257610af1610f04565b5b6020026020010181905250610b22565b84828281518110610b1657610b15610f04565b5b60200260200101819052505b5b8080610b2e90610f93565b915050610a89565b50610b48816000610c4060201b60201c565b610b5557610b54610e05565b5b60006040518060400160405280600e81526020017f7a6b2d65766d206973206c6966650000000000000000000000000000000000008152509050805160208201f35b600060405186815285602082015284604082015283606082015260008084608001836001610bb8fa9150608081016040525095945050505050565b6000604051868152856020820152846040820152836060820152600080846080018360066096fa9150608081016040525095945050505050565b600060405185815284602082015283604082015260008084606001836007611770fa91506060810160405250949350505050565b60008061afc884516184d0610c559190610fdb565b610c5f9190610ea1565b90506000604051905060005b8551811015610d91576000868281518110610c8957610c88610f04565b5b60200260200101516000015190506000878381518110610cac57610cab610f04565b5b60200260200101516020015190506000888481518110610ccf57610cce610f04565b5b60200260200101516040015190506000898581518110610cf257610cf1610f04565b5b602002602001015160600151905060008a8681518110610d1557610d14610f04565b5b602002602001015160800151905060008b8781518110610d3857610d37610f04565b5b602002602001015160a0015190508660c00286818a015285602082018a015283604082018a015284606082018a015281608082018a01528260a082018a0152505050505050508080610d8990610f93565b915050610c6b565b50600060c08651610da29190610fdb565b905060008183610db29190610ea1565b905060008087840185600888fa9450806040525050505092915050565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610e7882610e34565b9150610e8383610e34565b9250828203905081811115610e9b57610e9a610e3e565b5b92915050565b6000610eac82610e34565b9150610eb783610e34565b9250828201905080821115610ecf57610ece610e3e565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000610f6d82610e34565b9150610f7883610e34565b925082610f8857610f87610f33565b5b828206905092915050565b6000610f9e82610e34565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610fd057610fcf610e3e565b5b600182019050919050565b6000610fe682610e34565b9150610ff183610e34565b9250828202610fff81610e34565b9150828204841483151761101657611015610e3e565b5b509291505056fe")) + .run(); + } + + @Test + void testEcRecoverWithEmptyExt() { + BytecodeRunner.of( + Bytes.fromHexString( + "6080604052348015600f57600080fd5b5060476001601b6001620f00007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe609360201b60201c565b605157605060ce565b5b60006040518060400160405280600e81526020017f7a6b2d65766d206973206c6966650000000000000000000000000000000000008152509050805160208201f35b600060405186815285602082015284604082015283606082015260008084608001836001610bb8fa9150608081016040525095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fdfe")) + .run(); + } +} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/add/AddTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/add/AddTest.java index 76b624c93e..aca8ef628c 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/add/AddTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/add/AddTest.java @@ -18,12 +18,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class AddTest { @Test void testSmallZeroAdd() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/bin/BinTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/bin/BinTest.java index ab361a7195..b7bc806b79 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/bin/BinTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/bin/BinTest.java @@ -18,12 +18,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.units.bigints.UInt256; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class BinTest { @Test public void edgeCase() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/blockhash/BlockhashTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/blockhash/BlockhashTest.java index 4b1e8c2585..1327774769 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/blockhash/BlockhashTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/blockhash/BlockhashTest.java @@ -20,12 +20,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class BlockhashTest { // @Disabled("in our framework, BLOCKNUMBER is 0 thus breaking the wcp_lower_bound lookup") diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ecdata/EcDataTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ecdata/EcDataTest.java index 609dac9820..01dc6e1e32 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ecdata/EcDataTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ecdata/EcDataTest.java @@ -26,16 +26,13 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.types.EWord; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -@ExtendWith(EvmExtension.class) public class EcDataTest { @Test void testEcData() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/exp/ExpTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/exp/ExpTest.java index 3b24e9c6e4..22df078a71 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/exp/ExpTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/exp/ExpTest.java @@ -25,14 +25,11 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; @Slf4j -@ExtendWith(EvmExtension.class) public class ExpTest { // Generates 128, 64, 2, 1 as LD private static final int[] LD_INDICES = new int[] {1, 2, 7, 8}; diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ext/TestDuplicatedOperations.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ext/TestDuplicatedOperations.java index 1a042834f2..9537c2ab6e 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ext/TestDuplicatedOperations.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/ext/TestDuplicatedOperations.java @@ -20,12 +20,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class TestDuplicatedOperations { @Test void testDuplicate() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/CallEmptyNoStopTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/CallEmptyNoStopTest.java index 620fa645aa..d19665cb31 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/CallEmptyNoStopTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/CallEmptyNoStopTest.java @@ -21,7 +21,6 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.testing.ToyAccount; import net.consensys.linea.zktracer.testing.ToyExecutionEnvironment; import net.consensys.linea.zktracer.testing.ToyTransaction; @@ -34,10 +33,8 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; /** Ensure that calling a contract with empty code does not generate a virtual STOP trace */ -@ExtendWith(EvmExtension.class) public class CallEmptyNoStopTest { @Test void test() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/OtherTests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/OtherTests.java index d69e4066f1..080270f421 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/OtherTests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/OtherTests.java @@ -18,11 +18,8 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class OtherTests { @Test public void testMul() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/TestTwoPlusTwo.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/TestTwoPlusTwo.java index 81883444f6..16d716b4cf 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/TestTwoPlusTwo.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/hub/TestTwoPlusTwo.java @@ -18,12 +18,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class TestTwoPlusTwo { @Test void testAdd() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mmu/MemoryTests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mmu/MemoryTests.java index 736c475299..99a8bbf0a4 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mmu/MemoryTests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mmu/MemoryTests.java @@ -20,12 +20,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) class MemoryTests { private final Random rnd = new Random(666); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mod/ModTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mod/ModTest.java index 9d819f8de5..817993c5da 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mod/ModTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mod/ModTest.java @@ -18,12 +18,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.units.bigints.UInt256; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class ModTest { @Test void testSignedSmod() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mxp/MxpTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mxp/MxpTest.java index 819a5ccc89..b1546de473 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mxp/MxpTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/mxp/MxpTest.java @@ -27,7 +27,6 @@ import net.consensys.linea.zktracer.opcode.gas.MxpType; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.testing.ToyAccount; import net.consensys.linea.zktracer.testing.ToyExecutionEnvironment; import net.consensys.linea.zktracer.testing.ToyTransaction; @@ -42,11 +41,9 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; // https://github.com/Consensys/linea-besu-plugin/issues/197 -@ExtendWith(EvmExtension.class) public class MxpTest { private static final Random RAND = new Random(123456789123456L); public static final EWord TWO_POW_128 = EWord.of(EWord.ONE.shiftLeft(128)); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobCallTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobCallTest.java index 3666e97798..666ca1c925 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobCallTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobCallTest.java @@ -23,7 +23,6 @@ import net.consensys.linea.zktracer.module.hub.Hub; import net.consensys.linea.zktracer.module.hub.signals.Exceptions; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.testing.ToyAccount; import net.consensys.linea.zktracer.testing.ToyExecutionEnvironment; import net.consensys.linea.zktracer.testing.ToyTransaction; @@ -38,9 +37,7 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class OobCallTest { @Test diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobJumpAndJumpiTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobJumpAndJumpiTest.java index e14f961fe7..4c05d59579 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobJumpAndJumpiTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobJumpAndJumpiTest.java @@ -32,13 +32,10 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.types.EWord; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class OobJumpAndJumpiTest { public static final BigInteger TWO_POW_128_MINUS_ONE = diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobRdcTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobRdcTest.java index 64e25164a1..3b39d8c1cc 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobRdcTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobRdcTest.java @@ -26,12 +26,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class OobRdcTest { public static final BigInteger TWO_POW_128_LEFT = diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobSha2RipemdIdentityTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobSha2RipemdIdentityTest.java index 93af47272f..812888f3d9 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobSha2RipemdIdentityTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/oob/OobSha2RipemdIdentityTest.java @@ -28,16 +28,13 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.bouncycastle.crypto.digests.RIPEMD160Digest; import org.bouncycastle.util.encoders.Hex; import org.hyperledger.besu.datatypes.Address; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -@ExtendWith(EvmExtension.class) public class OobSha2RipemdIdentityTest { Random random = new Random(1L); static final int[] argSizes = diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/precompiles/PrecompileTests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/precompiles/PrecompileTests.java index a68a3f6c38..95d07f6001 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/precompiles/PrecompileTests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/precompiles/PrecompileTests.java @@ -14,8 +14,4 @@ */ package net.consensys.linea.zktracer.module.precompiles; -import net.consensys.linea.zktracer.testing.EvmExtension; -import org.junit.jupiter.api.extension.ExtendWith; - -@ExtendWith(EvmExtension.class) public class PrecompileTests {} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlpaddr/TestRlpAddress.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlpaddr/TestRlpAddress.java index 362a7e4a4b..cadf940c54 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlpaddr/TestRlpAddress.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/rlpaddr/TestRlpAddress.java @@ -26,7 +26,6 @@ import java.util.Random; import net.consensys.linea.zktracer.opcode.OpCode; -import net.consensys.linea.zktracer.opcode.OpCodes; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.ToyAccount; import net.consensys.linea.zktracer.testing.ToyExecutionEnvironment; @@ -48,8 +47,6 @@ public class TestRlpAddress { @Test void test() { - OpCodes.load(); - ToyWorld.ToyWorldBuilder world = ToyWorld.builder(); List txList = new ArrayList<>(); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/shf/ShfRtTracerTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/shf/ShfRtTracerTest.java index 7d43f96a6a..56eadf8054 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/shf/ShfRtTracerTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/shf/ShfRtTracerTest.java @@ -22,18 +22,15 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @Slf4j -@ExtendWith(EvmExtension.class) class ShfRtTracerTest { private static final Random RAND = new Random(); private static final int TEST_REPETITIONS = 4; diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/stp/StpTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/stp/StpTest.java index 52a9e13cd6..965798d688 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/stp/StpTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/stp/StpTest.java @@ -25,9 +25,7 @@ import java.util.Random; import net.consensys.linea.zktracer.opcode.OpCode; -import net.consensys.linea.zktracer.opcode.OpCodes; import net.consensys.linea.zktracer.testing.BytecodeCompiler; -import net.consensys.linea.zktracer.testing.EvmExtension; import net.consensys.linea.zktracer.testing.ToyAccount; import net.consensys.linea.zktracer.testing.ToyExecutionEnvironment; import net.consensys.linea.zktracer.testing.ToyTransaction; @@ -42,9 +40,7 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class StpTest { private static final Random RAND = new Random(666L); final int NB_CALL = 200; @@ -52,7 +48,6 @@ public class StpTest { @Test void testCall() { - OpCodes.load(); ToyWorld.ToyWorldBuilder world = ToyWorld.builder(); List txList = new ArrayList<>(); @@ -78,7 +73,6 @@ void testCall() { @Test void testCreate() { - OpCodes.load(); ToyWorld.ToyWorldBuilder world = ToyWorld.builder(); List txList = new ArrayList<>(); diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/trm/TrmTracerTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/trm/TrmTracerTest.java index 44e6e8e68b..0515dd860f 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/trm/TrmTracerTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/trm/TrmTracerTest.java @@ -18,13 +18,10 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.apache.tuweni.bytes.Bytes32; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class TrmTracerTest { private final Bytes32 RANDOM_STRING_FROM_THE_INTERNET = Bytes32.fromHexString( diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/wcp/WcpEdgeCaseTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/wcp/WcpEdgeCaseTest.java index 85b9dc097a..2ec181875f 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/module/wcp/WcpEdgeCaseTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/module/wcp/WcpEdgeCaseTest.java @@ -18,12 +18,9 @@ import net.consensys.linea.zktracer.opcode.OpCode; import net.consensys.linea.zktracer.testing.BytecodeCompiler; import net.consensys.linea.zktracer.testing.BytecodeRunner; -import net.consensys.linea.zktracer.testing.EvmExtension; import org.apache.tuweni.bytes.Bytes; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) public class WcpEdgeCaseTest { @Test void testZeroAndHugeArgs() { diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/DynamicTests.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/DynamicTests.java index 9a098f9935..ee09c2353c 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/DynamicTests.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/DynamicTests.java @@ -31,7 +31,6 @@ import net.consensys.linea.zktracer.module.shf.Shf; import net.consensys.linea.zktracer.module.wcp.Wcp; import net.consensys.linea.zktracer.opcode.OpCode; -import net.consensys.linea.zktracer.opcode.OpCodes; import org.apache.tuweni.bytes.Bytes32; import org.junit.jupiter.api.DynamicTest; @@ -48,7 +47,6 @@ public class DynamicTests { private final Module module; private DynamicTests(Module module) { - OpCodes.load(); this.module = module; this.testCaseRegistry = new LinkedList<>(); } diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/EvmExtension.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/EvmExtension.java deleted file mode 100644 index dd8f5f50ab..0000000000 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/EvmExtension.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Consensys Software Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package net.consensys.linea.zktracer.testing; - -import net.consensys.linea.zktracer.opcode.OpCodes; -import org.junit.jupiter.api.extension.BeforeAllCallback; -import org.junit.jupiter.api.extension.ExtensionContext; - -/** - * A JUnit {@link org.junit.jupiter.api.extension.Extension} handling the test lifecycle for EVM - * tests. - */ -public class EvmExtension implements BeforeAllCallback { - @Override - public void beforeAll(ExtensionContext context) { - OpCodes.load(); - } -} diff --git a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/ExampleTxTest.java b/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/ExampleTxTest.java index 8734539412..3269537c0c 100644 --- a/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/ExampleTxTest.java +++ b/arithmetization/src/test/java/net/consensys/linea/zktracer/testing/ExampleTxTest.java @@ -25,9 +25,7 @@ import org.hyperledger.besu.datatypes.Wei; import org.hyperledger.besu.ethereum.core.Transaction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -@ExtendWith(EvmExtension.class) class ExampleTxTest { @Test diff --git a/reference-tests/src/test/java/net/consensys/linea/EvmExtension.java b/reference-tests/src/test/java/net/consensys/linea/EvmExtension.java deleted file mode 100644 index a6159f46fe..0000000000 --- a/reference-tests/src/test/java/net/consensys/linea/EvmExtension.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Consensys Software Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -package net.consensys.linea; - -import net.consensys.linea.zktracer.opcode.OpCodes; -import org.junit.jupiter.api.extension.BeforeAllCallback; -import org.junit.jupiter.api.extension.ExtensionContext; - -/** - * A JUnit {@link org.junit.jupiter.api.extension.Extension} handling the test lifecycle for EVM - * tests. - */ -public class EvmExtension implements BeforeAllCallback { - @Override - public void beforeAll(ExtensionContext context) { - OpCodes.load(); - } -} diff --git a/reference-tests/src/test/resources/templates/BlockchainReferenceTest.java.template b/reference-tests/src/test/resources/templates/BlockchainReferenceTest.java.template index 318b5949dc..3bd62bc910 100644 --- a/reference-tests/src/test/resources/templates/BlockchainReferenceTest.java.template +++ b/reference-tests/src/test/resources/templates/BlockchainReferenceTest.java.template @@ -20,8 +20,6 @@ import static net.consensys.linea.BlockchainReferenceTestTools.generateTestParam import java.util.stream.Stream; -import net.consensys.linea.EvmExtension; - import org.hyperledger.besu.ethereum.referencetests.BlockchainReferenceTestCaseSpec; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.extension.ExtendWith; @@ -33,7 +31,6 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue; /** The blockchain test operation testing framework entry point. */ @Tag("BlockchainReferenceTest") -@ExtendWith(EvmExtension.class) public class %%TESTS_NAME%% { private static final String[] TEST_CONFIG_FILE_DIR_PATH = new String[] {%%TESTS_FILE%%}; diff --git a/reference-tests/src/test/resources/templates/GeneralStateReferenceTest.java.template b/reference-tests/src/test/resources/templates/GeneralStateReferenceTest.java.template index 03a58c424a..b34d0f7b4d 100644 --- a/reference-tests/src/test/resources/templates/GeneralStateReferenceTest.java.template +++ b/reference-tests/src/test/resources/templates/GeneralStateReferenceTest.java.template @@ -19,8 +19,6 @@ import static net.consensys.linea.GeneralStateReferenceTestTools.executeTest; import static net.consensys.linea.GeneralStateReferenceTestTools.generateTestParametersForConfig; import static org.junit.jupiter.api.Assumptions.assumeTrue; -import net.consensys.linea.EvmExtension; - import java.util.stream.Stream; import org.hyperledger.besu.ethereum.referencetests.GeneralStateTestCaseEipSpec; @@ -32,7 +30,6 @@ import org.junit.jupiter.params.provider.MethodSource; /** The general state test operation testing framework entry point. */ @Tag("GeneralStateReferenceTest") -@ExtendWith(EvmExtension.class) public class %%TESTS_NAME%% { private static final String[] TEST_CONFIG_FILE_DIR_PATH = new String[] {%%TESTS_FILE%%}; diff --git a/zkevm-constraints b/zkevm-constraints index 8c596d1384..4011a9d401 160000 --- a/zkevm-constraints +++ b/zkevm-constraints @@ -1 +1 @@ -Subproject commit 8c596d138414e52248610433af94631bb66372f0 +Subproject commit 4011a9d401ed6de33b9dc9813522af70e3cc80ca